summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg2010-12-13 08:40:16 +0100
committerAndreas Eversberg2010-12-13 09:13:16 +0100
commit0f5c2eabde69c66e8793171c878652184f9de5d8 (patch)
treeddc31dec96559f3b033a56c8a09799d582d6ce56
parentWorkaround for "noise" problems with app_rxfax in current LCR. (diff)
downloadlcr-0f5c2eabde69c66e8793171c878652184f9de5d8.tar.gz
lcr-0f5c2eabde69c66e8793171c878652184f9de5d8.tar.xz
lcr-0f5c2eabde69c66e8793171c878652184f9de5d8.zip
Adding various arguments to 'execute' condition and 'execute' action.
-rw-r--r--action.cpp3
-rw-r--r--route.c17
2 files changed, 18 insertions, 2 deletions
diff --git a/action.cpp b/action.cpp
index 1da9103..b7dfc58 100644
--- a/action.cpp
+++ b/action.cpp
@@ -1965,7 +1965,7 @@ void EndpointAppPBX::action_execute(void)
int iWaitStatus;
char *command = (char *)"";
char isdn_port[10];
- char *argv[11]; /* check also number of args below */
+ char *argv[12]; /* check also number of args below */
int i = 0;
/* get script / command */
@@ -1989,6 +1989,7 @@ void EndpointAppPBX::action_execute(void)
argv[i++] = e_callerinfo.name;
SPRINT(isdn_port, "%d", e_callerinfo.isdn_port);
argv[i++] = isdn_port;
+ argv[i++] = e_callerinfo.imsi;
argv[i++] = NULL; /* check also number of args above */
switch (pid = fork ()) {
case -1:
diff --git a/route.c b/route.c
index ca8ded8..f72d6b0 100644
--- a/route.c
+++ b/route.c
@@ -1890,6 +1890,8 @@ struct route_action *EndpointAppPBX::route(struct route_ruleset *ruleset)
struct route_action *action = NULL;
unsigned long comp_len;
int j, jj;
+ char isdn_port[10];
+ char *argv[11]; /* check also number of args below */
char callerid[64], callerid2[64], redirid[64];
int integer;
char *string;
@@ -2068,7 +2070,20 @@ struct route_action *EndpointAppPBX::route(struct route_ruleset *ruleset)
break;
case MATCH_EXECUTE:
- if (system(cond->string_value) == 0)
+ j = 0;
+ argv[j++] = (char *)"/bin/sh";
+ argv[j++] = (char *)"-c";
+ argv[j++] = cond->string_value;
+ argv[j++] = cond->string_value;
+ argv[j++] = e_extdialing;
+ argv[j++] = (char *)numberrize_callerinfo(e_callerinfo.id, e_callerinfo.ntype, options.national, options.international);
+ argv[j++] = e_callerinfo.extension;
+ argv[j++] = e_callerinfo.name;
+ SPRINT(isdn_port, "%d", e_callerinfo.isdn_port);
+ argv[j++] = isdn_port;
+ argv[j++] = e_callerinfo.imsi;
+ argv[j++] = NULL; /* check also number of args above */
+ if (execve("/bin/sh", argv, environ) == 0)
istrue = 1;
break;