[OpenSIPS-Users] How much A records are retained in IP comparison
Igor Solovyov
igor at choochee.com
Wed Mar 2 21:40:30 CET 2011
Dave,
Thanks for idea.
I've done the test:
route[test]
{
$var(fqdn) = "google.com";
$avp(s:ips) = $(var(fqdn){ip.resolve});
xlog("L_ERR", "--TEST--:
$(avp(s:ips)[0])::$(avp(s:ips)[1])::$(avp(s:ips)[2])");
return(-11);
}
The results:
Mar 2 22:20:12 os1 opensips: --TEST--: 74.125.87.99::<null>::<null>
Mar 2 22:20:16 os1 opensips: --TEST--: 74.125.87.104::<null>::<null>
As you can see we have just a Round Robbin.
Regards,
Igor.
On Wed, Mar 2, 2011 at 7:49 PM, Dave Singer <dave.singer at wideideas.com>wrote:
> Igor,
>
> I'm pretty sure that won't work at all. You would need to use the
> transformation ip.resolve.
> I don't know if it returns multiple IPs but if it does you would want to
> assign it to an avp that can handle multiple.
> An example to try:
> $var(fqdn) = "some.server.com"; # Not sure if you can do a transformation
> directly on a string. Never tried.
> $avp(s:ips) = $(var(fqdn){ip.resolve});
> xlog("INFO", "$(avp(s:ips)[0])::$(avp(s:ips)[1])::$(avp(s:ips)[2])\n");
> if ( avp_check("$avp(s:ips)", "eq/$si/") ) { .... }
>
> Let me know what you find.
> Dave
>
> On Wed, Mar 2, 2011 at 9:20 AM, Igor Solovyov <igor at choochee.com> wrote:
>
>> Hi,
>>
>> If I use
>> if ($si=="some.server.com")
>> {
>> ...
>> }
>> and some.server.com has several A records,
>> are all of them used in upper comparison?
>> How does TTL influence on saved IPs?
>>
>> Regards,
>> Igor.
>>
>> _______________________________________________
>> Users mailing list
>> 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/20110302/b27ddcf0/attachment.htm>
More information about the Users
mailing list