I know over time SIP OPTIONS message handling has changed and I've seen some write ups that seem to indicate that an s extension in the default context is needed now to get them to work.

It's probably my error in any case.

So, what am I doing wrong or what do I need to do to get the sip ping to work?

Bruce Ferrell

Just for fun, I created a sip peer called ping at a fixed address with a default context of ping:

sip.conf
=======
[ping]
type=peer
host=XX.XX.XX.XX
defaultip=XX.XX.XX.XX
context=ping

extensions.conf
============
[ping]
exten => s,1,NoOp()


I am sending the following:


OPTIONS sip:YY.YY.YY.YY SIP/2.0
Via: SIP/2.0/UDP XX.XX.XX.XX:5061;branch=z9hG4bK1316447867
From: <sip:p...@xx.xx.xx.xx>
To: <sip:YY.YY.YY.YY>
Contact: <sip:p...@xx.xx.xx.xx>
Call-ID: 20d664d681edcbd48dd76f57915d4...@xx.xx.xx.xx
CSeq: 102 OPTIONS
User-Agent: sip_ping.pl
Date: Mon, 19 September 2011 08:57:47 PDT
Allow: ACK, CANCEL
Content-Length: 0


And the asterisk instance is logging the following with core set debug 9:

<--- SIP read from UDP:XX.XX.XX.XX:6051 --->
OPTIONS sip:YY.YY.YY.YY SIP/2.0
Via: SIP/2.0/UDP XX.XX.XX.XX:5061;branch=z9hG4bK1316447867
From: <sip:p...@xx.xx.xx.xx>
To: <sip:YY.YY.YY.YY>
Contact: <sip:p...@xx.xx.xx.xx>
Call-ID: 20d664d681edcbd48dd76f57915d4...@xx.xx.xx.xx
CSeq: 102 OPTIONS
User-Agent: sip_ping.pl
Date: Mon, 19 September 2011 08:57:47 PDT
Allow: ACK, CANCEL
Content-Length: 0
<------------->
[2011-09-19 08:57:47] DEBUG[2979] chan_sip.c: Header 0 [ 32]: OPTIONS sip:YY.YY.YY.YY SIP/2.0 [2011-09-19 08:57:47] DEBUG[2979] chan_sip.c: Header 1 [ 59]: Via: SIP/2.0/UDP XX.XX.XX.XX:5061;branch=z9hG4bK1316447867 [2011-09-19 08:57:47] DEBUG[2979] chan_sip.c: Header 2 [ 29]: From: <sip:p...@xx.xx.xx.xx> [2011-09-19 08:57:47] DEBUG[2979] chan_sip.c: Header 3 [ 22]: To: <sip:YY.YY.YY.YY> [2011-09-19 08:57:47] DEBUG[2979] chan_sip.c: Header 4 [ 32]: Contact: <sip:p...@xx.xx.xx.xx> [2011-09-19 08:57:47] DEBUG[2979] chan_sip.c: Header 5 [ 54]: Call-ID: 20d664d681edcbd48dd76f57915d4...@xx.xx.xx.xx [2011-09-19 08:57:47] DEBUG[2979] chan_sip.c: Header 6 [ 17]: CSeq: 102 OPTIONS [2011-09-19 08:57:47] DEBUG[2979] chan_sip.c: Header 7 [ 23]: User-Agent: sip_ping.pl [2011-09-19 08:57:47] DEBUG[2979] chan_sip.c: Header 8 [ 41]: Date: Mon, 19 September 2011 08:57:47 PDT [2011-09-19 08:57:47] DEBUG[2979] chan_sip.c: Header 9 [ 18]: Allow: ACK, CANCEL [2011-09-19 08:57:47] DEBUG[2979] chan_sip.c: Header 10 [ 18]: Content-Length: 0
[2011-09-19 08:57:47] VERBOSE[2979] chan_sip.c: --- (11 headers 0 lines) ---
[2011-09-19 08:57:47] DEBUG[2979] chan_sip.c: = Looking for Call ID: 20d664d681edcbd48dd76f57915d4...@xx.xx.xx.xx (Checking From) --From tag --To-tag [2011-09-19 08:57:47] DEBUG[2979] chan_sip.c: OPTIONS request has no from tag, dropping callid: 20d664d681edcbd48dd76f57915d4...@xx.xx.xx.xx from: <sip:p...@xx.xx.xx.xx> [2011-09-19 08:57:47] DEBUG[2979] chan_sip.c: Invalid SIP message - rejected , no callid, len 355

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to