Data Structures | Typedefs | Functions

dlg_profile.h File Reference

Profile related functions for the dialog moduleModule: dialog :: Kamailio dialog module. More...

#include "../../parser/msg_parser.h"
#include "../../lib/srutils/srjson.h"
#include "../../locking.h"
#include "../../str.h"
#include "../../modules/tm/h_table.h"
Include dependency graph for dlg_profile.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

Typedefs

Functions


Detailed Description

Definition in file dlg_profile.h.


Function Documentation

int add_profile_definitions ( char *  profiles,
unsigned int  has_value 
)
See also:
new_dlg_profile
Parameters:
profiles profile name
has_value set to 0 for a profile without value, otherwise it has a value
Returns:
0 on success, -1 on failure

Definition at line 77 of file dlg_profile.c.

References _str::len, new_dlg_profile(), PROFILE_HASH_SIZE, and _str::s.

Here is the call graph for this function:

void destroy_linkers ( struct dlg_profile_link linker  ) 
Parameters:
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().

Here is the caller graph for this function:

int dlg_add_profile ( dlg_cell_t dlg,
str value,
struct dlg_profile_table profile 
)
Parameters:
dlg dialog
value value
profile dialog profile table
Returns:
0 on success, -1 on failure

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().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int get_profile_size ( struct dlg_profile_table profile,
str value 
)
Parameters:
profile evaluated profile
value value
Returns:
the profile size

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().

Here is the call graph for this function:

Here is the caller graph for this function:

int is_dlg_in_profile ( struct sip_msg msg,
struct dlg_profile_table profile,
str value 
)
Parameters:
msg SIP message
profile dialog profile table
value value
Returns:
1 on success, -1 on failure

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.

Here is the call graph for this function:

struct mi_root* mi_get_profile ( struct mi_root *  cmd_tree,
void *  param 
) [read]
Parameters:
cmd_tree MI command tree
param MI parameter
Returns:
MI root output on success, NULL on failure
Parameters:
cmd_tree MI command tree
param unused
Returns:
MI root output on success, NULL on failure

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.

Here is the call graph for this function:

struct mi_root* mi_profile_list ( struct mi_root *  cmd_tree,
void *  param 
) [read]
Parameters:
cmd_tree MI command tree
param unused
Returns:
MI root output on success, NULL on failure

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.

Here is the call graph for this function:

int profile_cleanup ( struct sip_msg msg,
unsigned int  flags,
void *  param 
)
Parameters:
msg SIP message
flags unused
param unused
Returns:
1

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().

Here is the call graph for this function:

struct dlg_profile_table* search_dlg_profile ( str name  )  [read]
Note:
Linear search, this won't have the best performance for huge profile lists
Parameters:
name searched dialog profile
Returns:
pointer to the profile on success, NULL otherwise

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().

Here is the caller graph for this function:

void set_current_dialog ( sip_msg_t msg,
dlg_cell_t dlg 
)
Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

int set_dlg_profile ( struct sip_msg msg,
str value,
struct dlg_profile_table profile 
)
Parameters:
msg SIP message
value value
profile dialog profile table
Returns:
0 on success, -1 on failure

Set the dialog profile.

Parameters:
msg SIP message
value value
profile dialog profile table
Returns:
0 on success, -1 on failure

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.

Here is the call graph for this function:

int unset_dlg_profile ( sip_msg_t msg,
str value,
dlg_profile_table_t profile 
)
Parameters:
msg SIP message
value value
profile dialog profile table
Returns:
1 on success, -1 on failure

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.

Here is the call graph for this function: