<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"><tt>Hello Leon,<br>
        <br>
        The branch route is specially design to map over the SIP branch
        concept - still you are looking for something lower (almost
        network level)&nbsp; - in branch route, the destination is still a
        SIP URI, you do not know yet the IP behind it; the DNS lookup is
        done after branch route.<br>
        <br>
        If we invent a new type of route to be triggered after DNS
        lookup, it will be difficult to allow changes over the RURI, as
        you may change again the destination (the domain part). But I'm
        open to any suggestion on finding a solution for this - the
        second instance solution is a bit ugly, I have to admit. <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 18.02.2014 10:24, Leon de Rooij wrote:<br>
    </div>
    <blockquote
cite="mid:CAESdRjm32YC4z7eiytZbCCcpKwXrPnnWwgDbR4CTjsWbhMFyHA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Bogdan,
        <div><br>
        </div>
        <div>Alright, that's clear. I was hoping to get the information
          from the branch_route[]. A second instance did cross my mind
          but I don't want to make it overly complex :)</div>
        <div><br>
        </div>
        <div>Thanks &amp; best regards,</div>
        <div><br>
        </div>
        <div>Leon</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Mon, Feb 17, 2014 at 10:38 PM,
          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> 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><tt>Hello,<br>
                  <br>
                  The DNS lookups and the serial forking is
                  transparently done for the script. What I mean is,
                  from script level, you will not see what "<a
                    moz-do-not-send="true" href="http://foo.bar.com"
                    target="_blank">foo.bar.com</a>" is resolved to (as
                  IPs); neither when the next IP is tried.&nbsp; There is no
                  type of route to give you access to the requests at
                  that time in the routing process (the outbound edge).<br>
                  <br>
                  Have you consider having a second instance of OpenSIPS
                  (as outbound proxy, after the one doing the DNS) to
                  see the destination IP and do the prefixing or so ?<br>
                  <br>
                  Regards,<br>
                </tt>
                <div class="">
                  <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>
                  <div class="h5"> On 17.02.2014 22:21, Leon de Rooij
                    wrote:<br>
                  </div>
                </div>
              </div>
              <div>
                <div class="h5">
                  <blockquote type="cite">
                    <div dir="ltr">Hi Bogdan,
                      <div><br>
                      </div>
                      <div>Thanks for your answer, the automatic
                        failover is clear, but I'd like to achieve
                        something extra, namely:</div>
                      <div><br>
                      </div>
                      <div>* I set the RURI domain-part to <a
                          moz-do-not-send="true"
                          href="http://foo.bar.com" target="_blank">foo.bar.com</a></div>
                      <div>* After t_relay() OpenSIPS resolves (NAPTR)
                        it to _sip._<a moz-do-not-send="true"
                          href="http://udp.bar.com" target="_blank">udp.bar.com</a>
                        and after that (SRV) to <a
                          moz-do-not-send="true"
                          href="http://gw1.bar.com" target="_blank">gw1.bar.com</a>
                        (prio 1) and after that (A) to 1.1.1.1</div>
                      <div> * Now when this 1.1.1.1 is found I'd like to
                        look it up in a database and for example see
                        that all hosts within <a moz-do-not-send="true"
                          href="http://1.0.0.0/8" target="_blank">1.0.0.0/8</a>
                        should have a preloaded route-set X, and add the
                        appropriate route header(s)</div>
                      <div>* Let's say this 1.1.1.1 is down, then
                        OpenSIPS will do a second lookup (or is lookup
                        done only once and are all possible records
                        saved in some AVP?), but anyway, let say it does
                        a second lookup, which resolves to 2.2.2.2 (prio
                        2), then I'd like to lookup that IP in my db and
                        maybe preload some other routes.</div>
                      <div><br>
                      </div>
                      <div>Is this possible ?</div>
                      <div><br>
                      </div>
                      <div>Thanks &amp; best regards,</div>
                      <div><br>
                      </div>
                      <div>Leon de Rooij &nbsp;</div>
                    </div>
                    <div class="gmail_extra"><br>
                      <br>
                      <div class="gmail_quote">On Mon, Feb 17, 2014 at
                        7:35 PM, 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>
                        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><tt>Hello,<br>
                                <br>
                                OpenSIPS automatically does DNS-based
                                failover (using the NATPR, SRV and A
                                records for the domain) - there is not
                                need to do it manually from script.
                                Using the same principal (serial
                                forking), transparent for you, OpenSIPS
                                TM module will do it for you.<br>
                                <br>
                                See the "disable_dns_failover" param - <a
                                  moz-do-not-send="true"
href="http://www.opensips.org/Documentation/Script-CoreParameters-1-10#toc39"
                                  target="_blank">http://www.opensips.org/Documentation/Script-CoreParameters-1-10#toc39</a><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> On 14.02.2014 17:37, Leon de Rooij
                                  wrote:<br>
                                </div>
                              </div>
                            </div>
                            <blockquote type="cite">
                              <div>
                                <div>
                                  <div dir="ltr">Hi all,
                                    <div><br>
                                    </div>
                                    <div>I'd like to route a call to a
                                      domain, perform NAPTR,SRV,A
                                      lookups and in each serial
                                      failure_route, use the resolved
                                      destination IP to set a custom
                                      pre-loaded route.</div>
                                    <div> <br>
                                    </div>
                                    <div>I've been trying to fix it like
                                      this:</div>
                                    <div><br>
                                    </div>
                                    <div>* put fqdn in ruri</div>
                                    <div>
                                      <div>* t_on_failure("1")</div>
                                    </div>
                                    <div>* t_on_branch("1")</div>
                                    <div>* t_relay()</div>
                                    <div><br>
                                    </div>
                                    <div>Should I then be able to get
                                      the resolved destination IP
                                      address in the branch_route[1] ?
                                      How should I then get the second,
                                      third, etc ip adress ? I tried to
                                      put another t_on_branch("1") in
                                      the failure_route but that results
                                      in an</div>
                                    <div><br>
                                    </div>
                                    <div>ERROR:tm:t_forward_nonack:
                                      failure to add branches</div>
                                    <div><br>
                                    </div>
                                    <div>Anybody know how this should
                                      work ?</div>
                                    <div><br>
                                    </div>
                                    <div>Thanks &amp; best regards,</div>
                                    <div><br>
                                    </div>
                                    <div>Leon de Rooij</div>
                                  </div>
                                  <br>
                                  <fieldset></fieldset>
                                  <br>
                                </div>
                              </div>
                              <pre>_______________________________________________
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>
                            <br>
                          </div>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>