Module: kamailio
Branch: master
Commit: 3f1f706b8b1fa5da9da56420d069fc231dd9d784
URL:
https://github.com/kamailio/kamailio/commit/3f1f706b8b1fa5da9da56420d069fc2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-10-26T21:16:36+02:00
kex: setdsturi() hanldes vars params
---
Modified: src/modules/kex/kex_mod.c
Modified: src/modules/kex/km_core.c
---
Diff:
https://github.com/kamailio/kamailio/commit/3f1f706b8b1fa5da9da56420d069fc2…
Patch:
https://github.com/kamailio/kamailio/commit/3f1f706b8b1fa5da9da56420d069fc2…
---
diff --git a/src/modules/kex/kex_mod.c b/src/modules/kex/kex_mod.c
index 46bc97a90e..f58cf189b6 100644
--- a/src/modules/kex/kex_mod.c
+++ b/src/modules/kex/kex_mod.c
@@ -88,8 +88,8 @@ static cmd_export_t cmds[]={
0, ANY_ROUTE },
{"isbflagset", (cmd_function)w_isbflagset, 2,fixup_igp_igp,
0, ANY_ROUTE },
- {"setdsturi", (cmd_function)w_setdsturi, 1, 0,
- 0, ANY_ROUTE },
+ {"setdsturi", (cmd_function)w_setdsturi, 1, fixup_spve_null,
+ fixup_free_spve_null, ANY_ROUTE },
{"resetdsturi", (cmd_function)w_resetdsturi, 0, 0,
0, ANY_ROUTE },
{"isdsturiset", (cmd_function)w_isdsturiset, 0, 0,
@@ -279,4 +279,4 @@ int mod_register(char *path, int *dlflags, void *p1, void *p2)
{
sr_kemi_modules_add(sr_kemi_kex_exports);
return 0;
-}
\ No newline at end of file
+}
diff --git a/src/modules/kex/km_core.c b/src/modules/kex/km_core.c
index 428e620d7b..f0d97f1af9 100644
--- a/src/modules/kex/km_core.c
+++ b/src/modules/kex/km_core.c
@@ -33,16 +33,17 @@
int w_setdsturi(struct sip_msg *msg, char *uri, str *s2)
{
- str s;
+ str suri;
- /* todo: fixup */
- s.s = uri;
- s.len = strlen(uri);
+ if(fixup_get_svalue(msg, (gparam_t*)uri, &suri)!=0) {
+ LM_ERR("cannot get the URI parameter\n");
+ return -1;
+ }
- if(set_dst_uri(msg, &s)!=0)
+ if(set_dst_uri(msg, &suri)!=0)
return -1;
- /* dst_uri changes, so it makes sense to re-use the current uri for
- forking */
+ /* dst_uri changed, so it makes sense to re-use the current uri
+ * for forking */
ruri_mark_new(); /* re-use uri for serial forking */
return 1;