Help with forwarding a call

I’m in the middle of Asterisk Essentials, but, I need some help at the moment.

I’ve paid for and am in the process of running through the online course,but, I have a small real world issue at hand. I work for a small wisp that offers voip phones for customers. I have just taken over as network admin,and, that includes running asterisk. So, I’m learning the ropes here as I go.

One of our customers gets a phone call,but, he is already on that line. So, instead of it beeping in on him he wants it to ring the other extension. My, simple work around was to make it only ring for 15 seconds on the first line, then go to the next. But, he wants it to skip the first one altogether if he is already speaking with someone.

Can I get a hand here?


An elegant way is to get ${DIALSTATUS} .

exten => 1234,1,Dial(SIP/1234,15) same => n,GotoIf($["${DIALSTATUS}" != "ANSWER"]?cell:hang) same => n(cell),Dial(SIP/voiptrunk/1234-cellular-number,15) same => n(hang),Hangup

So, if the status of a call to 1234 extension is not “ANSWER”, go further - dial some cell number (or some other local extension, Dial(SIP/5678,15))

About DIALSTATUS variable: … DIALSTATUS … ation_Dial

Maybe DEVICE_STATE will be more convenient for you: … VICE_STATE

I found that the solution was incredibly simple. Turn off call waiting on his end. That makes asterisk move on to the next extension if he is already on the line. I was simply over complicating things.

Thanks for the response though!

DIALSTATUS will never be ANSWER (or ANSWERED) as you haven’t set the option that causes successful calls to continue in the dialplan. If you are not doing detailed checking of DIALSTATUS, just having a sequence of calls of Dial will do the same.