Module: kamailio Branch: master Commit: 0a2f5e768813e448730ae8767ecb48cc4aadd074 URL: https://github.com/kamailio/kamailio/commit/0a2f5e768813e448730ae8767ecb48cc...
Author: Victor Seva linuxmaniac@torreviejawireless.org Committer: Victor Seva linuxmaniac@torreviejawireless.org Date: 2016-12-15T16:17:59+01:00
dialog: [RPC] from-tag optional on dlg.dlg_list[_ctx]
---
Modified: src/modules/dialog/dialog.c Modified: src/modules/dialog/doc/dialog_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/0a2f5e768813e448730ae8767ecb48cc... Patch: https://github.com/kamailio/kamailio/commit/0a2f5e768813e448730ae8767ecb48cc...
---
diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c index eecee86..eb5bfa5 100644 --- a/src/modules/dialog/dialog.c +++ b/src/modules/dialog/dialog.c @@ -1604,18 +1604,24 @@ static void internal_rpc_print_dlgs(rpc_t *rpc, void *c, int with_context) * \param with_context if 1 then the dialog context will be also printed */ static void internal_rpc_print_single_dlg(rpc_t *rpc, void *c, int with_context) { - str callid, from_tag; + str callid, ft; + str *from_tag = NULL; dlg_entry_t *d_entry; dlg_cell_t *dlg; unsigned int h_entry;
- if (rpc->scan(c, ".S.S", &callid, &from_tag) < 2) return; + if (rpc->scan(c, ".S", &callid) < 1) return;
h_entry = core_hash( &callid, 0, d_table->size); d_entry = &(d_table->entries[h_entry]); + + if (rpc->scan(c, "*.S", &ft) == 1) { + from_tag = &ft; + } + dlg_lock( d_table, d_entry); for( dlg = d_entry->first ; dlg ; dlg = dlg->next ) { - if (match_downstream_dialog( dlg, &callid, &from_tag)==1) { + if (match_downstream_dialog( dlg, &callid, from_tag)==1) { internal_rpc_print_dlg(rpc, c, dlg, with_context); } } @@ -1706,10 +1712,10 @@ static const char *rpc_print_dlgs_ctx_doc[2] = { "Print all dialogs with associated context", 0 }; static const char *rpc_print_dlg_doc[2] = { - "Print dialog based on callid and fromtag", 0 + "Print dialog based on callid and optionally fromtag", 0 }; static const char *rpc_print_dlg_ctx_doc[2] = { - "Print dialog with associated context based on callid and fromtag", 0 + "Print dialog with associated context based on callid and optionally fromtag", 0 }; static const char *rpc_end_dlg_entry_id_doc[2] = { "End a given dialog based on [h_entry] [h_id]", 0 diff --git a/src/modules/dialog/doc/dialog_admin.xml b/src/modules/dialog/doc/dialog_admin.xml index 528ce93..9eabd44 100644 --- a/src/modules/dialog/doc/dialog_admin.xml +++ b/src/modules/dialog/doc/dialog_admin.xml @@ -2394,7 +2394,7 @@ dlg_remote_profile("add", "caller", "test", "$sruid", "$var(exp)"); <title><varname>dlg.dlg_list</varname></title> <para> Lists the description of one dialog. The dialog identifiers are to be passed - as parameter (callid and fromtag). + as parameter (callid and optionally fromtag). </para> <para>Name: <emphasis>dlg.dlg_list</emphasis></para> <para>Parameters:</para> @@ -2411,6 +2411,9 @@ dlg_remote_profile("add", "caller", "test", "$sruid", "$var(exp)"); <programlisting format="linespecific"> kamcmd dlg.list abcdrssfrs122444@192.168.1.1 AAdfeEFF33 </programlisting> + <programlisting format="linespecific"> + serctl dlg.list abcdrssfrs122444@192.168.1.1 + </programlisting> </section> <section> <title><varname>dlg.dlg_list_ctx</varname></title> @@ -2426,6 +2429,9 @@ dlg_remote_profile("add", "caller", "test", "$sruid", "$var(exp)"); <programlisting format="linespecific"> kamcmd dlg.list_ctx abcdrssfrs122444@192.168.1.1 AAdfeEFF33 </programlisting> + <programlisting format="linespecific"> + serctl dlg.list_ctx abcdrssfrs122444@192.168.1.1 + </programlisting> </section> <section> <title><varname>dlg.terminate_dlg</varname></title>