[sr-dev] Patch: Fix SRV lookups when dns failover is enabled

Daniel-Constantin Mierla miconda at gmail.com
Sun Oct 20 22:09:49 CEST 2013


I applied the two patches related to this matter. I only renamed the 
structure you defined, stripping '_t' from its name as this suffix is 
commonly used across the code as a typedef'ed struct name.

Cheers,
Daniel

On 10/18/13 10:01 AM, Øyvind Kolbu wrote:
> On 17.10.2013 19:09, Daniel-Constantin Mierla wrote:
>> looking at the first patch, I see that PROTO_NONE was removed from those
>> switch statements on proto variables. I guess it was the reason of the
>> issue, as you pointed it out, that a non-existing udp srv records
>> results in failure. Isn't it?
>
> No, the reason was that it can never be true, as just before *proto is
> set to PROTO_UDP if not set.
>
>         if (proto){ /* makes sure we have a protocol set*/
>                 if (*proto==0)
>                         *proto=srv_proto=PROTO_UDP; /* default */
>                 else
>                         srv_proto=*proto;
>         }else{
>                 srv_proto=PROTO_UDP;
>         }
>
> The problem with the old code was that, unless you specified a
> protocol, it would only attempt to search up _sip._udp and not
> continue with _sip._tcp and possible other protocols.
>
>> To be sure I got properly the new logic, if proto var is PROTO_NONE,
>> then create_srv_pref_list(..) will build a list of protocols to try
>> based on config preferences. The it will be a dns lookup of the values
>> in the list. Right?
>
> Yes, if the original *proto is PROTO_NONE, then call
> create_srv_pref_list and then stop on the first match in the
> generated list.


-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Trainings - Berlin, Nov 25-28; Miami, Nov 18-20, 2013
   - more details about Kamailio trainings at http://www.asipto.com -




More information about the sr-dev mailing list