Giorgio Incantalupo
2006-Sep-18 01:53 UTC
[asterisk-users] is chanisavail command reliable?
Hi, I have an Asterisk box on a Debian Sarge distro with a Sangoma a102 PRI card and I have a big problem: Asterisk drops a lot of outbound calls. I do not use groups, I want to use a free channel given from Asterisk. What I do is: 1) use "chanisavail" command to ask Asterisk for a free channel to use 2) use that channel to dial outbound calls Asterisk gives me the free channel but when I make a call Asterisk tells me the channel is not available (I check variable ${AVAILSTATUS}). I checked but that channel is not busy on another call. How can it be possible? Is there anybody who can help me? TIA Giorgio Incantalupo
If you have a PRI, why are you telling asterisk which channel to use? why don't you set groups in zapata.conf and just use g1 or the like? On 9/18/06, Giorgio Incantalupo <gincantalupo@fgasoftware.com> wrote:> Hi, > I have an Asterisk box on a Debian Sarge distro with a Sangoma a102 PRI > card and I have a big problem: Asterisk drops a lot of outbound calls. > I do not use groups, I want to use a free channel given from Asterisk. > > What I do is: > 1) use "chanisavail" command to ask Asterisk for a free channel to use > 2) use that channel to dial outbound calls > > Asterisk gives me the free channel but when I make a call Asterisk tells > me the channel is not available (I check variable ${AVAILSTATUS}). I > checked but that channel is not busy on another call. > How can it be possible? Is there anybody who can help me? > > TIA > > > Giorgio Incantalupo > > > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
On Mon, 2006-09-18 at 10:53 +0200, Giorgio Incantalupo wrote:> Hi, > I have an Asterisk box on a Debian Sarge distro with a Sangoma a102 PRI > card and I have a big problem: Asterisk drops a lot of outbound calls. > I do not use groups, I want to use a free channel given from Asterisk. > > What I do is: > 1) use "chanisavail" command to ask Asterisk for a free channel to use > 2) use that channel to dial outbound callsI think this is not a good idea since an inbound call could arrive between 1) and 2) making the channel no longer available (the app isn't named ChanIsAvailAndReserveForOutgoingCall). Use ZAP/g1 (or whatever your group is) - works for me on PRI (both as net and as cpe) - depending on the behaviour of the other side ZAP/G1 could reduce the likelihood of the same channel being used by both sides. -- Dr. Michael Neuhauser mailto:mike@firmix.at Firmix Software GmbH sip:mike@firmix.at Vienna/Austria/Europe tel:+43-1-7890849-30 Linux Development and Services http://www.firmix.at/
On Monday 18 September 2006 04:53, Giorgio Incantalupo wrote:> What I do is: > 1) use "chanisavail" command to ask Asterisk for a free channel to use > 2) use that channel to dial outbound callsThe problem is that a race condition exists; the channel could be available at time (1), but something could snag it at time (2). There (currently) is no way to lock a channel after it's been detected as free so that something later could use it. My suggestion isn't to use ChanIsAvail() at all; simply Dial and catch ${DIALSTATUS}, like so: exten => foo,1,Dial(Tech/exten,,g) exten => foo,n,Goto(foo-${DIALSTATUS},1) exten => foo-CHANUNAVAIL,1,NoOp(Nope, wasn't available, gotta do something else...) exten => foo-BUSY,1,NoOp(busy...) exten => foo-NOANSWER,1,NoOp(no answer...) that way there is no race condition. What would maek this better is if you could group a bunch of channels, irrespective of technology, together and dial that group... something like this (assume a groups.conf) 1 => SIP/500, IAX2/user@peer/${EXTEN}, Zap/g1 2 => Zap/1,Zap/3,Zap/5 3 => SIP/${EXTEN}@peer and then do something like this: exten => _NXXNXXXXXX,1,Dial(GROUP/1,,g) which would dial SIP/500, IAX2/user@peer/9165551212 and the first available channel in the Zaptel group 1... (assuming 9165551212 was what matched)... variable expansion would be crucial in this kind of design. :-) -A.> > Asterisk gives me the free channel but when I make a call Asterisk tells > me the channel is not available (I check variable ${AVAILSTATUS}). I > checked but that channel is not busy on another call. > How can it be possible? Is there anybody who can help me? > > TIA > > > Giorgio Incantalupo > > > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users