I've used many versions of asterisk, with several different VoIP providers (SIP and one or two IAX2), physical cards on analog lines (Sangoma/Digium/Pika), and many different PC-based and hardphones (Aastra/Polycom/Sipura/Linksys/Snom/Mitel) and have never had that problem.
It's almost certainly your PSTN gateway. If it's an analog card, there's probably an extra wait at the end of the dial string, or a delay setting specific to the manufacturer. These cards mute the line while dialing, and that's probably what is happening here.
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
You haven't posted any addition details since asked for a couple of weeks ago so I'll try to answer as best I can (and recommend the question be closed):
Security: If your goal is to secure your Asterisk server then a proxy server / kamailio is not the answer. See Asterisk Security for details on how to do this.
Network: If your problem is NAT traversal then an SBC/Proxy can help - but isn't always necessary. Asterisk is pretty flexible in terms of publishing it's external IP in packets bound outside the local subnet. See NAT traversal for details on how to do this.
High Availability: If your goal is to add a proxy to redirect the traffic in the event of an Asterisk failure then a proxy isn't a great choice. (Nor is load balancing unless you don't need any session stickiness or synchronization etc). See High Availability for details on how to do this.