#include "../../locking.h"#include "../../mi/mi.h"#include "dlg_timer.h"#include "dlg_cb.h"


Go to the source code of this file.
Data Structures | |
| struct | dlg_cell |
| struct | dlg_entry |
| struct | dlg_table |
Defines | |
| #define | DLG_CALLEE_LEG 1 |
| #define | DLG_CALLER_LEG 0 |
| #define | DLG_DIR_DOWNSTREAM 1 |
| #define | DLG_DIR_NONE 0 |
| #define | DLG_DIR_UPSTREAM 2 |
| #define | DLG_EVENT_REQ 8 |
| #define | DLG_EVENT_REQACK 6 |
| #define | DLG_EVENT_REQBYE 7 |
| #define | DLG_EVENT_REQPRACK 5 |
| #define | DLG_EVENT_RPL1xx 2 |
| #define | DLG_EVENT_RPL2xx 3 |
| #define | DLG_EVENT_RPL3xx 4 |
| #define | DLG_EVENT_TDEL 1 |
| #define | DLG_FLAG_CALLEEBYE (1<<5) |
| #define | DLG_FLAG_CALLERBYE (1<<4) |
| #define | DLG_FLAG_CHANGED (1<<1) |
| #define | DLG_FLAG_HASBYE (1<<2) |
| #define | DLG_FLAG_LOCALDLG (1<<6) |
| #define | DLG_FLAG_NEW (1<<0) |
| #define | DLG_FLAG_TOBYE (1<<3) |
| #define | dlg_lock(_table, _entry) lock_set_get( (_table)->locks, (_entry)->lock_idx); |
| #define | DLG_STATE_CONFIRMED 4 |
| #define | DLG_STATE_CONFIRMED_NA 3 |
| #define | DLG_STATE_DELETED 5 |
| #define | DLG_STATE_EARLY 2 |
| #define | DLG_STATE_UNCONFIRMED 1 |
| #define | dlg_unlock(_table, _entry) lock_set_release( (_table)->locks, (_entry)->lock_idx); |
| #define | ref_dlg_unsafe(_dlg, _cnt) |
| #define | unref_dlg_unsafe(_dlg, _cnt, _d_entry) |
Functions | |
| struct dlg_cell * | build_new_dlg (str *callid, str *from_uri, str *to_uri, str *from_tag) |
| void | destroy_dlg (struct dlg_cell *dlg) |
| void | destroy_dlg_table (void) |
| int | dlg_set_leg_info (struct dlg_cell *dlg, str *tag, str *rr, str *contact, str *cseq, unsigned int leg) |
| int | dlg_update_cseq (struct dlg_cell *dlg, unsigned int leg, str *cseq) |
| struct dlg_cell * | get_dlg (str *callid, str *ftag, str *ttag, unsigned int *dir) |
| int | init_dlg_table (unsigned int size) |
| void | link_dlg (struct dlg_cell *dlg, int n) |
| struct dlg_cell * | lookup_dlg (unsigned int h_entry, unsigned int h_id) |
| static int | match_dialog (struct dlg_cell *dlg, str *callid, str *ftag, str *ttag, unsigned int *dir) |
| static int | match_downstream_dialog (struct dlg_cell *dlg, str *callid, str *ftag) |
| int | mi_print_dlg (struct mi_node *rpl, struct dlg_cell *dlg, int with_context) |
| struct mi_root * | mi_print_dlgs (struct mi_root *cmd, void *param) |
| struct mi_root * | mi_print_dlgs_ctx (struct mi_root *cmd, void *param) |
| void | next_state_dlg (struct dlg_cell *dlg, int event, int *old_state, int *new_state, int *unref) |
| void | ref_dlg (struct dlg_cell *dlg, unsigned int cnt) |
| void | unlink_unsafe_dlg (struct dlg_entry *d_entry, struct dlg_cell *dlg) |
| void | unref_dlg (struct dlg_cell *dlg, unsigned int cnt) |
Variables | |
| struct dlg_cell * | current_dlg_pointer |
| struct dlg_table * | d_table |
| #define DLG_CALLEE_LEG 1 |
Definition at line 71 of file dlg_hash.h.
Referenced by __dialog_ended(), build_dlg_t(), bye_reply_cb(), destroy_dlg(), dialog_update_db(), dlg_bridge_tm_callback(), dlg_bye_all(), dlg_onreply(), dlg_onroute(), dlg_ontimeout(), dlg_refer_callee(), dlg_refer_tm_callback(), dlg_transfer(), dlg_transfer_ctx_free(), internal_mi_print_dlg(), load_dialog_info_from_db(), log_next_state_dlg(), match_dialog(), next_state_dlg(), pv_get_dlg(), update_cseqs(), update_dialog_dbinfo(), w_dlg_bye(), and w_dlg_refer().
| #define DLG_CALLER_LEG 0 |
Definition at line 70 of file dlg_hash.h.
Referenced by __dialog_ended(), build_dlg_t(), bye_reply_cb(), destroy_dlg(), dialog_update_db(), dlg_bridge_tm_callback(), dlg_bye(), dlg_bye_all(), dlg_new_dialog(), dlg_onreply(), dlg_onroute(), dlg_ontimeout(), dlg_transfer(), dlg_transfer_ctx_free(), internal_mi_print_dlg(), load_dialog_info_from_db(), log_next_state_dlg(), match_dialog(), match_downstream_dialog(), next_state_dlg(), populate_leg_info(), pv_get_dlg(), send_bye(), update_cseqs(), update_dialog_dbinfo(), w_dlg_bye(), and w_dlg_refer().
| #define DLG_DIR_DOWNSTREAM 1 |
Definition at line 74 of file dlg_hash.h.
Referenced by add_pending_sdp_session(), dlg_seq_down_onreply(), match_dialog(), qos_dialog_created_CB(), qos_dialog_request_CB(), qos_dialog_response_CB(), run_create_callbacks(), and update_cseqs().
| #define DLG_DIR_NONE 0 |
Definition at line 73 of file dlg_hash.h.
Referenced by bye_reply_cb(), destroy_dlg(), dlg_onroute(), dlg_ontimeout(), internal_mi_print_dlg(), and run_load_callback().
| #define DLG_DIR_UPSTREAM 2 |
Definition at line 75 of file dlg_hash.h.
Referenced by add_pending_sdp_session(), dlg_onreply(), dlg_onroute(), dlg_seq_up_onreply(), match_dialog(), qos_dialog_created_CB(), qos_dialog_request_CB(), qos_dialog_response_CB(), and update_cseqs().
| #define DLG_EVENT_REQ 8 |
| #define DLG_EVENT_REQACK 6 |
| #define DLG_EVENT_REQBYE 7 |
Definition at line 59 of file dlg_hash.h.
Referenced by bye_reply_cb(), dlg_onroute(), dlg_ontimeout(), and next_state_dlg().
| #define DLG_EVENT_REQPRACK 5 |
| #define DLG_EVENT_RPL1xx 2 |
| #define DLG_EVENT_RPL2xx 3 |
| #define DLG_EVENT_RPL3xx 4 |
| #define DLG_EVENT_TDEL 1 |
| #define DLG_FLAG_CALLEEBYE (1<<5) |
| #define DLG_FLAG_CALLERBYE (1<<4) |
| #define DLG_FLAG_CHANGED (1<<1) |
Definition at line 63 of file dlg_hash.h.
Referenced by dialog_update_db(), dlg_onroute(), and update_dialog_dbinfo().
| #define DLG_FLAG_HASBYE (1<<2) |
| #define DLG_FLAG_LOCALDLG (1<<6) |
Definition at line 68 of file dlg_hash.h.
| #define DLG_FLAG_NEW (1<<0) |
Definition at line 62 of file dlg_hash.h.
Referenced by dialog_update_db(), dlg_onreply(), remove_dialog_from_db(), and update_dialog_dbinfo().
| #define DLG_FLAG_TOBYE (1<<3) |
Definition at line 129 of file dlg_hash.h.
Referenced by dialog_update_db(), internal_get_dlg(), internal_mi_print_dlgs(), is_dlg_in_profile(), link_dlg(), link_dlg_profile(), lookup_dlg(), next_state_dlg(), process_mi_params(), ref_dlg(), unref_dlg(), unset_dlg_profile(), and update_dialog_dbinfo().
| #define DLG_STATE_CONFIRMED 4 |
Definition at line 50 of file dlg_hash.h.
Referenced by dlg_onreply(), dlg_onroute(), dlg_ontimeout(), load_dialog_info_from_db(), and next_state_dlg().
| #define DLG_STATE_CONFIRMED_NA 3 |
Definition at line 49 of file dlg_hash.h.
Referenced by dlg_onreply(), dlg_onroute(), dlg_ontimeout(), load_dialog_info_from_db(), and next_state_dlg().
| #define DLG_STATE_DELETED 5 |
Definition at line 51 of file dlg_hash.h.
Referenced by bye_reply_cb(), dlg_onreply(), dlg_onroute(), dlg_ontimeout(), internal_get_dlg(), lookup_dlg(), next_state_dlg(), and process_mi_params().
| #define DLG_STATE_EARLY 2 |
Definition at line 48 of file dlg_hash.h.
Referenced by dlg_onreply(), load_dialog_info_from_db(), and next_state_dlg().
| #define DLG_STATE_UNCONFIRMED 1 |
Definition at line 131 of file dlg_hash.h.
Referenced by dialog_update_db(), internal_get_dlg(), internal_mi_print_dlgs(), is_dlg_in_profile(), link_dlg(), link_dlg_profile(), lookup_dlg(), next_state_dlg(), process_mi_params(), ref_dlg(), unref_dlg(), unset_dlg_profile(), and update_dialog_dbinfo().
| #define ref_dlg_unsafe | ( | _dlg, | |||
| _cnt | ) |
Value:
do { \ (_dlg)->ref += (_cnt); \ LM_DBG("ref dlg %p with %d -> %d\n", \ (_dlg),(_cnt),(_dlg)->ref); \ }while(0)
Definition at line 137 of file dlg_hash.h.
Referenced by next_state_dlg(), and ref_dlg().
| #define unref_dlg_unsafe | ( | _dlg, | |||
| _cnt, | |||||
| _d_entry | ) |
| struct dlg_cell* build_new_dlg | ( | str * | callid, | |
| str * | from_uri, | |||
| str * | to_uri, | |||
| str * | from_tag | |||
| ) | [read] |
Definition at line 192 of file dlg_hash.c.
References core_hash(), DLG_STATE_UNCONFIRMED, dlg_cell::from_uri, _str::len, len, LM_CRIT, LM_DBG, LM_ERR, _str::s, shm_free, shm_malloc(), dlg_table::size, and dlg_cell::to_uri.
Referenced by dlg_bridge_tm_callback(), dlg_new_dialog(), dlg_transfer(), and load_dialog_info_from_db().
| void destroy_dlg | ( | struct dlg_cell * | dlg | ) | [inline] |
Definition at line 113 of file dlg_hash.c.
References dlg_cell::callid, dlg_cell::cbs, dlg_cell::cseq, destroy_dlg_callbacks_list(), destroy_linkers(), DLG_CALLEE_LEG, DLG_CALLER_LEG, DLG_DIR_NONE, DLGCB_DESTROY, dlg_head_cbl::first, dlg_cell::h_entry, dlg_cell::h_id, _str::len, LM_CRIT, LM_DBG, dlg_cell::profile_links, remove_dialog_timer(), run_dlg_callbacks(), _str::s, shm_free, dlg_cell::tag, and dlg_cell::tl.
Referenced by destroy_dlg_table().
| void destroy_dlg_table | ( | void | ) |
Definition at line 161 of file dlg_hash.c.
References destroy_dlg(), dlg_table::entries, dlg_entry::first, dlg_table::locks, dlg_cell::next, shm_free, and dlg_table::size.
Referenced by mod_destroy().
| int dlg_set_leg_info | ( | struct dlg_cell * | dlg, | |
| str * | tag, | |||
| str * | rr, | |||
| str * | contact, | |||
| str * | cseq, | |||
| unsigned int | leg | |||
| ) |
Definition at line 241 of file dlg_hash.c.
References dlg_cell::contact, dlg_cell::cseq, _str::len, LM_ERR, NULL, dlg_cell::route_set, _str::s, shm_free, shm_malloc(), and dlg_cell::tag.
Referenced by dlg_bridge_tm_callback(), dlg_transfer(), load_dialog_info_from_db(), and populate_leg_info().
Definition at line 281 of file dlg_hash.c.
References dlg_cell::cseq, _str::len, LM_DBG, LM_ERR, NULL, _str::s, shm_free, and shm_malloc().
Referenced by update_cseqs().
Definition at line 382 of file dlg_hash.c.
References core_hash(), internal_get_dlg(), _str::len, LM_DBG, _str::s, and dlg_table::size.
Referenced by dlg_onroute(), and w_dlg_get().
| int init_dlg_table | ( | unsigned int | size | ) |
Definition at line 62 of file dlg_hash.c.
References dlg_table::entries, LM_ERR, dlg_entry::lock_idx, dlg_table::locks, dlg_table::locks_no, MAX_LDG_LOCKS, MIN_LDG_LOCKS, dlg_entry::next_id, shm_free, shm_malloc(), and dlg_table::size.
Referenced by mod_init().
| void link_dlg | ( | struct dlg_cell * | dlg, | |
| int | n | |||
| ) |
Definition at line 398 of file dlg_hash.c.
References dlg_lock, dlg_unlock, dlg_table::entries, dlg_entry::first, dlg_cell::h_entry, dlg_cell::h_id, dlg_entry::last, LM_DBG, dlg_cell::next, dlg_entry::next_id, dlg_cell::prev, and dlg_cell::ref.
Referenced by dlg_new_dialog(), and load_dialog_info_from_db().
| struct dlg_cell* lookup_dlg | ( | unsigned int | h_entry, | |
| unsigned int | h_id | |||
| ) | [read] |
Definition at line 308 of file dlg_hash.c.
References dlg_lock, DLG_STATE_DELETED, dlg_unlock, dlg_table::entries, dlg_entry::first, dlg_cell::h_id, LM_DBG, dlg_cell::next, dlg_cell::ref, dlg_table::size, and dlg_cell::state.
Referenced by dlg_onroute(), and mi_terminate_dlg().
| static int match_dialog | ( | struct dlg_cell * | dlg, | |
| str * | callid, | |||
| str * | ftag, | |||
| str * | ttag, | |||
| unsigned int * | dir | |||
| ) | [inline, static] |
Definition at line 196 of file dlg_hash.h.
References dlg_cell::callid, DLG_CALLEE_LEG, DLG_CALLER_LEG, DLG_DIR_DOWNSTREAM, DLG_DIR_UPSTREAM, _str::len, _str::s, and dlg_cell::tag.
Referenced by dlg_onroute(), and internal_get_dlg().
| static int match_downstream_dialog | ( | struct dlg_cell * | dlg, | |
| str * | callid, | |||
| str * | ftag | |||
| ) | [inline, static] |
Definition at line 278 of file dlg_hash.h.
References dlg_cell::callid, DLG_CALLER_LEG, _str::len, _str::s, and dlg_cell::tag.
Referenced by process_mi_params().
Definition at line 750 of file dlg_hash.c.
References internal_mi_print_dlg().
Referenced by mi_profile_list().
Definition at line 835 of file dlg_hash.c.
References free_mi_tree(), init_mi_tree(), internal_mi_print_dlg(), internal_mi_print_dlgs(), MI_OK, MI_SSTR, mi_root::node, NULL, and process_mi_params().
Definition at line 866 of file dlg_hash.c.
References free_mi_tree(), init_mi_tree(), internal_mi_print_dlg(), internal_mi_print_dlgs(), MI_OK, MI_SSTR, mi_root::node, NULL, and process_mi_params().
| void next_state_dlg | ( | struct dlg_cell * | dlg, | |
| int | event, | |||
| int * | old_state, | |||
| int * | new_state, | |||
| int * | unref | |||
| ) |
Definition at line 482 of file dlg_hash.c.
References dlg_cell::callid, dlg_cell::dflags, DLG_CALLEE_LEG, DLG_CALLER_LEG, DLG_EVENT_REQ, DLG_EVENT_REQACK, DLG_EVENT_REQBYE, DLG_EVENT_REQPRACK, DLG_EVENT_RPL1xx, DLG_EVENT_RPL2xx, DLG_EVENT_RPL3xx, DLG_EVENT_TDEL, DLG_FLAG_HASBYE, dlg_lock, DLG_STATE_CONFIRMED, DLG_STATE_CONFIRMED_NA, DLG_STATE_DELETED, DLG_STATE_EARLY, DLG_STATE_UNCONFIRMED, dlg_unlock, dlg_table::entries, dlg_cell::h_entry, dlg_cell::h_id, _str::len, LM_CRIT, LM_DBG, log_next_state_dlg(), ref_dlg_unsafe, _str::s, dlg_cell::state, dlg_cell::tag, and unref_dlg_unsafe.
Referenced by bye_reply_cb(), dlg_onreply(), dlg_onroute(), and dlg_ontimeout().
| void ref_dlg | ( | struct dlg_cell * | dlg, | |
| unsigned int | cnt | |||
| ) |
Definition at line 443 of file dlg_hash.c.
References dlg_lock, dlg_unlock, dlg_table::entries, dlg_cell::h_entry, and ref_dlg_unsafe.
Referenced by dlg_onreply(), dlg_onroute(), load_dialog_info_from_db(), and send_bye().
Definition at line 425 of file dlg_hash.c.
References dlg_entry::first, dlg_entry::last, dlg_cell::next, and dlg_cell::prev.
| void unref_dlg | ( | struct dlg_cell * | dlg, | |
| unsigned int | cnt | |||
| ) |
Definition at line 455 of file dlg_hash.c.
References dlg_lock, dlg_unlock, dlg_table::entries, dlg_cell::h_entry, and unref_dlg_unsafe.
Referenced by bye_reply_cb(), dlg_new_dialog(), dlg_onreply(), dlg_onroute(), dlg_ontimeout(), load_dialog_info_from_db(), mi_terminate_dlg(), profile_cleanup(), send_bye(), and unreference_dialog().
| struct dlg_cell* current_dlg_pointer |
global dialog
Definition at line 57 of file dlg_profile.c.
Referenced by dlg_new_dialog(), dlg_onreq(), dlg_onroute(), and w_dlg_get().
Definition at line 60 of file dlg_hash.c.
Referenced by dialog_update_db(), is_dlg_in_profile(), link_dlg_profile(), load_dialog_info_from_db(), mi_terminate_dlg(), run_load_callback(), unreference_dialog(), unset_dlg_profile(), and update_dialog_dbinfo().
1.5.6