<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hello,<br>
    <br>
    match_dialog() works at dialog level, while t_check_trans() works at
    transaction level.<br>
    When you call match_dialog() on a sequential request within the
    dialog, OpenSIPS will try to match the request to an already ongoing
    dialog in the OpenSIPS memory. If it succeeds, further on in your
    script you will have access to dialog related features.<br>
    <br>
    t_check_trans() works differently, based on what type of request you
    are handling. For CANCELs, it will return true if the INVITE
    transaction exists for that CANCEL, for ACKs it will return true if
    it's an end-to-end ACK for an INVITE transaction. Further more, for
    other requests, t_check_trans() will check if there is already an
    ongoing transaction, and thus the current request is a
    retransmission. In such a case, your script execution will stop, as
    you do not normally want to re-process retransmissions.<br>
    <br>
    Regards,<br>
    <pre class="moz-signature" cols="72">Vlad Paiu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a> </pre>
    <br>
    On 04/25/2012 05:03 PM, Wilmar Campos wrote:
    <blockquote
cite="mid:CAH_cxxFGGwKU7CY0wvD+8j96JjsKMksZ8-zP7GMO2RaG3zw4Pg@mail.gmail.com"
      type="cite">
      <div class="gmail_extra">Vlad, can you please explain the
        difference between match_dialog() and t_check_trans()? &nbsp;I have
        read the documentation but I still don't get it!</div>
      <div class="gmail_extra"><br>
      </div>
      <div class="gmail_extra">
        Thank you,</div>
      <div class="gmail_extra"><br>
      </div>
      <div class="gmail_extra">WC<br>
        <br>
        <div class="gmail_quote">On Wed, Apr 25, 2012 at 4:44 AM, Vlad
          Paiu <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:vladpaiu@opensips.org" target="_blank">vladpaiu@opensips.org</a>&gt;</span>
          wrote:<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"> Hi,<br>
              <br>
              It seems you are looping the ACK over &amp; over to
              yourself, so I think your sequential requests processing
              is wrong.<br>
              For matching sequential requests within a topo hiding
              dialog, use the match_dialog() function [1] .<br>
              <br>
              [1] <a moz-do-not-send="true"
                href="http://www.opensips.org/html/docs/modules/devel/dialog#id295095"
                target="_blank">http://www.opensips.org/html/docs/modules/devel/dialog#id295095</a>
              <div class="im"><br>
                <br>
                Regards,<br>
                <pre cols="72">Vlad Paiu
OpenSIPS 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>
                <div class="h5"> On 04/24/2012 08:17 PM, Wilmar Campos
                  wrote:
                  <blockquote type="cite">
                    <div class="gmail_extra">Here are additional trace
                      information of what I am seeing:</div>
                    <div class="gmail_extra"><br>
                    </div>
                    <div class="gmail_extra">
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:rr:find_first_route: No Route headers found</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:rr:loose_route: There is no Route HF</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]: &nbsp;no loose</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        ERROR:siptrace:trace_dialog: failed to create
                        dialog</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]: &nbsp;ack or prack</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:core:parse_headers: flags=78</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:tm:t_lookup_request: start searching:
                        hash=58803, isACK=1</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:core:parse_headers: flags=38</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:core:parse_to_param: tag=3544276353-446053</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:core:parse_to: end of header reached,
                        state=29</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:core:parse_to: display={"Wilmar Campos"},
                        ruri={<a moz-do-not-send="true"
                          href="mailto:sip:12054@x.x.x.101"
                          target="_blank">sip:12054@x.x.x.101</a>}</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:tm:t_lookup_request: REF_UNSAFE:[0xb4f2b744]
                        after is 1</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:tm:t_lookup_request: e2e proxy ACK found</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]: &nbsp;match</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]: x.x.x.253
                        &lt;null&gt; is ACK relay</div>
                      <div class="gmail_extra"> Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:tm:t_newtran: transaction on entrance=(nil)</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:core:parse_headers: flags=ffffffffffffffff</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:tm:t_newtran: building branch for end2end
                        ACK - flags=1</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:tm:t_relay_to: forwarding ACK</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:core:mk_proxy: doing DNS lookup...</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:core:check_ip_address: params x.x.x.253,
                        x.x.x.253, 0</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:core:forward_request: sending:</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        ACK: sip:x.x.x.253;did=c75.06cce112 SIP/2.0</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Max-Forwards: 47</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        To: <a moz-do-not-send="true"
                          href="mailto:sip:7917573108366435@x.x.x.253"
                          target="_blank">&lt;sip:7917573108366435@x.x.x.253&gt;</a>;tag=c4d8a7fc-CC-33</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        From: "Wilmar Campos" <a moz-do-not-send="true"
                          href="mailto:sip:12054@x.x.x.101"
                          target="_blank">&lt;sip:12054@x.x.x.101&gt;</a>;tag=3544276353-446053</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Call-ID: 1351817-3544276353-446044@nextone</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        CSeq: 1 ACK</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Allow: INVITE, BYE, OPTIONS, CANCEL, ACK,
                        REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK,
                        UPDATE</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.253;branch=z9hG4bK3b5e.12d52d27.2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Via: SIP/2.0/UDP
                        x.x.x.101:5060;branch=z9hG4bKde33285d3f6afec6b8ce5c7ef7f135e1</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Contact: <a moz-do-not-send="true"
                          href="mailto:sip:12054@x.x.x.101:5060"
                          target="_blank">&lt;sip:12054@x.x.x.101:5060&gt;</a></div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        Content-Length: 0</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        .:&nbsp;</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12526]:
                        DBG:core:forward_request: orig. len=1822,
                        new_len=1884, proto=1</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:core:parse_msg: SIP Request:</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:core:parse_msg: &nbsp;method: &nbsp;&lt;ACK&gt;</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:core:parse_msg: &nbsp;uri: &nbsp; &nbsp;
                        &lt;sip:x.x.x.253;did=c75.06cce112&gt;</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:core:parse_msg: &nbsp;version: &lt;SIP/2.0&gt;</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:core:parse_headers: flags=2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:core:parse_to_param: tag=c4d8a7fc-CC-33</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:core:parse_to: end of header reached,
                        state=29</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:core:parse_to: display={}, ruri={<a
                          moz-do-not-send="true"
                          href="mailto:sip:7917573108366435@x.x.x.253"
                          target="_blank">sip:7917573108366435@x.x.x.253</a>}</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:core:get_hdr_field: &lt;To&gt; [57]; uri=[<a
                          moz-do-not-send="true"
                          href="mailto:sip:7917573108366435@x.x.x.253"
                          target="_blank">sip:7917573108366435@x.x.x.253</a>]&nbsp;</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:core:get_hdr_field: to body [<a
                          moz-do-not-send="true"
                          href="mailto:sip:7917573108366435@x.x.x.253"
                          target="_blank">&lt;sip:7917573108366435@x.x.x.253&gt;</a>]</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:core:get_hdr_field: cseq &lt;CSeq&gt;:
                        &lt;1&gt; &lt;ACK&gt;</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:core:parse_via_param: found param type 232,
                        &lt;branch&gt; = &lt;z9hG4bK3b5e.12d52d27.2&gt;;
                        state=16</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:core:parse_via: end of header reached,
                        state=5</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:core:parse_headers: via found, flags=2</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:core:parse_headers: this is the first via</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:core:receive_msg: After parse_msg...</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:core:receive_msg: preparing to run routing
                        scripts...</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:sl:sl_filter_ACK: to late to be a local ACK!</div>
                      <div class="gmail_extra">Apr 24 13:12:42 prox-qos
                        /usr/local/sbin/opensips[12528]:
                        DBG:maxfwd:is_maxfwd_present: value = 47&nbsp;</div>
                      <div class="gmail_extra"><br>
                      </div>
                      <div class="gmail_extra"><br>
                      </div>
                      <div class="gmail_extra"> <br>
                      </div>
                      <br>
                      <div class="gmail_quote">On Mon, Apr 23, 2012 at
                        4:41 AM, Vlad Paiu <span dir="ltr">&lt;<a
                            moz-do-not-send="true"
                            href="mailto:vladpaiu@opensips.org"
                            target="_blank">vladpaiu@opensips.org</a>&gt;</span>
                        wrote:<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"> Hello,<br>
                            <br>
                            Please post a full SIP trace of the dialog
                            where the ACK is not properly routed, as
                            well as the OpenSIPS full debug log for it.<br>
                            <br>
                            Regards,<br>
                            <pre cols="72">Vlad Paiu
OpenSIPS 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 04/20/2012 09:11 PM, Wilmar Campos
                                wrote: </div>
                            </div>
                            <blockquote type="cite">
                              <div>
                                <div>Hi to All,
                                  <div>I hope everybody is well and
                                    ready for the weekend!</div>
                                  <div><br>
                                    <div>In the last days I have been
                                      playing with the topologyhiding
                                      from the Dialog Module, I am using
                                      Opensips 1.8.0.</div>
                                    <div>When I dont
                                      use&nbsp;topology_hiding() all messages
                                      are transmited OK, but when I use
                                      it, all but the ACK messages are
                                      transmited, &nbsp;t_relay is executed
                                      but message is never delivered to
                                      the other party.</div>
                                    <div><br>
                                    </div>
                                    <div>Can you please point me to
                                      the&nbsp;right&nbsp;direction here.</div>
                                    <div><br>
                                    </div>
                                    <div>I am pretty sure I am detecting
                                      the ACK, also I am sure t_relay
                                      its been executed.</div>
                                    <div><br>
                                    </div>
                                    <div>Thank all for seeing this..</div>
                                    <div>
                                      <div><br>
                                      </div>
                                      -- <br>
                                      Wilmar Campos<br>
                                    </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>
                          <br>
_______________________________________________<br>
                          Users mailing list<br>
                          <a moz-do-not-send="true"
                            href="mailto:Users@lists.opensips.org"
                            target="_blank">Users@lists.opensips.org</a><br>
                          <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><br>
                          <br>
                        </blockquote>
                      </div>
                      <br>
                      <br clear="all">
                      <div><br>
                      </div>
                      -- <br>
                      Wilmar Campos<br>
                    </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>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            Users mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
            <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><br>
            <br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        Wilmar Campos<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>
  </body>
</html>