domainpolicy.h File Reference

Header file for domainpolicy table relates functions. More...

#include "../../parser/msg_parser.h"

Include dependency graph for domainpolicy.h:

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

Go to the source code of this file.

Defines

#define DP_DDDS_RET_DNSERROR   -2
#define DP_DDDS_RET_NEGATIVE   -1
#define DP_DDDS_RET_NOTFOUND   2
#define DP_DDDS_RET_POSITIVE   1
#define MAX_DDDS_RECURSIONS   5
#define MAX_DOMAIN_SIZE   512

Functions

int domainpolicy_db_bind (const str *db_url)
 Bind the database interface.
void domainpolicy_db_close (void)
 Close the database connection.
int domainpolicy_db_init (const str *db_url)
 Initialize the database connection.
int domainpolicy_db_ver (const str *db_url, const str *name)
 Check the database table version.
int dp_apply_policy (struct sip_msg *_msg, char *_s1, char *_s2)
 Apply DP-DDDS policy to current SIP message.
int dp_can_connect (struct sip_msg *_msg, char *_s1, char *_s2)
 Check if host in Request URI has DP-DDDS NAPTRs and if we can connect to them.


Detailed Description

Header file for domainpolicy table relates functions.

Definition in file domainpolicy.h.


Define Documentation

#define DP_DDDS_RET_DNSERROR   -2

return codes of dp_can_connect negative values means false, 0 stops execution and discards the SIP request

Definition at line 48 of file domainpolicy.h.

Referenced by dp_can_connect_str().

#define DP_DDDS_RET_NEGATIVE   -1

Definition at line 49 of file domainpolicy.h.

Referenced by dp_can_connect_str().

#define DP_DDDS_RET_NOTFOUND   2

Definition at line 51 of file domainpolicy.h.

Referenced by dp_can_connect_str().

#define DP_DDDS_RET_POSITIVE   1

Definition at line 50 of file domainpolicy.h.

Referenced by dp_can_connect_str().

#define MAX_DDDS_RECURSIONS   5

how many indirect DDDS naptr are we going to follow?

Definition at line 40 of file domainpolicy.h.

Referenced by dp_can_connect_str().

#define MAX_DOMAIN_SIZE   512

maximal length of a domain string

Definition at line 37 of file domainpolicy.h.

Referenced by dp_can_connect(), enum_pv_query_3(), enum_query_2(), i_enum_query_2(), and is_from_user_enum_2().


Function Documentation

int domainpolicy_db_bind ( const str db_url  ) 

Bind the database interface.

Parameters:
db_url database url
Returns:
-1 on failure, 0 on success

Definition at line 209 of file domainpolicy.c.

References db_bind_mod(), and LM_CRIT.

Referenced by mod_init().

void domainpolicy_db_close ( void   ) 

Close the database connection.

Definition at line 245 of file domainpolicy.c.

References db_func::close.

int domainpolicy_db_init ( const str db_url  ) 

Initialize the database connection.

Parameters:
db_url database url
Returns:
-1 on failure, 0 on success

Definition at line 225 of file domainpolicy.c.

References db_func::init, and LM_CRIT.

Referenced by child_init().

int domainpolicy_db_ver ( const str db_url,
const str name 
)

Check the database table version.

Parameters:
db_url database URL
name table name
Returns:
-1 on failure, positive database version on success

Definition at line 260 of file domainpolicy.c.

References db_func::close, db_table_version(), db_func::init, and LM_CRIT.

Referenced by mod_init().

int dp_apply_policy ( struct sip_msg _msg,
char *  _s1,
char *  _s2 
)

Apply DP-DDDS policy to current SIP message.

Apply DP-DDDS policy to current SIP message. This means build a new destination URI from the policy AVP and export it as AVP. Then in kamailio.cfg this new target AVP can be pushed into the destination URI $duri

Parameters:
_msg SIP message
_s1 unused
_s2 unused
Returns:
negative on failure, positive on succes

Definition at line 811 of file domainpolicy.c.

References AVP_VAL_STR, domain, domain_prefix_avp_name_str, domain_prefix_name, domain_replacement_avp_name_str, domain_replacement_name, domain_suffix_avp_name_str, domain_suffix_name, usr_avp::flags, sip_msg::force_send_socket, grep_sock_info(), sip_uri::host, _str::len, len, LM_DBG, LM_ERR, LM_WARN, MAX_URI_SIZE, parse_phostport(), parse_sip_msg_uri(), sip_msg::parsed_uri, sip_uri::port, port, port_override_avp_name_str, port_override_name, REQUEST_ROUTE, route_type, _str::s, int_str::s, search_first_avp(), send_socket_avp_name_str, send_socket_name, set_dst_uri(), sip_uri::transport, transport_override_avp_name_str, transport_override_name, and ZSW.

int dp_can_connect ( struct sip_msg _msg,
char *  _s1,
char *  _s2 
)

Check if host in Request URI has DP-DDDS NAPTRs and if we can connect to them.

Parameters:
_msg SIP message
_s1 unused
_s2 unused
Returns:
negative on failure, positive on success

Definition at line 762 of file domainpolicy.c.

References domain, dp_can_connect_str(), sip_uri::host, _str::len, LM_DBG, LM_ERR, MAX_DOMAIN_SIZE, parse_sip_msg_uri(), sip_msg::parsed_uri, REQUEST_ROUTE, route_type, _str::s, and ZSW.


Generated on Tue May 22 16:00:39 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6