This is my new extensions.conf which seems to have solved the problem
[default]
exten => s,1,System(asterisk -rx 'sip reload') ; hack to force sip reload
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Playback(vm-extension)
exten => s,n,WaitExten()
exten => 0011,1,Goto(outbound,s,1)
exten => 11,1,Dial(SIP/mysipuser/5555555555,30,g) ;calls 555-555-5555
exten => 11,n,Goto(closechannel,s,1)
exten => 77,1,Dial(SIP/mysipuser/1111111111,30,g) ;calls 111-111-1111
exten => 77,n,Goto(closechannel,s,1)
[outbound]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Playback(vm-extension)
exten => s,n,WaitExten()
exten => _NXXNXXNXXX,1,Dial(SIP/mysipuser/${EXTEN})
exten => _NXXNXXNXXX,n,Hangup
[closechannel]
exten => s,1,System(asterisk -rx 'sip reload')
exten => s,n,Hangup()
So the three changes I made were the addition of the exten => s,1,System(asterisk -rx 'sip reload')
statement, [closechannel]
context, and the ,30,g
to the Dial() command. The System command forces a sip reload every time someone tries to call in. The ,g
flag tells asterisk to continue executing code after calling parties disconnect.
This seems to work "most" of the times.
Best Answer
The above method is the only way I've ever seen it done, providing you write in some kind of protection so someone can't just hit that context in your dial-plan and have fun reloading your server over and over ;)