<html><head/><body><html><head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /></head><body bgcolor="#ffffff" text="#000000">Hi.<br>
<br>
+1 from me for having a pv which contains a description of what exactly is wrong with the validated message. That&#39;s a non-intrusive change and leabes it to the script author to decide when and how verbose to report.<br>
<br>
Bye, Mike<br><br><div class="gmail_quote">Bogdan-Andrei Iancu &lt;bogdan@opensips.org&gt; wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

  
    
  
  
    <tt>I would suggest to spit -1 even more... or we can make the
      function to populate a kind of strerror :) - to return in a pvar
      the description of the failure....just exploring here :)<br />
      <br />
      Regards,<br />
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <br />
    On 02/26/2013 05:16 PM, Nick Altmann wrote:
    <blockquote cite="mid:CAJOe1EPNy3trg+Oi0JopXwGjFc9SkeA+9SuZ+PPtaFkf8oFVRQ@mail.gmail.com" type="cite">
      <div dir="ltr">Now we have:
        <div>
          <ul style="color: rgb(0, 0, 0); font-family: Helvetica,Arial;
            font-size: medium;" type="disc">
            <li>
              <p style="font-size: 12px; text-align: justify;"><span class=""><em>1</em></span> - the message is RFC3261
                compliant and has been successfully validated.</p>
            </li>
            <li>
              <p style="font-size: 12px; text-align: justify;"><span class=""><em>-1</em></span> - the message is not
                RFC3261 compliant.</p>
            </li>
            <li>
              <p style="font-size: 12px; text-align: justify;"><span class=""><em>-2</em></span> - signals a parsing error.</p>
            </li>
            <li>
              <p style="font-size: 12px; text-align: justify;"><span class=""><em>-3</em></span> - invalid SDP body.</p>
            </li>
            <li>
              <p style="font-size: 12px; text-align: justify;"><span class=""><em>-4</em></span> - invalid headers body.</p>
            </li>
            <li>
              <p style="font-size: 12px; text-align: justify;"><span class=""><em>-5</em></span> - invalid R-URI.</p>
            </li>
            <li>
              <p style="font-size: 12px; text-align: justify;"><span class=""><em>-6</em></span> - invalid R-URI domain.</p>
            </li>
            <li>
              <p style="font-size: 12px; text-align: justify;"><span class=""><em>-255</em></span> - undefined errors.</p>
            </li>
          </ul>
        </div>
        <div class="gmail_extra" style="">"-1" can be:</div>
        <div class="gmail_extra" style="">- message doesn't have callid</div>
        <div class="gmail_extra" style="">- message doesn't have Content
          Length header for proto %d</div>
        <div class="gmail_extra" style="">- PATH header supported only
          for REGISTERs<br />
        </div>
        <div class="gmail_extra" style="">- Cseq not parsed properly</div>
        <div class="gmail_extra" style="">- invalid body - content
          length %ld different then actual body %d<br />
        </div>
        <div class="gmail_extra" style=""><br />
        </div>
        <div class="gmail_extra" style="">Maybe increase log level for
          "-1" only?</div>
        <div class="gmail_extra" style="">But now I think I just can
          increase debug level before sip_msg_validate() and lower it
          after. :-)</div>
        <div class="gmail_extra"><br clear="all" />
          <div>--<br />
            Nick</div>
          <br />
          <br />
          <div class="gmail_quote">2013/2/26 Bogdan-Andrei Iancu <span dir="ltr">&lt;<a moz-do-not-send="true" href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>&gt;</span><br />
            <blockquote class="gmail_quote" style="margin: 0px 0px 0px
              0.8ex; border-left: 1px solid rgb(204, 204, 204);
              padding-left: 1ex;">
              <div bgcolor="#ffffff" text="#000000"> <tt>
                  </tt><div class="im"><tt>In this case, it means the function
                    has to report something more than -1....like: -1 no
                    MF hdr, -2 missing body, -3 missing TO, etc...<br />
                    <br />
                  </tt></div>
                  Regards,
                <div class="im">
                  <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                  <br />
                </div>
                <div class="im"> On 02/26/2013 03:32 PM, Nick Altmann
                  wrote: </div>
                <div>
                  <div class="h5">
                    <blockquote type="cite">
                      <div dir="ltr">Bogdan, 
                        <div><br />
                        </div>
                        <div>I'm second time deal with problem when I
                          receive "-1" from script and to understand
                          what is not okay I should compare message with
                          source code. :-)</div>
                        <div>
                          <div class="gmail_extra"> Of course I receive
                            and interpret this codes, but "-1" is not
                            fully informative sometimes. Especially when
                            sdp length is not okay. :-)</div>
                          <div class="gmail_extra"><br clear="all" />
                            <div>--<br />
                              Nick</div>
                            <br />
                            <br />
                            <div class="gmail_quote">2013/2/26
                              Bogdan-Andrei Iancu <span dir="ltr">&lt;<a moz-do-not-send="true" href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>&gt;</span><br />
                              <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex;
                                border-left: 1px solid rgb(204, 204,
                                204); padding-left: 1ex;">
                                <div bgcolor="#ffffff" text="#000000"> <tt>Hi
                                    Nick,<br />
                                    <br />
                                    Such a change may induce a
                                    self-spaming effect on your logs :).
                                    I would rather interpret the return
                                    code from script and let the script
                                    writer the decision if he wants to
                                    log that or not...(depending on the
                                    failed check, maybe if local
                                    subscriber or not, etc).<br />
                                    <br />
                                    At least these are my 2 cents on the
                                    matter :)<br />
                                    <br />
                                    Regards,<br />
                                  </tt>
                                  <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                                  <div>
                                    <div> <br />
                                      On 02/26/2013 01:01 PM, Nick
                                      Altmann wrote: </div>
                                  </div>
                                  <blockquote type="cite">
                                    <div>
                                      <div>
                                        <div dir="ltr">Hello!
                                          <div><br />
                                          </div>
                                          <div>What about to change DBG
                                            messages in
                                            sip_msg_validate() to ERR or
                                            INFO? It will help to
                                            understand the reason of
                                            reject. Especially for -1
                                            return (<span style="text-align:
                                              justify; font-size: 12px;
                                              font-family:
                                              Helvetica,Arial;">the
                                              message is not RFC3261
                                              compliant)</span>.</div>
                                          <div><br clear="all" />
                                            <div>--<br />
                                              Nick</div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                    <pre><fieldset></fieldset>
_______________________________________________
Users mailing list
<a moz-do-not-send="true" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                                  </blockquote>
                                </div>
                              </blockquote>
                            </div>
                            <br />
                          </div>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                </div>
              </div>
            </blockquote>
          </div>
          <br />
        </div>
      </div>
    </blockquote>
  

<p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><pre style="white-space: pre-wrap; word-wrap:break-word; font-family: monospace; margin-top: 0px"><hr /><br />Users mailing list<br />Users@lists.opensips.org<br /><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br /></pre></blockquote></div></body></html></body></html>