X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=action.cpp;h=6d6e964eff3fc8f637854ebf6694ae4a55fe5681;hp=478406d448b75bd037db4e51a889833213c82337;hb=863e741714652a1b6610e8d84b42f49ca4b680ca;hpb=8b70a9a5c2071c587ab4016dcbbb8e4bbf6da181 diff --git a/action.cpp b/action.cpp index 478406d..6d6e964 100644 --- a/action.cpp +++ b/action.cpp @@ -20,8 +20,6 @@ extern char **environ; int EndpointAppPBX::_action_init_call(char *remote) { class Join *join; - struct port_list *portlist = ea_endpoint->ep_portlist; - struct admin_list *admin; /* a created call, this should never happen */ if (ea_endpoint->ep_join_id) { @@ -32,7 +30,11 @@ int EndpointAppPBX::_action_init_call(char *remote) /* create join */ PDEBUG(DEBUG_EPOINT, "EPOINT(%d): Creating new join instance.\n", ea_endpoint->ep_serial); +#ifdef WITH_MISDN if (remote) { + struct port_list *portlist = ea_endpoint->ep_portlist; + struct admin_list *admin; + admin = admin_first; while(admin) { if (admin->remote_name[0] && !strcmp(admin->remote_name, remote)) @@ -50,8 +52,8 @@ int EndpointAppPBX::_action_init_call(char *remote) return(0); } join = new JoinRemote(ea_endpoint->ep_serial, remote, admin->sock); - } - else + } else +#endif join = new JoinPBX(ea_endpoint); if (!join) FATAL("No memoy for Join instance.\n"); @@ -74,6 +76,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 +94,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 +168,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 +179,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 +212,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 +328,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); } @@ -2283,11 +2291,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);