Module: kamailio
Branch: master
Commit: 68dce4972cff006693dbd80837b16d07e565b0ac
URL:
https://github.com/kamailio/kamailio/commit/68dce4972cff006693dbd80837b16d0…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-04-14T13:15:15+02:00
app_lua: extend the kemi engine to handle the routing block types
---
Modified: modules/app_lua/app_lua_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/68dce4972cff006693dbd80837b16d0…
Patch:
https://github.com/kamailio/kamailio/commit/68dce4972cff006693dbd80837b16d0…
---
diff --git a/modules/app_lua/app_lua_mod.c b/modules/app_lua/app_lua_mod.c
index 11134ea..8cf74a1 100644
--- a/modules/app_lua/app_lua_mod.c
+++ b/modules/app_lua/app_lua_mod.c
@@ -111,10 +111,33 @@ int sr_kemi_config_engine_lua(sip_msg_t *msg, int rtype, str
*rname)
{
int ret;
+ ret = -1;
if(rtype==REQUEST_ROUTE) {
ret = app_lua_run_ex(msg, "ksr_request_route", NULL, NULL, NULL, 1);
} else if(rtype==CORE_ONREPLY_ROUTE) {
ret = app_lua_run_ex(msg, "ksr_reply_route", NULL, NULL, NULL, 0);
+ } else if(rtype==BRANCH_ROUTE) {
+ if(rname!=NULL && rname->s!=NULL) {
+ ret = app_lua_run_ex(msg, rname->s, NULL, NULL, NULL, 0);
+ }
+ } else if(rtype==FAILURE_ROUTE) {
+ if(rname!=NULL && rname->s!=NULL) {
+ ret = app_lua_run_ex(msg, rname->s, NULL, NULL, NULL, 0);
+ }
+ } else if(rtype==BRANCH_FAILURE_ROUTE) {
+ if(rname!=NULL && rname->s!=NULL) {
+ ret = app_lua_run_ex(msg, rname->s, NULL, NULL, NULL, 0);
+ }
+ } else if(rtype==TM_ONREPLY_ROUTE) {
+ if(rname!=NULL && rname->s!=NULL) {
+ ret = app_lua_run_ex(msg, rname->s, NULL, NULL, NULL, 0);
+ }
+ } else if(rtype==ONSEND_ROUTE) {
+ ret = app_lua_run_ex(msg, "ksr_onsend_route", NULL, NULL, NULL, 0);
+ } else if(rtype==EVENT_ROUTE) {
+ if(rname!=NULL && rname->s!=NULL) {
+ ret = app_lua_run_ex(msg, rname->s, NULL, NULL, NULL, 0);
+ }
} else {
if(rname!=NULL) {
LM_ERR("route type %d with name [%.*s] not implemented\n",