Automatically use a free analog line for outbound call

Hi, there

I am wondering in general what should I do to make the following happen

  • I will have 4 analog phone lines from AT&T
  • I will have a TDM410 based card with 4 FXO ports to connect these 4 phone lines
  • I will have my people in the office to use SIP phone to share across these 4 AT&T phone lines

My question is that, let’s say, when someone is on the call using one phone line, and other people would like to make an outbound call, where Asterisk can automatically detect the available or the free phone lines to make the outbound call?

  • I have made some basic FXO port and Zap channel working, but would like to understand more what it takes to complete such a setup.

  • Please give me some high level direction about where I should change and I will dig through it.

Many thanks for your help

All you need to do is put each port into a group.

channel=> 1-4

Then when you use the dial command, address the group instead of the zap channel itself.

exten => s,1,Dial(Zap/g2/5551234) ; Dial 5551234 on the first available channel in group 2

Depending on how you address the group, the Dial() command will choose lines differently.

g: select the lowest-numbered non-busy Zap channel (aka. ascending sequential hunt group).
G: select the highest-numbered non-busy Zap channel (aka. descending sequential hunt group).
r: use a round-robin search, starting at the next highest channel than last time (aka. ascending rotary hunt group).
R: use a round-robin search, starting at the next lowest channel than last time (aka. descending rotary hunt group).

Check here for more about the Dial() command, and zap channel addressing. … lingaGroup

Great!! Appreciate your help very much.