X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=apppbx.cpp;h=25521dddb6907efd68cd774233cd31fc124453c8;hp=a64467e928078feaaaae6272a61273f85bd0841d;hb=feea42c7f7f2e171c1490bd0d3af09beba629f21;hpb=6db34c1dca5c3a2acd0af689319b583ff8271dbc diff --git a/apppbx.cpp b/apppbx.cpp index a64467e..25521dd 100644 --- a/apppbx.cpp +++ b/apppbx.cpp @@ -550,28 +550,36 @@ struct mISDNport *EndpointAppPBX::hunt_port(char *ifname, int *channel) struct select_channel *selchannel; struct mISDNport *mISDNport; int index, i; + int there_is_an_external = 0; interface = interface_first; /* first find the given interface or, if not given, one with no extension */ checknext: - if (!interface) + if (!interface) { + if (!there_is_an_external && !(ifname && ifname[0])) { + trace_header("CHANNEL SELECTION (no external interface specified)", DIRECTION_NONE); + add_trace("info", NULL, "Add 'external' parameter to interface.conf."); + end_trace(); + } return(NULL); + } /* check for given interface */ - if (ifname) { + if (ifname && ifname[0]) { if (!strcasecmp(interface->name, ifname)) { /* found explicit interface */ - trace_header("CHANNEL SELECTION (found interface)", DIRECTION_NONE); + trace_header("CHANNEL SELECTION (found given interface)", DIRECTION_NONE); add_trace("interface", NULL, "%s", ifname); end_trace(); goto foundif; } } else { - if (!interface->extension) { + if (interface->external) { + there_is_an_external = 1; /* found non extension */ - trace_header("CHANNEL SELECTION (found non extension interface)", DIRECTION_NONE); + trace_header("CHANNEL SELECTION (found external interface)", DIRECTION_NONE); add_trace("interface", NULL, "%s", interface->name); end_trace(); goto foundif; @@ -1565,7 +1573,7 @@ void EndpointAppPBX::port_information(struct port_list *portlist, int message_ty } /* keypad when connected */ - if (e_state == EPOINT_STATE_CONNECT) { + if (e_state == EPOINT_STATE_CONNECT || e_state == EPOINT_STATE_IN_ALERTING) { if (e_ext.keypad || e_enablekeypad) { PDEBUG(DEBUG_EPOINT, "EPOINT(%d) keypad information received during connect: %s.\n", ea_endpoint->ep_serial, param->information.id); /* processing keypad function */ @@ -1639,7 +1647,7 @@ NOTE: vbox is now handled due to overlap state #endif /* check for *X# sequence */ - if (e_state == EPOINT_STATE_CONNECT) { + if (e_state == EPOINT_STATE_CONNECT || e_state == EPOINT_STATE_IN_ALERTING) { if (e_dtmf_time+3 < now) { /* the last digit was too far in the past to be a sequence */ if (param->dtmf == '*') @@ -2758,6 +2766,9 @@ void EndpointAppPBX::join_alerting(struct port_list *portlist, int message_type, set_tone(portlist, "ringpbx"); else set_tone(portlist, "ringing"); + + if (e_ext.number[0]) + e_dtmf = 1; /* allow dtmf */ } /* join MESSAGE_CONNECT */ @@ -3268,7 +3279,7 @@ void EndpointAppPBX::ea_message_join(unsigned int join_id, int message_type, uni join_notify(portlist, message_type, param); break; - /* JOIN wants keypad / dtml */ + /* JOIN wants keypad / dtmf */ case MESSAGE_ENABLEKEYPAD: PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received keypad enable request.\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id); e_enablekeypad = 1; @@ -3514,7 +3525,7 @@ void EndpointAppPBX::join_join(void) class Port *our_port, *other_port; class Pdss1 *our_pdss1, *other_pdss1; - /* are we a candidate to join a join */ + /* are we a candidate to join a join? */ our_join = find_join_id(ea_endpoint->ep_join_id); if (!our_join) { PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: our join doesn't exist anymore.\n", ea_endpoint->ep_serial); @@ -3575,14 +3586,14 @@ void EndpointAppPBX::join_join(void) other_eapp = other_eapp->next; } if (!other_eapp) { - PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: no other endpoint on same isdn interface with port on hold.\n", ea_endpoint->ep_serial); + PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: no other endpoint on same isdn terminal.\n", ea_endpoint->ep_serial); return; } - PDEBUG(DEBUG_EPOINT, "EPOINT(%d) port on hold found.\n", ea_endpoint->ep_serial); + PDEBUG(DEBUG_EPOINT, "EPOINT(%d) port with same terminal found.\n", ea_endpoint->ep_serial); /* if we have the same join */ if (other_eapp->ea_endpoint->ep_join_id == ea_endpoint->ep_join_id) { - PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: we an the other have the same join.\n", ea_endpoint->ep_serial); + PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: we and the other have the same join.\n", ea_endpoint->ep_serial); return; } other_join = find_join_id(other_eapp->ea_endpoint->ep_join_id);