summaryrefslogtreecommitdiffstats
path: root/joinpbx.cpp
diff options
context:
space:
mode:
authorSuper User2007-08-24 08:39:42 +0200
committerSuper User2007-08-24 08:39:42 +0200
commitf1eb0ea3cc77016f59843055c28d7c5c76767623 (patch)
treeec3ade42ffd631bb1952f47342746a4dfc79ca26 /joinpbx.cpp
parentfix, work (diff)
downloadlcr-f1eb0ea3cc77016f59843055c28d7c5c76767623.tar.gz
lcr-f1eb0ea3cc77016f59843055c28d7c5c76767623.tar.xz
lcr-f1eb0ea3cc77016f59843055c28d7c5c76767623.zip
fixed partyline-conference handling
Diffstat (limited to 'joinpbx.cpp')
-rw-r--r--joinpbx.cpp79
1 files changed, 51 insertions, 28 deletions
diff --git a/joinpbx.cpp b/joinpbx.cpp
index 6d8b1b9..406d9e8 100644
--- a/joinpbx.cpp
+++ b/joinpbx.cpp
@@ -698,6 +698,57 @@ void JoinPBX::message_epoint(unsigned long epoint_id, int message_type, union pa
return;
}
+ /* process party line */
+ if (message_type == MESSAGE_SETUP) if (param->setup.partyline)
+ {
+ j_partyline = param->setup.partyline;
+ }
+ if (j_partyline)
+ {
+ switch(message_type)
+ {
+ case MESSAGE_SETUP:
+ PDEBUG(DEBUG_JOIN, "respsone with connect in partyline mode.\n");
+ relation->type = RELATION_TYPE_CONNECT;
+ message = message_create(j_serial, epoint_id, JOIN_TO_EPOINT, MESSAGE_CONNECT);
+ SPRINT(message->param.connectinfo.id, "%d", j_partyline);
+ message->param.connectinfo.ntype = INFO_NTYPE_UNKNOWN;
+ message_put(message);
+ j_updatebridge = 1; /* update bridge flag */
+ break;
+
+ case MESSAGE_AUDIOPATH:
+ PDEBUG(DEBUG_JOIN, "join received channel message: %d.\n", param->audiopath);
+ if (relation->channel_state != param->audiopath)
+ {
+ relation->channel_state = param->audiopath;
+ j_updatebridge = 1; /* update bridge flag */
+ if (options.deb & DEBUG_JOIN)
+ joinpbx_debug(this, "Join::message_epoint{after setting new channel state}");
+ }
+ break;
+
+ case MESSAGE_DISCONNECT:
+ PDEBUG(DEBUG_JOIN, "releasing after receiving disconnect, because join in partyline mode.\n");
+ message = message_create(j_serial, epoint_id, JOIN_TO_EPOINT, MESSAGE_RELEASE);
+ message->param.disconnectinfo.cause = CAUSE_NORMAL;
+ message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
+ message_put(message);
+ // fall through
+
+ case MESSAGE_RELEASE:
+ PDEBUG(DEBUG_JOIN, "releasing from join\n");
+ release(relation, 0, 0);
+ break;
+
+ default:
+ PDEBUG(DEBUG_JOIN, "ignoring message, because join in partyline mode.\n");
+ }
+ return;
+ }
+
+
+ /* process messages */
switch(message_type)
{
/* process audio path message */
@@ -826,34 +877,6 @@ void JoinPBX::message_epoint(unsigned long epoint_id, int message_type, union pa
return; // must return, because join may be destroyed
}
- /* process party line */
- if (message_type == MESSAGE_SETUP) if (param->setup.partyline)
- {
- PDEBUG(DEBUG_JOIN, "respsone with connect in partyline mode.\n");
- j_partyline = param->setup.partyline;
- message = message_create(j_serial, epoint_id, JOIN_TO_EPOINT, MESSAGE_CONNECT);
- message->param.setup.partyline = j_partyline;
- message_put(message);
- j_updatebridge = 1; /* update bridge flag */
- }
- if (j_partyline)
- {
- if (message_type == MESSAGE_DISCONNECT)
- {
- PDEBUG(DEBUG_JOIN, "releasing after receiving disconnect, because join in partyline mode.\n");
- message = message_create(j_serial, epoint_id, JOIN_TO_EPOINT, MESSAGE_RELEASE);
- message->param.disconnectinfo.cause = CAUSE_NORMAL;
- message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
- message_put(message);
- return;
- }
- }
- if (j_partyline)
- {
- PDEBUG(DEBUG_JOIN, "ignoring message, because join in partyline mode.\n");
- return;
- }
-
/* count relations */
num=joinpbx_countrelations(j_serial);