TT#8007 dialog: RPC dlg.dlg_list[_ctx] make from_tag parameter optional

Change-Id: I0300aad01a7b700350e1d3553afb03ec096e4e91
changes/89/10189/3
Victor Seva 9 years ago
parent a2cae5cebc
commit c0c3afd401

@ -20,6 +20,7 @@ sipwise/usrloc_dbro.patch
sipwise/0001-kex-add-extended-core-stats.patch
##
sipwise/rtpengine_next_branch_parm.patch
sipwise/dialog-RPC-dlg.dlg_list-_ctx-make-from_tag-parameter.patch
# sca improvements
sipwise/sca_add_onhold_bflag.patch
sipwise/sca-use-kamailio-module-interface.patch

@ -0,0 +1,88 @@
From: Victor Seva <vseva@sipwise.com>
Date: Thu, 15 Dec 2016 10:47:46 +0100
Subject: dialog: RPC dlg.dlg_list[_ctx] make from_tag parameter optional
Change-Id: Ia1c37ce6d8c4cbb2644697d3e1f735a298efe54b
---
modules/dialog/dialog.c | 16 +++++++++++-----
modules/dialog/doc/dialog_admin.xml | 8 +++++++-
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/modules/dialog/dialog.c b/modules/dialog/dialog.c
index 7d56cfc..b1715ad 100644
--- a/modules/dialog/dialog.c
+++ b/modules/dialog/dialog.c
@@ -1593,18 +1593,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);
}
}
@@ -1695,10 +1701,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/modules/dialog/doc/dialog_admin.xml b/modules/dialog/doc/dialog_admin.xml
index e5ff763..af06c38 100644
--- a/modules/dialog/doc/dialog_admin.xml
+++ b/modules/dialog/doc/dialog_admin.xml
@@ -2358,7 +2358,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>
@@ -2375,6 +2375,9 @@ dlg_remote_profile("add", "caller", "test", "$sruid", "$var(exp)");
<programlisting format="linespecific">
serctl dlg.list abcdrssfrs122444@192.168.1.1 AAdfeEFF33
</programlisting>
+ <programlisting format="linespecific">
+ serctl dlg.list abcdrssfrs122444@192.168.1.1
+ </programlisting>
</section>
<section>
@@ -2391,6 +2394,9 @@ dlg_remote_profile("add", "caller", "test", "$sruid", "$var(exp)");
<programlisting format="linespecific">
serctl 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>
Loading…
Cancel
Save