New Version 1.6
[lcr.git] / joinpbx.cpp
index 5c686dc..dd54e9b 100644 (file)
@@ -525,7 +525,7 @@ int joinpbx_countrelations(unsigned int join_id)
        if (!join)
                return(0);
 
        if (!join)
                return(0);
 
-       if (join->j_type != JOIN_TYPE_REMOTE)
+       if (join->j_type == JOIN_TYPE_REMOTE)
                return(2);
 
        if (join->j_type != JOIN_TYPE_PBX)
                return(2);
 
        if (join->j_type != JOIN_TYPE_PBX)
@@ -635,6 +635,9 @@ void JoinPBX::message_epoint(unsigned int epoint_id, int message_type, union par
                return;
        }
 
                return;
        }
 
+       /* count relations */
+       num=joinpbx_countrelations(j_serial);
+
        /* process party line */
        if (message_type == MESSAGE_SETUP) if (param->setup.partyline && !j_partyline) {
                j_partyline = param->setup.partyline;
        /* process party line */
        if (message_type == MESSAGE_SETUP) if (param->setup.partyline && !j_partyline) {
                j_partyline = param->setup.partyline;
@@ -783,7 +786,12 @@ void JoinPBX::message_epoint(unsigned int epoint_id, int message_type, union par
                                release(j_relation, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL);
                                return; // must return, because join IS destroyed
                        }
                                release(j_relation, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL);
                                return; // must return, because join IS destroyed
                        }
-                       /* remove all relations that are in called */
+                       /* in a conf, we don't kill the other members */
+                       if (num > 2) {
+                               release(relation, 0, 0);
+                               return;
+                       }
+                       /* remove all relations that are of called type */
                        release_again2:
                        reltemp = j_relation;
                        while(reltemp) {
                        release_again2:
                        reltemp = j_relation;
                        while(reltemp) {
@@ -809,9 +817,6 @@ void JoinPBX::message_epoint(unsigned int epoint_id, int message_type, union par
                return; // must return, because join may be destroyed
        }
 
                return; // must return, because join may be destroyed
        }
 
-       /* count relations */
-       num=joinpbx_countrelations(j_serial);
-
        /* check number of relations */
        if (num > 2) {
                PDEBUG(DEBUG_JOIN, "join has more than two relations so there is no need to send a message.\n");
        /* check number of relations */
        if (num > 2) {
                PDEBUG(DEBUG_JOIN, "join has more than two relations so there is no need to send a message.\n");