[OpenSIPS-Users] Pre-load different routes after DNS NAPTR/SRV lookup

Leon de Rooij leon.derooij at gmail.com
Mon Feb 17 21:21:49 CET 2014


Hi Bogdan,

Thanks for your answer, the automatic failover is clear, but I'd like to
achieve something extra, namely:

* I set the RURI domain-part to foo.bar.com
* After t_relay() OpenSIPS resolves (NAPTR) it to _sip._udp.bar.com and
after that (SRV) to gw1.bar.com (prio 1) and after that (A) to 1.1.1.1
* 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 1.0.0.0/8 should have a preloaded
route-set X, and add the appropriate route header(s)
* 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.

Is this possible ?

Thanks & best regards,

Leon de Rooij


On Mon, Feb 17, 2014 at 7:35 PM, Bogdan-Andrei Iancu <bogdan at opensips.org>wrote:

>  Hello,
>
> 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.
>
> See the "disable_dns_failover" param -
> http://www.opensips.org/Documentation/Script-CoreParameters-1-10#toc39
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>
> On 14.02.2014 17:37, Leon de Rooij wrote:
>
> Hi all,
>
>  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.
>
>  I've been trying to fix it like this:
>
>  * put fqdn in ruri
>  * t_on_failure("1")
>  * t_on_branch("1")
> * t_relay()
>
>  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
>
>  ERROR:tm:t_forward_nonack: failure to add branches
>
>  Anybody know how this should work ?
>
>  Thanks & best regards,
>
>  Leon de Rooij
>
>
> _______________________________________________
> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140217/fc1e2e57/attachment.htm>


More information about the Users mailing list