Skip to content

Commit

Permalink
Merge pull request #2935 from kamailio/vseva/dlg_rpc
Browse files Browse the repository at this point in the history
dialog: add local_only paramter to RPC dlg.stats_active
  • Loading branch information
miconda committed Dec 13, 2021
2 parents d39bbb0 + 506672e commit c3e7b1e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/modules/dialog/dialog.c
Expand Up @@ -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++;
Expand Down
8 changes: 7 additions & 1 deletion src/modules/dialog/doc/dialog_admin.xml
Expand Up @@ -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>
Expand Down

0 comments on commit c3e7b1e

Please sign in to comment.