Module: kamailio
Branch: master
Commit: e19f6f23f942ffbd940cbd194c405cae45dd38e0
URL:
https://github.com/kamailio/kamailio/commit/e19f6f23f942ffbd940cbd194c405ca…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-06-04T08:24:29+02:00
corex: send_data() and sendx() exported to kemi framework
---
Modified: src/modules/corex/corex_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e19f6f23f942ffbd940cbd194c405ca…
Patch:
https://github.com/kamailio/kamailio/commit/e19f6f23f942ffbd940cbd194c405ca…
---
diff --git a/src/modules/corex/corex_mod.c b/src/modules/corex/corex_mod.c
index ee1d506b69..4831535f67 100644
--- a/src/modules/corex/corex_mod.c
+++ b/src/modules/corex/corex_mod.c
@@ -245,6 +245,13 @@ static int w_send_data(sip_msg_t *msg, char *suri, char *sdata)
return 1;
}
+static int ki_send_data(sip_msg_t *msg, str *uri, str *data)
+{
+ if(corex_send_data(uri, NULL, data) < 0)
+ return -1;
+ return 1;
+}
+
static int w_sendx(sip_msg_t *msg, char *suri, char *ssock, char *sdata)
{
str uri;
@@ -271,6 +278,13 @@ static int w_sendx(sip_msg_t *msg, char *suri, char *ssock, char
*sdata)
return 1;
}
+static int ki_sendx(sip_msg_t *msg, str *uri, str *sock, str *data)
+{
+ if(corex_send_data(uri, sock, data) < 0)
+ return -1;
+ return 1;
+}
+
int corex_alias_subdomains_param(modparam_t type, void *val)
{
if(val==NULL)
@@ -898,6 +912,16 @@ static sr_kemi_t sr_kemi_corex_exports[] = {
{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
+ { str_init("corex"), str_init("send_data"),
+ SR_KEMIP_INT, ki_send_data,
+ { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
+ { str_init("corex"), str_init("sendx"),
+ SR_KEMIP_INT, ki_sendx,
+ { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_STR,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
};