t_fwd.c File Reference

TM :: Message forwarding. More...

#include "../../dprint.h"
#include "../../config.h"
#include "../../ut.h"
#include "../../dset.h"
#include "../../timer.h"
#include "../../hash_func.h"
#include "../../globals.h"
#include "../../action.h"
#include "../../data_lump.h"
#include "../../blacklists.h"
#include "../../usr_avp.h"
#include "../../mem/mem.h"
#include "../../parser/parser_f.h"
#include "t_funcs.h"
#include "t_hooks.h"
#include "t_msgbuilder.h"
#include "ut.h"
#include "t_cancel.h"
#include "t_lookup.h"
#include "t_fwd.h"
#include "fix_lumps.h"
#include "config.h"

Include dependency graph for t_fwd.c:

Go to the source code of this file.

Functions

int add_blind_uac (void)
 introduce a new uac, which is blind
static int add_uac (struct cell *t, struct sip_msg *request, str *uri, str *next_hop, str *path, struct proxy_l *proxy)
 Introduce a new UAC to transaction.
void cancel_invite (struct sip_msg *cancel_msg, struct cell *t_cancel, struct cell *t_invite)
static unsigned int count_local_rr (struct sip_msg *req)
int e2e_cancel_branch (struct sip_msg *cancel_msg, struct cell *t_cancel, struct cell *t_invite, int branch)
unsigned int get_on_branch (void)
static void post_print_uac_request (struct sip_msg *request, str *org_uri, str *org_dst)
static int pre_print_uac_request (struct cell *t, int branch, struct sip_msg *request)
static char * print_uac_request (struct sip_msg *i_req, unsigned int *len, struct socket_info *send_sock, enum sip_protos proto)
 be aware and use it *all* the time between pre_* and post_* functions!
static struct proxy_lshm_clone_proxy (struct proxy_l *sp, unsigned int move_dn)
int t_forward_nonack (struct cell *t, struct sip_msg *p_msg, struct proxy_l *proxy)
void t_on_branch (unsigned int go_to)
int t_replicate (struct sip_msg *p_msg, str *dst, int flags)
 Relay a replicated message.
static int update_uac_dst (struct sip_msg *request, struct ua_client *uac)

Variables

int _tm_branch_index = 0
static int goto_on_branch


Detailed Description

TM :: Message forwarding.

Definition in file t_fwd.c.


Function Documentation

int add_blind_uac ( void   ) 

introduce a new uac, which is blind

This UA only creates the data structures and starts FR timer, but that's it; it does not print messages and send anything anywhere; that is good for FIFO apps -- the transaction must look operationally and FR must be ticking, whereas the request is "forwarded" using a non-SIP way and will be replied the same way

Definition at line 278 of file t_fwd.c.

References cell::flags, get_t(), LM_ERR, MAX_BRANCHES, cell::nr_of_outgoings, REQ_FWDED, ua_client::request, set_kr(), start_retr(), T_BLIND_UAC, T_UNDEFINED, and cell::uac.

Referenced by load_tm(), t_write_req(), and t_write_unix().

static int add_uac ( struct cell t,
struct sip_msg request,
str uri,
str next_hop,
str path,
struct proxy_l proxy 
) [static]

void cancel_invite ( struct sip_msg cancel_msg,
struct cell t_cancel,
struct cell t_invite 
)

static unsigned int count_local_rr ( struct sip_msg req  )  [inline, static]

int e2e_cancel_branch ( struct sip_msg cancel_msg,
struct cell t_cancel,
struct cell t_invite,
int  branch 
)

unsigned int get_on_branch ( void   ) 

Definition at line 89 of file t_fwd.c.

References goto_on_branch.

Referenced by init_new_t(), and t_forward_nonack().

static void post_print_uac_request ( struct sip_msg request,
str org_uri,
str org_dst 
) [inline, static]

static int pre_print_uac_request ( struct cell t,
int  branch,
struct sip_msg request 
) [inline, static]

static char* print_uac_request ( struct sip_msg i_req,
unsigned int *  len,
struct socket_info send_sock,
enum sip_protos  proto 
) [inline, static]

be aware and use it *all* the time between pre_* and post_* functions!

Definition at line 182 of file t_fwd.c.

References buf, build_req_buf_from_sip_req(), E_OUT_OF_MEM, LM_ERR, MSG_TRANS_SHM_FLAG, NULL, and ser_error.

Referenced by e2e_cancel_branch(), and update_uac_dst().

static struct proxy_l* shm_clone_proxy ( struct proxy_l sp,
unsigned int  move_dn 
) [static, read]

int t_forward_nonack ( struct cell t,
struct sip_msg p_msg,
struct proxy_l proxy 
)

void t_on_branch ( unsigned int  go_to  ) 

Definition at line 75 of file t_fwd.c.

References BRANCH_ROUTE, get_t(), goto_on_branch, cell::on_branch, route_type, and T_UNDEFINED.

Referenced by script_init(), and w_t_on_branch().

int t_replicate ( struct sip_msg p_msg,
str dst,
int  flags 
)

Relay a replicated message.

Relay a replicated message. We just take the message as is, including Route-s, Record-route-s, and Vias, forward it downstream and prevent replies received from relaying by setting the replication/local_trans bit.

Note:
this is a quite horrible hack - nevertheless, it should be good enough for the primary customer of this function, REGISTER replication. If we want later to make it thoroughly, we need to introduce delete lumps for all the header fields above.
Parameters:
p_msg replicated message
dst destination
flags message flags
Returns:
-1 on errors, otherwise the return value from t_relay_to

Definition at line 750 of file t_fwd.c.

References branch_uri2dset(), GET_RURI, LM_ERR, set_dst_uri(), t_relay_to(), and TM_T_REPLY_repl_FLAG.

Referenced by w_t_replicate().

static int update_uac_dst ( struct sip_msg request,
struct ua_client uac 
) [inline, static]


Variable Documentation

Definition at line 73 of file t_fwd.c.

Referenced by pre_print_uac_request(), and reply_received().

int goto_on_branch [static]

Definition at line 72 of file t_fwd.c.

Referenced by get_on_branch(), and t_on_branch().


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