#include <string.h>#include <time.h>#include "../../trim.h"#include "../../pvar.h"#include "../../timer.h"#include "../../statistics.h"#include "../../action.h"#include "../../script_cb.h"#include "../../faked_msg.h"#include "../../parser/parse_from.h"#include "../../parser/parse_cseq.h"#include "../../parser/contact/parse_contact.h"#include "../../parser/parse_rr.h"#include "../tm/tm_load.h"#include "../rr/api.h"#include "dlg_hash.h"#include "dlg_timer.h"#include "dlg_cb.h"#include "dlg_handlers.h"#include "dlg_req_within.h"#include "dlg_db_handler.h"#include "dlg_profile.h"#include "dlg_var.h"

Go to the source code of this file.
Defines | |
| #define | DLG_SEPARATOR '.' |
| #define | get_dlg_tl_payload(_tl_) |
| #define | RR_DLG_PARAM_SIZE (2*2*sizeof(int)+3+MAX_DLG_RR_PARAM_NAME) |
Functions | |
| static int | add_dlg_rr_param (struct sip_msg *req, unsigned int entry, unsigned int id) |
| void | destroy_dlg_handlers (void) |
| int | dlg_new_dialog (struct sip_msg *msg, struct cell *t) |
| static void | dlg_onreply (struct cell *t, int type, struct tmcb_params *param) |
| void | dlg_onreq (struct cell *t, int type, struct tmcb_params *param) |
| void | dlg_onroute (struct sip_msg *req, str *route_params, void *param) |
| void | dlg_ontimeout (struct dlg_tl *tl) |
| static void | dlg_seq_down_onreply (struct cell *t, int type, struct tmcb_params *param) |
| static void | dlg_seq_up_onreply (struct cell *t, int type, struct tmcb_params *param) |
| static int | get_dlg_timeout (struct sip_msg *req) |
| void | init_dlg_handlers (char *rr_param_p, int dlg_flag_p, pv_spec_t *timeout_avp_p, int default_timeout_p, int seq_match_mode_p) |
| static int | parse_dlg_rr_param (char *p, char *end, int *h_entry, int *h_id) |
| int | populate_leg_info (struct dlg_cell *dlg, struct sip_msg *msg, struct cell *t, unsigned int leg, str *tag) |
| static int | pre_match_parse (struct sip_msg *req, str *callid, str *ftag, str *ttag) |
| int | pv_get_dlg_lifetime (struct sip_msg *msg, pv_param_t *param, pv_value_t *res) |
| int | pv_get_dlg_status (struct sip_msg *msg, pv_param_t *param, pv_value_t *res) |
| void | unref_new_dialog (void *dialog) |
| static void | unreference_dialog (void *dialog) |
| static int | update_cseqs (struct dlg_cell *dlg, struct sip_msg *req, unsigned int dir) |
Variables | |
| static unsigned int | CURR_DLG_ID = 0xffffffff |
| static unsigned int | CURR_DLG_LIFETIME = 0 |
| static unsigned int | CURR_DLG_STATUS = 0 |
| struct rr_binds | d_rrb |
| static int | default_timeout |
| static int | dlg_flag |
| stat_var * | early_dlgs |
| stat_var * | expired_dlgs |
| stat_var * | failed_dlgs |
| stat_var * | processed_dlgs |
| static str | rr_param |
| static int | seq_match_mode |
| static int | shutdown_done = 0 |
| static pv_spec_t * | timeout_avp |
| #define DLG_SEPARATOR '.' |
Definition at line 94 of file dlg_handlers.c.
Referenced by add_dlg_rr_param(), and parse_dlg_rr_param().
| #define get_dlg_tl_payload | ( | _tl_ | ) |
| #define RR_DLG_PARAM_SIZE (2*2*sizeof(int)+3+MAX_DLG_RR_PARAM_NAME) |
| static int add_dlg_rr_param | ( | struct sip_msg * | req, | |
| unsigned int | entry, | |||
| unsigned int | id | |||
| ) | [inline, static] |
Definition at line 118 of file dlg_handlers.c.
References rr_binds::add_rr_param, buf, d_rrb, DLG_SEPARATOR, int2reverse_hex(), _str::len, LM_ERR, RR_DLG_PARAM_SIZE, _str::s, and s.
Referenced by dlg_new_dialog().
| void destroy_dlg_handlers | ( | void | ) |
Definition at line 112 of file dlg_handlers.c.
References shutdown_done.
Referenced by mod_destroy().
Definition at line 434 of file dlg_handlers.c.
References add_dlg_rr_param(), hdr_field::body, build_new_dlg(), sip_msg::callid, current_dlg_pointer, d_tmb, cell::dialog_ctx, DLG_CALLER_LEG, dlg_enable_stats, DLG_FLAG_TOBYE, dlg_onreply(), sip_msg::first_line, get_dlg_timeout(), get_from, get_to, dlg_cell::h_entry, dlg_cell::h_id, HDR_CALLID_F, HDR_TO_F, if_update_stat, _str::len, link_dlg(), LM_ERR, METHOD_CANCEL, NULL, parse_from_header(), parse_headers(), populate_leg_info(), profile_cleanup(), tm_binds::register_tmcb, msg_start::request, run_create_callbacks(), _str::s, s, seq_match_mode, SEQ_MATCH_NO_ID, shm_free, TMCB_RESPONSE_FWDED, TMCB_RESPONSE_PRE_OUT, sip_msg::to, trim(), msg_start::u, unref_dlg(), unref_new_dialog(), and update_stat.
Referenced by dlg_onreq(), and w_dlg_manage().
| static void dlg_onreply | ( | struct cell * | t, | |
| int | type, | |||
| struct tmcb_params * | param | |||
| ) | [static] |
Definition at line 248 of file dlg_handlers.c.
References active_dlgs, dlg_cell::callid, tmcb_params::code, DB_MODE_REALTIME, dlg_cell::dflags, DLG_CALLEE_LEG, DLG_CALLER_LEG, dlg_db_mode, DLG_DIR_UPSTREAM, dlg_enable_stats, DLG_EVENT_RPL1xx, DLG_EVENT_RPL2xx, DLG_EVENT_RPL3xx, DLG_EVENT_TDEL, DLG_FLAG_NEW, DLG_STATE_CONFIRMED, DLG_STATE_CONFIRMED_NA, DLG_STATE_DELETED, DLG_STATE_EARLY, DLGCB_CONFIRMED, DLGCB_EARLY, DLGCB_FAILED, DLGCB_RESPONSE_FWDED, early_dlgs, get_to, dlg_cell::h_entry, dlg_cell::h_id, HDR_TO_F, if_update_stat, insert_dlg_timer(), _str::len, dlg_cell::lifetime, LM_CRIT, LM_DBG, LM_ERR, next_state_dlg(), tmcb_params::param, parse_headers(), populate_leg_info(), ref_dlg(), tmcb_params::rpl, run_dlg_callbacks(), _str::s, shutdown_done, dlg_cell::start_ts, dlg_cell::tag, dlg_cell::tl, TMCB_RESPONSE_FWDED, TMCB_TRANS_DELETED, sip_msg::to, unref_dlg(), and update_dialog_dbinfo().
Referenced by dlg_new_dialog(), and unref_new_dialog().
| void dlg_onreq | ( | struct cell * | t, | |
| int | type, | |||
| struct tmcb_params * | param | |||
| ) |
Definition at line 414 of file dlg_handlers.c.
References current_dlg_pointer, dlg_flag, dlg_new_dialog(), sip_msg::flags, NULL, and tmcb_params::req.
Referenced by mod_init().
Definition at line 615 of file dlg_handlers.c.
References active_dlgs, hdr_field::body, sip_msg::callid, dlg_cell::callid, dlg_cell::cbs, CURR_DLG_ID, CURR_DLG_LIFETIME, CURR_DLG_STATUS, current_dlg_pointer, d_rrb, d_tmb, DB_MODE_REALTIME, default_timeout, dlg_cell::dflags, DLG_CALLEE_LEG, DLG_CALLER_LEG, dlg_db_mode, DLG_DIR_NONE, DLG_DIR_UPSTREAM, dlg_enable_stats, DLG_EVENT_REQ, DLG_EVENT_REQACK, DLG_EVENT_REQBYE, DLG_EVENT_REQPRACK, DLG_FLAG_CHANGED, dlg_seq_down_onreply(), dlg_seq_up_onreply(), DLG_STATE_CONFIRMED, DLG_STATE_CONFIRMED_NA, DLG_STATE_DELETED, DLGCB_REQ_WITHIN, DLGCB_RESPONSE_WITHIN, DLGCB_TERMINATED, sip_msg::first_line, get_dlg(), get_dlg_timeout(), rr_binds::get_route_param, get_to, dlg_cell::h_entry, dlg_cell::h_id, HDR_TO_F, sip_msg::id, if_update_stat, _str::len, dlg_cell::lifetime, LM_CRIT, LM_DBG, LM_ERR, LM_WARN, lookup_dlg(), match_dialog(), METHOD_ACK, METHOD_BYE, METHOD_PRACK, next_state_dlg(), NULL, parse_dlg_rr_param(), parse_headers(), pre_match_parse(), ref_dlg(), tm_binds::register_tmcb, remove_dialog_from_db(), remove_dialog_timer(), msg_start::request, run_dlg_callbacks(), _str::s, seq_match_mode, SEQ_MATCH_NO_ID, SEQ_MATCH_STRICT_ID, set_current_dialog(), dlg_cell::start_ts, dlg_cell::tag, timeout, dlg_cell::tl, TMCB_RESPONSE_FWDED, sip_msg::to, dlg_head_cbl::types, msg_start::u, unref_dlg(), unreference_dialog(), update_cseqs(), update_dialog_dbinfo(), and update_dlg_timer().
Referenced by mod_init(), and w_dlg_manage().
| void dlg_ontimeout | ( | struct dlg_tl * | tl | ) |
Definition at line 823 of file dlg_handlers.c.
References active_dlgs, dlg_cell::callid, dlg_cell::dflags, dlg_bye_all(), DLG_CALLEE_LEG, DLG_CALLER_LEG, dlg_db_mode, DLG_DIR_NONE, dlg_enable_stats, DLG_EVENT_REQBYE, DLG_FLAG_TOBYE, dlg_set_ctx_dialog(), DLG_STATE_CONFIRMED, DLG_STATE_CONFIRMED_NA, DLG_STATE_DELETED, DLGCB_EXPIRED, exec_post_req_cb(), exec_pre_req_cb(), faked_msg_next(), get_dlg_tl_payload, if_update_stat, _str::len, LM_DBG, LM_WARN, next_state_dlg(), NULL, remove_dialog_from_db(), REQUEST_ROUTE, rlist, RT_NO, run_dlg_callbacks(), run_top_route(), _str::s, set_route_type, dlg_cell::state, dlg_cell::tag, dlg_cell::toroute, and unref_dlg().
Referenced by mod_init().
| static void dlg_seq_down_onreply | ( | struct cell * | t, | |
| int | type, | |||
| struct tmcb_params * | param | |||
| ) | [static] |
Definition at line 381 of file dlg_handlers.c.
References DLG_DIR_DOWNSTREAM, DLGCB_RESPONSE_WITHIN, tmcb_params::param, tmcb_params::rpl, run_dlg_callbacks(), shutdown_done, and TMCB_RESPONSE_FWDED.
Referenced by dlg_onroute().
| static void dlg_seq_up_onreply | ( | struct cell * | t, | |
| int | type, | |||
| struct tmcb_params * | param | |||
| ) | [static] |
Definition at line 361 of file dlg_handlers.c.
References DLG_DIR_UPSTREAM, DLGCB_RESPONSE_WITHIN, tmcb_params::param, tmcb_params::rpl, run_dlg_callbacks(), shutdown_done, and TMCB_RESPONSE_FWDED.
Referenced by dlg_onroute().
| static int get_dlg_timeout | ( | struct sip_msg * | req | ) | [inline, static] |
Definition at line 400 of file dlg_handlers.c.
References default_timeout, _pv_value::flags, LM_DBG, pv_get_spec_value(), PV_VAL_INT, and _pv_value::ri.
Referenced by dlg_new_dialog(), and dlg_onroute().
| void init_dlg_handlers | ( | char * | rr_param_p, | |
| int | dlg_flag_p, | |||
| pv_spec_t * | timeout_avp_p, | |||
| int | default_timeout_p, | |||
| int | seq_match_mode_p | |||
| ) |
Definition at line 97 of file dlg_handlers.c.
References default_timeout, dlg_flag, _str::len, _str::s, and seq_match_mode.
Referenced by mod_init().
| static int parse_dlg_rr_param | ( | char * | p, | |
| char * | end, | |||
| int * | h_entry, | |||
| int * | h_id | |||
| ) | [inline, static] |
Definition at line 530 of file dlg_handlers.c.
References DLG_SEPARATOR, LM_ERR, reverse_hex2int(), and s.
Referenced by dlg_onroute().
| int populate_leg_info | ( | struct dlg_cell * | dlg, | |
| struct sip_msg * | msg, | |||
| struct cell * | t, | |||
| unsigned int | leg, | |||
| str * | tag | |||
| ) |
Definition at line 163 of file dlg_handlers.c.
References ua_client::added_rr, dlg_cell::bind_addr, receive_info::bind_address, sip_msg::contact, dlg_cell::cseq, sip_msg::cseq, DLG_CALLER_LEG, dlg_set_leg_info(), dlg_cell::from_rr_nb, get_cseq, HDR_CONTACT_F, HDR_CSEQ_F, HDR_EOH_F, _str::len, LM_DBG, LM_ERR, NULL, parse_contact(), parse_headers(), hdr_field::parsed, pkg_free, print_rr_body(), sip_msg::rcv, sip_msg::record_route, cell::relayed_reply_branch, _str::s, socket_info::sock_str, and cell::uac.
Referenced by dlg_bridge_tm_callback(), dlg_new_dialog(), and dlg_onreply().
| static int pre_match_parse | ( | struct sip_msg * | req, | |
| str * | callid, | |||
| str * | ftag, | |||
| str * | ttag | |||
| ) | [inline, static] |
Definition at line 555 of file dlg_handlers.c.
References hdr_field::body, sip_msg::callid, get_from, get_to, HDR_CALLID_F, HDR_TO_F, LM_ERR, parse_from_header(), parse_headers(), sip_msg::to, and trim().
Referenced by dlg_onroute().
| int pv_get_dlg_lifetime | ( | struct sip_msg * | msg, | |
| pv_param_t * | param, | |||
| pv_value_t * | res | |||
| ) |
Definition at line 884 of file dlg_handlers.c.
References CURR_DLG_ID, CURR_DLG_LIFETIME, _pv_value::flags, sip_msg::id, int2str(), _str::len, NULL, pv_get_null(), PV_TYPE_INT, PV_VAL_INT, PV_VAL_STR, _pv_value::ri, _pv_value::rs, and _str::s.
| int pv_get_dlg_status | ( | struct sip_msg * | msg, | |
| pv_param_t * | param, | |||
| pv_value_t * | res | |||
| ) |
Definition at line 908 of file dlg_handlers.c.
References CURR_DLG_ID, CURR_DLG_STATUS, _pv_value::flags, sip_msg::id, int2str(), _str::len, NULL, pv_get_null(), PV_TYPE_INT, PV_VAL_INT, PV_VAL_STR, _pv_value::ri, _pv_value::rs, and _str::s.
| void unref_new_dialog | ( | void * | dialog | ) |
Definition at line 425 of file dlg_handlers.c.
References dlg_onreply(), tmcb_params::param, and TMCB_TRANS_DELETED.
Referenced by dlg_new_dialog().
| static void unreference_dialog | ( | void * | dialog | ) | [static] |
Definition at line 606 of file dlg_handlers.c.
References d_table, and unref_dlg().
Referenced by dlg_onroute().
| static int update_cseqs | ( | struct dlg_cell * | dlg, | |
| struct sip_msg * | req, | |||
| unsigned int | dir | |||
| ) | [inline, static] |
Definition at line 585 of file dlg_handlers.c.
References sip_msg::cseq, DLG_CALLEE_LEG, DLG_CALLER_LEG, DLG_DIR_DOWNSTREAM, DLG_DIR_UPSTREAM, dlg_update_cseq(), get_cseq, HDR_CSEQ_F, LM_CRIT, LM_ERR, parse_headers(), and hdr_field::parsed.
Referenced by dlg_onroute().
unsigned int CURR_DLG_ID = 0xffffffff [static] |
Definition at line 91 of file dlg_handlers.c.
Referenced by dlg_onroute(), pv_get_dlg_lifetime(), and pv_get_dlg_status().
unsigned int CURR_DLG_LIFETIME = 0 [static] |
Definition at line 89 of file dlg_handlers.c.
Referenced by dlg_onroute(), and pv_get_dlg_lifetime().
unsigned int CURR_DLG_STATUS = 0 [static] |
Definition at line 101 of file dialog.c.
Referenced by add_dlg_rr_param(), dlg_onroute(), and mod_init().
int default_timeout [static] |
Definition at line 76 of file dlg_handlers.c.
int dlg_flag [static] |
Definition at line 74 of file dlg_handlers.c.
Definition at line 73 of file dlg_handlers.c.
int seq_match_mode [static] |
Definition at line 77 of file dlg_handlers.c.
int shutdown_done = 0 [static] |
Definition at line 78 of file dlg_handlers.c.
Referenced by destroy_dlg_handlers(), dlg_onreply(), dlg_seq_down_onreply(), and dlg_seq_up_onreply().
pv_spec_t* timeout_avp [static] |
Definition at line 75 of file dlg_handlers.c.
1.5.6