[Kamailio-Users] DNS lookup for requests within dialog

Olle E. Johansson oej at edvina.net
Fri Sep 25 17:16:48 CEST 2009


24 sep 2009 kl. 12.46 skrev Daniel-Constantin Mierla:

> Hello,
>
> On 24.09.2009 12:10 Uhr, catalina oancea wrote:
>> Hi,
>>
>> In my scenario kamailio is not a registrar, it's just a proxy
>> forwarding requests from asterisk to the provider.
>>
> I see.
>
> As Juha said, REGISTER does not create a real dialog, since the  
> contact in 200OK is the address of publisher not of destination. So  
> a proxy does not have within-dialog like routing information.
>
> So here is a hack you can try:
> - add record route on your proxy
> - the provider should add its own record route to REGISTER reply --  
> if it is kamailio, that is simple via append_to_reply() from  
> textops, just before save() call.
> - hope/pray that asterisk is using these dialog info for building re- 
> registration messages
> - on your kamailio route based on Route header
>
RFC 3261, section 10.3:
Registrars MUST ignore the Record-Route header field if it is included  
in a REGISTER request. Registrars
MUST NOT include a Record-Route header field in any response to a  
REGISTER request.
A registrar might receive a request that traversed a proxy which  
treats REGISTER as an unknown request and
which added a Record-Route header field value.

Oops.

/O
>
> Cheers,
> Daniel
>
>>
>> 2009/9/24 Daniel-Constantin Mierla <miconda at gmail.com>:
>>
>>> Hello,
>>>
>>> On 24.09.2009 11:47 Uhr, catalina oancea wrote:
>>>
>>>> Hi all,
>>>>
>>>>
>>>> I tested the following scenario:
>>>>
>>>> astreisk                        kamailio                provider 
>>>> (hostname)
>>>>       -------------------->    dns lookup     -------------------->
>>>>         REGISTER 1                              REGISTER 1
>>>>
>>>>        <--------------------                       
>>>> <--------------------
>>>>         401                                          401
>>>>
>>>>         -------------------->   dns lookup      
>>>> -------------------->
>>>>         REGISTER 2                              REGISTER 2
>>>>         (same dialog, increased cseq)
>>>>
>>>>
>>>>
>>>> It seems that kamailio does dns lookup again when receiving  
>>>> REGISTER
>>>> 2, although both registers are part of the same dialog. Is this the
>>>> expected behavior?
>>>>
>>>>
>>>>
>>> IIRC now, there is no place in registrar related modules  
>>> (registrar and
>>> usrloc) where DNS query is done. You have some checks in your  
>>> config that
>>> caused that.
>>>
>>> There is also an option to fetch existing contacts from location  
>>> and see if
>>> it is an update (matching by call id and cseq) and do directly
>>> save("location").
>>>
>>> Cheers,
>>> Daniel
>>>
>>> --
>>> Daniel-Constantin Mierla
>>> * Kamailio SIP Masterclass, Nov 9-13, 2009, Berlin
>>> * http://www.asipto.com/index.php/sip-router-masterclass/
>>>
>>>
>>>
>>
>> _______________________________________________
>> Kamailio (OpenSER) - Users mailing list
>> Users at lists.kamailio.org
>> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
>> http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
>>
>>
>
> -- 
> Daniel-Constantin Mierla
> * Kamailio SIP Masterclass, Nov 9-13, 2009, Berlin
> * http://www.asipto.com/index.php/sip-router-masterclass/
>
>
> _______________________________________________
> Kamailio (OpenSER) - Users mailing list
> Users at lists.kamailio.org
> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
> http://lists.openser-project.org/cgi-bin/mailman/listinfo/users

---
* Olle E Johansson - oej at edvina.net
* Cell phone +46 70 593 68 51, Office +46 8 96 40 20, Sweden






More information about the Users mailing list