One of the issues I'm having now is that if I call in consecutive times to the asterisk server from the same phone, it may disconnect. Asterisk logs the following message:
[Aug 14 10:24:56] NOTICE[20537]: chan_sip.c:19477 handle_request_invite: Failed to authenticate device <sip:4165559999@222.222.222.222:5070>;tag=781ab8fb-co19342-INS016
It's like any phone in the world can only call in once to the asterisk server. Then I need to do a
> sip reload
from the Asterisk terminal to let them call in again.
I can also do a shell command like so to reload the sip
asterisk -rx 'sip reload'
But when I add this command to the crontab to be run every minute, it doesn't work. The shell command only works if I run it manually.
Can anyone tell me how I can enable callers to call my asterisk server more than once? Here are my sip.conf and extensions.conf (all other files untouched).
sip.conf
[general]
register => mysipuser:mysippass@localhost:5071
context=default
[mysipuser]
type=friend
secret=mysippass
username=mysipuser
host=111.111.111.111
port=5071
fromuser=mysipuser
canreinvite=no
insecure=very
qualify=2000
dtmfmode=inband
nat=no
context=default
extensions.conf
[default]
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) ;calls 555-555-5555
exten => 11,n,Hangup ; this line never gets executed
exten => 77,1,Dial(SIP/mysipuser/1111111111) ;calls 111-111-1111
exten => 77,n,Hangup ; this line never gets executed
[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
Additional Details I noticed that each time I execute the Dial() command in the extensions.conf, none of the lines after it gets fired, even if both parties hang up the phone. So for example:
exten => 11,1,Dial(SIP/mysipuser/5555555555)
exten => 11,n,System(echo 'hello world'>test.txt) ; this line and any line below do not fire
exten => 11,n,Hangup
The code stops executing after the Dial() command...that might explain why I can't call consecutive times..it's because the line is still active?