<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><tt>Hi Frank,<br>
        <br>
        We can use get_dialog_info , but a bit hackish :)  - as the
        search is based on the values of the dlg vars, not on the callid
        (unless you go and add to each dialog a variable containing the
        callid :) )<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>
      On 24.05.2014 02:18, frank fox wrote:<br>
    </div>
    <blockquote
      cite="mid:BAY407-EAS235C4BA0DA4C990931E3509C83E0@phx.gbl"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Exchange Server">
      <!-- converted from text -->
      <style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
      <div class="PlainText">Thank you Bogdan for the reply.<br>
        <br>
        I am wondering if I can use the get_dialog__info somehow to find
        out the original Invite (A) is sent back.<br>
        <br>
        I am still investigating if my SIP flow will always keep the
        contract (with the VIA header solution).<br>
        <br>
        Is there any other modules or functions that I could possibly
        use?<br>
        <br>
        Thank you,<br>
        Frank<br>
        <br>
        --- Original Message ---<br>
        <br>
        From: "Bogdan-Andrei Iancu" <a class="moz-txt-link-rfc2396E" href="mailto:bogdan@opensips.org">&lt;bogdan@opensips.org&gt;</a><br>
        Sent: May 22, 2014 1:06 PM<br>
        To: "frank fox" <a class="moz-txt-link-rfc2396E" href="mailto:franklyfox@outlook.com">&lt;franklyfox@outlook.com&gt;</a>,
        <a class="moz-txt-link-abbreviated" href="mailto:users@lists.opensips.org">users@lists.opensips.org</a><br>
        Subject: Re: hairpin and outside of dialog detection<br>
        <br>
      </div>
      <div style="background-color:#FFFFFF">
        <div class="x_moz-cite-prefix"><tt>Hello Frank,<br>
            <br>
            Well, the match dialog does not work for this as the second
            INVITE is not a sequential request, but an initial one (the
            dialog wise matching is done only on the sequential
            requests).<br>
            <br>
            You can do the check by looking at the IPs in the VIA
            header, hoping proxy2 is doing no topo hiding. So, when the
            call is back to proxy1, the via[2] ip should belong to
            itself.<br>
            <br>
            Regards,<br>
          </tt>
          <pre class="x_moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" class="x_moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
          On 20.05.2014 21:48, frank fox wrote:<br>
        </div>
        <blockquote type="cite">
          <style>
<!--
.x_hmmessage 
        {margin:0px;
        padding:0px}
body.x_hmmessage
        {font-size:12pt;
        font-family:Calibri}
-->
</style>
          <div dir="ltr"><br>
            Greetings:<br>
            <br>
            I have a scenario as below:<br>
            <pre>Proxy-1 ---(A)---&gt; Proxy-2 
      &lt;----(B)------------</pre>
            <br>
            (A) := Initial Invite from proxy-1 to proxy-2<br>
            (B) := proxy-2 modifies the $rd and sends the initial Invite
            back to proxy-1<br>
            <br>
            Question:<br>
            How can the proxy-1 knows that the coming Invite was
            originally sent by itself?<br>
            <br>
            It seems the match_dialog() doesn't work for this situation:<br>
            <br>
            dialog::  hash=3514:62628069"7"<br>
                    state:: 2<br>
                    user_flags:: 65536<br>
                    timestart:: 0<br>
                    timeout:: 0<br>
                    callid:: <a moz-do-not-send="true"
              class="x_moz-txt-link-abbreviated"
              href="mailto:a7ab8ff06766fabe1b4846712fba1051@10.242.65.162">
              a7ab8ff06766fabe1b4846712fba1051@10.242.65.162</a><br>
                    from_uri:: <a moz-do-not-send="true"
              class="x_moz-txt-link-abbreviated"
              href="mailto:sip:19905635611@10.242.65.162">
              sip:19905635611@10.242.65.162</a><br>
                    to_uri:: <a moz-do-not-send="true"
              class="x_moz-txt-link-abbreviated"
              href="mailto:sip:19905591214@external-sip.vocalocity.com">
              sip:19905591214@external-sip.vocalocity.com</a><br>
                    caller_tag:: 14174341581400528279229<br>
                    caller_contact:: <a moz-do-not-send="true"
              class="x_moz-txt-link-abbreviated"
              href="mailto:sip:19905635611@10.242.65.162:5060">
              sip:19905635611@10.242.65.162:5060</a><br>
                    callee_cseq:: 0<br>
                    caller_route_set::<br>
                    caller_bind_addr:: udp:10.116.239.217:5060<br>
                    callee_tag:: 16423468221400528279248<br>
                    callee_contact::<br>
                       caller_cseq:: 102<br>
                    callee_route_set::<br>
                    callee_bind_addr:: udp:10.116.239.217:5060<br>
            <br>
            <br>
            dialog::  hash=3514:62628069"8"<br>
                    state:: 2<br>
                    user_flags:: 65536<br>
                    timestart:: 0<br>
                    timeout:: 0<br>
                    callid:: <a moz-do-not-send="true"
              class="x_moz-txt-link-abbreviated"
              href="mailto:a7ab8ff06766fabe1b4846712fba1051@10.242.65.162">
              a7ab8ff06766fabe1b4846712fba1051@10.242.65.162</a><br>
                    from_uri:: <a moz-do-not-send="true"
              class="x_moz-txt-link-abbreviated"
              href="mailto:sip:19905635611@10.242.65.162">
              sip:19905635611@10.242.65.162</a><br>
                    to_uri:: <a moz-do-not-send="true"
              class="x_moz-txt-link-abbreviated"
              href="mailto:sip:19905591214@external-sip.vocalocity.com">
              sip:19905591214@external-sip.vocalocity.com</a><br>
                    caller_tag:: 14174341581400528279229<br>
                    caller_contact::<br>
                    callee_cseq:: 0<br>
                    caller_route_set::<br>
                    caller_bind_addr:: udp:10.116.239.217:5060<br>
                    callee_tag:: 16423468221400528279248<br>
                    callee_contact::<br>
                    caller_cseq:: 102<br>
                    callee_route_set::<br>
                    callee_bind_addr:: udp:10.116.239.217:5060<br>
            <br>
            <br>
            Regards,<br>
            Frank<br>
          </div>
        </blockquote>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>