#include "config.h"
#include "t_funcs.h"


Go to the source code of this file.
Defines | |
| #define | T_GET_TI "t_get_trans_ident" |
| #define | T_IS_LOCAL "t_is_local" |
| #define | T_LOOKUP_IDENT "t_lookup_ident" |
| #define | T_NULL_CELL ( (struct cell*) 0 ) |
| #define | T_UNDEFINED ( (struct cell*) -1 ) |
Typedefs | |
| typedef int(* | tget_ti_f )(struct sip_msg *, unsigned int *, unsigned int *) |
| typedef struct cell *(* | tgett_f )(void) |
| typedef int(* | tislocal_f )(struct sip_msg *) |
| typedef int(* | tlookup_ident_f )(struct cell **, unsigned int, unsigned int) |
| typedef struct cell *(* | tlookuporiginalt_f )(struct sip_msg *) |
| typedef int(* | tnewtran_f )(struct sip_msg *) |
| typedef void(* | tunrefcell_f )(struct cell *) |
Functions | |
| int | _add_branch_label (struct cell *trans, char *str, int *len, int branch) |
| int | add_branch_label (struct cell *trans, struct sip_msg *p_msg, int branch) |
| struct cell * | get_cancelled_t (void) |
| struct cell * | get_e2eack_t (void) |
| struct cell * | get_t (void) |
| int | init_rb (struct retr_buf *rb, struct sip_msg *msg) |
| void | init_t (void) |
| void | reset_cancelled_t (void) |
| void | reset_e2eack_t (void) |
| void | set_t (struct cell *t) |
| int | t_check (struct sip_msg *, int *branch) |
| Determine current transaction. | |
| int | t_get_trans_ident (struct sip_msg *p_msg, unsigned int *hash_index, unsigned int *label) |
| Get transaction identifier. | |
| int | t_is_local (struct sip_msg *) |
| Small wrapper around is_local. | |
| int | t_lookup_callid (struct cell **trans, str callid, str cseq) |
| Lookup a transaction by callid and cseq. | |
| int | t_lookup_ident (struct cell **trans, unsigned int hash_index, unsigned int label) |
| Lookup a transaction from a hash identifier. | |
| int | t_lookup_request (struct sip_msg *p_msg, int leave_new_locked) |
| Lookup request. | |
| struct cell * | t_lookupOriginalT (struct sip_msg *p_msg) |
| Lookups transaction being canceled by CANCEL in p_msg. | |
| int | t_newtran (struct sip_msg *p_msg) |
| Atomic "new_tran" construct. | |
| int | t_reply_matching (struct sip_msg *, int *) |
| Reply matching. | |
| int | t_unref (struct sip_msg *p_msg) |
| Unreference a transaction, release it if necessary. | |
| void | t_unref_cell (struct cell *) |
Variables | |
| unsigned int | global_msg_id |
| int | ruri_matching |
| int | via1_matching |
Definition in file t_lookup.h.
| #define T_GET_TI "t_get_trans_ident" |
Definition at line 90 of file t_lookup.h.
| #define T_IS_LOCAL "t_is_local" |
Definition at line 92 of file t_lookup.h.
| #define T_LOOKUP_IDENT "t_lookup_ident" |
Definition at line 91 of file t_lookup.h.
| #define T_NULL_CELL ( (struct cell*) 0 ) |
Definition at line 43 of file t_lookup.h.
Referenced by get_redirect(), t_forward_nonack(), t_unref(), and uac_auth().
| #define T_UNDEFINED ( (struct cell*) -1 ) |
Definition at line 42 of file t_lookup.h.
Referenced by add_blind_uac(), create_as_event_t(), do_t_unref(), get_current_dialog(), get_redirect(), get_reply_totag(), init_t(), pv_t_update_req(), pv_t_update_rpl(), register_tmcb(), reply_received(), reset_cancelled_t(), reset_e2eack_t(), script_init(), send_reply(), t_cancel_branches(), t_check(), t_check_status(), t_check_trans(), t_flush_flags(), t_load_contacts(), t_local_replied(), t_lookup_request(), t_lookupOriginalT(), t_newtran(), t_next_contacts(), t_on_branch(), t_on_negative(), t_on_reply(), t_unref(), t_was_cancelled(), uac_auth(), w_as_relay_t(), w_t_relay(), w_t_release(), and w_t_reply().
Definition at line 96 of file t_lookup.h.
Definition at line 75 of file t_lookup.h.
| typedef int(* tislocal_f)(struct sip_msg *) |
Definition at line 94 of file t_lookup.h.
| typedef int(* tlookup_ident_f)(struct cell **, unsigned int, unsigned int) |
Definition at line 97 of file t_lookup.h.
| typedef struct cell*(* tlookuporiginalt_f)(struct sip_msg *) |
Definition at line 73 of file t_lookup.h.
| typedef int(* tnewtran_f)(struct sip_msg *) |
Definition at line 95 of file t_lookup.h.
| typedef void(* tunrefcell_f)(struct cell *) |
Definition at line 64 of file t_lookup.h.
| int _add_branch_label | ( | struct cell * | trans, | |
| char * | str, | |||
| int * | len, | |||
| int | branch | |||
| ) |
| struct cell* get_cancelled_t | ( | void | ) | [read] |
| struct cell* get_e2eack_t | ( | void | ) | [read] |
| struct cell* get_t | ( | void | ) | [read] |
Definition at line 161 of file t_lookup.c.
Referenced by add_blind_uac(), faked_env(), load_tm(), pv_get_tm_reply_code(), pv_t_update_req(), pv_t_update_rpl(), register_tmcb(), reply_received(), run_reqin_callbacks(), run_trans_callbacks(), t_cancel_branches(), t_check_status(), t_check_trans(), t_flush_flags(), t_get_trans_ident(), t_is_local(), t_load_contacts(), t_local_replied(), t_next_contacts(), t_on_branch(), t_on_negative(), t_on_reply(), t_relay_to(), t_was_cancelled(), w_t_relay(), w_t_release(), and w_t_reply().
Definition at line 986 of file t_lookup.c.
References receive_info::bind_address, retr_buf::dst, E_BAD_VIA, via_body::host, _str::len, LM_ERR, dest_info::proto, receive_info::proto, via_body::proto, receive_info::proto_reserved1, dest_info::proto_reserved1, sip_msg::rcv, reply_to_via, _str::s, dest_info::send_sock, ser_error, dest_info::to, update_sock_struct_from_ip, update_sock_struct_from_via(), and sip_msg::via1.
Referenced by t_newtran().
| void init_t | ( | void | ) |
Definition at line 164 of file t_lookup.c.
References set_t(), and T_UNDEFINED.
Referenced by mod_init().
| void reset_cancelled_t | ( | void | ) |
| void reset_e2eack_t | ( | void | ) |
| void set_t | ( | struct cell * | t | ) |
Definition at line 162 of file t_lookup.c.
Referenced by faked_env(), init_t(), new_t(), reply_received(), run_reqin_callbacks(), run_trans_callbacks(), script_init(), t_check_trans(), t_lookup_callid(), t_lookup_ident(), t_lookup_request(), t_reply_matching(), and t_unref().
| int t_check | ( | struct sip_msg * | p_msg, | |
| int * | param_branch | |||
| ) |
Determine current transaction.
Determine current transaction for SIP message. Set T to a ptr if the transaction could be found, to 0 if not found, and to T_UNDEFINED on errors: Found Not Found Error (e.g. parsing) Return Value 1 0 -1 T ptr 0 T_UNDEFINED
Definition at line 919 of file t_lookup.c.
References sip_msg::cseq, sip_msg::first_line, get_cseq, HDR_CSEQ_F, HDR_EOH_F, HDR_TO_F, HDR_VIA1_F, LM_DBG, LM_ERR, cseq_body::method_id, METHOD_INVITE, parse_from_header(), parse_headers(), SIP_REQUEST, t_lookup_request(), t_reply_matching(), T_UNDEFINED, sip_msg::to, msg_start::type, and sip_msg::via1.
Referenced by pv_get_tm_reply_code(), pv_t_update_req(), reply_received(), t_check_trans(), t_get_trans_ident(), and t_is_local().
| int t_get_trans_ident | ( | struct sip_msg * | p_msg, | |
| unsigned int * | hash_index, | |||
| unsigned int * | label | |||
| ) |
Get transaction identifier.
Definition at line 1244 of file t_lookup.c.
References get_t(), cell::hash_index, cell::label, LM_ERR, and t_check().
Referenced by assemble_msg(), and load_tm().
| int t_is_local | ( | struct sip_msg * | p_msg | ) |
Lookup a transaction by callid and cseq.
Lookup a transaction by callid and cseq, parameters are pure header field content only, e.g. "123@10.0.0.1" and "11"
| trans | transaction | |
| callid | Call-Id value | |
| cseq | CSEQ value |
Definition at line 1336 of file t_lookup.c.
References cell::callid, cell::cseq_n, s_table::entrys, entry::first_cell, get_tm_table(), cell::hash_index, INVITE, INVITE_LEN, _str::len, LM_DBG, LM_ERR, LOCK_HASH, MAX_HEADER, cell::next_cell, print_callid_mini(), print_cseq_mini(), REF_UNSAFE, _str::s, set_t(), tm_hash, TM_TABLE_ENTRIES, and UNLOCK_HASH.
Referenced by mi_tm_cancel().
| int t_lookup_ident | ( | struct cell ** | trans, | |
| unsigned int | hash_index, | |||
| unsigned int | label | |||
| ) |
Lookup a transaction from a hash identifier.
Definition at line 1269 of file t_lookup.c.
References get_tm_table(), cell::label, LM_DBG, LM_ERR, LOCK_HASH, cell::next_cell, REF_UNSAFE, set_t(), TM_TABLE_ENTRIES, and UNLOCK_HASH.
Referenced by load_tm(), mi_tm_reply(), and t_uac_cancel().
| int t_lookup_request | ( | struct sip_msg * | p_msg, | |
| int | leave_new_locked | |||
| ) |
Lookup request.
Definition at line 417 of file t_lookup.c.
References hdr_field::body, via_body::branch, cell::callid, sip_msg::callid, check_transaction_quadruple(), dlg_matching(), EQ_LEN, EQ_REQ_URI_LEN, EQ_REQ_URI_STR, EQ_STR, EQ_VIA_LEN, EQ_VIA_STR, cell::flags, cell::from, get_cseq, get_tm_table(), get_to, sip_msg::hash_index, _str::len, LM_DBG, LM_ERR, LOCK_HASH, matching_3261(), MCOOKIE, MCOOKIE_LEN, METHOD_ACK, METHOD_INVITE, cell::next_cell, cell::nr_of_outgoings, NULL, REF_UNSAFE, cell::relayed_reply_branch, REQ_EXIST, ua_server::request, ruri_matching, _str::s, set_kr(), set_t(), ua_server::status, T_BLIND_UAC, t_release_transaction(), T_UNDEFINED, tm_hash, cell::to, cell::uas, UNLOCK_HASH, via_param::value, sip_msg::via1, and via1_matching.
Referenced by pv_t_update_rpl(), t_check(), t_check_trans(), and t_newtran().
Lookups transaction being canceled by CANCEL in p_msg.
Lookups transaction from hash table that is being canceled by the CANCEL in the message.
| p_msg | SIP message with CANCEL |
Definition at line 628 of file t_lookup.c.
References via_body::branch, EQ_LEN, EQ_REQ_URI_LEN, EQ_REQ_URI_STR, EQ_STR, EQ_VIA_LEN, EQ_VIA_STR, get_cseq, get_tm_table(), get_to, sip_msg::hash_index, cell::hash_index, _str::len, LM_DBG, LM_ERR, LOCK_HASH, matching_3261(), MCOOKIE, MCOOKIE_LEN, METHOD_CANCEL, cell::next_cell, NULL, REF_UNSAFE, ua_server::request, ruri_matching, _str::s, T_UNDEFINED, cell::uas, UNLOCK_HASH, via_param::value, sip_msg::via1, and via1_matching.
Referenced by load_tm(), t_check_trans(), and t_forward_nonack().
| int t_newtran | ( | struct sip_msg * | p_msg | ) |
Atomic "new_tran" construct.
Definition at line 1088 of file t_lookup.c.
References sip_msg::add_to_branch_len, sip_msg::add_to_branch_s, check_hdrs_changes(), E_BAD_REQ, E_BAD_TUPEL, E_BAD_VIA, E_OUT_OF_MEM, E_SCRIPT, has_tran_tmcbs, sip_msg::hash_index, HDR_EOH_F, init_rb(), LM_DBG, LM_ERR, METHOD_ACK, new_t(), cell::nr_of_outgoings, parse_headers(), sip_msg::parsed_flag, put_on_wait(), ua_server::response, run_trans_callbacks(), t_calc_branch(), t_lookup_request(), t_release_transaction(), t_retransmit_reply(), T_UNDEFINED, t_unref(), TMCB_E2EACK_IN, cell::uas, UNLOCK_HASH, and unmatched_totag().
Referenced by load_tm(), t_relay_to(), and w_t_newtran().
| int t_reply_matching | ( | struct sip_msg * | p_msg, | |
| int * | p_branch | |||
| ) |
Reply matching.
Definition at line 753 of file t_lookup.c.
References via_body::branch, BRANCH_SEPARATOR, retr_buf::buffer, eat_token2_end(), eat_token_end(), EQ_STRS, get_cseq, get_tm_table(), has_tran_tmcbs, cell::hash_index, HDR_TO_F, is_invite, is_local, cell::label, _str::len, LM_DBG, LM_ERR, ua_client::local_cancel, LOCK_HASH, MAX_BRANCHES, MCOOKIE, MCOOKIE_LEN, cell::md5, MD5_LEN, cell::method, cseq_body::method, METHOD_CANCEL, cseq_body::method_id, METHOD_OTHER, cell::next_cell, cell::nr_of_outgoings, NULL, parse_headers(), REF_UNSAFE, REQ_LINE, ua_server::request, reverse_hex2int(), run_trans_callbacks(), _str::s, set_t(), syn_branch, TM_TABLE_ENTRIES, TMCB_E2EACK_IN, TMCB_LOCAL_COMPLETED, TMCB_RESPONSE_IN, TMCB_RESPONSE_OUT, TMCB_RESPONSE_PRE_OUT, cell::uac, cell::uas, UNLOCK_HASH, via_param::value, and sip_msg::via1.
Referenced by t_check().
| int t_unref | ( | struct sip_msg * | p_msg | ) |
Unreference a transaction, release it if necessary.
Definition at line 1212 of file t_lookup.c.
References sip_msg::first_line, get_kr(), kr, LM_WARN, METHOD_ACK, REQ_RLSD, set_t(), SIP_REQUEST, T_NULL_CELL, t_release_transaction(), T_UNDEFINED, msg_start::type, and UNREF.
Referenced by do_t_unref(), reply_received(), and t_newtran().
| void t_unref_cell | ( | struct cell * | ) |
Definition at line 1234 of file t_lookup.c.
References UNREF.
Referenced by do_t_unref(), and load_tm().
| unsigned int global_msg_id |
| int ruri_matching |
Should be request-uri matching used as a part of pre-3261 transaction matching, as the standard wants us to do so (and is reasonable to do so, to be able to distinguish spirals)? Turn only off for better interaction with devices that are broken and send different r-uri in CANCEL/ACK than in original INVITE
Definition at line 135 of file t_lookup.c.
Referenced by t_lookup_request(), and t_lookupOriginalT().
| int via1_matching |
Definition at line 136 of file t_lookup.c.
Referenced by t_lookup_request(), and t_lookupOriginalT().
1.5.6