فهرست منبع

dlgs: register callback for core event SREV_SIP_REPLY_OUT

Daniel-Constantin Mierla 5 سال پیش
والد
کامیت
72d830ce66
1فایلهای تغییر یافته به همراه16 افزوده شده و 0 حذف شده
  1. 16 0
      src/modules/dlgs/dlgs_mod.c

+ 16 - 0
src/modules/dlgs/dlgs_mod.c

@@ -30,6 +30,7 @@
 #include "../../core/mod_fix.h"
 #include "../../core/ut.h"
 #include "../../core/kemi.h"
+#include "../../core/events.h"
 #include "../../core/utils/sruid.h"
 #include "../../core/timer_proc.h"
 
@@ -58,6 +59,8 @@ static int w_dlgs_tags_add(sip_msg_t *msg, char *ptags, char *p2);
 static int w_dlgs_tags_rm(sip_msg_t *msg, char *ptags, char *p2);
 static int w_dlgs_tags_count(sip_msg_t *msg, char *ptags, char *p2);
 
+static int dlgs_sip_reply_out(sr_event_param_t *evp);
+
 /* clang-format off */
 static cmd_export_t cmds[]={
 	{"dlgs_init", (cmd_function)w_dlgs_init, 3, fixup_spve_all,
@@ -125,6 +128,8 @@ static int mod_init(void)
 		return -1;
 	}
 
+	sr_event_register_cb(SREV_SIP_REPLY_OUT, dlgs_sip_reply_out);
+
 	if(dlgs_init()<0) {
 		return -1;
 	}
@@ -261,6 +266,17 @@ static int w_dlgs_tags_count(sip_msg_t *msg, char *ptags, char *p2)
 	return 1;
 }
 
+/**
+ *
+ */
+static int dlgs_sip_reply_out(sr_event_param_t *evp)
+{
+	if(evp->rpl!=NULL) {
+		dlgs_update_item(evp->rpl);
+	}
+	return 0;
+}
+
 /**
  *
  */