How to forward a call to an outside phone number

I have a simple IVR setup below and I want choice #3 to call an outside phone number and be routed through my PSTN gateway (SIP/SWITCH)



;extension 0001=phone1
exten => 0001,1,Dial(SIP/phone1,20,tr)
exten => 0001,2,VoiceMail,u2096

;extension 0002=phone2
;exten => 0002,1,Dial(SIP/phone2,20,tr)
;exten => 0002,3,VoiceMail,u2097

;Outbound Calls (Must Dial ‘9’)
exten => _9.,1,Dial(SIP/SWITCH/${EXTEN},tr)

;IVR Menu
exten => 617xxxxxxx,1,Answer
exten => 617xxxxxxx,2,SetMusicOnHold(default)
exten => 617xxxxxxx,3,Set(TIMEOUT(digit)=5)
exten => 617xxxxxxx,4,Set(TIMEOUT(response)=10)
exten => 617xxxxxxx,5(restart),Background(greeting)
exten => 617xxxxxxx,6,WaitExten
exten => 617xxxxxxx,7(restart),Background(greeting)

;IVR option 1
exten => 1,1,Background(auth-thankyou)
exten => 1,2,Background(transfer1)
exten => 1,3,Dial(SIP/phone2,10,tr)
exten => 1,4,VoiceMail,u0002

;IVR option 2
exten => 2,1,Background(auth-thankyou)
exten => 2,2,Background(transfer2)
exten => 2,3,VoiceMail,u0002

;IVR option 3
exten => 3,1,Background(auth-thankyou)
exten => 3,2,Background(transfer3)
exten => 3,3,Dial(SIP/SWITCH/${774274****})

;IVR option 4
exten => 4,1,Background(auth-thankyou)
exten => 4,2,Background(transfer4)
exten => 4,3,Dial(SIP/phone1,10,tr)
exten => 4,4,VoiceMail,u0001

I assume you’re asking how to do #3?

To dial via SIP, you need a definition in sip.conf for your provider, then the Dial command refers to that. As an example:

… Dial(SIP/${EXTEN}@dolphin-outbound,30,tr)

is the business end of the context I defined for my SIP connection in my extensions.conf, with “dolphin-outbound” the sip.conf context for the provider.

Hope that helps.