Profile related functions for the dialog moduleModule: dialog :: Kamailio dialog module. More...
#include "../../mem/shm_mem.h"#include "../../hashes.h"#include "../../trim.h"#include "../../dprint.h"#include "../../ut.h"#include "../../route.h"#include "../../modules/tm/tm_load.h"#include "dlg_hash.h"#include "dlg_var.h"#include "dlg_handlers.h"#include "dlg_profile.h"
Go to the source code of this file.
Definition in file dlg_profile.c.
| int add_profile_definitions | ( | char * | profiles, | |
| unsigned int | has_value | |||
| ) |
| profiles | profile name | |
| has_value | set to 0 for a profile without value, otherwise it has a value |
Definition at line 77 of file dlg_profile.c.
References _str::len, new_dlg_profile(), PROFILE_HASH_SIZE, and _str::s.

| static unsigned int calc_hash_profile | ( | str * | value, | |
| dlg_cell_t * | dlg, | |||
| dlg_profile_table_t * | profile | |||
| ) | [inline, static] |
| value | hash source | |
| dlg | dialog cell | |
| profile | dialog profile table (for hash size) |
Definition at line 335 of file dlg_profile.c.
References dlg_profile_table::has_value, and dlg_profile_table::size.
Referenced by get_profile_size(), and link_dlg_profile().

| static void destroy_dlg_profile | ( | struct dlg_profile_table * | profile | ) | [static] |
| profile | dialog profile |
Definition at line 230 of file dlg_profile.c.
Referenced by destroy_dlg_profiles().

| void destroy_linkers | ( | struct dlg_profile_link * | linker | ) |
| linker | dialog linker |
Definition at line 261 of file dlg_profile.c.
References dlg_profile_entry::content, dlg_profile_table::entries, and dlg_profile_hash::hash.
Referenced by destroy_dlg(), profile_cleanup(), set_current_dialog(), set_dlg_profile(), and unset_dlg_profile().

| int dlg_add_profile | ( | dlg_cell_t * | dlg, | |
| str * | value, | |||
| struct dlg_profile_table * | profile | |||
| ) |
| dlg | dialog | |
| value | value | |
| profile | dialog profile table |
Definition at line 496 of file dlg_profile.c.
References dlg_profile_table::has_value, _str::len, link_dlg_profile(), _str::s, and dlg_profile_hash::value.
Referenced by dlg_json_to_profiles().


| int dlg_json_to_profiles | ( | dlg_cell_t * | dlg, | |
| srjson_doc_t * | jdoc | |||
| ) |
Deserialize dialog profiles to json.
Definition at line 956 of file dlg_profile.c.
References dlg_add_profile(), dlg_profile_table::has_value, _str::len, _str::s, and search_dlg_profile().

| int dlg_profiles_to_json | ( | dlg_cell_t * | dlg, | |
| srjson_doc_t * | jdoc | |||
| ) |
Serialize dialog profiles to json.
Definition at line 874 of file dlg_profile.c.
References dlg_cell::h_entry, dlg_cell::h_id, dlg_profile_table::has_value, _str::len, dlg_profile_table::name, dlg_cell::profile_links, _str::s, and dlg_profile_hash::value.
| unsigned int get_profile_size | ( | struct dlg_profile_table * | profile, | |
| str * | value | |||
| ) |
| profile | evaluated profile | |
| value | value |
Definition at line 648 of file dlg_profile.c.
References calc_hash_profile(), dlg_profile_entry::content, dlg_profile_table::entries, dlg_profile_table::has_value, _str::len, _str::s, dlg_profile_table::size, and dlg_profile_hash::value.
Referenced by mi_get_profile().


| int is_dlg_in_profile | ( | struct sip_msg * | msg, | |
| struct dlg_profile_table * | profile, | |||
| str * | value | |||
| ) |
| msg | SIP message | |
| profile | dialog profile table | |
| value | value |
Definition at line 603 of file dlg_profile.c.
References d_table, dlg_get_msg_dialog(), dlg_lock, dlg_release(), dlg_unlock, dlg_table::entries, dlg_cell::h_entry, dlg_profile_table::has_value, _str::len, dlg_cell::profile_links, _str::s, and dlg_profile_hash::value.

| static void link_dlg_profile | ( | struct dlg_profile_link * | linker, | |
| struct dlg_cell * | dlg | |||
| ) | [static] |
| linker | dialog linker | |
| dlg | dialog cell |
Definition at line 353 of file dlg_profile.c.
References calc_hash_profile(), dlg_profile_entry::content, d_table, dlg_profile_hash::dlg, dlg_lock, dlg_unlock, dlg_profile_table::entries, dlg_table::entries, dlg_cell::h_entry, dlg_cell::h_id, dlg_profile_hash::hash, dlg_cell::profile_links, and dlg_profile_hash::value.
Referenced by dlg_add_profile(), set_current_dialog(), and set_dlg_profile().


| struct mi_root* mi_get_profile | ( | struct mi_root * | cmd_tree, | |
| void * | param | |||
| ) | [read] |
| cmd_tree | MI command tree | |
| param | unused |
Definition at line 708 of file dlg_profile.c.
References get_profile_size(), int2str(), _str::len, dlg_profile_table::name, _str::s, search_dlg_profile(), and dlg_profile_table::size.

| struct mi_root* mi_profile_list | ( | struct mi_root * | cmd_tree, | |
| void * | param | |||
| ) | [read] |
| cmd_tree | MI command tree | |
| param | unused |
Definition at line 789 of file dlg_profile.c.
References dlg_profile_hash::dlg, dlg_profile_table::entries, dlg_profile_table::has_value, _str::len, mi_print_dlg(), _str::s, search_dlg_profile(), dlg_profile_table::size, and dlg_profile_hash::value.

| static struct dlg_profile_table * new_dlg_profile | ( | str * | name, | |
| unsigned int | size, | |||
| unsigned int | has_value | |||
| ) | [static, read] |
| name | profile name | |
| size | profile size | |
| has_value | set to 0 for a profile without value, otherwise it has a value |
Definition at line 157 of file dlg_profile.c.
References dlg_profile_table::has_value, _str::len, _str::s, and search_dlg_profile().
Referenced by add_profile_definitions().


| int profile_cleanup | ( | struct sip_msg * | msg, | |
| unsigned int | flags, | |||
| void * | param | |||
| ) |
| msg | SIP message | |
| flags | unused | |
| param | unused |
Definition at line 301 of file dlg_profile.c.
References current_dlg_msg_id, destroy_linkers(), dlg_cell::dflags, dlg_profile_hash::dlg, DLG_FLAG_TM, and dlg_unref().

| struct dlg_profile_table* search_dlg_profile | ( | str * | name | ) | [read] |
| name | searched dialog profile |
Definition at line 136 of file dlg_profile.c.
References _str::len, dlg_profile_table::name, and _str::s.
Referenced by dlg_json_to_profiles(), mi_get_profile(), mi_profile_list(), and new_dlg_profile().

| void set_current_dialog | ( | sip_msg_t * | msg, | |
| dlg_cell_t * | dlg | |||
| ) |
| msg | SIP message | |
| dlg | dialog cell |
Definition at line 401 of file dlg_profile.c.
References current_dlg_msg_id, destroy_linkers(), dlg_cell::h_entry, dlg_cell::h_id, sip_msg::id, link_dlg_profile(), and sip_msg::pid.
Referenced by dlg_new_dialog(), and dlg_onroute().


| int set_dlg_profile | ( | struct sip_msg * | msg, | |
| str * | value, | |||
| struct dlg_profile_table * | profile | |||
| ) |
Set the dialog profile.
| msg | SIP message | |
| value | value | |
| profile | dialog profile table |
Definition at line 434 of file dlg_profile.c.
References current_dlg_msg_id, destroy_linkers(), dlg_get_msg_dialog(), dlg_release(), dlg_profile_table::has_value, sip_msg::id, _str::len, link_dlg_profile(), sip_msg::pid, _str::s, and dlg_profile_hash::value.

| int unset_dlg_profile | ( | sip_msg_t * | msg, | |
| str * | value, | |||
| dlg_profile_table_t * | profile | |||
| ) |
| msg | SIP message | |
| value | value | |
| profile | dialog profile table |
Definition at line 536 of file dlg_profile.c.
References d_table, destroy_linkers(), dlg_get_msg_dialog(), dlg_lock, dlg_release(), dlg_unlock, dlg_table::entries, dlg_cell::h_entry, dlg_profile_table::has_value, _str::len, dlg_cell::profile_links, and _str::s.

1.7.1