Module: kamailio
Branch: master
Commit: c3e7b1e4f402081b122ca6f0967f92005e1cfeaf
URL:
https://github.com/kamailio/kamailio/commit/c3e7b1e4f402081b122ca6f0967f920…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: GitHub <noreply(a)github.com>
Date: 2021-12-13T09:20:03+01:00
Merge pull request #2935 from kamailio/vseva/dlg_rpc
dialog: add local_only paramter to RPC dlg.stats_active
---
Modified: src/modules/dialog/dialog.c
Modified: src/modules/dialog/doc/dialog_admin.xml
---
Diff:
https://github.com/kamailio/kamailio/commit/c3e7b1e4f402081b122ca6f0967f920…
Patch:
https://github.com/kamailio/kamailio/commit/c3e7b1e4f402081b122ca6f0967f920…
---
diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c
index 243bb9bd9fe..7361887fe59 100644
--- a/src/modules/dialog/dialog.c
+++ b/src/modules/dialog/dialog.c
@@ -2858,16 +2858,21 @@ static void rpc_dlg_stats_active(rpc_t *rpc, void *c)
{
dlg_cell_t *dlg;
unsigned int i;
+ int dlg_own = 0;
int dlg_starting = 0;
int dlg_connecting = 0;
int dlg_answering = 0;
int dlg_ongoing = 0;
void *h;
+ if(rpc->scan(c, "*d", &dlg_own) < 1)
+ dlg_own = 0;
for( i=0 ; i<d_table->size ; i++ ) {
dlg_lock( d_table, &(d_table->entries[i]) );
for( dlg=d_table->entries[i].first ; dlg ; dlg=dlg->next ) {
+ if(dlg_own != 0 && dlg->bind_addr[0] == NULL)
+ continue;
switch(dlg->state) {
case DLG_STATE_UNCONFIRMED:
dlg_starting++;
diff --git a/src/modules/dialog/doc/dialog_admin.xml
b/src/modules/dialog/doc/dialog_admin.xml
index 987bd545450..745efb51f07 100644
--- a/src/modules/dialog/doc/dialog_admin.xml
+++ b/src/modules/dialog/doc/dialog_admin.xml
@@ -2801,7 +2801,13 @@ dlg_reset_property("timeout-noreset");
(not relying on core stats framework).
</para>
<para>Name: <emphasis>dlg.stats_active</emphasis></para>
- <para>Parameters: none.</para>
+ <para>Parameters:</para>
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>local_only</emphasis> (optional) - if not 0 then filter out
+ non local dialogues. No bind_addr info in memory.
+ </para></listitem>
+ </itemizedlist>
<para>Returned fields</para>
<itemizedlist>
<listitem><para>