Defines | Functions | Variables

modules_k/rr/record.c File Reference

Route & Record-Route module, loose routing support. More...

#include <string.h>
#include "../../mem/mem.h"
#include "../../dprint.h"
#include "../../parser/parse_uri.h"
#include "../../parser/parse_from.h"
#include "../../str.h"
#include "../../data_lump.h"
#include "record.h"
#include "rr_mod.h"
Include dependency graph for modules_k/rr/record.c:

Go to the source code of this file.

Defines

Functions

Variables


Detailed Description

Definition in file modules_k/rr/record.c.


Define Documentation

#define RR_TRANS_LEN   11

Insert manually created Record-Route header, no checks, no restrictions, always adds lr parameter, only fromtag is added automatically when requested. Allocates new private memory for this.

Parameters:
_m SIP message
_data manually created RR header
Returns:
1 on success, negative on failure

Definition at line 463 of file modules_k/rr/record.c.


Function Documentation

int add_rr_param ( struct sip_msg msg,
str rr_param 
)
Parameters:
msg SIP message
rr_param RR parameter
Returns:
0 on success, -1 on failure

Definition at line 665 of file modules_k/rr/record.c.

References sip_msg::add_rm, enable_double_rr, get_rr_param_lump(), sip_msg::id, insert_rr_param_lump(), _str::len, root, RR_PARAM_BUF_SIZE, and _str::s.

Here is the call graph for this function:

static int build_rr ( struct lump *  _l,
struct lump *  _l2,
str user,
str tag,
str params,
int  _inbound 
) [inline, static]

Build a Record-Route header field, allocates new private memory for this.

Parameters:
_l first lump
_l2 second lump
user user parameter
tag tag parameter
params parameter
_inbound inbound request
Returns:
0 on success, negative on failure

Definition at line 160 of file modules_k/rr/record.c.

References enable_double_rr, enable_full_lr, HDR_RECORDROUTE_T, insert_cond_lump_after(), insert_rr_param_lump(), insert_subst_lump_after(), _str::len, prefix, and _str::s.

Referenced by record_route().

Here is the call graph for this function:

Here is the caller graph for this function:

static struct lump* get_rr_param_lump ( struct lump **  root  )  [static, read]
Parameters:
root root of the lump list
Returns:
pointer to the RR parameter lump, or NULL if not found

Definition at line 640 of file modules_k/rr/record.c.

References HDR_RECORDROUTE_T.

Referenced by add_rr_param().

Here is the caller graph for this function:

static int get_username ( struct sip_msg _m,
str _user 
) [inline, static]

Extract username from the Request URI. First try to look at the original Request URI and if there is no username use the new Request URI.

Parameters:
_m SIP message
_user username
Returns:
0 on success, negative on errors

Definition at line 88 of file modules_k/rr/record.c.

References sip_msg::first_line, _str::len, sip_msg::new_uri, _str::s, and sip_uri::user.

Referenced by record_route(), record_route_advertised_address(), and record_route_preset().

Here is the caller graph for this function:

static struct lump* insert_rr_param_lump ( struct lump *  before,
char *  s,
int  l 
) [static, read]
Parameters:
before lump list
s parameter string
l parameter string length
Returns:
pointer to new lump on success, NULL on failure

Definition at line 123 of file modules_k/rr/record.c.

References HDR_RECORDROUTE_T.

Referenced by add_rr_param(), and build_rr().

Here is the caller graph for this function:

int record_route ( struct sip_msg _m,
str params 
)

Insert a new Record-Route header field and also 2nd one if it is enabled and the realm changed so the 2nd record-route header will be necessary.

Parameters:
_m SIP message
params RR parameter
Returns:
0 on success, negative on failure

Definition at line 278 of file modules_k/rr/record.c.

References add_username, anchor_lump(), append_fromtag, sip_msg::buf, build_rr(), enable_double_rr, get_username(), HDR_RECORDROUTE_T, sip_msg::headers, sip_msg::id, INBOUND, insert_cond_lump_after(), _str::len, hdr_field::name, OUTBOUND, parse_from_header(), hdr_field::parsed, and _str::s.

Referenced by sip_msg_shm_clone(), and w_record_route().

Here is the call graph for this function:

Here is the caller graph for this function:

int record_route_advertised_address ( struct sip_msg _m,
str _data 
)

Insert manually created Record-Route header, no checks, no restrictions, always adds lr parameter, fromtag is added automatically when requested, Allows addition of rr parameters using add_rr_param. Adds a 2nd header with the same details if the protocol changes and double rr enabled Allocates new private memory for this.

Parameters:
_m SIP message
_data manually created RR header
Returns:
1 on success, negative on failure

Definition at line 576 of file modules_k/rr/record.c.

References add_username, anchor_lump(), append_fromtag, sip_msg::buf, enable_double_rr, get_username(), HDR_RECORDROUTE_T, sip_msg::headers, INBOUND, insert_cond_lump_after(), _str::len, hdr_field::name, OUTBOUND, parse_from_header(), hdr_field::parsed, and _str::s.

Referenced by w_record_route_advertised_address().

Here is the call graph for this function:

Here is the caller graph for this function:

int record_route_preset ( struct sip_msg _m,
str _data 
)

Insert manually created Record-Route header, no checks, no restrictions, always adds lr parameter, only fromtag is added automatically when requested. Allocates new private memory for this.

Parameters:
_m SIP message
_data manually created RR header
Returns:
1 on success, negative on failure

Definition at line 357 of file modules_k/rr/record.c.

References add_username, anchor_lump(), append_fromtag, sip_msg::buf, enable_full_lr, get_username(), HDR_RECORDROUTE_T, sip_msg::headers, _str::len, hdr_field::name, parse_from_header(), hdr_field::parsed, and _str::s.

Here is the call graph for this function:


Variable Documentation

char rr_param_buf_ptr[RR_PARAM_BUF_SIZE] [static]
Note:
used for storing RR param which are added before RR insertion

Definition at line 74 of file modules_k/rr/record.c.