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.");
+ add_trace("info", NULL, "Add 'extern' parameter to interface.conf.");
end_trace();
}
return(NULL);
* ports will be created and a setup is sent if everything is ok. otherwhise
* the endpoint is destroyed.
*/
-void EndpointAppPBX::out_setup(void)
+void EndpointAppPBX::out_setup(int cfnr)
{
struct dialing_info dialinginfo;
class Port *port;
release(RELEASE_ALL, LOCATION_PRIVATE_LOCAL, CAUSE_OUTOFORDER, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL, 0); /* RELEASE_TYPE, join, port */
return; /* must exit here */
}
+ e_dialinginfo.sending_complete = 1;
if (e_dialinginfo.itype == INFO_ITYPE_VBOX) {
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) dialing directly to VBOX\n", ea_endpoint->ep_serial);
p = e_ext.cfnr;
if (*p) {
/* when cfnr is done, out_setup() will setup the call */
- if (e_cfnr_call_timeout.active) {
+ if (cfnr) {
/* present to forwarded party */
if (e_ext.anon_ignore && e_callerinfo.id[0]) {
e_callerinfo.present = INFO_PRESENT_ALLOWED;
port = ss5_hunt_line(mISDNport);
else
#endif
- if (!mISDNport->gsm)
- port = new Pdss1((mISDNport->ntmode)?PORT_TYPE_DSS1_NT_OUT:PORT_TYPE_DSS1_TE_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode);
+#ifdef WITH_GSM_BS
+ if (mISDNport->gsm_bs)
+ port = new Pgsm_bs(PORT_TYPE_GSM_BS_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode);
+ else
+#endif
+#ifdef WITH_GSM_MS
+ if (mISDNport->gsm_ms)
+ port = new Pgsm_ms(PORT_TYPE_GSM_MS_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode);
else
-#ifdef WITH_GSM
- port = new Pgsm(PORT_TYPE_GSM_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode);
-#else
- port = NULL;
#endif
+ port = new Pdss1((mISDNport->ntmode)?PORT_TYPE_DSS1_NT_OUT:PORT_TYPE_DSS1_TE_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode);
if (!port)
- FATAL("No memory for Port instance\n");
+ FATAL("Failed to create Port instance\n");
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) got port %s\n", ea_endpoint->ep_serial, port->p_name);
memset(&dialinginfo, 0, sizeof(dialinginfo));
SCPY(dialinginfo.id, e_dialinginfo.id);
port = ss5_hunt_line(mISDNport);
else
#endif
- if (!mISDNport->gsm)
- port = new Pdss1((mISDNport->ntmode)?PORT_TYPE_DSS1_NT_OUT:PORT_TYPE_DSS1_TE_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode);
+#ifdef WITH_GSM_BS
+ if (mISDNport->gsm_bs)
+ port = new Pgsm_bs(PORT_TYPE_GSM_BS_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode);
+ else
+#endif
+#ifdef WITH_GSM_MS
+ if (mISDNport->gsm_ms)
+ port = new Pgsm_ms(PORT_TYPE_GSM_MS_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode);
else
-#ifdef WITH_GSM
- port = new Pgsm(PORT_TYPE_GSM_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode);
-#else
- port = NULL;
#endif
+ port = new Pdss1((mISDNport->ntmode)?PORT_TYPE_DSS1_NT_OUT:PORT_TYPE_DSS1_TE_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode);
if (!port)
FATAL("No memory for Port instance\n");
earlyb = mISDNport->earlyb;
SCPY(dialinginfo.id, number);
dialinginfo.itype = INFO_ITYPE_ISDN;
dialinginfo.ntype = e_dialinginfo.ntype;
+ dialinginfo.sending_complete = e_dialinginfo.sending_complete;
portlist = ea_endpoint->portlist_new(port->p_serial, port->p_type, mISDNport->earlyb);
if (!portlist) {
PERROR("EPOINT(%d) cannot allocate port_list relation\n", ea_endpoint->ep_serial);
ea->new_state(EPOINT_STATE_OUT_SETUP);
/* call special setup routine */
- ea->out_setup();
+ ea->out_setup(0);
return 0;
}
class EndpointAppPBX *ea = (class EndpointAppPBX *)instance;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) call-forward-busy time has expired, calling the forwarded number: %s.\n", ea->ea_endpoint->ep_serial, ea->e_ext.cfnr);
- ea->out_setup();
+ ea->out_setup(1);
return 0;
}
/* epoint is idle, check callback */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) starting callback.\n", ea->ea_endpoint->ep_serial);
ea->new_state(EPOINT_STATE_OUT_SETUP);
- ea->out_setup();
+ ea->out_setup(0);
}
return 0;
/* other calls with no caller id (or not available for the extension) and force colp */
if ((e_connectinfo.id[0]=='\0' || (e_connectinfo.present==INFO_PRESENT_RESTRICTED && !e_ext.anon_ignore))&& e_ext.colp==COLP_FORCE) {
e_connectinfo.ntype = INFO_NTYPE_NOTPRESENT;
- if (portlist->port_type==PORT_TYPE_DSS1_TE_OUT || portlist->port_type==PORT_TYPE_DSS1_NT_OUT || portlist->port_type==PORT_TYPE_GSM_OUT) { /* external extension answered */
+ if (portlist->port_type==PORT_TYPE_DSS1_TE_OUT
+ || portlist->port_type==PORT_TYPE_DSS1_NT_OUT
+ || portlist->port_type==PORT_TYPE_GSM_BS_OUT
+ || portlist->port_type==PORT_TYPE_GSM_MS_OUT) { /* external extension answered */
port = find_port_id(portlist->port_id);
if (port) {
SCPY(e_connectinfo.id, nationalize_callerinfo(port->p_dialinginfo.id, &e_connectinfo.ntype, options.national, options.international));
}
+/* port MESSAGE_PROGRESS */
+void EndpointAppPBX::port_progress(struct port_list *portlist, int message_type, union parameter *param)
+{
+ logmessage(message_type, param, portlist->port_id, DIRECTION_IN);
+
+ struct lcr_msg *message;
+
+ /* signal to call tool */
+ admin_call_response(e_adminid, ADMIN_CALL_PROGRESS, "", 0, param->progressinfo.location, param->progressinfo.progress);
+
+ /* send progress to call if available */
+ if (ea_endpoint->ep_join_id) {
+ message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_PROGRESS);
+ memcpy(&message->param.progressinfo, ¶m->progressinfo, sizeof(struct progress_info));
+ message_put(message);
+ }
+
+}
+
/* port MESSAGE_FACILITY */
void EndpointAppPBX::port_facility(struct port_list *portlist, int message_type, union parameter *param)
{
port_notify(portlist, message_type, param);
break;
+ /* PORT sends a PROGRESS message */
+ case MESSAGE_PROGRESS:
+ PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received progress.\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
+ port_progress(portlist, message_type, param);
+ break;
+
/* PORT sends a SUSPEND message */
case MESSAGE_SUSPEND:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received suspend.\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
new_state(EPOINT_STATE_OUT_SETUP);
/* call special setup routine */
- out_setup();
+ out_setup(0);
}
/* join MESSAGE_mISDNSIGNAL */
break;
}
}
- if ((port->p_type==PORT_TYPE_DSS1_NT_OUT || port->p_type==PORT_TYPE_DSS1_TE_OUT || port->p_type==PORT_TYPE_GSM_OUT)
+ if ((port->p_type==PORT_TYPE_DSS1_NT_OUT
+ || port->p_type==PORT_TYPE_DSS1_TE_OUT
+ || port->p_type==PORT_TYPE_GSM_BS_OUT
+ || port->p_type==PORT_TYPE_GSM_MS_OUT)
&& port->p_state==PORT_STATE_OUT_ALERTING)
if (match_list(extensions, eapp->e_ext.number)) {
found = eapp;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: our port doesn't exist anymore.\n", ea_endpoint->ep_serial);
return;
}
- if ((our_port->p_type&PORT_CLASS_mISDN_MASK) != PORT_CLASS_mISDN_DSS1) {
+ if ((our_port->p_type & PORT_CLASS_mISDN_MASK) != PORT_CLASS_DSS1) {
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: our port is not isdn.\n", ea_endpoint->ep_serial);
return;
}
*errstr = "No Call";
return(1);
}
- if (((*port)->p_type&PORT_CLASS_mISDN_MASK)!=PORT_CLASS_mISDN_DSS1) { /* port is not external isdn */
+ if (((*port)->p_type & PORT_CLASS_mISDN_MASK) != PORT_CLASS_DSS1) { /* port is not external isdn */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) 2nd endpoint has not an external port.\n", ea_endpoint->ep_serial);
*errstr = "No Ext Call";
return(1);
end_trace();
break;
+ case MESSAGE_PROGRESS:
+ switch(param->progressinfo.progress) {
+ case 0x01:
+ logtext = "Call is not end to end ISDN";
+ break;
+ case 0x02:
+ logtext = "Destination address is non-ISDN";
+ break;
+ case 0x03:
+ logtext = "Origination address is non-ISDN";
+ break;
+ case 0x04:
+ logtext = "Call has returned to the ISDN";
+ break;
+ case 0x08:
+ logtext = "In-band info or pattern available";
+ break;
+ default:
+ SPRINT(buffer, "%d", param->progressinfo.progress);
+ logtext = buffer;
+
+ }
+ trace_header("PROGRESS", dir);
+ if (dir == DIRECTION_OUT)
+ add_trace("to", NULL, "CH(%lu)", port_id);
+ if (dir == DIRECTION_IN)
+ add_trace("from", NULL, "CH(%lu)", port_id);
+ add_trace("indicator", NULL, "%s", logtext);
+ switch(param->progressinfo.location) {
+ case LOCATION_USER:
+ add_trace("cause", "location", "0-User");
+ break;
+ case LOCATION_PRIVATE_LOCAL:
+ add_trace("cause", "location", "1-Local-PBX");
+ break;
+ case LOCATION_PUBLIC_LOCAL:
+ add_trace("cause", "location", "2-Local-Exchange");
+ break;
+ case LOCATION_TRANSIT:
+ add_trace("cause", "location", "3-Transit");
+ break;
+ case LOCATION_PUBLIC_REMOTE:
+ add_trace("cause", "location", "4-Remote-Exchange");
+ break;
+ case LOCATION_PRIVATE_REMOTE:
+ add_trace("cause", "location", "5-Remote-PBX");
+ break;
+ case LOCATION_INTERNATIONAL:
+ add_trace("cause", "location", "7-International-Exchange");
+ break;
+ case LOCATION_BEYOND:
+ add_trace("cause", "location", "10-Beyond-Interworking");
+ break;
+ default:
+ add_trace("cause", "location", "%d", param->progressinfo.location);
+ }
+ end_trace();
+ break;
+
case MESSAGE_INFORMATION:
trace_header("INFORMATION", dir);
if (dir == DIRECTION_OUT)