Need help with dialplan *1.4

hi,

need some help here…

if my default context has:

[default]
exten => 1102,1,Dial(SIP/1102)

exten => 1103,1,Dial(SIP/1103)

exten => 1989,1,Dial(SIP/1989@EX-UM-1)

exten => s-NOANSWER,1,SIPAddHeader(Diversion: tel:${ARG1};reason=user-busy;screen=no;privacy=off)

When someone calls 1102 and it does not answer or is busy, I need the call to be sent to 1989 with the diversion header.

How do i setup my extensions.conf to do this?

The sip.conf is all setup and working fine.

can’t anyone help me build this dialplan?

I tried :

exten => 1989,1,Dial(SIP/1989@EX-UM-1)

exten => 1102,1,Dial(SIP/1102)
exten => 1102,n,GotoIf($["${DIALSTATUS}" = “CHANUNAVAIL”]?lbl_Untitled_0:)
exten => 1102,n,GotoIf($["${DIALSTATUS}" = “NOANSWER”]?lbl_Untitled_0:)
exten => 1102,n,GotoIf($["${DIALSTATUS}" = “BUSY”]?lbl_Untitled_0:)
exten => 1102,n(lbl_Untitled_0),Transfer(SIP/1989@EX-UM-1)
exten => 1102,n,SIPAddHeader(Diversion: tel:${ARG1};reason=user-busy;screen=no;privacy=off)

Here is what the CLI shows when calling 1102… and 1102 cancels.

-- Executing [1102@default:1] Dial("SIP/1103-0000005f", "SIP/1102") in new stack -- Called 1102 -- SIP/1102-00000060 is ringing -- SIP/1102-00000060 is ringing -- SIP/1102-00000060 is ringing -- Got SIP response 486 "Busy Here" back from 10.98.5.162 -- SIP/1102-00000060 is busy == Everyone is busy/congested at this time (1:1/0/0) -- Executing [1102@default:2] GotoIf("SIP/1103-0000005f", "0?lbl_Untitled_0:") in new stack -- Executing [1102@default:3] GotoIf("SIP/1103-0000005f", "0?lbl_Untitled_0:") in new stack -- Executing [1102@default:4] GotoIf("SIP/1103-0000005f", "1?lbl_Untitled_0:") in new stack -- Goto (default,1102,5) -- Executing [1102@default:5] Transfer("SIP/1103-0000005f", "SIP/1989@EX-UM-1") in new stack -- Executing [1102@default:6] SIPAddHeader("SIP/1103-0000005f", "Diversion: <tel:>;reason=user-busy;screen=no;privacy=off") in new stack == Auto fallthrough, channel 'SIP/1103-0000005f' status is 'BUSY'

Implementation of the Transfer application is minimal. I wouldn’t rely on addheader working, even prior to answer. Error handling post answer is essentially broken. I would suggest using Dial rather than Transfer.

Calling addheader after transferring (or dialing) obviously isn’t going to do anything.

Your GotoIf’s don’t do anything useful, as they lead to the same place that you get to if none of them match.

I made some changes as per a coleague of mine, but this still does not work:

[default]

exten => 1102,1,Dial(SIP/1102,5)
exten => 1102,2,GoTo(1989)
exten => 1103,1,Dial(SIP/1103,5)
exten => 1103,2,GoTo(1989)

exten => 1989,1,SIPAddHeader(Diversion: sip:1103@10.98.6.5;reason=user-busy;screen=no;privacy=off)
exten => 1989,2,Dial(SIP/1989@EX-UM-1)

Nevermind,

I got it working with the bellow:

[default]

exten => _XXXX,1,Dial(SIP/${EXTEN},5)
exten => _XXXX,n,SIPAddHeader(Diversion: sip:${EXTEN}@10.98.6.5;reason=user-busy;screen=no;privacy=off)
exten => _XXXX,n,Dial(SIP/1989@EX-UM-1)

NOTE: This actualy goes through a session boarder controller which handles the UDP to TCP conversion and properly handles the 302 from the UM that goes to 5065, 5066 or 5067