Module: kamailio
Branch: master
Commit: 5f93bb6fed27e41e001a4748081ab6e3f32e737d
URL:
https://github.com/kamailio/kamailio/commit/5f93bb6fed27e41e001a4748081ab6e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-12-26T10:00:49+01:00
xhttp: kemi funtion to return $hu - http uri
---
Modified: src/modules/xhttp/xhttp_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/5f93bb6fed27e41e001a4748081ab6e…
Patch:
https://github.com/kamailio/kamailio/commit/5f93bb6fed27e41e001a4748081ab6e…
---
diff --git a/src/modules/xhttp/xhttp_mod.c b/src/modules/xhttp/xhttp_mod.c
index ba57066849..f62c880a9a 100644
--- a/src/modules/xhttp/xhttp_mod.c
+++ b/src/modules/xhttp/xhttp_mod.c
@@ -513,6 +513,28 @@ int bind_xhttp(xhttp_api_t *api)
return 0;
}
+/**
+ *
+ */
+static sr_kemi_xval_t _sr_kemi_xhttp_xval = {0};
+
+/**
+ *
+ */
+static sr_kemi_xval_t* ki_xhttp_get_hu(sip_msg_t *msg)
+{
+ memset(&_sr_kemi_xhttp_xval, 0, sizeof(sr_kemi_xval_t));
+
+ if(msg==NULL) {
+ sr_kemi_xval_null(&_sr_kemi_xhttp_xval, SR_KEMI_XVAL_NULL_EMPTY);
+ return &_sr_kemi_xhttp_xval;
+ }
+
+ _sr_kemi_xhttp_xval.vtype = SR_KEMIP_STR;
+ _sr_kemi_xhttp_xval.v.s = msg->first_line.u.request.uri;
+ return &_sr_kemi_xhttp_xval;
+}
+
/**
*
*/
@@ -523,6 +545,11 @@ static sr_kemi_t sr_kemi_xhttp_exports[] = {
{ SR_KEMIP_INT, SR_KEMIP_STR, SR_KEMIP_STR,
SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
+ { str_init("xhttp"), str_init("get_hu"),
+ SR_KEMIP_XVAL, ki_xhttp_get_hu,
+ { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
};