return;
if ((port->p_type & PORT_CLASS_POTS_MASK) == PORT_CLASS_POTS_FXS)
join_join_fxs();
- else if ((port->p_type & PORT_CLASS_mISDN_MASK) == PORT_CLASS_DSS1) {
+ else if ((port->p_type & PORT_CLASS_mISDN_MASK) == PORT_CLASS_DSS1
+ || (port->p_type & PORT_CLASS_GSM_MASK) == PORT_CLASS_GSM_BS) {
rc = join_join_dss1(param->transfer.invoke_id);
if (rc < 0) {
}
-/* join calls (look for a join that is on hold (same isdn interface/terminal))
+/* join calls (look for a join that is on hold (same isdn/gsm interface/terminal))
*/
int EndpointAppPBX::join_join_dss1(int invoke_id)
{
-#ifdef WITH_MISDN
struct lcr_msg *message;
struct join_relation *add_relation, *remove_relation;
struct join_relation **add_relation_pointer, **remove_relation_pointer;
class JoinPBX *our_joinpbx, *other_joinpbx, *add_joinpbx, *remove_joinpbx;
class EndpointAppPBX *other_eapp, *remove_eapp_hold, *remove_eapp_active;
class Port *our_port, *other_port;
- class Pdss1 *our_pdss1, *other_pdss1;
+#ifdef WITH_MISDN
+ class Pdss1 *our_pdss1 = NULL, *other_pdss1;
+#endif
+#ifdef WITH_GSM_BS
+ class Pgsm_bs *our_gsm_bs = NULL, *other_gsm_bs;
+#endif
class Endpoint *temp_epoint;
/* are we a candidate to join a join? */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: we have no port.\n", ea_endpoint->ep_serial);
return -1;
}
- if (!e_ext.number[0]) {
- PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: we are not internal extension.\n", ea_endpoint->ep_serial);
- return -1;
- }
our_port = find_port_id(ea_endpoint->ep_portlist->port_id);
if (!our_port) {
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: our port doesn't exist anymore.\n", ea_endpoint->ep_serial);
return -1;
}
- 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 -1;
- }
- our_pdss1 = (class Pdss1 *)our_port;
+#ifdef WITH_MISDN
+ if ((our_port->p_type & PORT_CLASS_mISDN_MASK) == PORT_CLASS_DSS1)
+ our_pdss1 = (class Pdss1 *)our_port;
+#endif
+#ifdef WITH_GSM_BS
+ if ((our_port->p_type & PORT_CLASS_GSM_MASK) == PORT_CLASS_GSM_BS)
+ our_gsm_bs = (class Pgsm_bs *)our_port;
+#endif
/* find an endpoint that has the same mISDNport/ces that we are on */
other_eapp = apppbx_first;
continue;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint candiate: (ep%d) terminal='%s' port=%s join=%d.\n", ea_endpoint->ep_serial, other_eapp->ea_endpoint->ep_serial, other_eapp->e_ext.number, (other_eapp->ea_endpoint->ep_portlist)?"YES":"NO", other_eapp->ea_endpoint->ep_join_id);
- if (other_eapp->e_ext.number[0] /* has terminal */
- && other_eapp->ea_endpoint->ep_portlist /* has port */
+ if (other_eapp->ea_endpoint->ep_portlist /* has port */
&& other_eapp->ea_endpoint->ep_join_id) { /* has join */
other_port = find_port_id(other_eapp->ea_endpoint->ep_portlist->port_id);
if (other_port) { /* port still exists */
- if (other_port->p_type==PORT_TYPE_DSS1_NT_OUT
- || other_port->p_type==PORT_TYPE_DSS1_NT_IN) { /* port is isdn nt-mode */
+#ifdef WITH_MISDN
+ if (our_pdss1
+ && (other_port->p_type==PORT_TYPE_DSS1_NT_OUT
+ || other_port->p_type==PORT_TYPE_DSS1_NT_IN)) { /* port is isdn nt-mode */
other_pdss1 = (class Pdss1 *)other_port;
- PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port is of type isdn! comparing our portnum=%d with other's portnum=%d hold=%s ces=%d\n", ea_endpoint->ep_serial, our_pdss1->p_m_mISDNport->portnum, other_pdss1->p_m_mISDNport->portnum, (other_pdss1->p_m_hold)?"YES":"NO", other_pdss1->p_m_d_ces);
- if (1 //other_pdss1->p_m_hold /* port is on hold */
+ PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port is of type isdn! comparing our portnum=%d with other's portnum=%d hold=%s ces=%d\n", ea_endpoint->ep_serial, our_pdss1->p_m_mISDNport->portnum, other_pdss1->p_m_mISDNport->portnum, (other_pdss1->p_hold)?"YES":"NO", other_pdss1->p_m_d_ces);
+ if (1 //other_pdss1->p_hold /* port is on hold */
&& other_pdss1->p_m_mISDNport == our_pdss1->p_m_mISDNport /* same isdn interface */
&& other_pdss1->p_m_d_ces == our_pdss1->p_m_d_ces) /* same tei+sapi */
break;
- } else {
+ } else
+#endif
+#ifdef WITH_GSM_BS
+ if (our_gsm_bs
+ && (other_port->p_type==PORT_TYPE_GSM_BS_OUT
+ || other_port->p_type==PORT_TYPE_GSM_BS_IN)) { /* port is GSM bs-mode */
+ other_gsm_bs = (class Pgsm_bs *)other_port;
+ PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port is of type GSM! comparing our imsi with other imsi=%s\n", ea_endpoint->ep_serial, our_gsm_bs->p_g_imsi, other_gsm_bs->p_g_imsi);
+ if (!strcmp(other_gsm_bs->p_g_imsi, our_gsm_bs->p_g_imsi)) /* same tei+sapi */
+ break;
+ } else
+#endif
+ {
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port is of other type!\n", ea_endpoint->ep_serial);
}
} else {
}
/* now find out which is ACTIVE-IDLE and which is ACTIVE-HELD */
- if (our_pdss1->p_m_hold && !other_pdss1->p_m_hold) {
+ if (our_port->p_hold && !other_port->p_hold) {
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) our relation is on hold and other is active, so we move our relations to other relations\n", ea_endpoint->ep_serial);
remove_eapp_hold = this;
remove_eapp_active = other_eapp;
/* we send a retrieve to that endpoint */
// mixer will update the hold-state of the join and send it to the endpoints is changes
-#else
- PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: no mISDN support anyway.\n", ea_endpoint->ep_serial);
-#endif
return 0;
}
if (other_port->p_type==PORT_TYPE_POTS_FXS_OUT
|| other_port->p_type==PORT_TYPE_POTS_FXS_IN) { /* port is FXS */
other_fxs = (class Pfxs *)other_port;
- PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port is of type isdn! comparing our portnum=%d with other's portnum=%d hold=%s state=%d\n", ea_endpoint->ep_serial, our_fxs->p_m_mISDNport->portnum, other_fxs->p_m_mISDNport->portnum, (other_fxs->p_m_hold)?"YES":"NO", other_fxs->p_state);
- if (1 //other_fxs->p_m_hold /* port is on hold */
+ PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port is of type isdn! comparing our portnum=%d with other's portnum=%d hold=%s state=%d\n", ea_endpoint->ep_serial, our_fxs->p_m_mISDNport->portnum, other_fxs->p_m_mISDNport->portnum, (other_fxs->p_hold)?"YES":"NO", other_fxs->p_state);
+ if (1 //other_fxs->p_hold /* port is on hold */
&& other_fxs->p_m_mISDNport == our_fxs->p_m_mISDNport) /* same isdn interface */
break;
} else {
}
/* now find out which is ACTIVE-IDLE and which is ACTIVE-HELD */
- if (our_fxs->p_m_hold && !other_fxs->p_m_hold) {
+ if (our_port->p_hold && !other_port->p_hold) {
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) our relation is on hold and other is active, so we move our relations to other relations\n", ea_endpoint->ep_serial);
remove_eapp = this;
remove_join = our_join;
/* we send a retrieve to that endpoint */
// mixer will update the hold-state of the join and send it to the endpoints is changes
+
+ return 0;
#else
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: no mISDN support anyway.\n", ea_endpoint->ep_serial);
-#endif
- return 0;
+ return -1;
+#endif
}
+/* do audio bridge of endpoints on same isdn/gsm terminal */
int EndpointAppPBX::join_3pty_dss1(void)
{
-#ifdef WITH_MISDN
class Join *our_join, *other_join;
class JoinPBX *our_joinpbx, *other_joinpbx;
class EndpointAppPBX *other_eapp;
class Port *our_port, *other_port;
- class Pdss1 *our_pdss1, *other_pdss1;
+#ifdef WITH_MISDN
+ class Pdss1 *our_pdss1 = NULL, *other_pdss1;
+#endif
+#ifdef WITH_GSM_BS
+ class Pgsm_bs *our_gsm_bs = NULL, *other_gsm_bs;
+#endif
/* are we a candidate to join a join? */
our_join = find_join_id(ea_endpoint->ep_join_id);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: we have no port.\n", ea_endpoint->ep_serial);
return -1;
}
- if (!e_ext.number[0]) {
- PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: we are not internal extension.\n", ea_endpoint->ep_serial);
- return -1;
- }
our_port = find_port_id(ea_endpoint->ep_portlist->port_id);
if (!our_port) {
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: our port doesn't exist anymore.\n", ea_endpoint->ep_serial);
return -1;
}
- 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 -1;
- }
- our_pdss1 = (class Pdss1 *)our_port;
+#ifdef WITH_MISDN
+ if ((our_port->p_type & PORT_CLASS_mISDN_MASK) == PORT_CLASS_DSS1)
+ our_pdss1 = (class Pdss1 *)our_port;
+#endif
+#ifdef WITH_GSM_BS
+ if ((our_port->p_type & PORT_CLASS_GSM_MASK) == PORT_CLASS_GSM_BS)
+ our_gsm_bs = (class Pgsm_bs *)our_port;
+#endif
/* find an endpoint that has the same mISDNport/ces that we are on */
other_eapp = apppbx_first;
continue;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint candiate: (ep%d) terminal='%s' port=%s join=%d.\n", ea_endpoint->ep_serial, other_eapp->ea_endpoint->ep_serial, other_eapp->e_ext.number, (other_eapp->ea_endpoint->ep_portlist)?"YES":"NO", other_eapp->ea_endpoint->ep_join_id);
- if (other_eapp->e_ext.number[0] /* has terminal */
- && other_eapp->ea_endpoint->ep_portlist /* has port */
+ if (other_eapp->ea_endpoint->ep_portlist /* has port */
&& other_eapp->ea_endpoint->ep_join_id) { /* has join */
other_port = find_port_id(other_eapp->ea_endpoint->ep_portlist->port_id);
if (other_port) { /* port still exists */
- if (other_port->p_type==PORT_TYPE_DSS1_NT_OUT
- || other_port->p_type==PORT_TYPE_DSS1_NT_IN) { /* port is isdn nt-mode */
+#ifdef WITH_MISDN
+ if (our_pdss1
+ && (other_port->p_type==PORT_TYPE_DSS1_NT_OUT
+ || other_port->p_type==PORT_TYPE_DSS1_NT_IN)) { /* port is isdn nt-mode */
other_pdss1 = (class Pdss1 *)other_port;
- PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port is of type isdn! comparing our portnum=%d with other's portnum=%d hold=%s ces=%d\n", ea_endpoint->ep_serial, our_pdss1->p_m_mISDNport->portnum, other_pdss1->p_m_mISDNport->portnum, (other_pdss1->p_m_hold)?"YES":"NO", other_pdss1->p_m_d_ces);
- if (1 //other_pdss1->p_m_hold /* port is on hold */
+ PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port is of type isdn! comparing our portnum=%d with other's portnum=%d hold=%s ces=%d\n", ea_endpoint->ep_serial, our_pdss1->p_m_mISDNport->portnum, other_pdss1->p_m_mISDNport->portnum, (other_pdss1->p_hold)?"YES":"NO", other_pdss1->p_m_d_ces);
+ if (1 //other_pdss1->p_hold /* port is on hold */
&& other_pdss1->p_m_mISDNport == our_pdss1->p_m_mISDNport /* same isdn interface */
&& other_pdss1->p_m_d_ces == our_pdss1->p_m_d_ces) /* same tei+sapi */
break;
- } else {
+ } else
+#endif
+#ifdef WITH_GSM_BS
+ if (our_gsm_bs
+ && (other_port->p_type==PORT_TYPE_GSM_BS_OUT
+ || other_port->p_type==PORT_TYPE_GSM_BS_IN)) { /* port is GSM bs-mode */
+ other_gsm_bs = (class Pgsm_bs *)other_port;
+ PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port is of type GSM! comparing our imsi with other imsi=%s\n", ea_endpoint->ep_serial, our_gsm_bs->p_g_imsi, other_gsm_bs->p_g_imsi);
+ if (!strcmp(other_gsm_bs->p_g_imsi, our_gsm_bs->p_g_imsi)) /* same tei+sapi */
+ break;
+ } else
+#endif
+ {
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port is of other type!\n", ea_endpoint->ep_serial);
}
} else {
other_eapp = other_eapp->next;
}
if (!other_eapp) {
- PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: no other endpoint on same isdn terminal.\n", ea_endpoint->ep_serial);
+ PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: no other endpoint on same terminal.\n", ea_endpoint->ep_serial);
return -1;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) port with same terminal found.\n", ea_endpoint->ep_serial);
/* we send a retrieve to that endpoint */
// mixer will update the hold-state of the join and send it to the endpoints is changes
-#else
- PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: no mISDN support anyway.\n", ea_endpoint->ep_serial);
-#endif
return 0;
}
+/* do audio bridge of endpoints on same fxs terminal */
int EndpointAppPBX::join_3pty_fxs(void)
{
#ifdef WITH_MISDN
if (other_port->p_type==PORT_TYPE_POTS_FXS_OUT
|| other_port->p_type==PORT_TYPE_POTS_FXS_IN) { /* port is isdn nt-mode */
other_fxs = (class Pfxs *)other_port;
- PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port is of type FXS! comparing our portnum=%d with other's portnum=%d hold=%s state=%d\n", ea_endpoint->ep_serial, our_fxs->p_m_mISDNport->portnum, other_fxs->p_m_mISDNport->portnum, (other_fxs->p_m_hold)?"YES":"NO", other_fxs->p_state);
- if (1 //other_fxs->p_m_hold /* port is on hold */
+ PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port is of type FXS! comparing our portnum=%d with other's portnum=%d hold=%s state=%d\n", ea_endpoint->ep_serial, our_fxs->p_m_mISDNport->portnum, other_fxs->p_m_mISDNport->portnum, (other_fxs->p_hold)?"YES":"NO", other_fxs->p_state);
+ if (1 //other_fxs->p_hold /* port is on hold */
&& other_fxs->p_m_mISDNport == our_fxs->p_m_mISDNport) /* same pots interface */
break;
} else {
/* we send a retrieve to that endpoint */
// mixer will update the hold-state of the join and send it to the endpoints is changes
+
+ return 0;
#else
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: no mISDN support anyway.\n", ea_endpoint->ep_serial);
-#endif
- return 0;
+ return -1;
+#endif
}
+/* split audio bridge */
int EndpointAppPBX::split_3pty(void)
{
-#ifdef WITH_MISDN
class Join *our_join, *other_join;
class JoinPBX *our_joinpbx, *other_joinpbx;
/* we send a retrieve to that endpoint */
// mixer will update the hold-state of the join and send it to the endpoints is changes
-#else
- PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot split: no mISDN support anyway.\n", ea_endpoint->ep_serial);
-#endif
return 0;
}
end_trace();
break;
+ case MESSAGE_ENABLEKEYPAD:
+ trace_header("ENABLEKEYPAD", dir);
+ end_trace();
+ break;
+
default:
PERROR("EPOINT(%d) message not of correct type (%d)\n", ea_endpoint->ep_serial, message_type);
}