Module: kamailio
Branch: master
Commit: 688db50c14f187ef5728089e4ae6c92dd091c7a8
URL:
https://github.com/kamailio/kamailio/commit/688db50c14f187ef5728089e4ae6c92…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-12-16T08:10:50+01:00
dialog: use event callback for reply out
---
Modified: src/modules/dialog/dialog.c
---
Diff:
https://github.com/kamailio/kamailio/commit/688db50c14f187ef5728089e4ae6c92…
Patch:
https://github.com/kamailio/kamailio/commit/688db50c14f187ef5728089e4ae6c92…
---
diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c
index 1db9468d95a..2e2ebe586b8 100644
--- a/src/modules/dialog/dialog.c
+++ b/src/modules/dialog/dialog.c
@@ -70,6 +70,7 @@
#include "../../modules/tm/tm_load.h"
#include "../../core/rpc_lookup.h"
#include "../../core/srapi.h"
+#include "../../core/events.h"
#include "../rr/api.h"
#include "dlg_hash.h"
#include "dlg_timer.h"
@@ -228,6 +229,8 @@ static int fixup_dlg_req_with_headers(void **, int);
static int fixup_dlg_req_with_content(void **, int);
static int fixup_dlg_req_with_headers_and_content(void **, int);
+static int dlg_sip_reply_out(sr_event_param_t *evp);
+
/* clang-format off */
static cmd_export_t cmds[]={
{"dlg_manage", (cmd_function)w_dlg_manage, 0,0,
@@ -796,6 +799,9 @@ static int mod_init(void)
ksr_module_set_flag(KSRMOD_FLAG_POSTCHILDINIT);
}
+ if(dlg_process_mode != 0) {
+ sr_event_register_cb(SREV_SIP_REPLY_OUT, dlg_sip_reply_out);
+ }
return 0;
}
@@ -871,6 +877,17 @@ static void mod_destroy(void)
}
+/**
+ *
+ */
+static int dlg_sip_reply_out(sr_event_param_t *evp)
+{
+ LM_DBG("handling sip response\n");
+ dlg_update_state(evp->rpl);
+ return 0;
+}
+
+
static int w_set_dlg_profile_helper(
sip_msg_t *msg, struct dlg_profile_table *profile, str *value)
{