#include <stdlib.h>#include <string.h>#include "../../dprint.h"#include "../../ut.h"#include "../../hash_func.h"#include "../../mi/mi.h"#include "dlg_timer.h"#include "dlg_hash.h"#include "dlg_profile.h"

Go to the source code of this file.
Defines | |
| #define | MAX_LDG_LOCKS 2048 |
| #define | MIN_LDG_LOCKS 2 |
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) |
| static struct dlg_cell * | internal_get_dlg (unsigned int h_entry, str *callid, str *ftag, str *ttag, unsigned int *dir) |
| static int | internal_mi_print_dlg (struct mi_node *rpl, struct dlg_cell *dlg, int with_context) |
| static int | internal_mi_print_dlgs (struct mi_node *rpl, int with_context) |
| void | link_dlg (struct dlg_cell *dlg, int n) |
| static void | log_next_state_dlg (const int event, const struct dlg_cell *dlg) |
| struct dlg_cell * | lookup_dlg (unsigned int h_entry, unsigned int h_id) |
| 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_tree, void *param) |
| struct mi_root * | mi_print_dlgs_ctx (struct mi_root *cmd_tree, void *param) |
| void | next_state_dlg (struct dlg_cell *dlg, int event, int *old_state, int *new_state, int *unref) |
| static struct mi_root * | process_mi_params (struct mi_root *cmd_tree, struct dlg_cell **dlg_p) |
| 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_table * | d_table = 0 |
| #define MAX_LDG_LOCKS 2048 |
| #define MIN_LDG_LOCKS 2 |
| 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().
| static struct dlg_cell* internal_get_dlg | ( | unsigned int | h_entry, | |
| str * | callid, | |||
| str * | ftag, | |||
| str * | ttag, | |||
| unsigned int * | dir | |||
| ) | [static, read] |
Definition at line 342 of file dlg_hash.c.
References dlg_lock, DLG_STATE_DELETED, dlg_unlock, dlg_table::entries, dlg_entry::first, _str::len, LM_DBG, match_dialog(), dlg_cell::next, dlg_cell::ref, _str::s, and dlg_cell::state.
Referenced by get_dlg().
| static int internal_mi_print_dlg | ( | struct mi_node * | rpl, | |
| struct dlg_cell * | dlg, | |||
| int | with_context | |||
| ) | [inline, static] |
Definition at line 623 of file dlg_hash.c.
References add_mi_node_child(), addf_mi_attr(), dlg_cell::bind_addr, dlg_cell::callid, dlg_cell::contact, dlg_cell::cseq, DLG_CALLEE_LEG, DLG_CALLER_LEG, DLG_DIR_NONE, DLGCB_MI_CONTEXT, dlg_cell::from_uri, dlg_cell::h_entry, dlg_cell::h_id, int2str(), _str::len, len, LM_ERR, MI_DUP_VALUE, NULL, dlg_cell::route_set, run_dlg_callbacks(), _str::s, socket_info::sock_str, dlg_cell::start_ts, dlg_cell::state, dlg_cell::tag, dlg_tl::timeout, dlg_cell::tl, and dlg_cell::to_uri.
Referenced by internal_mi_print_dlgs(), mi_print_dlg(), mi_print_dlgs(), and mi_print_dlgs_ctx().
| static int internal_mi_print_dlgs | ( | struct mi_node * | rpl, | |
| int | with_context | |||
| ) | [static] |
Definition at line 756 of file dlg_hash.c.
References dlg_lock, dlg_unlock, dlg_table::entries, dlg_entry::first, internal_mi_print_dlg(), LM_DBG, LM_ERR, dlg_cell::next, and dlg_table::size.
Referenced by mi_print_dlgs(), and mi_print_dlgs_ctx().
| 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().
| static void log_next_state_dlg | ( | const int | event, | |
| const struct dlg_cell * | dlg | |||
| ) | [inline, static] |
Small logging helper functions for next_state_dlg.
Definition at line 473 of file dlg_hash.c.
References dlg_cell::callid, DLG_CALLEE_LEG, DLG_CALLER_LEG, dlg_cell::h_entry, dlg_cell::h_id, _str::len, LM_CRIT, _str::s, dlg_cell::state, and dlg_cell::tag.
Referenced by next_state_dlg().
| 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().
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().
| static struct mi_root* process_mi_params | ( | struct mi_root * | cmd_tree, | |
| struct dlg_cell ** | dlg_p | |||
| ) | [static, read] |
Definition at line 781 of file dlg_hash.c.
References dlg_cell::callid, core_hash(), dlg_lock, DLG_STATE_DELETED, dlg_unlock, dlg_table::entries, dlg_entry::first, from_tag, dlg_cell::h_entry, init_mi_tree(), mi_node::kids, _str::len, LM_DBG, match_downstream_dialog(), MI_MISSING_PARM, MI_SSTR, dlg_cell::next, mi_node::next, mi_root::node, NULL, _str::s, dlg_table::size, dlg_cell::state, and mi_node::value.
Referenced by mi_print_dlgs(), and mi_print_dlgs_ctx().
| 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().
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