<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Well, the REGISTER Clue below seemed to work, the key is to do the force_rport() *before* t_newtran(). &nbsp;Which, now that I look at it, is exactly what&nbsp;Iñaki&nbsp;suggested. &nbsp;Thanx&nbsp;Iñaki!<div><br></div><div><div><div>&nbsp;&nbsp; force_rport();</div><div>&nbsp;&nbsp; if (!t_newtran()) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;sl_reply_error();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;return(-1);</div><div>&nbsp;&nbsp; &nbsp;};</div><div><br></div><div>&nbsp;&nbsp; &nbsp;if (is_method("SUBSCRIBE")) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;handle_subscribe();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;t_release();</div><div>&nbsp;&nbsp; &nbsp;};</div><div><br></div><div><br></div><div>Cheers</div></div><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span class="Apple-style-span" style="font-family: Calibri; font-size: 15px; ">---<br>Mahesh&nbsp;Paolini-Subramanya&nbsp;<br>CTO, &nbsp;Aptela Inc.</span></div><div><span class="Apple-style-span" style="font-family: Calibri; font-size: 15px; ">(703.386.1500 x9100)<a href="http://www.aptela.com/" style="color: blue; text-decoration: underline; "></a></span></div><div><span class="Apple-style-span" style="font-family: Calibri; font-size: 15px; "><a href="http://www.aptela.com/" style="color: blue; text-decoration: underline; ">http://www.aptela.com</a><br></span></div></div></div></div></div></div></div></span> </div><br><div><div>On May 28, 2009, at 6:08 AM, Mahesh Paolini-Subramanya wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>force_rport() doesnt do the trick - it was one of the first things i tried :-) &nbsp;All it seems to do is add 'rport=...' to the Via line on the returned message, not actually *send* to that port. &nbsp;Its clearly something ridiculously basic. &nbsp;</div><div>Also, fix_nated_contact() doesnt work entirely either. &nbsp;What it *does* do is ensure that the NOTIFY (from the Sbc to the fone) goes to $sp:$si...</div><div><br></div><div>Incidentally, if i stick a t_newtran()/t_release around my REGISTER handling section, i get the same behavior, i.e., the responses go to 5060 instead of the source port (i *am* using force_rport() there). &nbsp;Is that a Clue?</div><div><br></div><div>cheers</div><div><br></div><div>p.s. &nbsp;</div><div><br></div><div>The difference i see is as follows&nbsp;</div><div><br></div><div>A) Using the following basic code, &nbsp;the response &nbsp;(i've omitted most of the message)</div><div><br></div><div><div>&nbsp;&nbsp; if (!t_newtran()) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;sl_reply_error();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;return(-1);</div><div>&nbsp;&nbsp; &nbsp;};</div><div><br></div><div>&nbsp;&nbsp; &nbsp;if (is_method("SUBSCRIBE")) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;handle_subscribe();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;t_release();</div><div>&nbsp;&nbsp; &nbsp;};</div></div><div><br></div><div><div>U 2009/05/28 05:56:44.260579 1.2.3.4:2352 -> 5.6.7.8:5060</div><div>SUBSCRIBE sip:<a href="mailto:mm1@5.6.7.8">mm1@5.6.7.8</a> SIP/2.0.</div><div>Via: SIP/2.0/UDP 10.0.0.10:5060;branch=z9hG4bK537dd37BF6A3AE6.</div><div>Contact: &lt;sip:<a href="mailto:mm1@10.0.0.10">mm1@10.0.0.10</a>:5060>.</div><div><br></div></div><div><br></div><div><div>U 2009/05/28 05:56:44.264687 5.6.7.8:5060 -> 1.2.3.4:5060</div><div>SIP/2.0 202 OK.</div><div>Via: SIP/2.0/UDP 10.16.0.168:5060;branch=z9hG4bK537dd37BF6A3AE6;received=1.2.3.4.</div><div><br></div></div><div><br></div><div>B) If I use force_rport(), as follows, I get</div><div><div><div>&nbsp;&nbsp;</div><div>&nbsp;&nbsp; if (is_method("SUBSCRIBE")) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;force_rport();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;handle_subscribe();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;t_release();</div><div>&nbsp;&nbsp; &nbsp;};</div><div><br></div><div><div>U 2009/05/28 05:56:44.264687 5.6.7.8:5060 -> 1.2.3.4:5060</div><div>SIP/2.0 202 OK.</div><div>Via: SIP/2.0/UDP 10.16.0.168:5060;branch=z9hG4bK537dd37BF6A3AE6;rport=2352;received=1.2.3.4.</div><div><br></div></div></div></div><div><br></div><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span class="Apple-style-span" style="font-family: Calibri; font-size: 15px; ">---<br>Mahesh&nbsp;Paolini-Subramanya&nbsp;<br>CTO, &nbsp;Aptela Inc.</span></div><div><span class="Apple-style-span" style="font-family: Calibri; font-size: 15px; ">(703.386.1500 x9100)<a href="http://www.aptela.com/" style="color: blue; text-decoration: underline; "></a></span></div><div><span class="Apple-style-span" style="font-family: Calibri; font-size: 15px; "><a href="http://www.aptela.com/" style="color: blue; text-decoration: underline; ">http://www.aptela.com</a><br></span></div></div></div></div></div></div></div></span> </div><br><div><div>On May 27, 2009, at 6:29 PM, Mahesh Paolini-Subramanya wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>El Jueves, 28 de Mayo de 2009, Mahesh Paolini-Subramanya escribió:<br><blockquote type="cite">I'm trying to setup an extremely basic PRESENCE/BLF environment.<br></blockquote><blockquote type="cite">However, when I call handle_subscribe(), the message gets sent to $si:<br></blockquote><blockquote type="cite">5060, *not* $si:$sp<br></blockquote><br>I assume you mean "the response gets sent...", right?<br><br><br><blockquote type="cite">Any ideas? &nbsp;Should I be doing something with nat_traversal.co (don't<br></blockquote><blockquote type="cite">see what, but worth asking...)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">The relevant portion of kamailio.cfg is<br></blockquote><br>Add "force_rport()" here.<br><br><blockquote type="cite"> &nbsp;&nbsp;&nbsp;if (!t_newtran()) {<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sl_reply_error();<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return(-1);<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;};<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;if (is_method("SUBSCRIBE")) {<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;handle_subscribe();<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t_release();<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;};<br></blockquote><blockquote type="cite"><br></blockquote><br><br><br>-- <br>Iñaki Baz Castillo &lt;<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>><br><br>_______________________________________________<br>Kamailio (OpenSER) - Users mailing list<br><a href="mailto:Users@lists.kamailio.org">Users@lists.kamailio.org</a><br><a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</div></blockquote></div><br></div></blockquote></div><br></div></body></html>