X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=action.cpp;h=478406d448b75bd037db4e51a889833213c82337;hp=62f63edfb36c18d13fa40cdcb19360c6eca9c461;hb=8b70a9a5c2071c587ab4016dcbbb8e4bbf6da181;hpb=8fb861ef9ece9f4bd68ef79a77625ec23c27aef1 diff --git a/action.cpp b/action.cpp index 62f63ed..478406d 100644 --- a/action.cpp +++ b/action.cpp @@ -208,7 +208,7 @@ void EndpointAppPBX::action_dialing_external(void) memcpy(&redirinfo, &e_redirinfo, sizeof(redirinfo)); memset(&dialinginfo, 0, sizeof(dialinginfo)); dialinginfo.itype = INFO_ITYPE_ISDN; - dialinginfo.sending_complete = 0; +// dialinginfo.sending_complete = 0; SCPY(dialinginfo.id, e_extdialing); /* process prefix */ @@ -223,8 +223,6 @@ void EndpointAppPBX::action_dialing_external(void) /* process number complete */ if ((rparam = routeparam(e_action, PARAM_COMPLETE))) - if ((rparam = routeparam(e_action, PARAM_PREFIX))) - SCPY(dialinginfo.id, rparam->string_value); dialinginfo.sending_complete = 1; /* process number type */ @@ -313,6 +311,8 @@ void EndpointAppPBX::action_dialing_external(void) /* add or update outgoing call */ trace_header("ACTION extern (calling)", DIRECTION_NONE); add_trace("number", NULL, dialinginfo.id); + if (dialinginfo.sending_complete) + add_trace("number", "complete", "yes"); if (dialinginfo.interfaces[0]) add_trace("interfaces", NULL, dialinginfo.interfaces); end_trace(); @@ -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 */ @@ -1976,9 +1976,11 @@ void EndpointAppPBX::action_execute(void) 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; @@ -1989,6 +1991,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: @@ -1998,12 +2001,10 @@ void EndpointAppPBX::action_execute(void) 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);