#include <stdio.h>
#include <string.h>
#include <netdb.h>
#include "../../sr_module.h"
#include "../../dprint.h"
#include "../../error.h"
#include "../../ut.h"
#include "../../script_cb.h"
#include "../../mi/mi.h"
#include "../../usr_avp.h"
#include "../../mem/mem.h"
#include "../../pvar.h"
#include "../../mod_fix.h"
#include "sip_msg.h"
#include "h_table.h"
#include "ut.h"
#include "t_reply.h"
#include "t_fwd.h"
#include "t_lookup.h"
#include "callid.h"
#include "t_cancel.h"
#include "t_fifo.h"
#include "mi.h"
#include "tm_load.h"
#include "t_serial.h"
#include "t_var.h"

Go to the source code of this file.
Functions | |
| static int | child_init (int rank) |
| static int | do_t_unref (struct sip_msg *foo, void *bar) |
| static int | fixup_cancel_branches (void **param, int param_no) |
| static int | fixup_local_replied (void **param, int param_no) |
| static int | fixup_phostport2proxy (void **param, int param_no) |
| static int | fixup_t_relay1 (void **param, int param_no) |
| static int | fixup_t_relay2 (void **param, int param_no) |
| static int | fixup_t_replicate (void **param, int param_no) |
| static int | fixup_t_send_reply (void **param, int param_no) |
| static int | flag_fixup (void **param, int param_no) |
| int | load_tm (struct tm_binds *tmb) |
| static int | mod_init (void) |
| static MODULE_VERSION int | pv_get_tm_branch_idx (struct sip_msg *msg, pv_param_t *param, pv_value_t *res) |
| static int | pv_get_tm_reply_code (struct sip_msg *msg, pv_param_t *param, pv_value_t *res) |
| static int | script_init (struct sip_msg *foo, void *bar) |
| static int | t_cancel_branches (struct sip_msg *msg, char *, char *) |
| static int | t_check_status (struct sip_msg *msg, char *regexp, char *) |
| static int | t_check_trans (struct sip_msg *msg, char *, char *) |
| static int | t_flush_flags (struct sip_msg *msg, char *, char *) |
| static int | t_local_replied (struct sip_msg *msg, char *type, char *) |
| static int | t_relay_inerr2scripterr (void) |
| static int | t_was_cancelled (struct sip_msg *msg, char *, char *) |
| static int | w_pv_t_reply (struct sip_msg *msg, char *code, char *text) |
| static int | w_t_newtran (struct sip_msg *p_msg, char *, char *) |
| static int | w_t_on_branch (struct sip_msg *msg, char *go_to, char *) |
| static int | w_t_on_negative (struct sip_msg *msg, char *go_to, char *) |
| static int | w_t_on_reply (struct sip_msg *msg, char *go_to, char *) |
| static int | w_t_relay (struct sip_msg *p_msg, char *proxy, char *flags) |
| static int | w_t_release (struct sip_msg *msg, char *, char *) |
| static int | w_t_replicate (struct sip_msg *p_msg, char *dst, char *) |
| static int | w_t_reply (struct sip_msg *msg, char *code, char *text) |
Variables | |
| int | _tm_branch_index |
| str | auto_inv_100_reason = str_init("Giving a Try") |
| static cmd_export_t | cmds [] |
| static char * | contacts_avp_param = NULL |
| struct module_exports | exports |
| static char * | fr_inv_timer_param = NULL |
| static char * | fr_timer_param = NULL |
| static mi_export_t | mi_cmds [] |
| static pv_export_t | mod_items [] |
| static stat_export_t | mod_stats [] |
| static param_export_t | params [] |
| int | tm_enable_stats = 1 |
| stat_var * | tm_loc_rpls |
| stat_var * | tm_rcv_rpls |
| stat_var * | tm_rld_rpls |
| stat_var * | tm_trans_2xx |
| stat_var * | tm_trans_3xx |
| stat_var * | tm_trans_4xx |
| stat_var * | tm_trans_5xx |
| stat_var * | tm_trans_6xx |
| stat_var * | tm_trans_inuse |
| stat_var * | tm_uac_trans |
| stat_var * | tm_uas_trans |
Definition in file tm/tm.c.
| static int child_init | ( | int | rank | ) | [static] |
| static int do_t_unref | ( | struct sip_msg * | foo, | |
| void * | bar | |||
| ) | [static] |
Definition at line 536 of file tm/tm.c.
References get_cancelled_t(), get_e2eack_t(), NULL, T_UNDEFINED, t_unref(), and t_unref_cell().
Referenced by mod_init().
| static int fixup_cancel_branches | ( | void ** | param, | |
| int | param_no | |||
| ) | [static] |
| static int fixup_local_replied | ( | void ** | param, | |
| int | param_no | |||
| ) | [static] |
| static int fixup_phostport2proxy | ( | void ** | param, | |
| int | param_no | |||
| ) | [static] |
Definition at line 363 of file tm/tm.c.
References E_BUG, E_UNSPEC, proxy_l::host, _str::len, LM_CRIT, LM_ERR, mk_proxy(), parse_phostport(), port, proxy_l::proto, proxy, _str::s, s, and ser_error.
Referenced by fixup_t_relay1(), and fixup_t_relay2().
| static int fixup_t_relay1 | ( | void ** | param, | |
| int | param_no | |||
| ) | [static] |
Definition at line 397 of file tm/tm.c.
References E_CFG, fixup_phostport2proxy(), flag_fixup(), and LM_ERR.
| static int fixup_t_relay2 | ( | void ** | param, | |
| int | param_no | |||
| ) | [static] |
Definition at line 414 of file tm/tm.c.
References E_CFG, fixup_phostport2proxy(), flag_fixup(), and LM_ERR.
| static int fixup_t_replicate | ( | void ** | param, | |
| int | param_no | |||
| ) | [static] |
Definition at line 338 of file tm/tm.c.
References E_CFG, E_OUT_OF_MEM, flag_fixup(), _str::len, LM_ERR, pkg_malloc, _str::s, and s.
| static int fixup_t_send_reply | ( | void ** | param, | |
| int | param_no | |||
| ) | [static] |
Definition at line 428 of file tm/tm.c.
References E_CFG, _pv_spec::getf, _pv_name::isname, _str::len, LM_ERR, NULL, pv_parse_format(), _pv_param::pvn, _pv_spec::pvp, _str::s, s, _pv_elem::spec, str2int(), and _pv_name::u.
| static int flag_fixup | ( | void ** | param, | |
| int | param_no | |||
| ) | [static] |
Definition at line 319 of file tm/tm.c.
References _str::len, pkg_free, _str::s, s, and strno2int().
Referenced by fixup_t_relay1(), fixup_t_relay2(), and fixup_t_replicate().
| int load_tm | ( | struct tm_binds * | tmb | ) |
Definition at line 495 of file tm/tm.c.
References add_blind_uac(), dlg_add_extra(), tm_binds::dlg_add_extra, dlg_request_uas(), tm_binds::dlg_request_uas, dlg_response_uac(), tm_binds::dlg_response_uac, free_dlg(), tm_binds::free_dlg, get_t(), new_dlg_uac(), tm_binds::new_dlg_uac, new_dlg_uas(), tm_binds::new_dlg_uas, print_dlg(), tm_binds::print_dlg, register_tmcb(), tm_binds::register_tmcb, req_outside(), req_within(), request(), set_kr(), tm_binds::t_addblind, tm_binds::t_cancel_uac, tm_binds::t_get_picked, t_get_picked_branch(), t_get_reply_totag(), tm_binds::t_get_reply_totag, t_get_trans_ident(), tm_binds::t_get_trans_ident, tm_binds::t_gett, t_is_local(), tm_binds::t_is_local, t_lookup_ident(), tm_binds::t_lookup_ident, tm_binds::t_lookup_original_t, t_lookupOriginalT(), t_newtran(), tm_binds::t_newtran, tm_binds::t_relay, tm_binds::t_reply, t_reply_with_body(), tm_binds::t_reply_with_body, tm_binds::t_request, tm_binds::t_request_outside, tm_binds::t_request_within, tm_binds::t_setkr, t_uac_cancel(), t_unref_cell(), tm_binds::unref_cell, w_t_relay(), and w_t_reply().
Referenced by init(), load_tm_api(), and mod_init().
| static int mod_init | ( | void | ) | [static] |
Definition at line 573 of file tm/tm.c.
References contacts_avp_param, do_t_unref(), fr_inv_timer_next, fr_inv_timer_param, fr_timer_param, init_avp_params(), init_callid(), init_hash_table(), init_t(), init_tmcb_lists(), init_twrite_lines(), init_twrite_sock(), _str::len, LM_CRIT, LM_ERR, LM_INFO, MAX_BRANCHES, POST_SCRIPT_CB, PRE_SCRIPT_CB, register_script_cb(), register_timer(), register_utimer(), REQ_TYPE_CB, _str::s, script_init(), module_exports::stats, timer_routine(), tm_enable_stats, tm_init_tags(), tm_init_timers(), uac_init(), and utimer_routine().
| static int pv_get_tm_branch_idx | ( | struct sip_msg * | msg, | |
| pv_param_t * | param, | |||
| pv_value_t * | res | |||
| ) | [static] |
Definition at line 1052 of file tm/tm.c.
References _pv_value::flags, int2str(), _str::len, NULL, PV_TYPE_INT, PV_VAL_INT, PV_VAL_STR, _pv_value::ri, _pv_value::rs, and _str::s.
| static int pv_get_tm_reply_code | ( | struct sip_msg * | msg, | |
| pv_param_t * | param, | |||
| pv_value_t * | res | |||
| ) | [static] |
Definition at line 1072 of file tm/tm.c.
References FAILURE_ROUTE, sip_msg::first_line, _pv_value::flags, get_t(), int2str(), ua_client::last_received, _str::len, LM_CRIT, LM_DBG, LM_ERR, NULL, ONREPLY_ROUTE, PV_TYPE_INT, PV_VAL_INT, PV_VAL_STR, msg_start::reply, REQUEST_ROUTE, _pv_value::ri, route_type, _pv_value::rs, _str::s, ua_server::status, t_check(), t_get_picked_branch(), msg_start::u, cell::uac, and cell::uas.
| static int script_init | ( | struct sip_msg * | foo, | |
| void * | bar | |||
| ) | [static] |
Definition at line 552 of file tm/tm.c.
References reset_cancelled_t(), reset_e2eack_t(), reset_kr(), set_t(), t_on_branch(), t_on_negative(), t_on_reply(), and T_UNDEFINED.
Referenced by mod_init().
| static int t_cancel_branches | ( | struct sip_msg * | msg, | |
| char * | k, | |||
| char * | s2 | |||
| ) | [inline, static] |
Definition at line 1148 of file tm/tm.c.
References retr_buf::buffer, BUSY_BUFFER, cancel_uacs(), cb, sip_msg::first_line, get_t(), is_invite, LM_DBG, ua_client::local_cancel, LOCK_REPLIES, NULL, msg_start::reply, _str::s, T_UNDEFINED, msg_start::u, cell::uac, UNLOCK_REPLIES, and which_cancel().
| static int t_check_status | ( | struct sip_msg * | msg, | |
| char * | regexp, | |||
| char * | foo | |||
| ) | [inline, static] |
Definition at line 676 of file tm/tm.c.
References FAILURE_ROUTE, sip_msg::first_line, get_t(), int2str(), ua_client::last_received, LM_CRIT, LM_DBG, LM_ERR, ONREPLY_ROUTE, msg_start::reply, REQUEST_ROUTE, route_type, ua_server::status, t_get_picked_branch(), T_UNDEFINED, msg_start::u, cell::uac, and cell::uas.
| static int t_check_trans | ( | struct sip_msg * | msg, | |
| char * | foo, | |||
| char * | bar | |||
| ) | [inline, static] |
Definition at line 729 of file tm/tm.c.
References hdr_field::body, sip_msg::branch_index, sip_msg::callid, check_transaction_quadruple(), sip_msg::first_line, get_cseq, get_t(), sip_msg::hash_index, LM_ERR, METHOD_ACK, METHOD_CANCEL, NULL, set_t(), SIP_REPLY, t_check(), t_lookup_request(), t_lookupOriginalT(), t_retransmit_reply(), T_UNDEFINED, tm_hash, msg_start::type, and UNREF.
| static int t_flush_flags | ( | struct sip_msg * | msg, | |
| char * | foo, | |||
| char * | bar | |||
| ) | [inline, static] |
Definition at line 785 of file tm/tm.c.
References sip_msg::flags, get_t(), LM_ERR, ua_server::request, T_UNDEFINED, and cell::uas.
| static int t_local_replied | ( | struct sip_msg * | msg, | |
| char * | type, | |||
| char * | bar | |||
| ) | [inline, static] |
Definition at line 803 of file tm/tm.c.
References FAILURE_ROUTE, FAKED_REPLY, cell::first_branch, ua_client::flags, get_t(), LM_CRIT, LM_ERR, cell::nr_of_outgoings, cell::relayed_reply_branch, ua_client::reply, route_type, t_get_picked_branch(), T_UAC_HAS_RECV_REPLY, T_UNDEFINED, and cell::uac.
| static int t_relay_inerr2scripterr | ( | void | ) | [inline, static] |
Definition at line 973 of file tm/tm.c.
References E_BAD_ADDRESS, E_BAD_REQ, E_BAD_TO, E_BAD_URI, E_INVALID_PARAMS, E_IP_BLOCKED, E_NO_DESTINATION, E_NO_SOCKET, E_SEND, and ser_error.
Referenced by w_t_relay().
| static int t_was_cancelled | ( | struct sip_msg * | msg, | |
| char * | foo, | |||
| char * | bar | |||
| ) | [inline, static] |
| static int w_pv_t_reply | ( | struct sip_msg * | msg, | |
| char * | code, | |||
| char * | text | |||
| ) | [inline, static] |
Definition at line 903 of file tm/tm.c.
References _str::len, NULL, pv_printf_s(), str2int(), and w_t_reply().
| static int w_t_newtran | ( | struct sip_msg * | p_msg, | |
| char * | foo, | |||
| char * | bar | |||
| ) | [inline, static] |
| static int w_t_on_branch | ( | struct sip_msg * | msg, | |
| char * | go_to, | |||
| char * | foo | |||
| ) | [inline, static] |
| static int w_t_on_negative | ( | struct sip_msg * | msg, | |
| char * | go_to, | |||
| char * | foo | |||
| ) | [inline, static] |
| static int w_t_on_reply | ( | struct sip_msg * | msg, | |
| char * | go_to, | |||
| char * | foo | |||
| ) | [inline, static] |
| static int w_t_relay | ( | struct sip_msg * | p_msg, | |
| char * | proxy, | |||
| char * | flags | |||
| ) | [inline, static] |
Definition at line 1002 of file tm/tm.c.
References FAILURE_ROUTE, cell::flags, get_t(), LM_CRIT, LM_ERR, METHOD_ACK, REQUEST_ROUTE, route_type, t_forward_nonack(), T_NO_DNS_FAILOVER_FLAG, t_relay_inerr2scripterr(), t_relay_to(), t_release_transaction(), T_UNDEFINED, and TM_T_REPLY_nodnsfo_FLAG.
Referenced by load_tm().
| static int w_t_release | ( | struct sip_msg * | msg, | |
| char * | str, | |||
| char * | str2 | |||
| ) | [inline, static] |
Definition at line 928 of file tm/tm.c.
References get_t(), t_release_transaction(), and T_UNDEFINED.
| static int w_t_replicate | ( | struct sip_msg * | p_msg, | |
| char * | dst, | |||
| char * | flags | |||
| ) | [inline, static] |
| static int w_t_reply | ( | struct sip_msg * | msg, | |
| char * | code, | |||
| char * | text | |||
| ) | [inline, static] |
Definition at line 872 of file tm/tm.c.
References FAILURE_ROUTE, get_t(), LM_CRIT, LM_DBG, LM_ERR, LM_WARN, METHOD_ACK, REQUEST_ROUTE, route_type, t_reply(), t_reply_unsafe(), and T_UNDEFINED.
Referenced by load_tm(), and w_pv_t_reply().
| int _tm_branch_index |
| str auto_inv_100_reason = str_init("Giving a Try") |
cmd_export_t cmds[] [static] |
char* contacts_avp_param = NULL [static] |
| struct module_exports exports |
char* fr_inv_timer_param = NULL [static] |
char* fr_timer_param = NULL [static] |
mi_export_t mi_cmds[] [static] |
pv_export_t mod_items[] [static] |
stat_export_t mod_stats[] [static] |
param_export_t params[] [static] |
| int tm_enable_stats = 1 |
Definition at line 145 of file tm/tm.c.
Referenced by mod_init(), remove_from_hash_table_unsafe(), and reply_received().
1.5.6