[Freeswitch-users] DNS resolving for REGISTER requests

Sebastian Denz denzs at gonicus.de
Mon Jun 24 13:33:05 UTC 2019


Am 6/24/19 um 3:22 PM schrieb Mike Jerris:
> On Mon, Jun 24, 2019 at 9:19 AM Sebastian Denz <denzs at gonicus.de> wrote:
> 
>> Using "sofia loglevel sresolv 9" i dont see any sres_cache_get() calls
>> at all before FS sends a REGISTER.
>>
>> But they are done before any other (new) transaction.
>>
>> Regarding RFC 3263 Section 4. this seems to be kinda valid,
>> because the ongoing RE-REGISTERS requests are happening in-dialog so
>> they are not a _new_ transaction?!
> 
> 
> They ARE a new transaction.

Ah right! Of course...

>>
>> But from a practical point of view i would expect there should be a
>> mechanism which ensures the used IP is are still valid?!
>>
>> So i think at least the internal dns cache should be used...
>>
>> What do you suggest?
>>
>> Is there anything else i can do to narrow this down and/or should i open
>> an issue in
> 
> Jira?
>>
>>
> certainly a jira but this needs someone to dig in the code and find a
> solution

I'll make a testsetup to be able reproduce it as i cant fiddle around on
the production system...

When i am sure it is reproducible on the current HEAD i'll open an issue
and try to help fixing it...

> Am 6/24/19 um 3:02 PM schrieb Mike Jerris:
>>> if that’s the case it’s an issue with the resolver cache in sofia-sip
>>>
>>> On Mon, Jun 24, 2019 at 9:01 AM Sebastian Denz <denzs at gonicus.de> wrote:
>>>
>>>> Hello Mike,
>>>>
>>>> thanks for getting in the discussion!
>>>>
>>>> I have a pcap-trace from last saturday containing sip and dns where i
>>>> can see the following behaviour:
>>>>
>>>> 11:39:32 FS does an SRV-Lookup for _sip._tcp.reg.sip-trunk.telekom.de
>>>>          -> Answer contains three records with TTL:3600
>>>>          FS does an A-Lookup for the record with the lowest priority
>>>>          -> Answer contains an IPv4 adress with TTL:216
>>>>
>>>> FS registers to the provided ip address and re-registers every ~ 5
>> minutes
>>>>
>>>> But there is no more dns traffic for the rest of the day (~ 12.5
>> hours)...
>>>>
>>>> Version is 1.8.2-3-a98a958ac3~64bit on Debian Stretch.
>>>>
>>>> Could this be an issue with the systems resolving logic (libnss) or is
>>>> the resolving completly done by FS itself?
>>>>
>>>> Am 6/24/19 um 2:19 PM schrieb Mike Jerris:
>>>>> if the DNS entries haven’t yet expired then freeswitch won’t query
>> again.
>>>>> The provider should set lower expiration on their records before a
>> change
>>>>> or wait the full expiration after making a change to
>>>>> actually move hosts or they will cause this issue.  This has always
>> been
>>>>> how the DNS system works.
>>>>>
>>>>> On Mon, Jun 24, 2019 at 8:14 AM Sebastian Denz <denzs at gonicus.de>
>> wrote:
>>>>>
>>>>>> That is already the case..
>>>>>>
>>>>>> When FS starts up it does an SRV-Lookup which contains several
>> adresses.
>>>>>>
>>>>>> One thing is.. the old endpoint is still working..
>>>>>>
>>>>>> The provider just changes the IP behind the A record of the first SRV
>>>>>> result.
>>>>>>
>>>>>> But the main problem is that FS does not use DNS at all before
>> sending a
>>>>>> REGISTER... So i doubt this can be workarounded without touching the
>>>>>> code of FS or (and that is what i am going to do) use an external
>> script
>>>>>> to detect the change and then trigger a gateway restart in FS...
>>>>>>
>>>>>> Am 6/24/19 um 1:30 PM schrieb Giovanni Maruzzelli:
>>>>>>> Maybe, just maybe, putting all addresses in srv records, FS will read
>>>>>> that
>>>>>>> at startup, then try them all if first fail? No idea if works... Just
>>>>>>> curious...
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Jun 24, 2019, 12:18 Sebastian Denz <denzs at gonicus.de> wrote:
>>>>>>>
>>>>>>>> I already thought about something like that..
>>>>>>>>
>>>>>>>> But the main reason for the problem seems to be, that FreeSWITCH
>> does
>>>>>>>> not query the dns (remote or local) at all before sending the
>>>>>>>> REGISTER... :-/
>>>>>>>>
>>>>>>>> I could workaround the current issue easily by using static
>> addresses
>>>>>>>> but then i would loose the failover capability and i would have to
>>>> check
>>>>>>>> for changes manually or by script... normally dns would just solve
>>>> that
>>>>>>>> by itself :)
>>>>>>>>
>>>>>>>> I think i could put Kamailio in front of FreeSWITCH and let it
>> handle
>>>>>>>> the dns resolution, but that feels like using a sledgehammer to
>> crack
>>>> a
>>>>>>>> nut ;)
>>>>>>>>
>>>>>>>> And i would prefer a tiny approach, ideally with FreeSWITCH behaving
>>>>>>>> correctly...?!
>>>>>>>>
>>>>>>>> Am 6/24/19 um 12:24 PM schrieb Giovanni Maruzzelli:
>>>>>>>>> obviously, you can locally provide dns with dnsmasq or such, easily
>>>>>>>>> configured, for other domains too.
>>>>>>>>>
>>>>>>>>> Maybe you can put all SRV addresses, with different weights, in
>> your
>>>>>> own
>>>>>>>>> (eg, locally defined) zone definition for deutsche telekom, and
>>>>>>>> freeswitch
>>>>>>>>> will try them all.
>>>>>>>>>
>>>>>>>>> Not sure this will work, but maybe yes :)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Mon, Jun 24, 2019 at 12:19 PM Sebastian Denz <denzs at gonicus.de>
>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Thank you for giving me that pointer!
>>>>>>>>>>
>>>>>>>>>> I thought i would have searched for everything regarding that
>> topic,
>>>>>>>>>> but obviously i missed that post!
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>
>>>>
>> https://lists.freeswitch.org/pipermail/freeswitch-users/2018-January/128837.html
>>>>>>>>>>
>>>>>>>>>> I'll contact Kai directly as i was not able to found a
>> corresponding
>>>>>>>>>> issue in the tracker...
>>>>>>>>>>
>>>>>>>>>> But if anyone has another idea regarding the problem, i would of
>>>>>> course
>>>>>>>>>> appreciate any hints too! ;)
>>>>>>>>>>
>>>>>>>>>> Sebastian
>>>>>>>>>>
>>>>>>>>>> Am 6/24/19 um 11:21 AM schrieb Giovanni Maruzzelli:
>>>>>>>>>>> I believe this question  was already asked in the past in this
>>>>>> mailing
>>>>>>>>>>> list, and IIRC the answer was no.
>>>>>>>>>>>
>>>>>>>>>>> You may wanto to check on the mailing list archives (in
>> signature),
>>>>>>>>>> because
>>>>>>>>>>> maybe my merory is wrong.
>>>>>>>>>>>
>>>>>>>>>>> -giovanni
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Mon, Jun 24, 2019 at 11:14 AM Sebastian Denz <
>> denzs at gonicus.de>
>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hello,
>>>>>>>>>>>>
>>>>>>>>>>>> i am using FreeSWITCH as SBC to our SIP provider (Deutsche
>> Telekom
>>>>>> in
>>>>>>>>>>>> germany).
>>>>>>>>>>>>
>>>>>>>>>>>> This works quite well, but ~ once in a month we are unable to do
>>>>>>>>>>>> outbound calls.
>>>>>>>>>>>>
>>>>>>>>>>>> It turned out, that the provider changes some IPs from time to
>>>>>> time..
>>>>>>>>>>>>
>>>>>>>>>>>> That leads to FreeSWITCH being registered to the old IP while
>>>>>>>>>>>> INVITE-requests of new dialogs are sent to the new address. The
>>>>>>>> provider
>>>>>>>>>>>> terminates this with 403 - forbidden.
>>>>>>>>>>>>
>>>>>>>>>>>> The registration happens every 5 minutes, but FreeSWITCH does
>> not
>>>>>>>> update
>>>>>>>>>>>> the dns cache for the target IP address. So i gets stuck in that
>>>>>>>>>>>> situation being registered on the old IP while sending INVITEs
>> to
>>>>>> the
>>>>>>>>>>>> new one..
>>>>>>>>>>>>
>>>>>>>>>>>> The only solution to that is reloading the profile or restarting
>>>>>>>>>>>> FreeSWITCH...
>>>>>>>>>>>>
>>>>>>>>>>>> Is there an option to make FreeSWITCH asking the dns _before
>>>> every_
>>>>>>>>>>>> REGISTER? Or do you have any other suggestion on how to fix
>> this?
>>>>>>>>>>>>
>>>>>>>>>>>> Best regards,
>>>>>>>>>>>> Sebastian Denz
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>
>>>>
>> _________________________________________________________________________
>>>>>>>>>>>>
>>>>>>>>>>>> The FreeSWITCH project is sponsored by SignalWire
>>>>>>>>>> https://signalwire.com
>>>>>>>>>>>> Enhance your FreeSWITCH install with disruptive priced SMS and
>>>> PSTN
>>>>>>>>>>>> services.
>>>>>>>>>>>> Build your next product on our scalable cloud platform.
>>>>>>>>>>>>
>>>>>>>>>>>> Join our online community to chat in real time
>>>>>>>>>>>> https://signalwire.community
>>>>>>>>>>>>
>>>>>>>>>>>> Professional FreeSWITCH Services
>>>>>>>>>>>> sales at freeswitch.com
>>>>>>>>>>>> https://freeswitch.com
>>>>>>>>>>>>
>>>>>>>>>>>> Official FreeSWITCH Sites
>>>>>>>>>>>> https://freeswitch.com/oss
>>>>>>>>>>>> https://freeswitch.org/confluence
>>>>>>>>>>>> https://cluecon.com
>>>>>>>>>>>>
>>>>>>>>>>>> FreeSWITCH-users mailing list
>>>>>>>>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>>>>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>>>>>>>> UNSUBSCRIBE:
>>>>>>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>>>>>>>> https://freeswitch.com
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>
>>>>>>
>>>>
>> _________________________________________________________________________
>>>>>>>>>>>
>>>>>>>>>>> The FreeSWITCH project is sponsored by SignalWire
>>>>>>>> https://signalwire.com
>>>>>>>>>>> Enhance your FreeSWITCH install with disruptive priced SMS and
>> PSTN
>>>>>>>>>> services.
>>>>>>>>>>> Build your next product on our scalable cloud platform.
>>>>>>>>>>>
>>>>>>>>>>> Join our online community to chat in real time
>>>>>>>>>> https://signalwire.community
>>>>>>>>>>>
>>>>>>>>>>> Professional FreeSWITCH Services
>>>>>>>>>>> sales at freeswitch.com
>>>>>>>>>>> https://freeswitch.com
>>>>>>>>>>>
>>>>>>>>>>> Official FreeSWITCH Sites
>>>>>>>>>>> https://freeswitch.com/oss
>>>>>>>>>>> https://freeswitch.org/confluence
>>>>>>>>>>> https://cluecon.com
>>>>>>>>>>>
>>>>>>>>>>> FreeSWITCH-users mailing list
>>>>>>>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>>>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>>>>>>> UNSUBSCRIBE:
>>>>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>>>>>>> https://freeswitch.com
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>
>>>>
>> _________________________________________________________________________
>>>>>>>>>>
>>>>>>>>>> The FreeSWITCH project is sponsored by SignalWire
>>>>>>>> https://signalwire.com
>>>>>>>>>> Enhance your FreeSWITCH install with disruptive priced SMS and
>> PSTN
>>>>>>>>>> services.
>>>>>>>>>> Build your next product on our scalable cloud platform.
>>>>>>>>>>
>>>>>>>>>> Join our online community to chat in real time
>>>>>>>>>> https://signalwire.community
>>>>>>>>>>
>>>>>>>>>> Professional FreeSWITCH Services
>>>>>>>>>> sales at freeswitch.com
>>>>>>>>>> https://freeswitch.com
>>>>>>>>>>
>>>>>>>>>> Official FreeSWITCH Sites
>>>>>>>>>> https://freeswitch.com/oss
>>>>>>>>>> https://freeswitch.org/confluence
>>>>>>>>>> https://cluecon.com
>>>>>>>>>>
>>>>>>>>>> FreeSWITCH-users mailing list
>>>>>>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>>>>>> UNSUBSCRIBE:
>>>>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>>>>>> https://freeswitch.com
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>
>>>>
>> _________________________________________________________________________
>>>>>>>>>
>>>>>>>>> The FreeSWITCH project is sponsored by SignalWire
>>>>>> https://signalwire.com
>>>>>>>>> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
>>>>>>>> services.
>>>>>>>>> Build your next product on our scalable cloud platform.
>>>>>>>>>
>>>>>>>>> Join our online community to chat in real time
>>>>>>>> https://signalwire.community
>>>>>>>>>
>>>>>>>>> Professional FreeSWITCH Services
>>>>>>>>> sales at freeswitch.com
>>>>>>>>> https://freeswitch.com
>>>>>>>>>
>>>>>>>>> Official FreeSWITCH Sites
>>>>>>>>> https://freeswitch.com/oss
>>>>>>>>> https://freeswitch.org/confluence
>>>>>>>>> https://cluecon.com
>>>>>>>>>
>>>>>>>>> FreeSWITCH-users mailing list
>>>>>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>>>>> UNSUBSCRIBE:
>>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>>>>> https://freeswitch.com
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>
>> _________________________________________________________________________
>>>>>>>>
>>>>>>>> The FreeSWITCH project is sponsored by SignalWire
>>>>>> https://signalwire.com
>>>>>>>> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
>>>>>>>> services.
>>>>>>>> Build your next product on our scalable cloud platform.
>>>>>>>>
>>>>>>>> Join our online community to chat in real time
>>>>>>>> https://signalwire.community
>>>>>>>>
>>>>>>>> Professional FreeSWITCH Services
>>>>>>>> sales at freeswitch.com
>>>>>>>> https://freeswitch.com
>>>>>>>>
>>>>>>>> Official FreeSWITCH Sites
>>>>>>>> https://freeswitch.com/oss
>>>>>>>> https://freeswitch.org/confluence
>>>>>>>> https://cluecon.com
>>>>>>>>
>>>>>>>> FreeSWITCH-users mailing list
>>>>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>>>> UNSUBSCRIBE:
>>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>>>> https://freeswitch.com
>>>>>>>
>>>>>>>
>>>>>>>
>>>>
>> _________________________________________________________________________
>>>>>>>
>>>>>>> The FreeSWITCH project is sponsored by SignalWire
>>>> https://signalwire.com
>>>>>>> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
>>>>>> services.
>>>>>>> Build your next product on our scalable cloud platform.
>>>>>>>
>>>>>>> Join our online community to chat in real time
>>>>>> https://signalwire.community
>>>>>>>
>>>>>>> Professional FreeSWITCH Services
>>>>>>> sales at freeswitch.com
>>>>>>> https://freeswitch.com
>>>>>>>
>>>>>>> Official FreeSWITCH Sites
>>>>>>> https://freeswitch.com/oss
>>>>>>> https://freeswitch.org/confluence
>>>>>>> https://cluecon.com
>>>>>>>
>>>>>>> FreeSWITCH-users mailing list
>>>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>>> UNSUBSCRIBE:
>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>>> https://freeswitch.com
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>> _________________________________________________________________________
>>>>>>
>>>>>> The FreeSWITCH project is sponsored by SignalWire
>>>> https://signalwire.com
>>>>>> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
>>>>>> services.
>>>>>> Build your next product on our scalable cloud platform.
>>>>>>
>>>>>> Join our online community to chat in real time
>>>>>> https://signalwire.community
>>>>>>
>>>>>> Professional FreeSWITCH Services
>>>>>> sales at freeswitch.com
>>>>>> https://freeswitch.com
>>>>>>
>>>>>> Official FreeSWITCH Sites
>>>>>> https://freeswitch.com/oss
>>>>>> https://freeswitch.org/confluence
>>>>>> https://cluecon.com
>>>>>>
>>>>>> FreeSWITCH-users mailing list
>>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>> UNSUBSCRIBE:
>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>> https://freeswitch.com
>>>>>
>>>>>
>>>>>
>> _________________________________________________________________________
>>>>>
>>>>> The FreeSWITCH project is sponsored by SignalWire
>> https://signalwire.com
>>>>> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
>>>> services.
>>>>> Build your next product on our scalable cloud platform.
>>>>>
>>>>> Join our online community to chat in real time
>>>> https://signalwire.community
>>>>>
>>>>> Professional FreeSWITCH Services
>>>>> sales at freeswitch.com
>>>>> https://freeswitch.com
>>>>>
>>>>> Official FreeSWITCH Sites
>>>>> https://freeswitch.com/oss
>>>>> https://freeswitch.org/confluence
>>>>> https://cluecon.com
>>>>>
>>>>> FreeSWITCH-users mailing list
>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>> UNSUBSCRIBE:
>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>> https://freeswitch.com
>>>>>
>>>>
>>>>
>>>>
>> _________________________________________________________________________
>>>>
>>>> The FreeSWITCH project is sponsored by SignalWire
>> https://signalwire.com
>>>> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
>>>> services.
>>>> Build your next product on our scalable cloud platform.
>>>>
>>>> Join our online community to chat in real time
>>>> https://signalwire.community
>>>>
>>>> Professional FreeSWITCH Services
>>>> sales at freeswitch.com
>>>> https://freeswitch.com
>>>>
>>>> Official FreeSWITCH Sites
>>>> https://freeswitch.com/oss
>>>> https://freeswitch.org/confluence
>>>> https://cluecon.com
>>>>
>>>> FreeSWITCH-users mailing list
>>>> FreeSWITCH-users at lists.freeswitch.org
>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>> UNSUBSCRIBE:
>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>> https://freeswitch.com
>>>
>>>
>>> _________________________________________________________________________
>>>
>>> The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
>>> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
>> services.
>>> Build your next product on our scalable cloud platform.
>>>
>>> Join our online community to chat in real time
>> https://signalwire.community
>>>
>>> Professional FreeSWITCH Services
>>> sales at freeswitch.com
>>> https://freeswitch.com
>>>
>>> Official FreeSWITCH Sites
>>> https://freeswitch.com/oss
>>> https://freeswitch.org/confluence
>>> https://cluecon.com
>>>
>>> FreeSWITCH-users mailing list
>>> FreeSWITCH-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> https://freeswitch.com
>>>
>>
>>
>> _________________________________________________________________________
>>
>> The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
>> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
>> services.
>> Build your next product on our scalable cloud platform.
>>
>> Join our online community to chat in real time
>> https://signalwire.community
>>
>> Professional FreeSWITCH Services
>> sales at freeswitch.com
>> https://freeswitch.com
>>
>> Official FreeSWITCH Sites
>> https://freeswitch.com/oss
>> https://freeswitch.org/confluence
>> https://cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> https://freeswitch.com
> 
> 
> _________________________________________________________________________
> 
> The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
> Build your next product on our scalable cloud platform.
> 
> Join our online community to chat in real time https://signalwire.community
> 
> Professional FreeSWITCH Services
> sales at freeswitch.com
> https://freeswitch.com
> 
> Official FreeSWITCH Sites
> https://freeswitch.com/oss
> https://freeswitch.org/confluence
> https://cluecon.com
> 
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> https://freeswitch.com
> 




More information about the FreeSWITCH-users mailing list