I configured a really easy asterisk pbx.
Follow here my sip.conf:
[general]
context = default
bindport=5060
bindaddr=0.0.0.0
;srvlookup=yes
disallow=all
allow=alaw
;allow=gsm
;allow=ilbc
language=en
;nat=yes
rtptimeout=60
rtpholdtimeout=300
register => 5308812:YYYYYYY@sip.messagenet.it:5061/5308812
[700]
type=friend
callerid=“Max00” <700>
username=700
secret=JJJJJJ
qualify=yes
host=dynamic
;context=internal
[701]
type=friend
callerid=“Max01” <701>
username=701
secret=JJJJJJ
qualify=yes
host=dynamic
context=internal
[messagenet00]
type=friend
;auth=md5
username=5308812
fromuser=5308812
secret=YYYYYYY
host=sip.messagenet.it
port=5061
qualify=yes
insecure=very
nat=yes
Here my extension.conf:
general]
[globals]
max0 => 700
max1 => 701
luca0 => 702
[default]
include => internal
include => external
[internal]
exten => 700,1,dial(SIP/700)
exten => 701,1,dial(SIP/701)
exten => 702,1,dial(SIP/702)
[external]
exten => 5308812,1,Dial(SIP/700) ; my Messagenet internal number
exten => _XXX.,1,Dial(SIP/${EXTEN}@messagenet00)
If I try to call and speak between the two internal or I did an outcall throught the messagenet, there isn’t problem; all works fine!
If I try to call the public number of messagenet, the internal phone 700 rings, as I defined: exten => 5308812,1,Dial(SIP/700)
All seems to be OK but when I hang-up (with hard or soft phone, same result) I can read on the CLI (verbose 9) this:
WARNING[8606]: chan_sip.c:12334 handle_response_invite: Received response: “Forbidden” from ‘sip:02303127569@212.97.59.76:5061;tag=as6f4dc9c4’
== Spawn extension (default, 5308812, 1) exited non-zero on ‘SIP/5308812-09628e28’
and I lost the channel
I’m running Asterisk 1.4.21.2~dfsg-3 on Debian
Some ideas, maybe?
Thanks.
Max