cr_fixup.c File Reference

Fixup functions.

More...

#include "../../mod_fix.h"
#include "../../mem/mem.h"
#include "cr_fixup.h"
#include "carrierroute.h"
#include "cr_map.h"
#include "cr_domain.h"
#include "prime_hash.h"
#include "cr_data.h"

Include dependency graph for cr_fixup.c:

Go to the source code of this file.

Functions

static int avp_name_fixup (void **param)
static int carrier_fixup (void **param)
static int carrier_name_2_id (const str *name)
int cr_load_next_domain_fixup (void **param, int param_no)
int cr_load_user_carrier_fixup (void **param, int param_no)
int cr_route_fixup (void **param, int param_no)
static int domain_fixup (void **param)
static int domain_name_2_id (const str *name)
static enum hash_source hash_fixup (const char *my_hash_source)


Detailed Description

Fixup functions.

Definition in file cr_fixup.c.


Function Documentation

static int avp_name_fixup ( void **  param  )  [static]

Fixes the module functions' parameters in case of AVP names.

Parameters:
param the parameter
Returns:
0 on success, -1 on failure

Definition at line 181 of file cr_fixup.c.

References fixup_spve_null(), LM_ERR, and PVT_AVP.

Referenced by cr_load_next_domain_fixup(), cr_load_user_carrier_fixup(), and cr_route_fixup().

static int carrier_fixup ( void **  param  )  [static]

Fixes the module functions' parameters if it is a carrier. supports name string and PVs.

Parameters:
param the parameter
Returns:
0 on success, -1 on failure

Definition at line 120 of file cr_fixup.c.

References carrier_name_2_id(), fixup_spve_null(), GPARAM_TYPE_INT, GPARAM_TYPE_STR, id, LM_ERR, and pkg_free.

Referenced by cr_load_next_domain_fixup(), and cr_route_fixup().

static int carrier_name_2_id ( const str name  )  [static]

The fixup funcions will use the initial mapping. If the mapping changes afterwards (eg. due to cr_reload_routes), the names used in the routing script will not be mapped to the correct IDs!

Parameters:
name carrier name
Returns:
carrier id

Definition at line 48 of file cr_fixup.c.

References route_data_t::carrier_map, route_data_t::carrier_num, get_data(), id, map_name2id(), NULL, and release_data().

Referenced by carrier_fixup().

int cr_load_next_domain_fixup ( void **  param,
int  param_no 
)

fixes the module functions' parameters, i.e. it maps the routing domain names to numbers for faster access at runtime

Parameters:
param the parameter
param_no the number of the parameter
Returns:
0 on success, -1 on failure

Definition at line 262 of file cr_fixup.c.

References avp_name_fixup(), carrier_fixup(), domain_fixup(), fixup_spve_null(), and LM_ERR.

int cr_load_user_carrier_fixup ( void **  param,
int  param_no 
)

Fixes the module functions' parameters.

Parameters:
param the parameter
param_no the number of the parameter
Returns:
0 on success, -1 on failure

Definition at line 304 of file cr_fixup.c.

References avp_name_fixup(), CARRIERROUTE_MODE_FILE, fixup_spve_null(), LM_ERR, and mode.

int cr_route_fixup ( void **  param,
int  param_no 
)

Fixes the module functions' parameters, i.e. it maps the routing domain names to numbers for faster access at runtime

Parameters:
param the parameter
param_no the number of the parameter
Returns:
0 on success, -1 on failure

Definition at line 207 of file cr_fixup.c.

References avp_name_fixup(), carrier_fixup(), domain_fixup(), fixup_spve_null(), hash_fixup(), LM_ERR, pkg_free, and shs_error.

static int domain_fixup ( void **  param  )  [static]

Fixes the module functions' parameters if it is a domain. supports name string, and PVs.

Parameters:
param the parameter
Returns:
0 on success, -1 on failure

Definition at line 151 of file cr_fixup.c.

References domain_name_2_id(), fixup_spve_null(), GPARAM_TYPE_INT, GPARAM_TYPE_STR, id, LM_ERR, and pkg_free.

Referenced by cr_load_next_domain_fixup(), cr_route_fixup(), fetchc_fixup(), save_fixup(), and unreg_fixup().

static int domain_name_2_id ( const str name  )  [static]

The fixup funcions will use the initial mapping. If the mapping changes afterwards (eg. due to cr_reload_routes), the names used in the routing script will not be mapped to the correct IDs!

Parameters:
name domain name
Returns:
domain id

Definition at line 72 of file cr_fixup.c.

References route_data_t::domain_map, route_data_t::domain_num, get_data(), id, map_name2id(), NULL, and release_data().

Referenced by domain_fixup().

static enum hash_source hash_fixup ( const char *  my_hash_source  )  [static]

Fixes the hash source to enum values

Parameters:
my_hash_source the hash source as string
Returns:
the enum value on success, -1 on failure

Definition at line 95 of file cr_fixup.c.

References shs_call_id, shs_error, shs_from_uri, shs_from_user, shs_to_uri, and shs_to_user.

Referenced by cr_route_fixup().


Generated on Mon May 21 18:00:38 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6