فهرست منبع

Merge pull request #2935 from kamailio/vseva/dlg_rpc

dialog: add local_only paramter to RPC dlg.stats_active
Daniel-Constantin Mierla 3 سال پیش
والد
کامیت
c3e7b1e4f4
2فایلهای تغییر یافته به همراه12 افزوده شده و 1 حذف شده
  1. 5 0
      src/modules/dialog/dialog.c
  2. 7 1
      src/modules/dialog/doc/dialog_admin.xml

+ 5 - 0
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++;

+ 7 - 1
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>