X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=action.cpp;h=e0a884d3bddf1bc38992911de090c942c070d51f;hp=b7dfc582740d3b14e0e31ca73821fb44116c034b;hb=5463e1b62a39ce417b610584e3d34a8bc30ac15e;hpb=0f5c2eabde69c66e8793171c878652184f9de5d8 diff --git a/action.cpp b/action.cpp index b7dfc58..e0a884d 100644 --- a/action.cpp +++ b/action.cpp @@ -74,6 +74,7 @@ void EndpointAppPBX::action_dialing_internal(void) struct capa_info capainfo; struct caller_info callerinfo; struct redir_info redirinfo; + struct rtp_info rtpinfo; struct dialing_info dialinginfo; struct port_list *portlist = ea_endpoint->ep_portlist; struct lcr_msg *message; @@ -91,6 +92,7 @@ void EndpointAppPBX::action_dialing_internal(void) memcpy(&capainfo, &e_capainfo, sizeof(capainfo)); memcpy(&callerinfo, &e_callerinfo, sizeof(callerinfo)); memcpy(&redirinfo, &e_redirinfo, sizeof(redirinfo)); + memcpy(&rtpinfo, &e_rtpinfo, sizeof(rtpinfo)); memset(&dialinginfo, 0, sizeof(dialinginfo)); dialinginfo.itype = INFO_ITYPE_ISDN_EXTENSION; SCPY(dialinginfo.id, e_dialinginfo.id); @@ -164,6 +166,7 @@ void EndpointAppPBX::action_dialing_internal(void) memcpy(&message->param.setup.redirinfo, &redirinfo, sizeof(struct redir_info)); memcpy(&message->param.setup.callerinfo, &callerinfo, sizeof(struct caller_info)); memcpy(&message->param.setup.capainfo, &capainfo, sizeof(struct capa_info)); + memcpy(&message->param.setup.rtpinfo, &rtpinfo, sizeof(struct rtp_info)); message_put(message); } @@ -174,6 +177,7 @@ void EndpointAppPBX::action_dialing_external(void) struct capa_info capainfo; struct caller_info callerinfo; struct redir_info redirinfo; + struct rtp_info rtpinfo; struct dialing_info dialinginfo; char *p; struct port_list *portlist = ea_endpoint->ep_portlist; @@ -206,6 +210,7 @@ void EndpointAppPBX::action_dialing_external(void) memcpy(&capainfo, &e_capainfo, sizeof(capainfo)); memcpy(&callerinfo, &e_callerinfo, sizeof(callerinfo)); memcpy(&redirinfo, &e_redirinfo, sizeof(redirinfo)); + memcpy(&rtpinfo, &e_rtpinfo, sizeof(rtpinfo)); memset(&dialinginfo, 0, sizeof(dialinginfo)); dialinginfo.itype = INFO_ITYPE_ISDN; // dialinginfo.sending_complete = 0; @@ -321,6 +326,7 @@ void EndpointAppPBX::action_dialing_external(void) memcpy(&message->param.setup.redirinfo, &redirinfo, sizeof(struct redir_info)); memcpy(&message->param.setup.callerinfo, &callerinfo, sizeof(struct caller_info)); memcpy(&message->param.setup.capainfo, &capainfo, sizeof(struct capa_info)); + memcpy(&message->param.setup.rtpinfo, &rtpinfo, sizeof(struct rtp_info)); message_put(message); } @@ -1976,9 +1982,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; @@ -1999,12 +2007,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); @@ -2283,11 +2289,12 @@ void EndpointAppPBX::process_dialing(int timeout) } 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);