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 */
end_trace();
return;
}
+#if 0
argv[i++] = (char *)"/bin/sh";
argv[i++] = (char *)"-c";
argv[i++] = command;
+#endif
argv[i++] = command;
if ((rparam = routeparam(e_action, PARAM_PARAM))) {
argv[i++] = rparam->string_value;
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:
case 0:
/* To be shure there are no zombies created double fork */
if ((pid2 = fork()) == 0) {
- execve("/bin/sh", argv, environ);
- }
- else {
- /* Exit immediately and release the waiting parent. The subprocess falls to init because the parent died */
- exit(0);
+ execve(command, argv, environ);
}
+ /* Exit immediately and release the waiting parent. The subprocess falls to init because the parent died */
+ exit(0);
break;
default:
trace_header("ACTION execute", DIRECTION_NONE);
}
gettimeofday(¤t_time, NULL);
- if (timeout && TIME_SMALLER(&e_match_timeout.timeout, ¤t_time)) {
+ if (e_match_to_action && TIME_SMALLER(&e_match_timeout.timeout, ¤t_time)) {
/* return timeout rule */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d): terminal '%s' dialing: '%s', timeout in ruleset '%s'\n", ea_endpoint->ep_serial, e_ext.number, e_dialinginfo.id, e_ruleset->name);
unsched_timer(&e_match_timeout);
e_action = e_match_to_action;
+ e_match_to_action = NULL;
e_extdialing = e_match_to_extdialing;
trace_header("ROUTING (timeout)", DIRECTION_NONE);
add_trace("action", NULL, "%s", action_defs[e_action->index].name);