[resolved] rollover lines

We have a PRI with multiple TNs on it. In one particular case, I need to create a “rollover group.” By this I mean we’ll have calls coming in on a TN and then have it ring on lines on an Audiocodes box that has 8 FXS ports on it. What I need to do is to try dialing line 1 on the audiocodes - if it is busy, try line 2, if it is busy, try line 3, etc, until we get a line that is not busy. these lines are all connected to a key system.

I had to do something like this not too long ago.

I just had:

[code]exten => s,1,Dial(Zap/1)
exten => s,n,Dial(Zap/2)
exten => s,n,Dial(zap/3)

exten => s,n,Busy
[/code]

This will dial the first Zap channel, if it is busy, it goes to the next and so on until you run out (in your case 3), at that point it gives the caller a busy signal.

You may need to adjust your Dial statements. In my case, I was dialing a legacy PBX through a PRI, so my dial statement actually read:

where g1 was the PRI and 168 was the extension on the legacy PBX.

So if you leave out the optional number-of-seconds-to-ring, it will return immediately if busy?

After I posted this, I read up on the application ChanIsAvail. You call it with all the channels you wish to ring and it sets the variable AVAILCHAN to the first unused channel. Option j tells it to add 101 to the priority if none of the channels are available. I haven’t tested it yet, but this is what I created.

exten => 1000, 1, Answer
exten => 1000, 2, ChanIsAvail(SIP/100&SIP/200&SIP/300&SIP/400|js)
exten => 1000, 3, Dial(${AVAILCHAN})
exten => 1000, 4,Hangup()
exten => 1000, 103,Congestion()
exten => 1000, 104,Hangup()

That looks like it will work, too. That will work better if you want to transfer to Asterisk’s voicemail or something else if no one answers. In my case, I didn’t need to do any of that. When the first was busy, it just fell through the next. It is possible that in my config, if we had hung up, it might have dialed the next extension in line as long as the caller did not hang up. In my case, this wasn’t really an issue. This was just a temporary solution.

Your config looks to be more of a better solution.