All,
<div><br></div><div>A very special issue I'm facing now. I'm using "is_method" from the reply block (starting with a "has_totag" which matches and then goes inside that block to check stuff out).</div>
<div><br></div><div>Here is the code:</div><div><br></div><div><div>xlog ("L_INFO", "Right before the reINVITE check!\n");</div><div> if ( is_method("INVITE") ) {</div>
<div> append_hf("GW: REINVITE\r\n");</div><div> if ( t_check_trans() ) {</div><div> t_relay();</div><div> exit;</div>
<div> }</div><div> }</div><div> xlog ("L_INFO", "Right after the reINVITE check!\n");</div><div> sl_send_reply("404","Not here");</div>
</div><div><br></div><div><br></div><div>Here is the packet:</div><div><br></div><div><br></div><div><div>12:18:24.725518 IP 192.168.1.134.5060 > 192.168.0.2.5060: SIP, length: 720</div><div>E.....@...v(................INVITE sip:XXXXXXXXXX@DOMAIN SIP/2.0</div>
<div><br></div><div>CSeq: 443638 INVITE</div></div><div><br></div><div><br></div><div>Here is the definition from the documentation:</div><div><br></div><div><br></div><div><meta charset="utf-8"><div class="titlepage" style="font-family: Helvetica, Arial; font-size: medium; ">
<div><div><h3 class="title"><code class="function">is_method(name)</code></h3></div></div></div><p style="font-family: Helvetica, Arial; font-size: 12px; text-align: justify; ">Check if the method of the message matches the name. If name is a known method (invite, cancel, ack, bye, options, info, update, register, message, subscribe, notify, refer, prack), the function performs method ID testing (integer comparison) instead of ignore case string comparison.</p>
<p style="font-family: Helvetica, Arial; font-size: 12px; text-align: justify; ">The 'name' can be a list of methods in the form of 'method1|method2|...'. In this case, the function returns true if the SIP message's method is one from the list. IMPORTANT NOTE: in the list must be only methods defined in OpenSIPS with ID (invite, cancel, ack, bye, options, info, update, register, message, subscribe, notify, refer, prack, publish; for more see:<a href="http://www.iana.org/assignments/sip-parameters" target="_top" style="color: rgb(4, 31, 197); text-decoration: none; ">http://www.iana.org/assignments/sip-parameters</a>).</p>
<p style="font-family: Helvetica, Arial; font-size: 12px; text-align: justify; ">If used for replies, the function tests the value of method field from CSeq header.</p><p style="font-family: Helvetica, Arial; font-size: 12px; text-align: justify; ">
<br></p><p style="font-family: Helvetica, Arial; font-size: 12px; text-align: justify; "><br></p><p style="font-family: Helvetica, Arial; font-size: 12px; text-align: justify; "><meta charset="utf-8">If used for replies, the function tests the value of method field from <b>CSeq header.</b></p>
<p style="font-family: Helvetica, Arial; font-size: 12px; text-align: justify; "><b><br></b></p><p style="font-family: Helvetica, Arial; font-size: 12px; text-align: justify; ">The CSeq header above sure enough has "INVITE" inside it. And the is_method filed is being used from a reply (it shouldn't really matter though right? It should match regardless).</p>
<p style="font-family: Helvetica, Arial; font-size: 12px; text-align: justify; "><br></p><p style="font-family: Helvetica, Arial; font-size: 12px; text-align: justify; ">Please point out what I'm doing wrong - the daemon.log file shows:</p>
<p style="font-family: Helvetica, Arial; font-size: 12px; text-align: justify; "><br></p><p style="text-align: justify; "></p><p style="text-align: justify; "><font class="Apple-style-span" face="Helvetica, Arial"><span class="Apple-style-span" style="font-size: 12px;">Feb 10 12:18:25 sip-proxy1 /usr/sbin/opensips[22658]: DBG:rr:loose_route: There is no Route HF</span></font></p>
<p style="text-align: justify; "><font class="Apple-style-span" face="Helvetica, Arial"><span class="Apple-style-span" style="font-size: 12px;">Feb 10 12:18:25 sip-proxy1 /usr/sbin/opensips[22658]: Right before the reINVITE check!</span></font></p>
<p style="text-align: justify; "><font class="Apple-style-span" face="Helvetica, Arial"><span class="Apple-style-span" style="font-size: 12px;">Feb 10 12:18:25 sip-proxy1 /usr/sbin/opensips[22658]: Right after the reINVITE check!</span></font></p>
<p style="text-align: justify; "><font class="Apple-style-span" face="Helvetica, Arial"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></p><p style="text-align: justify; "><font class="Apple-style-span" face="Helvetica, Arial"><span class="Apple-style-span" style="font-size: 12px;">It *should* pass loose_route as it does, and then between the two log messages stuff should happen - in this case, a match of the INVITE header. </span></font></p>
<p style="text-align: justify; "><font class="Apple-style-span" face="Helvetica, Arial"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></p><p style="text-align: justify; "><font class="Apple-style-span" face="Helvetica, Arial"><span class="Apple-style-span" style="font-size: 12px;">I don't see what I'm doing wrong.</span></font></p>
<p></p></div><div><br></div>