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

Bogdan-Andrei Iancu bogdan at opensips.org
Mon Feb 17 22:38:21 CET 2014


Hello,

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 
"foo.bar.com" is resolved to (as IPs); neither when the next IP is 
tried.  There is no type of route to give you access to the requests at 
that time in the routing process (the outbound edge).

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 ?

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 17.02.2014 22:21, Leon de Rooij wrote:
> 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 <http://foo.bar.com>
> * After t_relay() OpenSIPS resolves (NAPTR) it to _sip._udp.bar.com 
> <http://udp.bar.com> and after that (SRV) to gw1.bar.com 
> <http://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 <http://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 <mailto: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 Developer
>     http://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 list
>>     Users at lists.opensips.org  <mailto:Users at lists.opensips.org>
>>     http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140217/fbaa5473/attachment.htm>


More information about the Users mailing list