Module: kamailio
Branch: master
Commit: f405f033a74673a7beeb4fd93a13538275c6b8c9
URL:
https://github.com/kamailio/kamailio/commit/f405f033a74673a7beeb4fd93a13538…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-02-17T16:37:55+01:00
kemix: exported function to get next hop uri
---
Modified: src/modules/kemix/kemix_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f405f033a74673a7beeb4fd93a13538…
Patch:
https://github.com/kamailio/kamailio/commit/f405f033a74673a7beeb4fd93a13538…
---
diff --git a/src/modules/kemix/kemix_mod.c b/src/modules/kemix/kemix_mod.c
index 0409e56d21..d261766f85 100644
--- a/src/modules/kemix/kemix_mod.c
+++ b/src/modules/kemix/kemix_mod.c
@@ -778,6 +778,21 @@ static sr_kemi_xval_t* ki_kx_gete_duri(sip_msg_t *msg)
return ki_kx_get_duri_mode(msg, SR_KEMI_XVAL_NULL_EMPTY);
}
+/**
+ *
+ */
+static sr_kemi_xval_t* ki_kx_get_nhuri(sip_msg_t *msg)
+{
+ memset(&_sr_kemi_kx_xval, 0, sizeof(sr_kemi_xval_t));
+ if(msg->dst_uri.s==NULL || msg->dst_uri.len<=0) {
+ return ki_kx_get_ruri(msg);
+ }
+
+ _sr_kemi_kx_xval.vtype = SR_KEMIP_STR;
+ _sr_kemi_kx_xval.v.s = msg->dst_uri;
+ return &_sr_kemi_kx_xval;
+}
+
/**
*
*/
@@ -938,7 +953,11 @@ static sr_kemi_t sr_kemi_kx_exports[] = {
{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
-
+ { str_init("kx"), str_init("get_nhuri"),
+ SR_KEMIP_XVAL, ki_kx_get_nhuri,
+ { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
{ str_init("kx"), str_init("get_ua"),
SR_KEMIP_XVAL, ki_kx_get_ua,
{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,