+
+ # is there one already connected?
+ if (DXChannel->get($call)) {
+ my $mess = DXM::msg('conother', $call);
+ dbg('chan', "-> D $call $mess\n");
+ $conn->send_now("D$call|$mess");
+ sleep(1);
+ dbg('chan', "-> Z $call bye\n");
+ $conn->send_now("Z$call|bye"); # this will cause 'client' to disconnect
+ return;
+ }
+
+ # is there one already connected elsewhere in the cluster?
+ if (DXCluster->get($call)) {
+ my $mess = DXM::msg('concluster', $call);
+ dbg('chan', "-> D $call $mess\n");
+ $conn->send_now("D$call|$mess");
+ sleep(1);
+ dbg('chan', "-> Z $call bye\n");
+ $conn->send_now("Z$call|bye"); # this will cause 'client' to disconnect
+ return;
+ }
+