<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>The request URI should be taken from the Contact header of the server response.</div><div><br></div>Pasting the whole dialog, not just the start and end may provide a clue when it, if it changed.<div><br></div><div>Adrian</div><div><br><div><div>On Dec 11, 2012, at 4:28 AM, Owen Lynch wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi,<div><br></div><div>I am running sip-subscribe-presence like this:</div><div>sip-subscribe-presence -s -a <a href="mailto:monkey3@flowdevtest.paragon.co.nz">monkey3@flowdevtest.paragon.co.nz</a> <a href="mailto:monkey3@flowdevtest.paragon.co.nz">monkey3@flowdevtest.paragon.co.nz</a><br>
</div><div><br></div><div>When I terminate sip-subscribe-presence after a successful subscription I get a 404 Not Here instead of a NOTIFY. This is because the request URI has changed and the kamailio server does not consider it to be a valid in-dialog subscribe.</div>
<div><br></div><div>The initial subscribe is:</div><div><br></div><div><div><a href="http://192.168.2.236:57765/">192.168.2.236:57765</a> -(SIP over tls)-> <a href="http://192.168.2.125:5061/">192.168.2.125:5061</a></div>
<div>SUBSCRIBE <a href="mailto:sip%3Amonkey3@flowdevtest.paragon.co.nz">sip:monkey3@flowdevtest.paragon.co.nz</a> SIP/2.0</div><div>Via: SIP/2.0/tls 192.168.2.236:57765;rport;branch=z9hG4bKPjqvB4spMeyGC4jdrtknGLSSFxdq68xa58</div>
<div>Max-Forwards: 70</div><div>From: <<a href="mailto:sip%3Amonkey3@flowdevtest.paragon.co.nz">sip:monkey3@flowdevtest.paragon.co.nz</a>>;tag=DlElTbYUX1NSHigaPB0l56s42EdoOvzx</div><div>To: <<a href="mailto:sip%3Amonkey3@flowdevtest.paragon.co.nz">sip:monkey3@flowdevtest.paragon.co.nz</a>></div>
<div>Contact: <<a href="sip:pfyhnird@192.168.2.236:47656;transport=tls">sip:pfyhnird@192.168.2.236:47656;transport=tls</a>></div><div>Call-ID: r-Zf69ji74Iu3xxxiIcPDAet9OKEndj7</div><div>CSeq: 5339 SUBSCRIBE</div><div>Event: presence</div><div>Expires: 3600</div><div>Accept: application/pidf+xml</div>
<div>Allow-Events: presence</div><div>User-Agent: sipsimple 0.31.1</div><div>Authorization: Digest username="monkey3", realm="<a href="http://flowdevtest.paragon.co.nz/">flowdevtest.paragon.co.nz</a>", nonce="UMalGFDGo+yB6OMcb64SBYtElh7Q1zF3", uri="<a href="mailto:sip%3Amonkey3@flowdevtest.paragon.co.nz">sip:monkey3@flowdevtest.paragon.co.nz</a>", response="752330a8c9062b82c2e7b9e8ab11a7d0", cnonce="VJJm.rzmXf3nViftDB6NolivoXaTWzWH", qop=auth, nc=00000001</div>
<div>Content-Length:  0</div></div><div><br></div><div>It is acknowledged with:</div><div><br></div><div><div>2012-12-11 16:11:47.712883: RECEIVED: Packet 4, +0:00:00.023362</div><div><a href="http://192.168.2.125:5061/">192.168.2.125:5061</a> -(SIP over tls)-> <a href="http://192.168.2.236:57765/">192.168.2.236:57765</a></div>
<div>SIP/2.0 202 OK</div><div>Record-Route: <<a href="sip:192.168.2.125:5061;transport=tls;lr=on">sip:192.168.2.125:5061;transport=tls;lr=on</a>></div><div>Via: SIP/2.0/tls 192.168.2.236:57765;rport=57765;branch=z9hG4bKPjqvB4spMeyGC4jdrtknGLSSFxdq68xa58</div><div>From: <<a href="mailto:sip%3Amonkey3@flowdevtest.paragon.co.nz">sip:monkey3@flowdevtest.paragon.co.nz</a>>;tag=DlElTbYUX1NSHigaPB0l56s42EdoOvzx</div>
<div>To: <<a href="mailto:sip%3Amonkey3@flowdevtest.paragon.co.nz">sip:monkey3@flowdevtest.paragon.co.nz</a>>;tag=85c03e96299e8572e145bc73db23802a-c1f4</div><div>Call-ID: r-Zf69ji74Iu3xxxiIcPDAet9OKEndj7</div><div>CSeq: 5339 SUBSCRIBE</div>
<div>Expires: 3600</div><div>Contact: <<a href="sip:192.168.2.129:5061;transport=tls">sip:192.168.2.129:5061;transport=tls</a>></div><div>Server: kamailio (3.3.2 (i386/linux))</div><div>Content-Length: 0</div></div><div><br></div><div><br></div><div>But the final subscribe (expires=0) is:</div>
<div><br></div><div><div>2012-12-11 16:12:07.179514: SENDING: Packet 7, +0:00:19.489993</div><div><a href="http://192.168.2.236:57765/">192.168.2.236:57765</a> -(SIP over tls)-> <a href="http://192.168.2.125:5061/">192.168.2.125:5061</a></div>
<div>SUBSCRIBE <b>sip:<a href="http://192.168.2.129:57929/">192.168.2.129:57929</a></b>;transport=tls SIP/2.0</div><div>Via: SIP/2.0/tls 192.168.2.236:57765;rport;branch=z9hG4bKPjW4TsbpZqhCOjMMm0KhIzbvrJant7Ovip</div><div>
Max-Forwards: 70</div><div>From: <<a href="mailto:sip%3Amonkey3@flowdevtest.paragon.co.nz">sip:monkey3@flowdevtest.paragon.co.nz</a>>;tag=DlElTbYUX1NSHigaPB0l56s42EdoOvzx</div><div>To: <<a href="mailto:sip%3Amonkey3@flowdevtest.paragon.co.nz">sip:monkey3@flowdevtest.paragon.co.nz</a>>;tag=85c03e96299e8572e145bc73db23802a-c1f4</div>
<div>Contact: <<a href="sip:pfyhnird@192.168.2.236:47656;transport=tls">sip:pfyhnird@192.168.2.236:47656;transport=tls</a>></div><div>Call-ID: r-Zf69ji74Iu3xxxiIcPDAet9OKEndj7</div><div>CSeq: 5340 SUBSCRIBE</div><div>Route: <<a href="sip:192.168.2.125:5061;transport=tls;lr">sip:192.168.2.125:5061;transport=tls;lr</a>></div>
<div>Event: presence</div><div>Expires: 0</div><div>Accept: application/pidf+xml</div><div>Allow-Events: presence</div><div>User-Agent: sipsimple 0.31.1</div><div>Content-Length:  0</div></div><div><br></div><div>It is acknowledged with:</div>
<div><br></div><div><div>2012-12-11 16:12:07.179669: RECEIVED: Packet 8, +0:00:19.490148</div><div><a href="http://192.168.2.125:5061/">192.168.2.125:5061</a> -(SIP over tls)-> <a href="http://192.168.2.236:57765/">192.168.2.236:57765</a></div>
<div>SIP/2.0 404 Not here</div><div>Via: SIP/2.0/tls 192.168.2.236:57765;rport=57765;branch=z9hG4bKPjW4TsbpZqhCOjMMm0KhIzbvrJant7Ovip</div><div>From: <<a href="mailto:sip%3Amonkey3@flowdevtest.paragon.co.nz">sip:monkey3@flowdevtest.paragon.co.nz</a>>;tag=DlElTbYUX1NSHigaPB0l56s42EdoOvzx</div>
<div>To: <<a href="mailto:sip%3Amonkey3@flowdevtest.paragon.co.nz">sip:monkey3@flowdevtest.paragon.co.nz</a>>;tag=85c03e96299e8572e145bc73db23802a-c1f4</div><div>Call-ID: r-Zf69ji74Iu3xxxiIcPDAet9OKEndj7</div><div>CSeq: 5340 SUBSCRIBE</div>
<div>Server: kamailio (3.3.2 (i386/linux))</div><div>Content-Length: 0</div></div><div><br></div><div>The final subscribe request URI is "SUBSCRIBE sip:<a href="http://192.168.2.129/">192.168.2.129</a>:<b>57929</b>;transport=tls" but it needs to be "SUBSCRIBE sip:<a href="http://192.168.2.129/">192.168.2.129</a>:<b>5061</b>;transport=tls", i.e. the port should match the port it is connected to, not a new port. Can you advise on how the script picks a new port for the request URI and whether I can force it to what I want. Package version is 0.31.1</div>
<div><br></div><div>We have a kamailio sip proxy on .2.125 and a kamailio presence server on .2.129</div><div><br></div><div>Kind regards,</div><div>Owen Lynch</div>
_______________________________________________<br>SIPBeyondVoIP mailing list<br><a href="mailto:SIPBeyondVoIP@lists.ag-projects.com">SIPBeyondVoIP@lists.ag-projects.com</a><br>http://lists.ag-projects.com/mailman/listinfo/sipbeyondvoip<br></blockquote></div><br></div></body></html>