[sr-dev] git:master:c8f7be02: corex: added $cfg(route) - return name of routing block for crt action
Daniel-Constantin Mierla
miconda at gmail.com
Mon Jun 26 08:36:08 CEST 2017
Module: kamailio
Branch: master
Commit: c8f7be02e20f434f88c084c38b66d5dd34cf4dc1
URL: https://github.com/kamailio/kamailio/commit/c8f7be02e20f434f88c084c38b66d5dd34cf4dc1
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-06-26T08:22:34+02:00
corex: added $cfg(route) - return name of routing block for crt action
- aliased $cfg(file) to $cfg(name)
---
Modified: src/modules/corex/corex_var.c
---
Diff: https://github.com/kamailio/kamailio/commit/c8f7be02e20f434f88c084c38b66d5dd34cf4dc1.diff
Patch: https://github.com/kamailio/kamailio/commit/c8f7be02e20f434f88c084c38b66d5dd34cf4dc1.patch
---
diff --git a/src/modules/corex/corex_var.c b/src/modules/corex/corex_var.c
index b2dea26734..8a36158fb4 100644
--- a/src/modules/corex/corex_var.c
+++ b/src/modules/corex/corex_var.c
@@ -44,6 +44,13 @@ int pv_parse_cfg_name(pv_spec_p sp, str *in)
sp->pvp.pvn.u.isname.name.n = 0;
else if(strncmp(in->s, "name", 4)==0)
sp->pvp.pvn.u.isname.name.n = 1;
+ else if(strncmp(in->s, "file", 4)==0)
+ sp->pvp.pvn.u.isname.name.n = 1;
+ else goto error;
+ break;
+ case 5:
+ if(strncmp(in->s, "route", 5)==0)
+ sp->pvp.pvn.u.isname.name.n = 2;
else goto error;
break;
default:
@@ -72,7 +79,12 @@ int pv_get_cfg(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
switch(param->pvn.u.isname.name.n)
{
case 1:
- n = get_cfg_crt_name();
+ n = get_cfg_crt_file_name();
+ if(n==0)
+ return pv_get_null(msg, param, res);
+ return pv_get_strzval(msg, param, res, n);
+ case 2:
+ n = get_cfg_crt_route_name();
if(n==0)
return pv_get_null(msg, param, res);
return pv_get_strzval(msg, param, res, n);
More information about the sr-dev
mailing list