#include "../../parser/msg_parser.h"
#include "../../locking.h"
#include "../../str.h"


Go to the source code of this file.
Data Structures | |
| struct | dlg_profile_entry |
| struct | dlg_profile_hash |
| struct | dlg_profile_link |
| struct | dlg_profile_table |
Functions | |
| int | add_profile_definitions (char *profiles, unsigned int has_value) |
| Add profile definitions to the global list. | |
| void | destroy_dlg_profiles (void) |
| Destroy the global dialog profile list. | |
| void | destroy_linkers (struct dlg_profile_link *linker) |
| Destroy dialog linkers. | |
| unsigned int | get_profile_size (struct dlg_profile_table *profile, str *value) |
| Get the size of a profile. | |
| int | is_dlg_in_profile (struct sip_msg *msg, struct dlg_profile_table *profile, str *value) |
| Check if a dialog belongs to a profile. | |
| struct mi_root * | mi_get_profile (struct mi_root *cmd_tree, void *param) |
| Output a profile via MI interface. | |
| struct mi_root * | mi_profile_list (struct mi_root *cmd_tree, void *param) |
| List the profiles via MI interface. | |
| int | profile_cleanup (struct sip_msg *msg, void *param) |
| Cleanup a profile. | |
| struct dlg_profile_table * | search_dlg_profile (str *name) |
| Search a dialog profile in the global list. | |
| void | set_current_dialog (struct sip_msg *msg, struct dlg_cell *dlg) |
| Set the global variables to the current dialog. | |
| int | set_dlg_profile (struct sip_msg *msg, str *value, struct dlg_profile_table *profile) |
| Set the dialog profile. | |
| int | unset_dlg_profile (struct sip_msg *msg, str *value, struct dlg_profile_table *profile) |
| Unset a dialog profile. | |
Module: dialog.
Definition in file dlg_profile.h.
| int add_profile_definitions | ( | char * | profiles, | |
| unsigned int | has_value | |||
| ) |
Add profile definitions to the global list.
| 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, LM_DBG, LM_ERR, dlg_profile_table::name, new_dlg_profile(), NULL, PROFILE_HASH_SIZE, _str::s, and trim_spaces_lr.
Referenced by mod_init().
| void destroy_dlg_profiles | ( | void | ) |
Destroy the global dialog profile list.
Definition at line 244 of file dlg_profile.c.
References destroy_dlg_profile(), and dlg_profile_table::next.
Referenced by mod_destroy().
| void destroy_linkers | ( | struct dlg_profile_link * | linker | ) |
Destroy dialog linkers.
| linker | dialog linker |
Definition at line 261 of file dlg_profile.c.
References dlg_profile_entry::content, dlg_profile_table::entries, dlg_profile_entry::first, get_lock(), dlg_profile_hash::hash, dlg_profile_link::hash_linker, dlg_profile_table::lock, dlg_profile_hash::next, dlg_profile_link::next, NULL, dlg_profile_hash::prev, dlg_profile_link::profile, release_lock(), and shm_free.
Referenced by destroy_dlg(), get_current_dialog(), profile_cleanup(), set_current_dialog(), and unset_dlg_profile().
| unsigned int get_profile_size | ( | struct dlg_profile_table * | profile, | |
| str * | value | |||
| ) |
Get the size of a profile.
| profile | evaluated profile | |
| value | value |
Definition at line 606 of file dlg_profile.c.
References calc_hash_profile(), dlg_profile_entry::content, dlg_profile_table::entries, dlg_profile_entry::first, get_lock(), dlg_profile_table::has_value, _str::len, dlg_profile_table::lock, dlg_profile_hash::next, NULL, release_lock(), _str::s, dlg_profile_table::size, and dlg_profile_hash::value.
Referenced by mi_get_profile(), and w_get_profile_size().
| int is_dlg_in_profile | ( | struct sip_msg * | msg, | |
| struct dlg_profile_table * | profile, | |||
| str * | value | |||
| ) |
Check if a dialog belongs to a profile.
| msg | SIP message | |
| profile | dialog profile table | |
| value | value |
Definition at line 564 of file dlg_profile.c.
References d_table, dlg_lock, dlg_unlock, dlg_table::entries, get_current_dialog(), dlg_cell::h_entry, dlg_profile_table::has_value, dlg_profile_link::hash_linker, _str::len, dlg_profile_link::next, NULL, dlg_profile_link::profile, dlg_cell::profile_links, _str::s, and dlg_profile_hash::value.
Referenced by w_is_in_profile().
Output a profile via MI interface.
| cmd_tree | MI command tree | |
| param | MI parameter |
| cmd_tree | MI command tree | |
| param | unused |
Definition at line 650 of file dlg_profile.c.
References add_mi_attr(), add_mi_node_child(), free_mi_tree(), get_profile_size(), init_mi_tree(), int2str(), mi_node::kids, _str::len, len, MI_BAD_PARM, MI_DUP_VALUE, MI_MISSING_PARM, MI_OK, MI_SSTR, dlg_profile_table::name, mi_node::next, mi_root::node, NULL, _str::s, search_dlg_profile(), dlg_profile_table::size, and mi_node::value.
List the profiles via MI interface.
| cmd_tree | MI command tree | |
| param | unused |
Definition at line 731 of file dlg_profile.c.
References dlg_profile_hash::dlg, dlg_profile_table::entries, dlg_profile_entry::first, free_mi_tree(), get_lock(), dlg_profile_table::has_value, init_mi_tree(), mi_node::kids, _str::len, dlg_profile_table::lock, MI_BAD_PARM, MI_MISSING_PARM, MI_OK, mi_print_dlg(), MI_SSTR, dlg_profile_hash::next, mi_node::next, mi_root::node, NULL, release_lock(), _str::s, search_dlg_profile(), dlg_profile_table::size, mi_node::value, and dlg_profile_hash::value.
| int profile_cleanup | ( | struct sip_msg * | msg, | |
| void * | param | |||
| ) |
Cleanup a profile.
| msg | SIP message | |
| unused |
Definition at line 300 of file dlg_profile.c.
References current_dlg_msg_id, destroy_linkers(), NULL, and unref_dlg().
Referenced by dlg_new_dialog(), and mod_init().
| struct dlg_profile_table* search_dlg_profile | ( | str * | name | ) | [read] |
Search a dialog profile in the global list.
| name | searched dialog profile |
Definition at line 136 of file dlg_profile.c.
References _str::len, dlg_profile_table::name, dlg_profile_table::next, NULL, and _str::s.
Referenced by fixup_profile(), mi_get_profile(), mi_profile_list(), and new_dlg_profile().
Set the global variables to the current dialog.
Definition at line 419 of file dlg_profile.c.
References current_dlg_msg_id, destroy_linkers(), sip_msg::id, link_dlg_profile(), dlg_profile_link::next, and NULL.
Referenced by 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 |
| msg | SIP message | |
| value | value | |
| profile | dialog profile table |
Definition at line 451 of file dlg_profile.c.
References get_current_dialog(), dlg_profile_table::has_value, dlg_profile_link::hash_linker, _str::len, link_dlg_profile(), LM_CRIT, LM_ERR, dlg_profile_link::next, NULL, dlg_profile_link::profile, REQUEST_ROUTE, route_type, _str::s, shm_malloc(), and dlg_profile_hash::value.
Referenced by w_set_dlg_profile().
| int unset_dlg_profile | ( | struct sip_msg * | msg, | |
| str * | value, | |||
| struct dlg_profile_table * | profile | |||
| ) |
Unset a dialog profile.
| msg | SIP message | |
| value | value | |
| profile | dialog profile table |
Definition at line 504 of file dlg_profile.c.
References d_table, destroy_linkers(), dlg_lock, dlg_unlock, dlg_table::entries, get_current_dialog(), dlg_cell::h_entry, dlg_profile_table::has_value, _str::len, LM_CRIT, dlg_profile_link::next, NULL, dlg_cell::profile_links, REQUEST_ROUTE, route_type, and _str::s.
Referenced by w_unset_dlg_profile().
1.5.6