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


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] |
Definition in file t_reply.h.
| #define LOCK_REPLIES | ( | _t | ) | lock(&(_t)->reply_mutex ) |
Definition at line 78 of file t_reply.h.
Referenced by _reply_light(), cancel_invite(), final_response_handler(), reply_received(), t_cancel_branches(), and t_retransmit_reply().
| #define UNLOCK_REPLIES | ( | _t | ) | unlock(&(_t)->reply_mutex ) |
Definition at line 79 of file t_reply.h.
Referenced by _reply_light(), local_reply(), relay_reply(), reply_received(), t_cancel_branches(), and t_retransmit_reply().
| typedef unsigned int branch_bm_t |
| typedef int(* tget_picked_f)(void) |
| typedef int(* tget_reply_totag_f)(struct sip_msg *, str *) |
| enum rps |
reply processing status
| 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 | ) |
| 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
This is the "UAC" above transaction layer; if a final reply is received, it triggers a callback.
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().
| 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.
This is the code which decides what and when shall be relayed upstream.
Definition at line 1120 of file t_reply.c.
References retr_buf::activ_type, sip_msg::add_rm, buf, retr_buf::buffer, build_res_buf_from_sip_req(), build_res_buf_from_sip_res(), calc_crc_suffix(), cancel_uacs(), retr_buf::dst, error_text(), FAKED_REPLY, free_via_clen_lump(), get_to, has_tran_tmcbs, is_invite, ua_client::last_received, _str::len, LM_DBG, LM_ERR, NULL, pkg_free, cell::relayed_reply_branch, ua_client::reply, REPLY_OVERBUFFER_LEN, ua_server::request, ua_server::response, RPS_COMPLETED, RPS_ERROR, run_trans_callbacks(), _str::s, SEND_PR_BUFFER, set_extra_tmcb_params(), set_final_timer(), shm_resize, sip_msg_free, stats_trans_rpl, ua_server::status, store_reply(), t_reply_unsafe(), t_should_relay_response(), tm_tag_suffix, TMCB_E2EACK_IN, TMCB_RESPONSE_FWDED, TMCB_RESPONSE_OUT, TMCB_RESPONSE_PRE_OUT, sip_msg::to, cell::uac, cell::uas, UNLOCK_REPLIES, update_local_tags(), and update_totag_set().
Referenced by cancel_invite(), fake_reply(), and reply_received().
| int reply_received | ( | struct sip_msg * | p_msg | ) |
Called whenever a reply for our module is received.
This function is called whenever a reply for our module is received, we need to register this function on module initialization.
| p_msg | SIP message |
Definition at line 1384 of file t_reply.c.
References _tm_branch_index, ACT_FL_DROP, ua_client::br_flags, sip_msg::branch_index, retr_buf::buffer, cancel_branch(), cancel_uacs(), cleanup_uac_timers(), drop_stateless_replies, ua_client::flags, sip_msg::flags, cell::flags, fr_inv_avp2timer(), FR_INV_TIMER_LIST, retr_buf::fr_timer, get_cseq, get_t(), getb0flags(), HDR_RETRY_AFTER_F, if_update_stat, is_invite, is_local, ua_client::last_received, LM_DBG, LM_ERR, ua_client::local_cancel, local_reply(), LOCK_REPLIES, METHOD_CANCEL, no_autoack, NULL, cell::on_reply, onreply_avp_mode, onreply_rlist, parse_headers(), put_on_wait(), relay_reply(), ua_server::request, ua_client::request, reset_timer(), restart_fr_on_each_reply, retr_buf::retr_list, retr_buf::retr_timer, RPS_COMPLETED, RPS_PROVISIONAL, RT_T2, run_top_route(), _str::s, send_ack(), set_avp_list(), set_t(), set_timer(), setb0flags(), ua_server::status, t_check(), T_NO_DNS_FAILOVER_FLAG, T_UAC_HAS_RECV_REPLY, T_UAC_TO_CANCEL_FLAG, T_UNDEFINED, t_unref(), tm_enable_stats, tm_rcv_rpls, cell::uac, cell::uas, UNLOCK_REPLIES, and cell::user_avps.
| void set_final_timer | ( | struct cell * | t | ) |
Set final timer on a transaction.
Definition at line 1049 of file t_reply.c.
References force_retr(), is_local, METHOD_INVITE, put_on_wait(), cell::relayed_reply_branch, ua_server::request, ua_server::response, start_retr(), ua_server::status, and cell::uas.
Referenced by _reply_light(), and relay_reply().
| 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().
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().
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().
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 | |||
| ) |
Definition at line 1586 of file t_reply.c.
References _reply_light(), add_lump_rpl(), build_res_buf_from_sip_req(), free_lump_rpl(), _str::len, LM_DBG, LM_ERR, LUMP_RPL_BODY, LUMP_RPL_HDR, REQ_RPLD, ua_server::request, _str::s, set_kr(), cell::uas, unlink_lump_rpl(), and UNREF.
Referenced by load_tm(), and mi_tm_reply().
| int t_retransmit_reply | ( | struct cell * | t | ) |
Retransmits the last sent inbound reply.
| t | request for which I want to retransmit an associated reply |
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 | ) |
Checks if the message was previously acknowledged.
has this to-tag been never seen in previous 200/INVs?
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().
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().
| int onreply_avp_mode |
restart fr timer on each provisional reply, default yes
Definition at line 102 of file t_reply.c.
Referenced by reply_received().
| char* tm_tag_suffix |
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().
1.5.6