Ring in two places?

I’ve got two Aastra 480i s I’m trying to make ring together. One is at the front desk, the other in a work area behind it. The receptionist wants to be able to answer incoming calls at either phone, depending on where she’s standing. Here’s what I have now (and it’s not what I need):

exten => s,1,Dial(SIP/100&SIP/101,${RINGTIME},r)
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s,103,Dial(SIP/200&SIP/201,${RINGTIME},r)
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s,204,Dial(SIP/300&SIP/301,${RINGTIME},r)
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s,305,Dial(SIP/400&SIP/401,${RINGTIME},r)
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,Goto(oper-busy,s,1)
exten => s-CHANUNAVAIL,1,Goto(oper-busy,s,1)
exten => s-BUSY,1,Goto(oper-busy,s,1)

The problem occurs when a second call comes in. That is, the phone the receptionist is using doesn’t ring on a free line, the Dial application just sends the call to the one she’s not using where the same line is free (and it’s a fair distance away).

I think this situation is what’s referred to as a shared or bridged line appearance and we don’t yet have a way to handle it in Asterisk. Correct?

Anybody have a workaround for this situation? If there was an option I could use with Dial that told it to the next exten if any of the peers were busy, I’d be home free.


Have you thought of using a queue? This is how I deal with this situation.


use ring group it will ring all the phone in the group and which ever one answers get’s the call, besure you have a way to park / transfer the call so she can park it / transfer it form anywhere she picks up
also in asterisk you can answer any ring exten form any other exten…


are you assuming that everyone is using FreePBX or a FreePBX-based Asterisk setup ?

I was just at freepbx.org and was here looking for some code…

Really I was asleep…cuz I REALLY should have been at whirlpool…

Not using FreePBX.

Is setting up a queue my best bet?

Personaly I would say so. Then you can also get some stats as well


You could just do:

exten => _X.,1,Dial(SIP/001&SIP/002,60)

Where 001 and 002 are extensions… it’s not advanced, but we use it and it works.


Tried that. The problem is Dial will ring any channel in the list that’s available. So, if our receptionist is talking on (ie line appearance 1) on one phone and a call comes in, the call will ring only on the phone she’s not sitting near (because line appearance 1 isn’t busy there). I need a solution that rings both phones whether or not she is already talking on one. Make sense?

So far, using a queue appears to be the only solution.

I’m looking at some queue examples and it appears as though I’ll be in the same boat if I use them that I am in now using Dial and a list of peers. That is, if each line on each phone is assigned the same weight and one of the lines is in use on one phone, the other phone will be the only one that rings that line number when a call is queued. However, I need the phone that’s in use to ring on the next available line, too.

The queue solution would work great if a person was sitting at each phone. However, this situation has two phones and a single person that may be using either one at a given time. Here’s a use case:

Call comes in
exten => "ring phone 1 line 1 and phone 2 line 1"
user picks up phone 1 line 1 and second call comes in before phone 1 line 1 is hung up
exten => "ring Phone 1 line 2 and Phone 2 line 2 (or phone 2 line 1)"
line one placed on hold, line 2 answered, 3rd call comes in before line 1 or 2 is hung up
exten => “ring Phone 1 line 3 and Phone 2 line 3 (or phone 2 line 1)”


The above should work the same way if you swap phone 1 and phone 2

where do you stop ? 3 lines, 30 lines ?

what about creating a user for each line the phone is capable of supporting and dialling all of them when a call comes in. it’s messy and every free line on the phones will be going, but you’re only talking 2 phones.

you might still need to use a queue though to stop problems with simultaneous incoming calls.

I thought of that, but I was hoping for a solution with a little more finesse.

I can just hear it…“why do all the lines ring for just one call? Our old phone system didn’t do that.” You see, I’m constantly competing with the antiquated KSUs I’ve replaced.

Is there REALLY no way to do what I’m talking about? It appears I’m restricted in two ways. First, I can’t get dial to move to the next priority if even a single channel in the list I pass it is available. Second, I appear to have no reliable way to tell if a SIP channel is occupied already and use such knowledge in deciding where to route a call.

it’s hard getting users to appreciate that their concept of “lines” is defunct, i know, i’ve been there. how about “to make sure you answer it !”. we are only talking 2 phones here.

you can use some intelligence to establish the call, dialparties.agi (from AMP/FreePBX i think) is evidence of this, but you’ll need to integrate the rest of the dialplan to achieve it.

e.g. start with 2 lists of all registered users (1 per “line” on phone), 1 list for each phone. work through each list, establishing whether they are busy (using ASTDB/ChanIsAvail ??). once you have an available channel, either proceed with next list, or exit with list of 2 available channels to call.

bingo, you have a dialstring.

Does ChanIsAvail tell you whether a channel is in use? When I tried using it, it seemed as though it only returned false when the channel was lagged. It was returning true even when there was an active call on the channel. Was it supposed to work that way?

I did end up fixing this, hadn’t posted it yet.

; Find free line on first 480i
exten => 1,1,ChanIsAvail(SIP/100&SIP/200&SIP/300&SIP/400,s)
exten => 1,n,Set(OPX1=${AVAILCHAN:0:7})
; Find free line on second 480i
exten => 1,n,ChanIsAvail(SIP/111&SIP/211&SIP/311&SIP/411,s)
; cat the two and dial
exten => 1,n,Set(OPX1=${OPX1}&${AVAILCHAN:0:7})
exten => 1,n,Dial(${OPX1},${RINGTIME},r)

The above does exactly what I need. In my first attempt to use ChanIsAvail I neglected to use the “s” option.

FYI, using dynamic agents with a queue, and phones that support multiple lines will do the exact same thing.

our agents use eyebeam as their phone, and when they are signed into queue, the queue will send as many calls to them as their call-limit allows. this is great for you, as it would do exactly what you want, but it sucks for us, because we want one simultaneous queue call per agent.

there is a patch to fix this (IMHO) broken behavior, but it won’t be out until 1.4.

in any case, i just wanted to offer this, in case you should ever need/want to try using a queue.