From a24ae098bdd5dd4687d984095c18acc284b6ab26 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sun, 28 Nov 2010 08:53:32 +0100 Subject: Fixed channel selection on outgoing calls on NT-mode multipoint On a multipoint bus, it is required to assign a channel with no other alternative allowed. This is required, because an individual phone on the bus may not choose a different channel, while other phones accept the indicated channel. Also an individual phone does not have the information about other available channels. On a point-to-point configuration it is possible anyway. In this multipoint case, the channel assignment is now forced automatically, even if the 'force' keyword is not specified in the "out-channel" of interface.conf. Additionally "lcradmin portinfo" shows the channel selection settings now. --- socket_server.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'socket_server.c') diff --git a/socket_server.c b/socket_server.c index 47626c4..e84fa5e 100644 --- a/socket_server.c +++ b/socket_server.c @@ -740,6 +740,7 @@ int admin_state(struct admin_queue **responsep) struct interface *interface; struct interface_port *ifport; struct mISDNport *mISDNport; + struct select_channel *selchannel; int i; int num; int anybusy; @@ -872,7 +873,40 @@ int admin_state(struct admin_queue **responsep) response->am[num].u.i.slip_rx = mISDNport->slip_rx; /* channels */ response->am[num].u.i.channels = mISDNport->b_num; - /* channel info */ + /* channel selection */ + selchannel = ifport->out_channel; + if (ifport->channel_force) + SCAT(response->am[num].u.i.out_channel, "force"); + while (selchannel) { + if (response->am[num].u.i.out_channel[0]) + SCAT(response->am[num].u.i.out_channel, ","); + switch (selchannel->channel) { + case CHANNEL_NO: + SCAT(response->am[num].u.i.out_channel, "no"); + break; + case CHANNEL_ANY: + SCAT(response->am[num].u.i.out_channel, "any"); + break; + case CHANNEL_FREE: + SCAT(response->am[num].u.i.out_channel, "free"); + break; + default: + SPRINT(strchr(response->am[num].u.i.out_channel, '\0'), "%d", selchannel->channel); + } + selchannel = selchannel->next; + } + selchannel = ifport->in_channel; + while (selchannel) { + switch (selchannel->channel) { + case CHANNEL_FREE: + SCAT(response->am[num].u.i.in_channel, "free"); + break; + default: + SPRINT(strchr(response->am[num].u.i.in_channel, '\0'), "%d", selchannel->channel); + } + selchannel = selchannel->next; + } + /* channel state */ i = 0; anybusy = 0; while(i < mISDNport->b_num) { -- cgit v1.2.3-55-g7522