Want to setup Asterisk to dialout when incoming call arrives

I have a single SIP account which allows as many incoming and outgoing calls as I want. I have tested this by dialing an outgoing call on my X-Lite program into the Asterisk server to a external phone number, and then at the same time dialing in and getting the voice mail.

What I want to happen is dial an internal sip phone, and also dial an external phone number and whichever phone answers gets the call. Right now if the internal SIP phone answers the incoming call, it works perfectly. The external phone rings, and answers, but I can hear nothing at either end. I can call the external phone perfectly if I dial it from the internal SIP phone though…

Here is the pertinent part of the config:
register => :@/1000


TRUNK=SIP/ ; Trunk interface
exten => 1001, 1, Dial(SIP/ext1001,20,u)
exten => 1001, 2, Voicemail(1001,u)
exten => 1002, 1, Dial(SIP/ext1002,20,u)
exten => 1002, 2, Voicemail(1002,u)

exten => 1000,1,Set(GROUP(${EXTEN})=incoming)
exten => 1000,2,noop( ${GROUP_COUNT(incoming@${EXTEN})} )
;set concurrent call limit here
exten => 1000,3,GotoIf($[${GROUP_COUNT(incoming@${EXTEN})} > 2 ]?333)
exten => 1000,4,Dial(SIP/ext1001&${TRUNK}/,30,R)
exten => 1000,5,Voicemail(1001,u)
exten => 1000,6,Hangup()
exten => 1000,333,Busy()
include => extensions

exten => 8500,1,VoicemailMain
exten => _91NXXNXXXXXX,1,Dial(${TRUNK}/${EXTEN:1})
include = extensions

Here is the verbose logfile.
– Executing [1000@default:1] Set(“SIP/R354450-081a1050”, “GROUP(1000)=incoming”) in new stack
– Executing [1000@default:2] NoOp(“SIP/R354450-081a1050”, " 1 ") in new stack
– Executing [1000@default:3] GotoIf(“SIP/R354450-081a1050”, “0?333”) in new stack
– Executing [1000@default:4] Dial(“SIP/R354450-081a1050”, “SIP/ext1001&SIP/R354450/508xxxxxxx|30|R”) in new stack
– Called ext1001
– Called R354450/5087333124
– SIP/ext1001-081a7f78 is ringing
– Got SIP response 480 “Temporarily Unavailable” back from
– SIP/ext1001-081a7f78 is circuit-busy
– Unregistered SIP ‘ext1001’
– SIP/R354450-081ac2f8 is ringing
– SIP/R354450-081ac2f8 is making progress passing it to SIP/R354450-081a1050
– SIP/R354450-081ac2f8 answered SIP/R354450-081a1050
– Packet2Packet bridging SIP/R354450-081a1050 and SIP/R354450-081ac2f8
== Spawn extension (default, 1000, 4) exited non-zero on ‘SIP/R354450-081a1050’

Thoughts? I wanted to do this if possible, but I guess I am just missing something real stupid.


I have since tried a second SIP account from the same company. So I am receiving a call on SIP account #1, and attempting to connect it to a phone dialed out on account #2.

This does not work either.

Can anybody help me here, as I am trying to get this to work?




try adding canreinvite=no to the general section of the sip.conf and see.

Also it maybe that your supplier doesnt allow calls to be hairpined.

try answering a call and then transfering it to an external number.