<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">AFAIK there is no any single pv that
      provides a destination for both sip message types (request/reply).<br>
      As you can see from my example $sel(next_hop.host) contains dst
      only for sip requests. To know where kamailio is going to send<br>
      a reply you can check the second VIA header parameters like
      received or host if received is not present.<br>
      <br>
      BTW after calling such a route $var(next_hop) or any other you
      want to use has what you need in a "single pv".<br>
      <br>
    </div>
    <blockquote
cite="mid:CAJUJwtiH5gPMXwchJNBeVOA_x_9tvebW-oNg_4-mSfWKD2uAEA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Thanks Vitaliy, 
        <div>That seems working, I am testing with it..it's great. </div>
        <div>Can I ask if there is any psuedo variable for this thing ! </div>
        <div><br>
        </div>
        <div>Best Regards,</div>
        <div>Sammy</div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Sat, Aug 24, 2013 at 3:10 PM,
          Vitaliy Aleksandrov <span dir="ltr"><<a
              moz-do-not-send="true"
              href="mailto:vitalik.voip@gmail.com" target="_blank">vitalik.voip@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <div>How about next config snippet:<br>
                <br>
                <i>route[GET_NEXT_HOP]</i><i><br>
                </i><i>{</i><i><br>
                </i><i>    $var(next_hop) = $null;</i><i><br>
                </i><i>    </i><i><br>
                </i><i>    if (is_request()) {</i><i><br>
                </i><i>        $var(next_hop) = $sel(next_hop.host);</i><i><br>
                </i><i>    } else if (is_reply()) {</i><i><br>
                </i><i>         if ($sel(via[2].received) != $null)</i><i><br>
                </i><i>            $var(next_hop) =
                  $sel(via[2].received);</i><i><br>
                </i><i>        else</i><i><br>
                </i><i>            $var(next_hop) = $sel(via[2].host);</i><i><br>
                </i><i>    }</i><i><br>
                </i><i>}</i><br>
                <br>
                If you need to know what next hop kamailio will use to
                forward current sip message (request/reply) you can just
                call route(GET_NEXT_HOP) which puts what you need into
                $var(next_hop).<br>
                <br>
              </div>
              <blockquote type="cite">
                <div>
                  <div class="h5">
                    <div dir="ltr">Dear list,
                      <div><br>
                      </div>
                      <div>Its just a little thing to ask but I somehow
                        can't seem to figure out which psuedo variable
                        to use to find out where a particular 200 OK is
                        destined to go. </div>
                      <div><br>
                      </div>
                      <div>the scenario is I've multiple media servers
                        in dispatcher and calls are distributed. I need
                        to capture a 200OK that is destined to go to a
                        particular ip!</div>
                      <div><br>
                      </div>
                      <div>I've tried using the dst_ip, $dd, $du but
                        none of them are giving any results for the 200
                        OK. I just need to know where do kamailio is
                        going to send this 200 since it is already a
                        part of an on-going INVITE/call.</div>
                      <div><br>
                      </div>
                      <div>Thanks,</div>
                      <div>Sammy</div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                  </div>
                </div>
                <pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
              </blockquote>
              <br>
            </div>
            <br>
            _______________________________________________<br>
            SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
            mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
              target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>