loose.h File Reference

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

#include <regex.h>
#include "../../str.h"
#include "../../parser/msg_parser.h"

Include dependency graph for loose.h:

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

Go to the source code of this file.

Defines

#define RR_FLOW_DOWNSTREAM   (1<<0)
#define RR_FLOW_UPSTREAM   (1<<1)

Functions

int check_route_param (struct sip_msg *msg, regex_t *re)
 Check if the route hdr has the required parameter.
int get_route_param (struct sip_msg *msg, str *name, str *val)
 Gets the value of a route parameter.
int is_direction (struct sip_msg *msg, int dir)
 Check the direction of the message.
int loose_route (struct sip_msg *_m, char *_s1, char *_s2)
 Do loose routing as per RFC3261.


Detailed Description

Route & Record-Route module, loose routing support.

Definition in file loose.h.


Define Documentation

#define RR_FLOW_DOWNSTREAM   (1<<0)

Definition at line 38 of file loose.h.

Referenced by direction_fixup(), and is_direction().

#define RR_FLOW_UPSTREAM   (1<<1)

Definition at line 39 of file loose.h.

Referenced by acc_onreq(), direction_fixup(), is_direction(), and restore_from().


Function Documentation

int check_route_param ( struct sip_msg msg,
regex_t *  re 
)

Check if the route hdr has the required parameter.

The function checks for the request "msg" if the URI parameters of the local Route header (corresponding to the local server) matches the given regular expression "re". It must be call after the loose_route was done.

Parameters:
msg SIP message request that will has the Route header parameters checked
re compiled regular expression to be checked against the Route header parameters
Returns:
-1 on failure, 1 on success

Definition at line 950 of file loose.c.

References sip_msg::id, _str::len, LM_DBG, params, routed_msg_id, and _str::s.

Referenced by load_rr(), and w_check_route_param().

int get_route_param ( struct sip_msg msg,
str name,
str val 
)

Gets the value of a route parameter.

The function search in to the "msg"'s Route header parameters the parameter called "name" and returns its value into "val". It must be call only after the loose_route is done.

Parameters:
msg - request that will have the Route header parameter searched
name - contains the Route header parameter to be serached
val returns the value of the searched Route header parameter if found. It might be an empty string if the parameter had no value.
Returns:
0 if parameter was found (even if it has no value), -1 otherwise

Definition at line 994 of file loose.c.

References sip_msg::id, len, _str::len, routed_msg_id, and _str::s.

Referenced by is_direction(), and load_rr().

int is_direction ( struct sip_msg msg,
int  dir 
)

Check the direction of the message.

The function checks the flow direction of the request "msg". As for checking it's used the "ftag" Route header parameter, the append_fromtag module parameter must be enables. Also this must be call only after the loose_route is done.

Parameters:
msg SIP message request that will have the direction checked
dir direction to be checked against. It may be RR_FLOW_UPSTREAM or RR_FLOW_DOWNSTREAM
Returns:
0 if the request flow direction is the same as the given direction, -1 otherwise

Definition at line 1086 of file loose.c.

References sip_msg::from, get_route_param(), sip_msg::id, _str::len, LM_DBG, parse_from_header(), hdr_field::parsed, RR_FLOW_DOWNSTREAM, RR_FLOW_UPSTREAM, and _str::s.

Referenced by load_rr(), and w_is_direction().

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

Do loose routing as per RFC3261.

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

Definition at line 904 of file loose.c.

References after_loose(), after_strict(), find_first_route(), sip_uri::host, is_myself(), is_preloaded(), LM_DBG, LM_ERR, parse_sip_msg_uri(), sip_msg::parsed_uri, sip_uri::port_no, and sip_uri::user.


Generated on Wed May 23 18:00:41 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6