Busy toned in called number. Jump to next FXO Channel

Hello everyone, I have a little problem that I want to share and see if someone can give me a hand on this. Here it goes.
I have a system with 4 FXO lines, and couple of IP phones connected to the server, the company that provides us with the analog lines for the FXO ports is a low quality company and most of the time when a call is made in one of the ports a busy tone is heard and then you have to keep trying until the call gets through. What is needed to do is to fix the dialplan that if it sense a busy tone in the called line to jump to the next FXO channel. How can I accomplish this.

Thanks in advance.

Nest the dial command like:


; Check the availability of dahdi/1 and dahdi/2:
exten => 123,1,ChanIsAvail(dahdi/1&dahdi/2,j)

; As an exception, using priority jumping, because we want to announce
; something to the caller if no channel is available

; at least one channel is available - dial this channel:
exten => 123,2,NoOp(${AVAILORIGCHAN} is available)
exten => 123,3,Dial(${AVAILORIGCHAN}/123456)

; if the call goes to priority 102 landen, neither dahdi/1 nor dahdi/2 is available
exten => 123,102,Playback(all-channels-busy)

the-asterisk-book.com/1.6/applik … avail.html

I think you mean congestions, rather than busy.

If they are a poor provider, they probably don’t offer answer supervision, either, in which case the call is already connected through by the time the tone is presented. Although there are some provisions to detect end of call from tones, Asterisk will consider the call to have succeeeded.

In any case, if you are getting congestion, why is an immediate redial likely to succeed?

The real answer is a better network operator.

You could look to see if any of the applications currently available offer suitable tone detection, and then use the G option on Dial, and only actually invoke Bridge if you think you have a valid answer.

thanks everybody for getting the time to answer.

David55 you did make a valid observation, the called is treated as successful by asterisk even though the line was busy, how can I check if the provider has “answer supervision” enabled. Also in the case they do not provide answer supervision, what are my options to surpass this problem, actually I have many lines with the same provider because for good or bad is the only one available, and I have to solve this problem. Please advise what could be the best option.

Thanks in advance.

Usually you force the disconnect with busydetect & busycount

But busydetect only applies after the call has been treated as successful.

For answer supervision, you should ask the service provider, or read their technical specification for the service they provide. Otherwise, you will just have to try every answer detection option in turn (I’m not sure if current versions support more than line reversal). If you get it wrong, the call will always appear to be unanswered.