dlg_profile.h File Reference

Profile related functions for the dialog module

Module: dialog. More...

#include "../../parser/msg_parser.h"
#include "../../locking.h"
#include "../../str.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

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_rootmi_get_profile (struct mi_root *cmd_tree, void *param)
 Output a profile via MI interface.
struct mi_rootmi_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_tablesearch_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.


Detailed Description

Profile related functions for the dialog module

Module: dialog.

Definition in file dlg_profile.h.


Function Documentation

int add_profile_definitions ( char *  profiles,
unsigned int  has_value 
)

Add profile definitions to the global list.

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, 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  ) 

unsigned int get_profile_size ( struct dlg_profile_table profile,
str value 
)

int is_dlg_in_profile ( struct sip_msg msg,
struct dlg_profile_table profile,
str value 
)

Check if a dialog belongs to a profile.

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

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

struct mi_root* mi_get_profile ( struct mi_root cmd_tree,
void *  param 
) [read]

Output a profile via MI interface.

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

struct mi_root* mi_profile_list ( struct mi_root cmd_tree,
void *  param 
) [read]

int profile_cleanup ( struct sip_msg msg,
void *  param 
)

Cleanup a profile.

Parameters:
msg SIP message
unused 
Returns:
1

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.

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, dlg_profile_table::next, NULL, and _str::s.

Referenced by fixup_profile(), mi_get_profile(), mi_profile_list(), and new_dlg_profile().

void set_current_dialog ( struct sip_msg msg,
struct dlg_cell dlg 
)

Set the global variables to the current dialog.

Parameters:
msg SIP message
dlg dialog cell

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.

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

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

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


Generated on Tue May 22 16:00:38 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6