int l3_id;
int i;
struct misdn_stack *stack=get_stack_by_bc(bc);
- int free_chan;
if (stack->nt) {
- free_chan = find_free_chan_in_stack(stack, bc, bc->channel_preselected?bc->channel:0);
- if (!free_chan) return -1;
+ if (!find_free_chan_in_stack(stack, bc, bc->channel_preselected ? bc->channel : 0))
+ return -1;
/*bc->channel=free_chan;*/
- cb_log(4,stack->port, " --> found channel: %d\n",free_chan);
+ cb_log(4,stack->port, " --> found channel: %d\n", bc->channel);
for (i=0; i <= MAXPROCS; i++)
if (stack->procids[i]==0) break;
} else {
if (stack->ptp || bc->te_choose_channel) {
/* we know exactly which channels are in use */
- free_chan = find_free_chan_in_stack(stack, bc, bc->channel_preselected?bc->channel:0);
- if (!free_chan) return -1;
+ if (!find_free_chan_in_stack(stack, bc, bc->channel_preselected ? bc->channel : 0))
+ return -1;
/*bc->channel=free_chan;*/
- cb_log(2,stack->port, " --> found channel: %d\n",free_chan);
+ cb_log(2,stack->port, " --> found channel: %d\n", bc->channel);
} else {
/* other phones could have made a call also on this port (ptmp) */
bc->channel=0xff;
{
if (bc->channel == 0xff) {
- bc->channel=find_free_chan_in_stack(stack, bc, 0);
- if (!bc->channel) {
+ if (!find_free_chan_in_stack(stack, bc, 0)) {
cb_log(0, stack->port, "Any Channel Requested, but we have no more!!\n");
break;
}
bc->l3_id=hh->dinfo;
if (bc->channel<=0) {
- bc->channel=find_free_chan_in_stack(stack,0,0);
-
- if (bc->channel<=0)
+ if (!find_free_chan_in_stack(stack, bc, 0))
goto ERR_NO_CHANNEL;
}
}
} else {
- bc->channel = find_free_chan_in_stack(stack, bc, 0);
- if (!bc->channel) {
+ if (!find_free_chan_in_stack(stack, bc, 0)) {
cb_log(0, stack->port, " No free channel at the moment\n");
msg_t *dmsg;
if (stack->nt) {
if (bc->channel <=0 ) { /* else we have the channel already */
- bc->channel = find_free_chan_in_stack(stack, bc, 0);
- if (!bc->channel) {
+ if (!find_free_chan_in_stack(stack, bc, 0)) {
cb_log(0, stack->port, " No free channel at the moment\n");
err=-ENOCHAN;
"\t yes (= 4 seconds)\n"
"\t no (= 0 seconds = disabled)" },
{ "nttimeout", MISDN_CFG_NTTIMEOUT, MISDN_CTYPE_BOOL, "no", NONE ,
- "Set this to yes if you want calls disconnected in overlap mode"
- "when a timeout happens.\n"},
+ "Set this to yes if you want calls disconnected in overlap mode\n"
+ "\twhen a timeout happens." },
{ "msns", MISDN_CFG_MSNS, MISDN_CTYPE_MSNLIST, NO_DEFAULT, NONE,
"MSN's for TE ports, listen on those numbers on the above ports, and\n"
"\tindicate the incoming calls to Asterisk.\n"