rpid.c File Reference

Remote-Party-ID related functions

More...

#include <string.h>
#include <strings.h>
#include "../../str.h"
#include "../../data_lump.h"
#include "../../dprint.h"
#include "../../mem/mem.h"
#include "../../parser/parse_nameaddr.h"
#include "../../parser/parse_uri.h"
#include "../../parser/parser_f.h"
#include "../../ut.h"
#include "../../pvar.h"
#include "auth_mod.h"
#include "api.h"
#include "rpid.h"

Include dependency graph for rpid.c:

Go to the source code of this file.

Defines

#define RPID_HF_NAME   "Remote-Party-ID: "
#define RPID_HF_NAME_LEN   (sizeof(RPID_HF_NAME) - 1)

Functions

static int append_rpid_helper (struct sip_msg *_m, str *_s)
 Append RPID helper function.
int append_rpid_hf (struct sip_msg *_m, char *_s1, char *_s2)
 Append RPID header field to the message.
int append_rpid_hf_p (struct sip_msg *_m, char *_prefix, char *_suffix)
 Append RPID header field to the message with parameters.
void get_rpid_avp (int_str *rpid_avp_p, int *rpid_avp_type_p)
 Gets the RPID avp specs.
int init_rpid_avp (char *rpid_avp_param)
 Parse and set the RPID AVP specs.
static int is_e164 (str *_user)
 Check if user is a E164 number.
int is_rpid_user_e164 (struct sip_msg *_m, char *_s1, char *_s2)
 Check if URI in RPID AVP contains an E164 user part.

Variables

static int_str rpid_avp_name
static unsigned short rpid_avp_type


Detailed Description

Remote-Party-ID related functions

Definition in file rpid.c.


Define Documentation

#define RPID_HF_NAME   "Remote-Party-ID: "

Definition at line 51 of file rpid.c.

Referenced by append_rpid_hf(), and append_rpid_hf_p().

#define RPID_HF_NAME_LEN   (sizeof(RPID_HF_NAME) - 1)

Definition at line 52 of file rpid.c.

Referenced by append_rpid_hf(), and append_rpid_hf_p().


Function Documentation

static int append_rpid_helper ( struct sip_msg _m,
str _s 
) [inline, static]

Append RPID helper function.

Parameters:
_m SIP message
_s appended string
Note:
Copy of append_hf_helper from textops
Returns:
0 on success, negative on failure

Definition at line 133 of file rpid.c.

References anchor_lump(), sip_msg::buf, HDR_EOH_F, insert_new_lump_before(), _str::len, LM_ERR, parse_headers(), _str::s, and sip_msg::unparsed.

Referenced by append_rpid_hf(), and append_rpid_hf_p().

int append_rpid_hf ( struct sip_msg _m,
char *  _s1,
char *  _s2 
)

Append RPID header field to the message.

Parameters:
_m SIP message
_s1 unused
_s2 unused
Returns:
1 on success, -1 on failure

Definition at line 164 of file rpid.c.

References append_rpid_helper(), AVP_VAL_STR, CRLF, CRLF_LEN, usr_avp::flags, _str::len, LM_DBG, LM_ERR, int_str::n, pkg_free, pkg_malloc, rpid_avp_type, RPID_HF_NAME, RPID_HF_NAME_LEN, rpid_prefix, rpid_suffix, _str::s, int_str::s, and search_first_avp().

int append_rpid_hf_p ( struct sip_msg _m,
char *  _prefix,
char *  _suffix 
)

Append RPID header field to the message with parameters.

Parameters:
_m SIP message
_prefix prefix
_suffix suffix
Returns:
1 on success, -1 on failure

Definition at line 227 of file rpid.c.

References append_rpid_helper(), AVP_VAL_STR, CRLF, CRLF_LEN, usr_avp::flags, _str::len, LM_DBG, LM_ERR, int_str::n, pkg_free, pkg_malloc, rpid_avp_type, RPID_HF_NAME, RPID_HF_NAME_LEN, _str::s, int_str::s, s, and search_first_avp().

void get_rpid_avp ( int_str rpid_avp_p,
int *  rpid_avp_type_p 
)

Gets the RPID avp specs.

Parameters:
rpid_avp_p AVP name
rpid_avp_type_p AVP type

Definition at line 96 of file rpid.c.

References rpid_avp_type.

Referenced by bind_auth().

int init_rpid_avp ( char *  rpid_avp_param  ) 

Parse and set the RPID AVP specs.

Parameters:
rpid_avp_param RPID AVP parameter
Returns:
0 on success, -1 on failure

Definition at line 64 of file rpid.c.

References _str::len, LM_ERR, int_str::n, pv_get_avp_name(), pv_parse_spec(), _pv_spec::pvp, PVT_AVP, rpid_avp_type, _str::s, and _pv_spec::type.

Referenced by mod_init().

static int is_e164 ( str _user  )  [inline, static]

Check if user is a E164 number.

Parameters:
_user user
Note:
Copy of is_e164 from enum module
Returns:
1 if its a E164 number, -1 if not

Definition at line 109 of file rpid.c.

References _str::len, and _str::s.

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

int is_rpid_user_e164 ( struct sip_msg _m,
char *  _s1,
char *  _s2 
)

Check if URI in RPID AVP contains an E164 user part.

Parameters:
_m SIP message
_s1 unused
_s2 unused
Returns:
1 if the URI contains an E164 user part, -1 if not

Definition at line 293 of file rpid.c.

References AVP_VAL_STR, find_not_quoted(), usr_avp::flags, is_e164(), _str::len, LM_DBG, LM_ERR, int_str::n, parse_nameaddr(), parse_uri(), rpid_avp_type, _str::s, search_first_avp(), name_addr::uri, and sip_uri::user.


Variable Documentation

Definition at line 56 of file rpid.c.

unsigned short rpid_avp_type [static]


Generated on Thu May 24 12:00:42 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6