Module: kamailio Branch: master Commit: e7bf487cfcde699fbcd6fd4a6233ef2113570545 URL: https://github.com/kamailio/kamailio/commit/e7bf487cfcde699fbcd6fd4a6233ef21...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2025-07-23T17:24:55+02:00
dispatcher: use always the internal faked message for event routes
- being executed on state change, the config message does not provide useful data (e.g., on ds_mark_dst() inside failure route, the UAS request is used, not having uri where it was sent) - the r-uri of the internal faked message is set to the destination uri from the dispatcher record
---
Modified: src/modules/dispatcher/dispatch.c
---
Diff: https://github.com/kamailio/kamailio/commit/e7bf487cfcde699fbcd6fd4a6233ef21... Patch: https://github.com/kamailio/kamailio/commit/e7bf487cfcde699fbcd6fd4a6233ef21...
---
diff --git a/src/modules/dispatcher/dispatch.c b/src/modules/dispatcher/dispatch.c index d51d7b6b1ed..4f33d2789f0 100644 --- a/src/modules/dispatcher/dispatch.c +++ b/src/modules/dispatcher/dispatch.c @@ -3538,7 +3538,7 @@ static void ds_run_route(sip_msg_t *msg, str *uri, char *route, ds_rctx_t *rctx) { int rt, backup_rt; struct run_act_ctx ctx; - sip_msg_t *fmsg; + sip_msg_t *fmsg = NULL; sr_kemi_eng_t *keng = NULL; str evname;
@@ -3565,18 +3565,14 @@ static void ds_run_route(sip_msg_t *msg, str *uri, char *route, ds_rctx_t *rctx) } }
- if(msg == NULL || msg == FAKED_REPLY) { - if(faked_msg_init() < 0) { - LM_ERR("faked_msg_init() failed\n"); - return; - } - fmsg = faked_msg_next(); - if(rewrite_uri(fmsg, uri) < 0) { - LM_ERR("failed to set r-uri\n"); - return; - } - } else { - fmsg = msg; + if(faked_msg_init() < 0) { + LM_ERR("faked_msg_init() failed\n"); + return; + } + fmsg = faked_msg_next(); + if(rewrite_uri(fmsg, uri) < 0) { + LM_ERR("failed to set r-uri\n"); + return; }
if(rt >= 0 || ds_event_callback.len > 0) { @@ -3600,9 +3596,7 @@ static void ds_run_route(sip_msg_t *msg, str *uri, char *route, ds_rctx_t *rctx) set_route_type(backup_rt); _ds_rctx = NULL; } - if(fmsg != msg) { - reset_uri(fmsg); - } + reset_uri(fmsg); }