<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi Tyler,<br>
    <br>
    On 02/10/2011 05:33 AM, Tyler Merritt wrote:
    <blockquote
      cite="mid:AANLkTimjnG5=vfSCTj9M0SBJ9m-Eb_itWeFsR71vfsK-@mail.gmail.com"
      type="cite">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>
    </blockquote>
    <br>
    I suggest you to print the message buffer here just to be sure. Use
    xlog("$mb\n");<br>
    <br>
    Regards,<br>
    <pre class="moz-signature" cols="72">-- 
Anca Vamanu
OpenSIPS Developer
</pre>
    <br>
    <br>
    <blockquote
      cite="mid:AANLkTimjnG5=vfSCTj9M0SBJ9m-Eb_itWeFsR71vfsK-@mail.gmail.com"
      type="cite">
      <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>
    </blockquote>
    <blockquote
      cite="mid:AANLkTimjnG5=vfSCTj9M0SBJ9m-Eb_itWeFsR71vfsK-@mail.gmail.com"
      type="cite">
      <div>Here is the packet:</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>
        <div>12:18:24.725518 IP 192.168.1.134.5060 &gt;
          192.168.0.2.5060: SIP, length: 720</div>
        <div><a class="moz-txt-link-abbreviated" href="mailto:E.....@...v">E.....@...v</a>(................INVITE <a class="moz-txt-link-freetext" href="sip:XXXXXXXXXX@DOMAIN">sip:XXXXXXXXXX@DOMAIN</a>
          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 moz-do-not-send="true"
            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;"><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>
      </div>
      <div><br>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">
</pre>
  </body>
</html>