<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I see that pjsip_resolver.c tries unsuccessfuly to resolve the hostname each 10 seconds:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:monospace"><span style="color:rgb(0,0,0)">[Aug 27 07:51:36] DEBUG[595] res_pjsip.c: 0x7f75282eb150: Wrapper created
</span><br>[Aug 27 07:51:36] DEBUG[595] res_pjsip.c: 0x7f75282eb150: Set timer to 2000 msec
<br>[Aug 27 07:51:36] DEBUG[595] res_pjsip/pjsip_resolver.c: Performing SIP DNS resolution of target '<a href="http://rpi6.in.xorcom.com">rpi6.in.xorcom.com</a>'
<br>[Aug 27 07:51:36] DEBUG[595] res_pjsip/pjsip_resolver.c: Transport type for target '<a href="http://rpi6.in.xorcom.com">rpi6.in.xorcom.com</a>' is 'Unspecified'
<br>[Aug 27 07:51:36] DEBUG[595] res_pjsip/pjsip_resolver.c: [0x7f75282fe7f8] Created resolution tracking for target '<a href="http://rpi6.in.xorcom.com">rpi6.in.xorcom.com</a>'
<br>[Aug 27 07:51:36] DEBUG[595] res_pjsip/pjsip_resolver.c: [0x7f75282fe7f8] Added target '<a href="http://rpi6.in.xorcom.com">rpi6.in.xorcom.com</a>' with record type '35', transport 'Unspecified', and port '0'
<br>[Aug 27 07:51:36] DEBUG[595] res_pjsip/pjsip_resolver.c: [0x7f75282fe7f8] Added target '_sips._<a href="http://tcp.rpi6.in.xorcom.com">tcp.rpi6.in.xorcom.com</a>' with record type '33', transport 'TLS', and port '5061'
<br>[Aug 27 07:51:36] DEBUG[595] res_pjsip/pjsip_resolver.c: [0x7f75282fe7f8] Added target '_sip._<a href="http://tcp.rpi6.in.xorcom.com">tcp.rpi6.in.xorcom.com</a>' with record type '33', transport 'TCP', and port '5060'
<br>[Aug 27 07:51:36] DEBUG[595] res_pjsip/pjsip_resolver.c: [0x7f75282fe7f8] Added target '_sip._<a href="http://udp.rpi6.in.xorcom.com">udp.rpi6.in.xorcom.com</a>' with record type '33', transport 'UDP', and port '5060'
<br>[Aug 27 07:51:36] DEBUG[595] res_pjsip/pjsip_resolver.c: [0x7f75282fe7f8] Added target '<a href="http://rpi6.in.xorcom.com">rpi6.in.xorcom.com</a>' with record type '1', transport 'UDP', and port '5060'
<br>[Aug 27 07:51:36] DEBUG[595] res_pjsip/pjsip_resolver.c: [0x7f75282fe7f8] Starting initial resolution using parallel queries for target '<a href="http://rpi6.in.xorcom.com">rpi6.in.xorcom.com</a>'
<br>[Aug 27 07:51:36] DEBUG[605] res_pjsip/pjsip_resolver.c: [0x7f75282fe7f8] All parallel queries completed
<br>[Aug 27 07:51:36] DEBUG[605] res_pjsip/pjsip_resolver.c: [0x7f75282fe7f8] Resolution completed - 0 viable targets
<br>[Aug 27 07:51:36] DEBUG[595] res_pjsip/pjsip_resolver.c: [0x7f75282fe7f8] Invoking user callback with '0' addresses
<br>[Aug 27 07:51:36] DEBUG[595] res_pjsip.c: 0x7f75282eb150: PJSIP tsx response received
<br>[Aug 27 07:51:36] DEBUG[595] res_pjsip.c: 0x7f75282eb150: Cancelling timer
<br>[Aug 27 07:51:36] DEBUG[595] res_pjsip.c: 0x7f75282eb150: Timer cancelled
<br>[Aug 27 07:51:36] DEBUG[595] res_pjsip.c: 0x7f75282eb150: Callbacks executed
<br>[Aug 27 07:51:36] DEBUG[595] res_pjsip.c: 0x7f75282eb150: wrapper destroyed
<br>[Aug 27 07:51:36] DEBUG[595] res_pjsip/pjsip_options.c: Contact g145/sip:<a href="http://rpi6.in.xorcom.com">rpi6.in.xorcom.com</a> status didn't change: Unreachable, RTT: 0.000 msec
<br>[Aug 27 07:51:36] DEBUG[595] res_pjsip/pjsip_options.c: AOR 'g145' now has 0 available contacts<br>
<br></span></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">But a DNS server is available at this time:</div><span style="font-family:monospace"><span style="color:rgb(0,0,0)"># host <a href="http://rpi6.in.xorcom.com">rpi6.in.xorcom.com</a>
</span><br><a href="http://rpi6.in.xorcom.com">rpi6.in.xorcom.com</a> has address 192.168.0.175<br>
<br></span><span style="font-family:monospace"><span style="color:rgb(0,0,0)"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">#</span> ping <a href="http://rpi6.in.xorcom.com">rpi6.in.xorcom.com</a>
</span><br>PING <a href="http://rpi6.in.xorcom.com">rpi6.in.xorcom.com</a> (192.168.0.175) 56(84) bytes of data.
<br>64 bytes from <a href="http://rpi6.in.xorcom.com">rpi6.in.xorcom.com</a> (192.168.0.175): icmp_seq=1 ttl=64 time=0.990 ms<br>
<br></span><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"></div></div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thank you</span>,<br>Leonid Fainshtein<br><br></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 27, 2020 at 1:52 PM Joshua C. Colp <<a href="mailto:jcolp@sangoma.com">jcolp@sangoma.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Thu, Aug 27, 2020 at 7:48 AM Leonid Fainshtein <<a href="mailto:leonid.fainshtein@xorcom.com" target="_blank">leonid.fainshtein@xorcom.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif">Hi,</div><div style="font-family:arial,helvetica,sans-serif">I have Asterisk 16.x with a trunk configured with a hostname in PJSIP AOR.</div><div style="font-family:arial,helvetica,sans-serif">The registration is not required for this trunk.</div><div style="font-family:arial,helvetica,sans-serif">I paid attention that Asterisk performs DNS resolving of the hostname that is configured in the AOR 'contact' parameter only upon the Asterisk start only.</div><div style="font-family:arial,helvetica,sans-serif">Thus, if Asterisk is started when the DNS server is unreachable due to the Internet connection failure then the 'contact' will be not resolvable forever even when the Internet connection is returned. As a result of that, the 'qualify' procedure is not performed and the trunk status is 'Unavail'.</div><div style="font-family:arial,helvetica,sans-serif">The only way to revive the trunk is to restart Asterisk. Even 'pjsip reload' doesn't solve the problem.</div><div style="font-family:arial,helvetica,sans-serif">Is it the 'by design' Asterisk behavior or I have missed something?<br></div></div></blockquote><div><br></div><div>PJSIP in Asterisk uses asynchronous DNS, so it should resolve at the time the request is actually made and should work afterwards. Not doing so would be a bug, and collecting a debug level log (debug to a file in logger.conf with core set debug 9) would explicitly show what is going on for DNS.</div></div><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-family:tahoma,sans-serif"><font color="#073763">Joshua C. Colp</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Asterisk Technical Lead</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Sangoma Technologies</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Check us out at <a href="http://www.sangoma.com" target="_blank">www.sangoma.com</a> and <a href="http://www.asterisk.org" target="_blank">www.asterisk.org</a></font><br></div></div></div></div></div></div></div></div></div></div></div>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
Check out the new Asterisk community forum at: <a href="https://community.asterisk.org/" rel="noreferrer" target="_blank">https://community.asterisk.org/</a><br>
<br>
New to Asterisk? Start here:<br>
      <a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" rel="noreferrer" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Getting+Started</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a></blockquote></div>