Call Forward Busy

I have an extension dial plan that works fine …

1, Answer()
2, Dial (SIP/12)
3, Hangup()

I would like to dial extension 13 if 12 is busy …

1, Answer()
2, If (SIP/12 is busy) Dial (SIP/13)
3, Dial (SIP/12)
4, Hangup()

Can someone help me with the syntax for line 2?

Thanks

Line 2 doesn’t exist.

You test the status of the call after line 3 and exit. You really need to see exactly what value you are getting for ${HANGUPCAUSE} when the line is busy. You follow that with a Dial for the other number.

Note that your line 4 is redundant, as a successful call will never reach it, and it will be inferred if an unsuccessful one drops off the end of the dialplan.

Good info … thanks for the reply!

So in the following …

1, Answer()
2, Dial (SIP/12)
3. If (SIP/12) is busy, Dial (SIP/13)

What is the syntax for line 3?

You can use ${DIALSTATUS} variable

exten => 12,1,Dial(SIP/${EXTEN},10)
same => n,GotoIf($["${DIALSTATUS}" = “BUSY”]?busy:unavail)
same => n(unavail),Dial(SIP/13,10)
same => n,Hangup()
same => n(busy),Dial(SIP/13,10)
same => n,Hangup()

read http://www.asteriskdocs.org/

Great … thanks! I’ll give it a try.

DIALSTATUS is very coarse, which is why I suggested HANGUPCAUSE. I think you may find that busy status is actually reported as CONGESTION.

I didn’t provide code because:

  1. I don’t know exactly what statuses constitute busy for you;
  2. it would be free consultancy.