From ef0eddbfec88fb7ce5f92e2a04ab000ac0fa91d2 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Thu, 19 Jan 2012 09:14:58 +0100 Subject: [PATCH] Fixed 'earlyb' handling mISDN-TE ports receive audio patterns by default again. --- apppbx.cpp | 13 +++++++++++-- joinpbx.cpp | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/apppbx.cpp b/apppbx.cpp index cf6f840..75856d4 100644 --- a/apppbx.cpp +++ b/apppbx.cpp @@ -1006,6 +1006,7 @@ void EndpointAppPBX::out_setup(int cfnr) p = e_ext.interfaces; PDEBUG(DEBUG_EPOINT, "EPOINT(%d) generating multiple joins for extension %s to interfaces %s\n", ea_endpoint->ep_serial, e_dialinginfo.id, p); while(*p) { + earlyb = 0; ifname[0] = '\0'; while(*p!=',' && *p!='\0') if (*p > ' ') @@ -1026,18 +1027,21 @@ void EndpointAppPBX::out_setup(int cfnr) if (interface->gsm_bs) { SPRINT(portname, "%s-%d-out", interface->name, 0); port = new Pgsm_bs(PORT_TYPE_GSM_BS_OUT, portname, &port_settings, interface); + earlyb = (interface->is_earlyb == IS_YES); } else #endif #ifdef WITH_GSM_MS if (interface->gsm_ms) { SPRINT(portname, "%s-%d-out", interface->name, 0); port = new Pgsm_ms(PORT_TYPE_GSM_MS_OUT, portname, &port_settings, interface); + earlyb = (interface->is_earlyb == IS_YES); } else #endif #ifdef WITH_GSM_MS if (interface->sip) { SPRINT(portname, "%s-%d-out", interface->name, 0); port = new Psip(PORT_TYPE_SIP_OUT, portname, &port_settings, interface); + earlyb = (interface->is_earlyb == IS_YES); } else #endif { @@ -1072,6 +1076,7 @@ void EndpointAppPBX::out_setup(int cfnr) port = new Premote(PORT_TYPE_REMOTE_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode, admin->sock); } else 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); + earlyb = mISDNport->earlyb; } if (!port) FATAL("Failed to create Port instance\n"); @@ -1081,7 +1086,7 @@ void EndpointAppPBX::out_setup(int cfnr) dialinginfo.itype = INFO_ITYPE_ISDN_EXTENSION; dialinginfo.ntype = e_dialinginfo.ntype; /* create port_list relation */ - portlist = ea_endpoint->portlist_new(port->p_serial, port->p_type, interface->is_earlyb == IS_YES); + portlist = ea_endpoint->portlist_new(port->p_serial, port->p_type, earlyb); if (!portlist) { PERROR("EPOINT(%d) cannot allocate port_list relation\n", ea_endpoint->ep_serial); delete port; @@ -1259,6 +1264,7 @@ void EndpointAppPBX::out_setup(int cfnr) else p = e_dialinginfo.id; do { + earlyb = 0; number[0] = '\0'; while(*p!=',' && *p!='\0') SCCAT(number, *p++); @@ -1279,18 +1285,21 @@ void EndpointAppPBX::out_setup(int cfnr) if (interface->gsm_bs) { SPRINT(portname, "%s-%d-out", interface->name, 0); port = new Pgsm_bs(PORT_TYPE_GSM_BS_OUT, portname, &port_settings, interface); + earlyb = (interface->is_earlyb == IS_YES); } else #endif #ifdef WITH_GSM_MS if (interface->gsm_ms) { SPRINT(portname, "%s-%d-out", interface->name, 0); port = new Pgsm_ms(PORT_TYPE_GSM_MS_OUT, portname, &port_settings, interface); + earlyb = (interface->is_earlyb == IS_YES); } else #endif #ifdef WITH_GSM_MS if (interface->sip) { SPRINT(portname, "%s-%d-out", interface->name, 0); port = new Psip(PORT_TYPE_SIP_OUT, portname, &port_settings, interface); + earlyb = (interface->is_earlyb == IS_YES); } else #endif { @@ -1325,10 +1334,10 @@ void EndpointAppPBX::out_setup(int cfnr) port = new Premote(PORT_TYPE_REMOTE_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode, admin->sock); } else 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); + earlyb = mISDNport->earlyb; } if (!port) FATAL("No memory for Port instance\n"); - earlyb = (interface->is_earlyb == IS_YES); PDEBUG(DEBUG_EPOINT, "EPOINT(%d) created port %s\n", ea_endpoint->ep_serial, port->p_name); memset(&dialinginfo, 0, sizeof(dialinginfo)); if (e_dialinginfo.keypad[0]) diff --git a/joinpbx.cpp b/joinpbx.cpp index 6440f58..2e2fabf 100644 --- a/joinpbx.cpp +++ b/joinpbx.cpp @@ -691,7 +691,7 @@ void JoinPBX::message_epoint(unsigned int epoint_id, int message_type, union par switch(message_type) { /* process audio path message */ case MESSAGE_AUDIOPATH: - PDEBUG(DEBUG_JOIN, "join received channel message: %d.\n", param->audiopath); + PDEBUG(DEBUG_JOIN, "join received channel message: audiopath=%d, current relation's channel_state=%d\n", param->audiopath, relation->channel_state); if (relation->channel_state != param->audiopath) { relation->channel_state = param->audiopath; trigger_work(&j_updatebridge); -- 2.13.6