Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _DIALOG_DLG_PROFILE_H_
00029 #define _DIALOG_DLG_PROFILE_H_
00030
00031 #include "../../parser/msg_parser.h"
00032 #include "../../lib/srutils/srjson.h"
00033 #include "../../locking.h"
00034 #include "../../str.h"
00035 #include "../../modules/tm/h_table.h"
00036
00037
00038
00048 typedef struct dlg_profile_hash {
00049 str value;
00050 struct dlg_cell *dlg;
00051 struct dlg_profile_hash *next;
00052 struct dlg_profile_hash *prev;
00053 unsigned int hash;
00054 } dlg_profile_hash_t;
00055
00056
00058 typedef struct dlg_profile_link {
00059 struct dlg_profile_hash hash_linker;
00060 struct dlg_profile_link *next;
00061 struct dlg_profile_table *profile;
00062 } dlg_profile_link_t;
00063
00064
00066 typedef struct dlg_profile_entry {
00067 struct dlg_profile_hash *first;
00068 unsigned int content;
00069 } dlg_profile_entry_t;
00070
00071
00073 typedef struct dlg_profile_table {
00074 str name;
00075 unsigned int size;
00076 unsigned int has_value;
00077 gen_lock_t lock;
00078 struct dlg_profile_entry *entries;
00079 struct dlg_profile_table *next;
00080 } dlg_profile_table_t;
00081
00082
00090 int add_profile_definitions( char* profiles, unsigned int has_value);
00091
00092
00096 void destroy_dlg_profiles(void);
00097
00098
00105 struct dlg_profile_table* search_dlg_profile(str *name);
00106
00107
00115 int profile_cleanup(sip_msg_t *msg, unsigned int flags, void *param );
00116
00117
00122 void destroy_linkers(dlg_profile_link_t *linker);
00123
00124
00130 void set_current_dialog(sip_msg_t *msg, struct dlg_cell *dlg);
00131
00132
00140 int set_dlg_profile(sip_msg_t *msg, str *value,
00141 dlg_profile_table_t *profile);
00142
00143
00151 int unset_dlg_profile(sip_msg_t *msg, str *value,
00152 dlg_profile_table_t *profile);
00153
00154
00162 int is_dlg_in_profile(sip_msg_t *msg, dlg_profile_table_t *profile,
00163 str *value);
00164
00165
00172 unsigned int get_profile_size(dlg_profile_table_t *profile, str *value);
00173
00174
00181 struct mi_root * mi_get_profile(struct mi_root *cmd_tree, void *param );
00182
00183
00190 struct mi_root * mi_profile_list(struct mi_root *cmd_tree, void *param );
00191
00195 int is_known_dlg(sip_msg_t *msg);
00196
00204 int dlg_add_profile(dlg_cell_t *dlg, str *value, struct dlg_profile_table *profile);
00205
00209 int dlg_profiles_to_json(dlg_cell_t *dlg, srjson_doc_t *jdoc);
00210
00214 int dlg_json_to_profiles(dlg_cell_t *dlg, srjson_doc_t *jdoc);
00215
00216 #endif