Hello all,
I’m trying create simple call between two peers(blink) via Asterisk. Asterisk running on:
192.168.0.107
both clients are on : 192.168.0.106
both clients are correctly registered, but when I’m trying to call each other a I got SIP/2.0 489 Bad Event.
debian*CLI> sip show peers
Name/username Host Dyn Forcerport Comedia ACL Port Status Description
202/202 192.168.0.106 D Yes Yes 62981 Unmonitored
203/203 192.168.0.106 D Yes Yes 62981 Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline]
extensions.conf
[internal]
exten => 202,1,Dial(SIP/202)
exten => 203,1,Dial(SIP/202)
sip.conf
[general]
allowguest=yes
maxexpirey=3600
defaultexpirey=3600
port=5060
bindaddr=0.0.0.0
srvlookup=yes
disallow=all
allow=ulaw
context=internal
language=en
transport=ws,wss, udp
avpf=yes
encryption=no
icesupport=yes
nat=force_rport,comedia
context=internal
dtmfmode=rfc2833
[203]
type=friend
secret=203
host=dynamic
context=internal
nat=force_rport,comedia
transport=udp, ws, wss
[202]
type=friend
secret=202
host=dynamic
context=internal
nat=force_rport,comedia
transport=udp
Thank you for your help!
Patrik
Which version of Asterisk? What is generating the 489? What SIP request is it responding to when it produces that status?
Asterisk only generates 489 in response to SUBSCRIBE requests, so this response should have nothing to do with failed call setups.
(Incidentally, how did you select your nat= settings? Why do you have allowguest set to yes?)
Version: Asterisk PBX 12.1.0-rc3
here is message:
<--- Transmitting (NAT) to 192.168.0.106:62981 --->
SIP/2.0 489 Bad Event
Via: SIP/2.0/UDP 192.168.0.106:62981;branch=z9hG4bKPj20dda23d329b4b3a8c45e1f1bf224d5f;received=192.168.0.106;rport=62981
From: "Patrik" <sip:203@192.168.0.107>;tag=d4482dab15644d53a5c435dbc2b766c2
To: "Patrik" <sip:203@192.168.0.107>;tag=as75ee35b4
Call-ID: fe8e64d7440347f6a4affb34bfb6ca3f
CSeq: 1 PUBLISH
Server: Asterisk PBX 12.1.0-rc3
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0
but now i Found in log following error:
nat options I just found out in some tutorial, but I don’t think that may be problem…
The PUBLISH error is irrelevant to the call setup failure.
You either need to enable SRTP in the phones or disable it in Asterisk.
You should not copy settings from tutorials without understanding them. They are often chosen because they don’t produce obvious problem symptoms rather than because they are good choices. In this case, people used to put nat=yes in their tutorials. This was deprecated in favour of indidual sub-options, probably to make people think about what they really wanted, but the tutorial writes just translated yes into the full set of options! Generally phones on the same LAN do not require any nat= settings.
It is common to see insecure=port, invite, which used to be insecure=very. When it was either not needed, or only insecure=invite was needed. The name of that option was supposed to warn you that excessively permissive values were undesirable, but, because being insecure tends not to produce error messages, tutorial writers ignored that.