summaryrefslogtreecommitdiffstats
path: root/route.c
diff options
context:
space:
mode:
authorAndreas Eversberg2011-07-14 14:25:42 +0200
committerAndreas Eversberg2011-07-14 14:25:42 +0200
commitda91d7d85fe092122e35ece52695f98345738359 (patch)
treea06ffff8291b8f61441ef75b28a4184824806af5 /route.c
parent[GSM_BS] Added DTMF support. (diff)
parent[GSM] Replaced strcpy by required macro name. (diff)
downloadlcr-da91d7d85fe092122e35ece52695f98345738359.tar.gz
lcr-da91d7d85fe092122e35ece52695f98345738359.tar.xz
lcr-da91d7d85fe092122e35ece52695f98345738359.zip
Merge branch 'develop'
Conflicts: Makefile.in README chan_lcr.c configure gsm_bs.cpp gsm_ms.cpp interface.c route.c
Diffstat (limited to 'route.c')
-rw-r--r--route.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/route.c b/route.c
index f72d6b0..8217ff1 100644
--- a/route.c
+++ b/route.c
@@ -1902,6 +1902,7 @@ struct route_action *EndpointAppPBX::route(struct route_ruleset *ruleset)
struct admin_list *admin;
time_t now;
struct tm *now_tm;
+ int pid2;
/* reset timeout action */
e_match_to_action = NULL;
@@ -2071,9 +2072,11 @@ struct route_action *EndpointAppPBX::route(struct route_ruleset *ruleset)
case MATCH_EXECUTE:
j = 0;
+#if 0
argv[j++] = (char *)"/bin/sh";
argv[j++] = (char *)"-c";
argv[j++] = cond->string_value;
+#endif
argv[j++] = cond->string_value;
argv[j++] = e_extdialing;
argv[j++] = (char *)numberrize_callerinfo(e_callerinfo.id, e_callerinfo.ntype, options.national, options.international);
@@ -2083,8 +2086,11 @@ struct route_action *EndpointAppPBX::route(struct route_ruleset *ruleset)
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;
+ if (fork() == 0) {
+ if ((pid2 = fork()) == 0) {
+ execve(cond->string_value, argv, environ);
+ }
+ }
break;
case MATCH_DEFAULT: