diff --git a/modules/dialog/README b/modules/dialog/README index 63202f349b4..48126d25f3a 100644 --- a/modules/dialog/README +++ b/modules/dialog/README @@ -788,25 +788,30 @@ modparam("dialog", "flags_column", "flags_c_name") 1.6.36. profiles_with_value (string) - List of names for profiles with values. + List of names for profiles with values. Flag /b allows + replicating dialogs over the bin interface. Before, all of them + were replicated. Default value is “empty”. Example 1.36. Set profiles_with_value parameter ... -modparam("dialog", "profiles_with_value", "caller ; my_profile; share/s" -) +modparam("dialog", "profiles_with_value", "caller ; my_profile; share/s; + repl/b;") ... 1.6.37. profiles_no_value (string) - List of names for profiles without values. + List of names for profiles without values. Flag /b allows + replicating dialogs over the bin interface. Before, all of them + were replicated. Default value is “empty”. Example 1.37. Set profiles_no_value parameter ... -modparam("dialog", "profiles_no_value", "inbound ; outbound ; shared/s") +modparam("dialog", "profiles_no_value", "inbound ; outbound ; shared/s; +repl/b;") ... 1.6.38. db_flush_vals_profiles (int) diff --git a/modules/dialog/dlg_db_handler.c b/modules/dialog/dlg_db_handler.c index 37bc8faed7b..abc3f0d2480 100644 --- a/modules/dialog/dlg_db_handler.c +++ b/modules/dialog/dlg_db_handler.c @@ -388,7 +388,7 @@ void read_dialog_profiles(char *b, int l, struct dlg_cell *dlg,int double_check, char *end; char *p,*s,*e; char bk; - int use_cached; + unsigned repl_type; end = b + l; p = b; @@ -402,7 +402,7 @@ void read_dialog_profiles(char *b, int l, struct dlg_cell *dlg,int double_check, if (double_check) { LM_DBG("Double checking profile - if it exists we'll skip it \n"); - use_cached = 0; + repl_type = REPL_NONE; /* check if this is a shared profile, and remove /s for manual * matching */ @@ -416,11 +416,13 @@ void read_dialog_profiles(char *b, int l, struct dlg_cell *dlg,int double_check, /* skip spaces after p */ for (++s; *s == ' ' && s < e; s++); if ( s < e && *s == 's') - use_cached=1; + repl_type = REPL_CACHEDB; + else if (s < e && *s == 'b') + repl_type = REPL_PROTOBIN; } for (it=dlg->profile_links;it;it=it->next) { - if (it->profile->use_cached == use_cached && + if (it->profile->repl_type == repl_type && it->profile->name.len == double_check_name.len && memcmp(it->profile->name.s,double_check_name.s, double_check_name.len) == 0) { @@ -1161,7 +1163,7 @@ str* write_dialog_vars( struct dlg_val *vars) * deallocated if the dialog ends */ str* write_dialog_profiles( struct dlg_profile_link *links) { - static str o = {NULL,0},cached_marker={"/s",2}; + static str o = {NULL,0},cached_marker={"/s",2}, bin_marker={"/b", 2}; static int o_l = 0; struct dlg_profile_link *link; unsigned int l,i; @@ -1176,8 +1178,8 @@ str* write_dialog_profiles( struct dlg_profile_link *links) for( i=0 ; ivalue.len ; i++ ) if (link->value.s[i]=='|' || link->value.s[i]=='#' || link->value.s[i]=='\\') l++; - if (link->profile->use_cached) - l+=cached_marker.len; + if (link->profile->repl_type!=REPL_NONE/*==(CACHEDB||PROTOBIN)*/) + l+=cached_marker.len; /* same length for both */ } /* allocate the string to be stored */ @@ -1195,9 +1197,12 @@ str* write_dialog_profiles( struct dlg_profile_link *links) o.len = l; p = o.s; for ( link=links; link ; link=link->next) { - if (link->profile->use_cached) + if (link->profile->repl_type == REPL_CACHEDB) p += write_pair( p, &link->profile->name, &cached_marker, &link->value); + else if (link->profile->repl_type == REPL_PROTOBIN) + p += write_pair( p, &link->profile->name, &bin_marker, + &link->value); else p += write_pair( p, &link->profile->name, NULL, &link->value); } diff --git a/modules/dialog/dlg_profile.c b/modules/dialog/dlg_profile.c index 6a772c54d25..1a419f876e9 100644 --- a/modules/dialog/dlg_profile.c +++ b/modules/dialog/dlg_profile.c @@ -47,7 +47,7 @@ static int finished_allocating_locks = 0; extern int log_profile_hash_size; static struct dlg_profile_table* new_dlg_profile( str *name, - unsigned int size, unsigned int has_value, unsigned use_cached); + unsigned int size, unsigned int has_value, unsigned repl_type); /* used by cachedb interface */ static cachedb_funcs cdbf; @@ -145,14 +145,16 @@ int add_profile_definitions( char* profiles, unsigned int has_value) char *d; char *e; str name; - unsigned int i, use_cached = 0; - + unsigned int i; + enum repl_types type; if (profiles==NULL || strlen(profiles)==0 ) return 0; p = profiles; do { - use_cached = 0; + /* By default no replication (no CACHEDB nor BIN)*/ + type = REPL_NONE; + /* locate name of profile */ name.s = p; d = strchr( p, ';'); @@ -181,13 +183,29 @@ int add_profile_definitions( char* profiles, unsigned int has_value) for (++p; *p == ' ' && p < e; p++); if ( p < e && *p == 's') { if (cdb_url.len && cdb_url.s) { - use_cached = 1; + if (type==REPL_PROTOBIN) + goto repl_error; + + type= REPL_CACHEDB; } else { LM_WARN("profile %.*s configured to be stored in CacheDB, " "but the cachedb_url was not defined\n", name.len, name.s); - use_cached = 0; } + } else if ( p < e && *p == 'b') { + if (profile_replicate_cluster) { + if (type==REPL_CACHEDB) + goto repl_error; + + type = REPL_PROTOBIN; + } else { + LM_WARN("profile %.*s configured to be replicated over BIN, " + "but replicate_profiles_to param is not defined\n", + name.len, name.s); + } + } else if (isalnum(*p)) { + LM_ERR("Invalid letter in profile definitition !\n", *p); + return -1; } } @@ -202,10 +220,11 @@ int add_profile_definitions( char* profiles, unsigned int has_value) /* name ok -> create the profile */ LM_DBG("creating profile <%.*s> %s\n", name.len, name.s, - use_cached ? "cached" : ""); + type ==REPL_CACHEDB ? "cached" : + (type==REPL_PROTOBIN ? "bin replicated": "")); if (new_dlg_profile( &name, 1 << log_profile_hash_size, - has_value, use_cached)==NULL) { + has_value, type)==NULL) { LM_ERR("failed to create new profile <%.*s>\n",name.len,name.s); return -1; } @@ -213,6 +232,10 @@ int add_profile_definitions( char* profiles, unsigned int has_value) }while( (p=d)!=NULL ); return 0; + +repl_error: + LM_ERR("Can't use both bin replication and cachedb!\n"); + return -1; } #define DLG_COPY(_d, _s) \ @@ -393,7 +416,7 @@ struct dlg_profile_table* search_dlg_profile(str *name) { struct dlg_profile_table *profile; char *p,*e; - int use_cached=0; + unsigned repl_type=REPL_NONE; str profile_name = *name; /* check if this is a shared profile, and remove /s for lookup */ @@ -406,11 +429,14 @@ struct dlg_profile_table* search_dlg_profile(str *name) /* skip spaces after p */ for (++p; *p == ' ' && p < e; p++); if ( p < e && *p == 's') - use_cached=1; + repl_type=REPL_CACHEDB; + else if (p < e && *p == 'b') + repl_type=REPL_PROTOBIN; } for( profile=profiles ; profile ; profile=profile->next ) { - if (profile->use_cached == use_cached && profile_name.len ==profile->name.len && + if (profile->repl_type == repl_type && + profile_name.len ==profile->name.len && memcmp(profile_name.s,profile->name.s,profile_name.len)==0 ) return profile; } @@ -419,7 +445,7 @@ struct dlg_profile_table* search_dlg_profile(str *name) } static struct dlg_profile_table* new_dlg_profile( str *name, unsigned int size, - unsigned int has_value, unsigned use_cached) + unsigned int has_value, unsigned repl_type) { struct dlg_profile_table *profile; struct dlg_profile_table *ptmp; @@ -446,9 +472,10 @@ static struct dlg_profile_table* new_dlg_profile( str *name, unsigned int size, return NULL; } - len = sizeof(struct dlg_profile_table) + name->len + 1 + - (!use_cached ? (size * ( (has_value == 0 ) ? - sizeof( int ) : sizeof( map_t ) )) : 0); + len = sizeof(struct dlg_profile_table) + name->len + 1; + /* anything else than only CACHEDB */ + if (repl_type != REPL_CACHEDB) + len += size * ((has_value==0) ? sizeof(int):sizeof(map_t)); profile = (struct dlg_profile_table *)shm_malloc(len); @@ -463,12 +490,10 @@ static struct dlg_profile_table* new_dlg_profile( str *name, unsigned int size, profile->size = size; profile->has_value = (has_value==0)?0:1; - profile->use_cached = use_cached; - - profile->repl = NULL; + profile->repl_type = repl_type; /* init locks */ - if (!use_cached) { + if (repl_type != REPL_CACHEDB) { profile->locks = get_a_lock_set(size) ; if( !profile->locks ) @@ -479,7 +504,7 @@ static struct dlg_profile_table* new_dlg_profile( str *name, unsigned int size, } } - if( use_cached ) { + if( repl_type == REPL_CACHEDB ) { profile->name.s = (char *)(profile + 1); @@ -531,7 +556,7 @@ static void destroy_dlg_profile(struct dlg_profile_table *profile) if (profile==NULL) return; - if( profile -> has_value && !profile -> use_cached ) + if( profile->has_value && !(profile->repl_type==REPL_CACHEDB) ) { for( i= 0; i < profile->size; i++) map_destroy( profile->entries[i], free_profile_val); @@ -571,7 +596,7 @@ void destroy_linkers(struct dlg_profile_link *linker, char is_replicated) /* unlink from profile table */ - if (!l->profile->use_cached) { + if (!(l->profile->repl_type==REPL_CACHEDB)) { lock_set_get( l->profile->locks, l->hash_idx); if( l->profile->has_value) @@ -675,7 +700,7 @@ static void link_dlg_profile(struct dlg_profile_link *linker, /* insert into profile hash table */ /* but only if cachedb is not used */ - if (!linker->profile->use_cached) { + if (!(linker->profile->repl_type==REPL_CACHEDB)) { /* calculate the hash position */ hash = calc_hash_profile(&linker->value, dlg, linker->profile); linker->hash_idx = hash; @@ -870,7 +895,7 @@ unsigned int get_profile_size(struct dlg_profile_table *profile, str *value) { /* iterate through the hash and count all records */ - if (cdbc && profile->use_cached) { + if (cdbc && (profile->repl_type == REPL_CACHEDB)) { if (dlg_fill_name(&profile->name) < 0) goto failed; @@ -902,7 +927,7 @@ unsigned int get_profile_size(struct dlg_profile_table *profile, str *value) if( value==NULL ) { - if (cdbc && profile->use_cached) { + if (cdbc && (profile->repl_type == REPL_CACHEDB)) { if (dlg_fill_size(&profile->name) < 0) goto failed; @@ -932,7 +957,7 @@ unsigned int get_profile_size(struct dlg_profile_table *profile, str *value) } else { - if (cdbc && profile->use_cached) { + if (cdbc && (profile->repl_type == REPL_CACHEDB)) { if (dlg_fill_value(&profile->name, value) < 0) goto failed; @@ -1039,7 +1064,7 @@ struct mi_root * mi_get_profile(struct mi_root *cmd_tree, void *param ) goto error; } - if (profile->use_cached) { + if (profile->repl_type == REPL_CACHEDB) { attr = add_mi_attr(node, MI_DUP_VALUE, "shared", 6, "yes", 3); } else { attr = add_mi_attr(node, MI_DUP_VALUE, "shared", 6, "no", 2); @@ -1048,6 +1073,17 @@ struct mi_root * mi_get_profile(struct mi_root *cmd_tree, void *param ) goto error; } + if (profile->repl_type == REPL_PROTOBIN) { + attr = add_mi_attr(node, MI_DUP_VALUE, "replicated", 10, "yes", 3); + } else { + attr = add_mi_attr(node, MI_DUP_VALUE, "replicated", 10, "no", 2); + } + if (attr == NULL) { + goto error; + } + + + return rpl_tree; error: free_mi_tree(rpl_tree); @@ -1104,7 +1140,7 @@ struct mi_root * mi_get_profile_values(struct mi_root *cmd_tree, void *param ) profile = search_dlg_profile( profile_name ); if (profile==NULL) return init_mi_tree( 404, MI_SSTR("Profile not found")); - if (profile->use_cached) + if (profile->repl_type == REPL_CACHEDB) return init_mi_tree( 405, MI_SSTR("Unsupported command for shared profiles")); /* gather dialog count for all values in this profile */ diff --git a/modules/dialog/dlg_profile.h b/modules/dialog/dlg_profile.h index 59e7c434767..9f21f426455 100644 --- a/modules/dialog/dlg_profile.h +++ b/modules/dialog/dlg_profile.h @@ -54,10 +54,11 @@ struct dlg_profile_link { struct repl_prof_novalue; +enum repl_types {REPL_NONE=0, REPL_CACHEDB=1, REPL_PROTOBIN}; struct dlg_profile_table { str name; unsigned int has_value; - unsigned int use_cached; + enum repl_types repl_type; unsigned int size; @@ -146,6 +147,7 @@ extern str cdb_noval_prefix; extern str cdb_size_prefix; extern str cdb_url; extern int profile_timeout; +extern int profile_replicate_cluster; extern struct dlg_profile_table *profiles; diff --git a/modules/dialog/dlg_replication.c b/modules/dialog/dlg_replication.c index c22c3b534e0..8569be60623 100644 --- a/modules/dialog/dlg_replication.c +++ b/modules/dialog/dlg_replication.c @@ -232,7 +232,7 @@ int dlg_replicated_create(struct dlg_cell *cell, str *ftag, str *ttag, int safe) /* Do not replicate the pinging - we might terminate dialogs badly when running - as backup + as backup if (dlg->flags & DLG_FLAG_PING_CALLER || dlg->flags & DLG_FLAG_PING_CALLEE) { if (insert_ping_timer(dlg) != 0) LM_CRIT("Unable to insert dlg %p into ping timer\n",dlg); @@ -453,8 +453,8 @@ void replicate_dialog_created(struct dlg_cell *dlg) if (bin_init(&module_name, REPLICATION_DLG_CREATED, BIN_VERSION) != 0) goto error; - - bin_push_int(clusterer_api.get_my_id()); + + bin_push_int(clusterer_api.get_my_id()); callee_leg = callee_idx(dlg); @@ -517,7 +517,7 @@ void replicate_dialog_updated(struct dlg_cell *dlg) { static str module_name = str_init("dialog"); int callee_leg; - str *vars, *profiles; + str *vars, *profiles; if (bin_init(&module_name, REPLICATION_DLG_UPDATED, BIN_VERSION) != 0) goto error; @@ -565,7 +565,7 @@ void replicate_dialog_updated(struct dlg_cell *dlg) bin_push_int((unsigned int)time(0) + dlg->tl.timeout - get_ticks()); bin_push_int(dlg->legs[DLG_CALLER_LEG].last_gen_cseq); bin_push_int(dlg->legs[callee_leg].last_gen_cseq); - + if (clusterer_api.send_to(dialog_replicate_cluster, PROTO_BIN) < 0) { LM_ERR("replicate dialog updated failed\n"); return; @@ -585,7 +585,7 @@ void replicate_dialog_updated(struct dlg_cell *dlg) void replicate_dialog_deleted(struct dlg_cell *dlg) { static str module_name = str_init("dialog"); - + if (bin_init(&module_name, REPLICATION_DLG_DELETED, BIN_VERSION) != 0) goto error; @@ -593,11 +593,11 @@ void replicate_dialog_deleted(struct dlg_cell *dlg) bin_push_str(&dlg->callid); bin_push_str(&dlg->legs[DLG_CALLER_LEG].tag); bin_push_str(&dlg->legs[callee_idx(dlg)].tag); - + if (clusterer_api.send_to(dialog_replicate_cluster, PROTO_BIN) < 0) { goto error; } - + return; error: LM_ERR("Failed to replicate deleted dialog\n"); @@ -637,11 +637,11 @@ void receive_dlg_binary_packet(int packet_type, struct receive_info *ri, void *a char *ip; unsigned short port; int server_id; - + rc = bin_pop_int(&server_id); if (rc < 0) return; - + LM_DBG("Received a binary packet!\n"); if(get_bin_pkg_version() != BIN_VERSION){ @@ -655,7 +655,7 @@ void receive_dlg_binary_packet(int packet_type, struct receive_info *ri, void *a ip, port, packet_type); return; } - + if(!clusterer_api.check(accept_replicated_dlg, &ri->src_su, server_id, ri->proto)) return; @@ -778,13 +778,13 @@ static inline void dlg_replicate_profiles(void) return; error: - LM_ERR("Failed to replicate profile dialog\n"); + LM_ERR("Failed to replicate profile dialog\n"); } static repl_prof_count_t* find_destination(repl_prof_novalue_t *noval, int machine_id) { repl_prof_count_t *head; - + head = noval->dsts; while(head != NULL){ if( head->machine_id == machine_id ) @@ -957,7 +957,7 @@ int repl_prof_remove(str *name, str *value) LM_ERR("cannot initiate bin buffer\n"); return -1; } - + bin_push_int(clusterer_api.get_my_id()); if (repl_prof_add(name, value?1:0, value, 0) < 0) @@ -996,7 +996,7 @@ static void repl_prof_timer_f(unsigned int ticks, void *param) int i; for (profile = profiles; profile; profile = profile->next) { - if (!profile->has_value) + if (!profile->has_value || profile->repl_type != REPL_PROTOBIN) continue; for (i = 0; i < profile->size; i++) { lock_set_get(profile->locks, i); @@ -1071,6 +1071,9 @@ static void repl_prof_utimer_f(utime_t ticks, void *param) bin_push_int(clusterer_api.get_my_id()); for (profile = profiles; profile; profile = profile->next) { + if (!(profile->repl_type&REPL_PROTOBIN)) + continue; + count = 0; if (!profile->has_value) { for (i = 0; i < profile->size; i++) { diff --git a/modules/dialog/dlg_replication.h b/modules/dialog/dlg_replication.h index 2d39a03d03b..7e716eb34e1 100644 --- a/modules/dialog/dlg_replication.h +++ b/modules/dialog/dlg_replication.h @@ -41,7 +41,6 @@ extern int accept_replicated_dlg; extern int dialog_replicate_cluster; -extern int profile_replicate_cluster; extern struct clusterer_binds clusterer_api; diff --git a/modules/dialog/doc/dialog_admin.xml b/modules/dialog/doc/dialog_admin.xml index 6d6618670c6..977c3d861c4 100644 --- a/modules/dialog/doc/dialog_admin.xml +++ b/modules/dialog/doc/dialog_admin.xml @@ -1,24 +1,24 @@ - + &adminguide; - +
Overview - The dialog module provides dialog awareness to the &osips; proxy. Its + The dialog module provides dialog awareness to the &osips; proxy. Its functionality is to keep trace of the current dialogs, to offer information about them (like how many dialogs are active). Aside tracking, the dialog module offers functionalities like flags and - attributes per dialog (persistent data across dialog), dialog profiling + attributes per dialog (persistent data across dialog), dialog profiling and dialog termination (on timeout base or external triggered). - The module, via an internal API, also provide the foundation to build on - top of it more complex dialog-based functionalities via other &osips; + The module, via an internal API, also provide the foundation to build on + top of it more complex dialog-based functionalities via other &osips; modules.
@@ -30,10 +30,10 @@ the create_dialog() function, with or without parameter.. - The dialog is automatically destroyed when a BYE is - received. In case of no BYE, the dialog lifetime is + The dialog is automatically destroyed when a BYE is + received. In case of no BYE, the dialog lifetime is controlled via the default timeout (see default_timeout - - ) and custom timeout (see + - ) and custom timeout (see $DLG_timeout - ). @@ -44,8 +44,8 @@ Dialog profiling is a mechanism that helps in classifying, sorting and keeping trace of certain types of dialogs, using whatever properties of the dialog (like caller, destination, type of calls, etc). - Dialogs can be dynamically added in different (and several) profile - tables - logically, each profile table can have a special meaning (like + Dialogs can be dynamically added in different (and several) profile + tables - logically, each profile table can have a special meaning (like dialogs outside the domain, dialogs terminated to PSTN, etc). @@ -53,16 +53,16 @@ - with no value - a dialog simply belongs - to a profile. (like outbound calls profile). There is no other + with no value - a dialog simply belongs + to a profile. (like outbound calls profile). There is no other additional information to describe the dialog's belonging to the profile; - with value - a dialog belongs to a profile - having a certain value (like in caller profile, where the value + with value - a dialog belongs to a profile + having a certain value (like in caller profile, where the value is the caller ID). The belonging of the dialog to the profile is strictly related to the value. @@ -73,8 +73,8 @@ A dialog can be added to multiple profiles in the same time. - Profiles are visible (at the moment) in the request route (for initial - and sequential requests) and in the branch, failure and reply routes of + Profiles are visible (at the moment) in the request route (for initial + and sequential requests) and in the branch, failure and reply routes of the original request. @@ -145,7 +145,7 @@
External Libraries or Applications - The following libraries or applications must be installed before + The following libraries or applications must be installed before running &osips; with this module loaded: @@ -164,7 +164,7 @@
<varname>enable_stats</varname> (integer) - If the statistics support should be enabled or not. Via statistic + If the statistics support should be enabled or not. Via statistic variables, the module provide information about the dialog processing. Set it to zero to disable or to non-zero to enable it. @@ -186,14 +186,14 @@ modparam("dialog", "enable_stats", 0)
<varname>hash_size</varname> (integer) - The size of the hash table internally used to keep the dialogs. A + The size of the hash table internally used to keep the dialogs. A larger table is much faster but consumes more memory. The hash size must be a power of 2 number. - IMPORTANT: If dialogs' information should be stored in a database, - a constant hash_size should be used, otherwise the restored process - will not take place. If you really want to modify the hash_size you + IMPORTANT: If dialogs' information should be stored in a database, + a constant hash_size should be used, otherwise the restored process + will not take place. If you really want to modify the hash_size you must delete all table's rows before restarting &osips;. @@ -220,7 +220,7 @@ modparam("dialog", "hash_size", 1024) is provided as the base 2 logarithm(e.g. log_profile_hash_size =4 means the table has 2^4 entries). - + Default value is 4. @@ -303,7 +303,7 @@ modparam("dialog", "dlg_extra_hdrs", "Hint: credit expired\r\n") How the seqential requests should be matched against the known dialogs. The modes are a combination between matching based on a cookie (DID) - stored as cookie in Record-Route header and the matching based on SIP + stored as cookie in Record-Route header and the matching based on SIP elements (as in RFC3261). @@ -311,17 +311,17 @@ modparam("dialog", "dlg_extra_hdrs", "Hint: credit expired\r\n") - 0 - DID_ONLY - the match is done + 0 - DID_ONLY - the match is done exclusively based on DID; - 1 - DID_FALLBACK - the match is first + 1 - DID_FALLBACK - the match is first tried based on DID and if not present, it will fallback to SIP matching; - 2 - DID_NONE - the match is done - exclusively based on SIP elements; no DID information is added + 2 - DID_NONE - the match is done + exclusively based on SIP elements; no DID information is added in RR. @@ -343,7 +343,7 @@ modparam("dialog", "dlg_match_mode", 1)
<varname>db_url</varname> (string) - If you want to store the information about the dialogs in a database + If you want to store the information about the dialogs in a database a database url must be specified. @@ -375,16 +375,16 @@ modparam("dialog", "db_url", "&exampledb;") flushed into DB; - 1 - REALTIME - any dialog information + 1 - REALTIME - any dialog information changes will be reflected into the database immediately. - 2 - DELAYED - the dialog information + 2 - DELAYED - the dialog information changes will be flushed into the DB periodically, based on a timer routine. - 3 - SHUTDOWN - the dialog information + 3 - SHUTDOWN - the dialog information will be flushed into DB only at shutdown - no runtime updates. @@ -427,7 +427,7 @@ modparam("dialog", "db_update_period", 120)
<varname>options_ping_interval</varname> (integer) - The interval (seconds) at which OpenSIPS will generate in-dialog OPTIONS pings for dialogs. + The interval (seconds) at which OpenSIPS will generate in-dialog OPTIONS pings for dialogs. @@ -447,7 +447,7 @@ modparam("dialog", "options_ping_interval", 20)
<varname>reinvite_ping_interval</varname> (integer) - The interval (seconds) at which OpenSIPS will generate in-dialog Re-INVITE pings for dialogs. + The interval (seconds) at which OpenSIPS will generate in-dialog Re-INVITE pings for dialogs. @@ -467,7 +467,7 @@ modparam("dialog", "reinvite_ping_interval", 600)
<varname>table_name</varname> (string) - If you want to store the information about the dialogs in a + If you want to store the information about the dialogs in a database a table name must be specified. @@ -508,7 +508,7 @@ modparam("dialog", "call_id_column", "callid_c_name")
<varname>from_uri_column</varname> (string) - The column's name in the database to store the caller's + The column's name in the database to store the caller's sip address. @@ -529,7 +529,7 @@ modparam("dialog", "from_uri_column", "from_uri_c_name")
<varname>from_tag_column</varname> (string) - The column's name in the database to store the From tag from + The column's name in the database to store the From tag from the Invite request. @@ -571,7 +571,7 @@ modparam("dialog", "to_uri_column", "to_uri_c_name")
<varname>to_tag_column</varname> (string) - The column's name in the database to store the To tag from + The column's name in the database to store the To tag from the 200 OK response to the Invite request, if present. @@ -676,7 +676,7 @@ modparam("dialog", "to_route_column", "to_route_c_name")
<varname>from_contact_column</varname> (string) - The column's name in the database to store the caller's contact + The column's name in the database to store the caller's contact uri. @@ -697,7 +697,7 @@ modparam("dialog", "from_contact_column", "from_contact_c_name")
<varname>to_contact_column</varname> (string) - The column's name in the database to store the callee's contact + The column's name in the database to store the callee's contact uri. @@ -718,7 +718,7 @@ modparam("dialog", "to_contact_column", "to_contact_c_name")
<varname>from_sock_column</varname> (string) - The column's name in the database to store the information about + The column's name in the database to store the information about the local interface receiving the traffic from caller. @@ -739,7 +739,7 @@ modparam("dialog", "from_sock_column", "from_sock_c_name")
<varname>to_sock_column</varname> (string) - The column's name in the database to store information about the + The column's name in the database to store information about the local interface receiving the traffic from callee. @@ -760,7 +760,7 @@ modparam("dialog", "to_sock_column", "to_sock_c_name")
<varname>dlg_id_column</varname> (string) - The column's name in the database to store the dialogs' + The column's name in the database to store the dialogs' id information. @@ -781,7 +781,7 @@ modparam("dialog", "dlg_id_column", "dlg_id_c_name")
<varname>state_column</varname> (string) - The column's name in the database to store the + The column's name in the database to store the dialogs' state information. @@ -802,7 +802,7 @@ modparam("dialog", "state_column", "state_c_name")
<varname>start_time_column</varname> (string) - The column's name in the database to store the + The column's name in the database to store the dialogs' start time information. @@ -943,7 +943,10 @@ modparam("dialog", "flags_column", "flags_c_name")
<varname>profiles_with_value</varname> (string) - List of names for profiles with values. + List of names for profiles with values. Flag + /b allows replicating dialogs over the bin + interface. Before, all of them were replicated. + @@ -954,7 +957,7 @@ modparam("dialog", "flags_column", "flags_c_name") Set <varname>profiles_with_value</varname> parameter ... -modparam("dialog", "profiles_with_value", "caller ; my_profile; share/s") +modparam("dialog", "profiles_with_value", "caller ; my_profile; share/s; repl/b;") ... @@ -963,7 +966,9 @@ modparam("dialog", "profiles_with_value", "caller ; my_profile; share/s")
<varname>profiles_no_value</varname> (string) - List of names for profiles without values. + List of names for profiles without values. Flag + /b allows replicating dialogs over the bin + interface. Before, all of them were replicated. @@ -974,7 +979,7 @@ modparam("dialog", "profiles_with_value", "caller ; my_profile; share/s") Set <varname>profiles_no_value</varname> parameter ... -modparam("dialog", "profiles_no_value", "inbound ; outbound ; shared/s") +modparam("dialog", "profiles_no_value", "inbound ; outbound ; shared/s; repl/b;") ... @@ -1005,7 +1010,7 @@ modparam("dialog", "db_flush_vals_profiles", 1) <varname>timer_bulk_del_no</varname> (int) The number of dialogs that should be attempted to be - deleted at the same time ( a single query ) from the + deleted at the same time ( a single query ) from the DB back-end. @@ -1047,7 +1052,7 @@ modparam("dialog", "cachedb_url", "redis://127.0.0.1:6379")
<varname>profile_value_prefix</varname> (string) - Specifies what prefix should be added to the profiles with + Specifies what prefix should be added to the profiles with value when they are inserted into CacheDB backed. This is only used when distributed profiles are enabled. @@ -1202,7 +1207,7 @@ modparam("dialog", "accept_replicated_profiles", 1) <varname>replicate_profiles_to</varname> (int) Adds profiles replication destinations, that belong to the - specified cluster id. The destination will receive all dialog-related events + specified cluster id. The destination will receive all dialog-related events (creation, updating and deletion) over TCP, using the Binary Internal Interface. @@ -1219,7 +1224,7 @@ modparam("dialog", "replicate_profiles_to", 1)
- +
<varname>accept_replicated_profile_timeout</varname> (int) @@ -1239,7 +1244,7 @@ modparam("dialog", "accept_replicated_profile_timeout", 30)
- +
<varname>auth_check</varname> (int) @@ -1259,7 +1264,7 @@ modparam("dialog", "auth_check", 1)
- +
<varname>replicate_profiles_buffer</varname> (string) @@ -1379,7 +1384,7 @@ modparam("dialog", "replicate_profiles_expire", 10) - The function returns true if the dialog was successfully created or + The function returns true if the dialog was successfully created or if the dialog was previously created. @@ -1410,7 +1415,7 @@ create_dialog("B"); This function is to be used to match a sequential (in-dialog) request - to an existing dialog. In other words, the function will try to match + to an existing dialog. In other words, the function will try to match the current request to an known ongoing dialog. @@ -1418,10 +1423,10 @@ create_dialog("B"); from Route header and also falls back to SIP-wise matching. - As sequential requests are automatically matched to the dialog when + As sequential requests are automatically matched to the dialog when doing "loose_route()" from script, this function is intended to: (A) control the place in your script where the dialog matching is done - and (B) to cope with bogus sequential requests that do not have Route + and (B) to cope with bogus sequential requests that do not have Route headers, so they are not handled by loose_route(). @@ -1451,7 +1456,7 @@ create_dialog("B"); validate_dialog() - The function checks the current received requests against the dialog + The function checks the current received requests against the dialog (internal data) it belongs to. Performing several tests, the function will help to detect the bogus injected in-dialog requests (like malicious BYEs). @@ -1461,7 +1466,7 @@ create_dialog("B"); information checking (contact and route set). - The function returns true if a dialog exists for the request and if + The function returns true if a dialog exists for the request and if the request is valid (according to dialog data). If the request is invalid, the following return codes are returned : @@ -1509,9 +1514,9 @@ create_dialog("B"); fix_route_dialog() - The function forces an in dialog SIP message to contain the ruri, route headers and + The function forces an in dialog SIP message to contain the ruri, route headers and dst_uri, as specified by the internal data of the dialog it belongs to. - The function will prevent the existence of bogus injected in-dialog + The function will prevent the existence of bogus injected in-dialog requests ( like malicious BYEs ) @@ -1540,9 +1545,9 @@ create_dialog("B"); The function extracts a dialog value from another dialog. It first searches through all existing (ongoing) dialogs for a dialog that has a dialog - variable named "key" with the value "key_val" + variable named "key" with the value "key_val" (so a dialog where $dlg_val(key)=="key_val"). If found, it returns - the value of the dialog variable "attr" from the + the value of the dialog variable "attr" from the found dialog in the "var" pseudo-variable, otherwise nothing is written in "var", and a negative error code is returned. @@ -1569,7 +1574,7 @@ create_dialog("B"); - key_val - the value of the dialog + key_val - the value of the dialog variable that is used as key in searching the target dialog. @@ -1606,18 +1611,18 @@ $dlg_val(callee) = $ru; inserted in the same profile multiple times. - NOTE: the dialog must be created before using this function (use + NOTE: the dialog must be created before using this function (use create_dialog() function before). Meaning of the parameters is as follows: - profile - name of the profile to be + profile - name of the profile to be added to; - value (optional) - string value to + value (optional) - string value to define the belonging of the dialog to the profile - note that the profile must support values. Pseudo-variables are supported. @@ -1648,18 +1653,18 @@ set_dlg_profile("caller","$fu"); Removes the current dialog from a profile. - NOTE: the dialog must be created before using this function (use + NOTE: the dialog must be created before using this function (use create_dialog() function before). Meaning of the parameters is as follows: - profile - name of the profile to be + profile - name of the profile to be removed from; - value (optional) - string value to + value (optional) - string value to define the belonging of the dialog to the profile - note that the profile must support values. Pseudo-variables are supported. @@ -1687,26 +1692,26 @@ unset_dlg_profile("caller","$fu"); is_in_profile(profile,[value]) - Checks if the current dialog belongs to a profile. If the profile - supports values, the check can be reinforced to take into account a - specific value - if the dialog was inserted into the profile for a - specific value. If no value is passed, only simply belonging of the - dialog to the profile is checked. Note that if the profile does not + Checks if the current dialog belongs to a profile. If the profile + supports values, the check can be reinforced to take into account a + specific value - if the dialog was inserted into the profile for a + specific value. If no value is passed, only simply belonging of the + dialog to the profile is checked. Note that if the profile does not support values, this will be silently discarded. - NOTE: the dialog must be created before using this function (use + NOTE: the dialog must be created before using this function (use create_dialog() function before). Meaning of the parameters is as follows: - profile - name of the profile to be + profile - name of the profile to be checked against; - value (optional) - string value to + value (optional) - string value to toughen the check. Pseudo-variables are supported. @@ -1736,22 +1741,22 @@ if (is_in_profile("caller","XX")) { get_profile_size(profile,[value],size) - Returns the number of dialogs belonging to a profile. If the profile - supports values, the check can be reinforced to take into account a - specific value - how many dialogs were inserted into the profile with - a specific value. If not value is passed, only simply belonging of the - dialog to the profile is checked. Note that the profile does not + Returns the number of dialogs belonging to a profile. If the profile + supports values, the check can be reinforced to take into account a + specific value - how many dialogs were inserted into the profile with + a specific value. If not value is passed, only simply belonging of the + dialog to the profile is checked. Note that the profile does not supports values, this will be silently discarded. Meaning of the parameters is as follows: - profile - name of the profile to get + profile - name of the profile to get the size for; - value (optional) - string value to + value (optional) - string value to toughen the check. Pseudo-variables are supported; @@ -1792,7 +1797,7 @@ xlog("currently, the user %fu has $avp(size) active outgoing calls\n"); The flag index can be between 0 and 31. - NOTE: the dialog must be created before using this function (use + NOTE: the dialog must be created before using this function (use create_dialog() function before). @@ -1825,7 +1830,7 @@ set_dlg_flag("3"); The value should be 0 (false) or 1 (true). - NOTE: the dialog must be created before using this function (use + NOTE: the dialog must be created before using this function (use create_dialog() function before). @@ -1848,14 +1853,14 @@ test_and_set_dlg_flag("3", "0"); Resets the dialog flag index idx to false. - The dialog flags are dialog persistent and they can be accessed + The dialog flags are dialog persistent and they can be accessed (set and test) for all requests belonging to the dialog. The flag index can be between 0 and 31. - NOTE: the dialog must be created before using this function (use + NOTE: the dialog must be created before using this function (use create_dialog() function before). @@ -1878,14 +1883,14 @@ reset_dlg_flag("16"); Returns true if the dialog flag index idx is set. - The dialog flags are dialog persistent and they can be accessed + The dialog flags are dialog persistent and they can be accessed (set and test) for all requests belonging to the dialog. The flag index can be between 0 and 31. - NOTE: the dialog must be created before using this function (use + NOTE: the dialog must be created before using this function (use create_dialog() function before). @@ -1909,16 +1914,16 @@ if (is_dlg_flag_set("16")) { store_dlg_value(name,val) - Attaches to the dialog the value val under the - name name. The values attached to dialogs are - dialog persistent and they can be accessed (read and write) for all + Attaches to the dialog the value val under the + name name. The values attached to dialogs are + dialog persistent and they can be accessed (read and write) for all requests belonging to the dialog. Parameter val may contain pseudo-variables. - NOTE: the dialog must be created before using this function (use + NOTE: the dialog must be created before using this function (use create_dialog() function before). @@ -1947,9 +1952,9 @@ $dlg_val(account_type) = "prepaid"; fetch_dlg_value(name,pvar) - Fetches from the dialog the value of attribute named - name. The values attached to dialogs are - dialog persistent and they can be accessed (read and write) for all + Fetches from the dialog the value of attribute named + name. The values attached to dialogs are + dialog persistent and they can be accessed (read and write) for all requests belonging to the dialog. @@ -1957,7 +1962,7 @@ $dlg_val(account_type) = "prepaid"; and avp ($avp). - NOTE: the dialog must be created before using this function (use + NOTE: the dialog must be created before using this function (use create_dialog() function before). @@ -2001,7 +2006,7 @@ $var(account) = $dlg_val(account_type);
<varname>processed_dialogs</varname> - Returns the total number of processed dialogs (terminated, + Returns the total number of processed dialogs (terminated, expired or active) from the startup.
@@ -2106,7 +2111,7 @@ $var(account) = $dlg_val(account_type); should start.
- counter - how many dialogs should be + counter - how many dialogs should be listed (starting from the offset) @@ -2132,7 +2137,7 @@ $var(account) = $dlg_val(account_type);
<varname>dlg_list_ctx</varname> - The same as the dlg_list but including in the + The same as the dlg_list but including in the dialog description the associated context from modules sitting on top of the dialog module. @@ -2177,7 +2182,7 @@ $var(account) = $dlg_val(account_type); entry - extra_hdrs - (optional) string containg + extra_hdrs - (optional) string containg extra headers (full format) to be added to the BYE requests. @@ -2199,11 +2204,11 @@ $var(account) = $dlg_val(account_type);
<varname>profile_get_size</varname> - Returns the number of dialogs belonging to a profile. If the profile - supports values, the check can be reinforced to take into account a - specific value - how many dialogs were inserted into the profile with - a specific value. If not value is passed, only simply belonging of the - dialog to the profile is checked. Note that the profile does not + Returns the number of dialogs belonging to a profile. If the profile + supports values, the check can be reinforced to take into account a + specific value - how many dialogs were inserted into the profile with + a specific value. If not value is passed, only simply belonging of the + dialog to the profile is checked. Note that the profile does not supports values, this will be silently discarded. @@ -2216,7 +2221,7 @@ $var(account) = $dlg_val(account_type); value for. - value (optional)- string value to + value (optional)- string value to toughen the check; @@ -2233,11 +2238,11 @@ $var(account) = $dlg_val(account_type);
<varname>profile_list_dlgs</varname> - Lists all the dialogs belonging to a profile. If the profile - supports values, the check can be reinforced to take into account a - specific value - list only the dialogs that were inserted into the - profile with that specific value. If not value is passed, all dialogs - belonging to the profile will be listed. Note that the profile does + Lists all the dialogs belonging to a profile. If the profile + supports values, the check can be reinforced to take into account a + specific value - list only the dialogs that were inserted into the + profile with that specific value. If not value is passed, all dialogs + belonging to the profile will be listed. Note that the profile does not supports values, this will be silently discarded. Also, when using shared profiles using the CacheDB interface, this command will only display the local dialogs. @@ -2252,7 +2257,7 @@ $var(account) = $dlg_val(account_type); dialog for. - value (optional)- string value to + value (optional)- string value to toughen the check; @@ -2416,7 +2421,7 @@ $var(account) = $dlg_val(account_type);
<varname>$DLG_status</varname> - Returns the status of the dialog corresponding to the processed + Returns the status of the dialog corresponding to the processed sequential request. This PV will be available only for sequential requests, after doing loose_route(). @@ -2437,7 +2442,7 @@ $var(account) = $dlg_val(account_type); yet) - 3 - Confirmed by a final reply but + 3 - Confirmed by a final reply but no ACK received yet. @@ -2453,9 +2458,9 @@ $var(account) = $dlg_val(account_type);
<varname>$DLG_lifetime</varname> - Returns the duration (in seconds) of the dialog corresponding to - the processed sequential request. The duration is calculated from - the dialog confirmation and the current moment. This PV will be + Returns the duration (in seconds) of the dialog corresponding to + the processed sequential request. The duration is calculated from + the dialog confirmation and the current moment. This PV will be available only for sequential requests, after doing loose_route(). @@ -2468,7 +2473,7 @@ $var(account) = $dlg_val(account_type); Returns the dialog flags array (as a single integer value) of the dialog corresponding to the processed sequential request. - This PV will be available only for sequential requests, + This PV will be available only for sequential requests, after doing loose_route(). @@ -2481,7 +2486,7 @@ $var(account) = $dlg_val(account_type); Returns the direction of the request in dialog (as "UPSTREAM" or "DOWNSTREAM" string) - to be used for sequential request. - This PV will be available only for sequential requests (on + This PV will be available only for sequential requests (on replies), after doing loose_route(). @@ -2492,9 +2497,9 @@ $var(account) = $dlg_val(account_type);
<varname>$DLG_did</varname> - Returns the id of the dialog corresponding to - the processed sequential request. The output format is - entry ':' id (as returned by the dlg_list MI function). This PV will be + Returns the id of the dialog corresponding to + the processed sequential request. The output format is + entry ':' id (as returned by the dlg_list MI function). This PV will be available only for sequential requests, after doing loose_route(). @@ -2505,7 +2510,7 @@ $var(account) = $dlg_val(account_type);
<varname>$DLG_end_reason</varname> - Returns the reason for the dialog termination. It can be + Returns the reason for the dialog termination. It can be one of the following : @@ -2560,7 +2565,7 @@ $var(account) = $dlg_val(account_type);
<varname>$dlg_val(name)</varname> - This is a read/write variable that allows access to the dialog + This is a read/write variable that allows access to the dialog attribute named name. This PV will be available only for sequential requests, after doing loose_route().