X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=joinpbx.cpp;h=988ba24280933fbbeb17277b19d432f617b7d8e0;hp=a98765f9810ef69316a4e2265b842a7b82de0f62;hb=a698197188e22f42a5483bcb775f66522863d871;hpb=877a2dfd52782f72ba2d28483212166f2326b1fa diff --git a/joinpbx.cpp b/joinpbx.cpp index a98765f..988ba24 100644 --- a/joinpbx.cpp +++ b/joinpbx.cpp @@ -368,10 +368,11 @@ void JoinPBX::bridge(void) /* * Bridge between port instances if: + * - two or more relations * - one or all are not mISDN */ message = message_create(j_serial, relation->epoint_id, JOIN_TO_EPOINT, MESSAGE_BRIDGE); - message->param.bridge_id = j_serial; + message->param.bridge_id = (relations>=2 && !allmISDN) ? j_serial : 0; PDEBUG(DEBUG_JOIN, "join%u EP%u requests bridge=%u\n", j_serial, relation->epoint_id, message->param.bridge_id); message_put(message); @@ -498,9 +499,6 @@ int joinpbx_countrelations(unsigned int join_id) if (!join) return(0); - if (join->j_type == JOIN_TYPE_REMOTE) - return(2); - if (join->j_type != JOIN_TYPE_PBX) return(0); joinpbx = (class JoinPBX *)join; @@ -691,7 +689,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); @@ -917,8 +915,7 @@ int JoinPBX::out_setup(unsigned int epoint_id, int message_type, union parameter epoint = new Endpoint(0, j_serial); if (!epoint) FATAL("No memory for Endpoint instance\n"); - if (!(epoint->ep_app = new DEFAULT_ENDPOINT_APP(epoint, 1))) // outgoing - FATAL("No memory for Endpoint Application instance\n"); + epoint->ep_app = new_endpointapp(epoint, 1, EAPP_TYPE_PBX); // outgoing relation->epoint_id = epoint->ep_serial; /* send setup message to new endpoint */ //printf("JOLLY DEBUG: %d\n",join_countrelations(j_serial));