cr_func.h File Reference

Routing and balancing functions.

More...

#include "../../parser/msg_parser.h"
#include "../../pvar.h"
#include "../../mod_fix.h"
#include "prime_hash.h"

Include dependency graph for cr_func.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int cr_load_next_domain (struct sip_msg *_msg, gparam_t *_carrier, gparam_t *_domain, gparam_t *_prefix_matching, gparam_t *_host, gparam_t *_reply_code, gparam_t *_dstavp)
int cr_load_user_carrier (struct sip_msg *_msg, gparam_t *_user, gparam_t *_domain, gparam_t *_dstavp)
int cr_prime_route (struct sip_msg *_msg, gparam_t *_carrier, gparam_t *_domain, gparam_t *_prefix_matching, gparam_t *_rewrite_user, enum hash_source _hsrc, gparam_t *_dstavp)
int cr_route (struct sip_msg *_msg, gparam_t *_carrier, gparam_t *_domain, gparam_t *_prefix_matching, gparam_t *_rewrite_user, enum hash_source _hsrc, gparam_t *_dstavp)


Detailed Description

Routing and balancing functions.

Definition in file cr_func.h.


Function Documentation

int cr_load_next_domain ( struct sip_msg _msg,
gparam_t _carrier,
gparam_t _domain,
gparam_t _prefix_matching,
gparam_t _host,
gparam_t _reply_code,
gparam_t _dstavp 
)

Loads next domain from failure routing table and stores it in an AVP.

Parameters:
_msg the current SIP message
_carrier the requested carrier
_domain the requested routing domain
_prefix_matching the user to be used for prefix matching
_host the host name to be used for rule matching
_reply_code the reply code to be used for rule matching
_dstavp the name of the destination AVP
Returns:
1 on success, -1 on failure

Definition at line 686 of file cr_func.c.

References route_data_t::carrier_map, route_data_t::carrier_num, cr_gp2id(), route_data_t::default_carrier_id, route_data_t::domain_map, route_data_t::domain_num, domain_data_t::failure_tree, fallback_default, fixup_get_svalue(), sip_msg::flags, get_carrier_data(), get_data(), get_domain_data(), _str::len, LM_ERR, LM_INFO, LM_NOTICE, NULL, release_data(), _str::s, and set_next_domain_recursor().

int cr_load_user_carrier ( struct sip_msg _msg,
gparam_t _user,
gparam_t _domain,
gparam_t _dstavp 
)

Loads user carrier from subscriber table and stores it in an AVP.

Parameters:
_msg the current SIP message
_user the user to determine the carrier data
_domain the domain to determine the domain data
_dstavp the name of the AVP where to store the carrier id
Returns:
1 on success, -1 on failure

Definition at line 595 of file cr_func.c.

References add_avp(), domain, fixup_get_svalue(), _pv_name::isname, LM_ERR, load_user_carrier(), int_str::n, _gparam::pve, _pv_param::pvn, _pv_spec::pvp, _pv_elem::spec, _pv_name::u, user, and _gparam::v.

int cr_prime_route ( struct sip_msg _msg,
gparam_t _carrier,
gparam_t _domain,
gparam_t _prefix_matching,
gparam_t _rewrite_user,
enum hash_source  _hsrc,
gparam_t _dstavp 
)

rewrites the request URI of msg after determining the new destination URI

Parameters:
_msg the current SIP message
_carrier the requested carrier
_domain the requested routing domain
_prefix_matching the user to be used for prefix matching
_rewrite_user the localpart of the URI to be rewritten
_hsrc the SIP header used for hashing
_dstavp the name of the destination AVP where the used host name is stored
Returns:
1 on success, -1 on failure
rewrites the request URI of msg after determining the new destination URI with the prime hash algorithm.

Parameters:
_msg the current SIP message
_carrier the requested carrier
_domain the requested routing domain
_prefix_matching the user to be used for prefix matching
_rewrite_user the localpart of the URI to be rewritten
_hsrc the SIP header used for hashing
_dstavp the name of the destination AVP where the used host name is stored
Returns:
1 on success, -1 on failure

Definition at line 663 of file cr_func.c.

References alg_prime, and cr_do_route().

int cr_route ( struct sip_msg _msg,
gparam_t _carrier,
gparam_t _domain,
gparam_t _prefix_matching,
gparam_t _rewrite_user,
enum hash_source  _hsrc,
gparam_t _dstavp 
)

rewrites the request URI of msg after determining the new destination URI

Parameters:
_msg the current SIP message
_carrier the requested carrier
_domain the requested routing domain
_prefix_matching the user to be used for prefix matching
_rewrite_user the localpart of the URI to be rewritten
_hsrc the SIP header used for hashing
_dstavp the name of the destination AVP where the used host name is stored
Returns:
1 on success, -1 on failure
rewrites the request URI of msg after determining the new destination URI with the crc32 hash algorithm.

Parameters:
_msg the current SIP message
_carrier the requested carrier
_domain the requested routing domain
_prefix_matching the user to be used for prefix matching
_rewrite_user the localpart of the URI to be rewritten
_hsrc the SIP header used for hashing
_dstavp the name of the destination AVP where the used host name is stored
Returns:
1 on success, -1 on failure

Definition at line 639 of file cr_func.c.

References alg_crc32, and cr_do_route().


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