t_reply.h File Reference

TM :: Reply handling. More...

#include "../../tags.h"
#include "h_table.h"

Include dependency graph for t_reply.h:

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

Go to the source code of this file.

Defines

#define LOCK_REPLIES(_t)   lock(&(_t)->reply_mutex )
#define UNLOCK_REPLIES(_t)   unlock(&(_t)->reply_mutex )

Typedefs

typedef unsigned int branch_bm_t
typedef int(* tget_picked_f )(void)
typedef int(* tget_reply_totag_f )(struct sip_msg *, str *)
typedef int(* treply_f )(struct sip_msg *, unsigned int, str *)
typedef int(* treply_wb_f )(struct cell *trans, unsigned int code, str *text, str *body, str *new_header, str *to_tag)

Enumerations

enum  rps {
  RPS_ERROR = 0, RPS_PUSHED_AFTER_COMPLETION, RPS_DISCARDED, RPS_STORE,
  RPS_COMPLETED, RPS_PROVISIONAL
}

Functions

void cleanup_uac_timers (struct cell *t)
 Cleanup UAC timers on a transaction.
unsigned int get_on_negative (void)
unsigned int get_on_reply (void)
enum rps local_reply (struct cell *t, struct sip_msg *p_msg, int branch, unsigned int msg_status, branch_bm_t *cancel_bitmap)
 "UAC" above transaction layer
void on_negative_reply (struct cell *t, struct sip_msg *msg, int code, void *param)
enum rps relay_reply (struct cell *t, struct sip_msg *p_msg, int branch, unsigned int msg_status, branch_bm_t *cancel_bitmap)
 Decide what and when shall be relayed upstream.
int reply_received (struct sip_msg *p_msg)
 Called whenever a reply for our module is received.
void set_final_timer (struct cell *t)
 Set final timer on a transaction.
int t_get_picked_branch (void)
 returns the picked branch
int t_get_reply_totag (struct sip_msg *msg, str *totag)
void t_on_negative (unsigned int go_to)
 Set which 'reply' structure to take if only negative replies arrive.
void t_on_reply (unsigned int go_to)
int t_reply (struct cell *t, struct sip_msg *, unsigned int, str *)
 Small wrapper around _reply with locking.
int t_reply_unsafe (struct cell *t, struct sip_msg *, unsigned int, str *)
 Small wrapper around _reply without locking.
int t_reply_with_body (struct cell *trans, unsigned int code, str *text, str *body, str *new_header, str *to_tag)
int t_retransmit_reply (struct cell *t)
 Retransmits the last sent inbound reply.
void tm_init_tags (void)
int unixsock_t_reply (str *msg)
int unmatched_totag (struct cell *t, struct sip_msg *ack)
 Checks if the message was previously acknowledged.

Variables

int disable_6xx_block
int drop_stateless_replies
int onreply_avp_mode
int restart_fr_on_each_reply
char * tm_tag_suffix
char tm_tags [TOTAG_VALUE_LEN]


Detailed Description

TM :: Reply handling.

Definition in file t_reply.h.


Define Documentation

#define LOCK_REPLIES ( _t   )     lock(&(_t)->reply_mutex )

#define UNLOCK_REPLIES ( _t   )     unlock(&(_t)->reply_mutex )


Typedef Documentation

typedef unsigned int branch_bm_t

branch bitmap type

Definition at line 68 of file t_reply.h.

typedef int(* tget_picked_f)(void)

Definition at line 117 of file t_reply.h.

typedef int(* tget_reply_totag_f)(struct sip_msg *, str *)

Definition at line 74 of file t_reply.h.

typedef int(* treply_f)(struct sip_msg *, unsigned int, str *)

Definition at line 71 of file t_reply.h.

typedef int(* treply_wb_f)(struct cell *trans, unsigned int code, str *text, str *body, str *new_header, str *to_tag)

Definition at line 72 of file t_reply.h.


Enumeration Type Documentation

enum rps

reply processing status

Enumerator:
RPS_ERROR  something bad happened
RPS_PUSHED_AFTER_COMPLETION  transaction completed but we still accept the reply
RPS_DISCARDED  reply discarded
RPS_STORE  reply stored for later processing
RPS_COMPLETED  transaction completed
RPS_PROVISIONAL  provisional reply not affecting transaction state

Definition at line 44 of file t_reply.h.


Function Documentation

void cleanup_uac_timers ( struct cell t  ) 

Cleanup UAC timers on a transaction.

Definition at line 1073 of file t_reply.c.

References cell::first_branch, retr_buf::fr_timer, LM_DBG, ua_client::request, reset_timer(), retr_buf::retr_timer, and cell::uac.

Referenced by _reply_light(), local_reply(), reply_received(), and t_release_transaction().

unsigned int get_on_negative ( void   ) 

Definition at line 180 of file t_reply.c.

References goto_on_negative.

Referenced by init_new_t().

unsigned int get_on_reply ( void   ) 

Definition at line 184 of file t_reply.c.

References goto_on_reply.

Referenced by init_new_t().

enum rps local_reply ( struct cell t,
struct sip_msg p_msg,
int  branch,
unsigned int  msg_status,
branch_bm_t cancel_bitmap 
)

"UAC" above transaction layer

This is the "UAC" above transaction layer; if a final reply is received, it triggers a callback.

Note:
It assumes it is entered locked with REPLY_LOCK and it returns unlocked!
Returns:
reply_status

Definition at line 1306 of file t_reply.c.

References cancel_uacs(), cleanup_uac_timers(), FAKED_REPLY, get_cseq, has_tran_tmcbs, is_invite, ua_client::last_received, LM_DBG, METHOD_INVITE, put_on_wait(), ua_client::reply, RPS_ERROR, run_trans_callbacks(), stats_trans_rpl, ua_server::status, store_reply(), t_should_relay_response(), TMCB_E2EACK_IN, TMCB_LOCAL_COMPLETED, TMCB_LOCAL_RESPONSE_OUT, TMCB_RESPONSE_OUT, TMCB_RESPONSE_PRE_OUT, cell::uac, cell::uas, UNLOCK_REPLIES, update_totag_set(), and which_cancel().

Referenced by fake_reply(), and reply_received().

void on_negative_reply ( struct cell t,
struct sip_msg msg,
int  code,
void *  param 
)

enum rps relay_reply ( struct cell t,
struct sip_msg p_msg,
int  branch,
unsigned int  msg_status,
branch_bm_t cancel_bitmap 
)

int reply_received ( struct sip_msg p_msg  ) 

void set_final_timer ( struct cell t  ) 

int t_get_picked_branch ( void   ) 

returns the picked branch

Definition at line 134 of file t_reply.c.

References picked_branch.

Referenced by load_tm(), pv_get_tm_reply_code(), pv_t_update_rpl(), t_check_status(), and t_local_replied().

int t_get_reply_totag ( struct sip_msg msg,
str totag 
)

Definition at line 124 of file t_reply.c.

References calc_crc_suffix(), NULL, and tm_tag_suffix.

Referenced by load_tm().

void t_on_negative ( unsigned int  go_to  ) 

Set which 'reply' structure to take if only negative replies arrive.

Definition at line 152 of file t_reply.c.

References get_t(), goto_on_negative, cell::on_negative, and T_UNDEFINED.

Referenced by script_init(), and w_t_on_negative().

void t_on_reply ( unsigned int  go_to  ) 

Definition at line 166 of file t_reply.c.

References get_t(), goto_on_reply, cell::on_reply, and T_UNDEFINED.

Referenced by script_init(), and w_t_on_reply().

int t_reply ( struct cell t,
struct sip_msg ,
unsigned  int,
str  
)

Small wrapper around _reply with locking.

Definition at line 1029 of file t_reply.c.

References _reply().

Referenced by cancel_invite(), kill_transaction(), t_relay_to(), and w_t_reply().

int t_reply_unsafe ( struct cell t,
struct sip_msg ,
unsigned  int,
str  
)

Small wrapper around _reply without locking.

Definition at line 1039 of file t_reply.c.

References _reply().

Referenced by relay_reply(), and w_t_reply().

int t_reply_with_body ( struct cell trans,
unsigned int  code,
str text,
str body,
str new_header,
str to_tag 
)

int t_retransmit_reply ( struct cell t  ) 

Retransmits the last sent inbound reply.

Parameters:
t request for which I want to retransmit an associated reply
Returns:
1 on succes, -1 on errors

Definition at line 986 of file t_reply.c.

References BUF_SIZE, retr_buf::buffer, retr_buf::dst, _str::len, len, LM_CRIT, LM_DBG, LOCK_REPLIES, ua_server::response, _str::s, SEND_PR_BUFFER, dest_info::send_sock, cell::uas, and UNLOCK_REPLIES.

Referenced by retransmission_handler(), t_check_trans(), and t_newtran().

void tm_init_tags ( void   ) 

Definition at line 189 of file t_reply.c.

References init_tags(), TM_TAG_SEPARATOR, tm_tag_suffix, and tm_tags.

Referenced by mod_init().

int unixsock_t_reply ( str msg  ) 

int unmatched_totag ( struct cell t,
struct sip_msg ack 
)

Checks if the message was previously acknowledged.

has this to-tag been never seen in previous 200/INVs?

Returns:
0 if the message was previously acknowledged (i.e., no E2EACK callback is needed) and 1 if the callback shall be executed

Definition at line 200 of file t_reply.c.

References totag_elem::acked, cell::fwded_totags, get_to, HDR_TO_F, _str::len, LM_DBG, LM_ERR, totag_elem::next, parse_headers(), _str::s, totag_elem::tag, and sip_msg::to.

Referenced by t_newtran().


Variable Documentation

disable the 6xx fork-blocking - default no (as per RFC3261)

Definition at line 108 of file t_reply.c.

Referenced by t_should_relay_response().

drop responses matching no client transaction (draft-sparks-sip-invfix-03)

Definition at line 105 of file t_reply.c.

Referenced by reply_received().

Definition at line 103 of file t_reply.c.

Referenced by reply_received().

restart fr timer on each provisional reply, default yes

Definition at line 102 of file t_reply.c.

Referenced by reply_received().

Definition at line 113 of file t_reply.c.

Referenced by _reply(), new_dlg_uas(), relay_reply(), t_get_reply_totag(), and tm_init_tags().

char tm_tags[TOTAG_VALUE_LEN]

private place where we create to-tags for replies

Definition at line 111 of file t_reply.c.

Referenced by new_dlg_uas(), and tm_init_tags().


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