Asterisk call dialplan runs very slowly

HI ,
I am running asterisk 15.2.2 on openwrt based board

I am facing an issue that after a few calls are made the asterisk dialplan proceeds very slowly. I am attaching a video capture of the asterisk console here . You can see that each step will take long time

Video Capture

And below is the pjsip history. I am not sure why it takes so long for the call to really establish in this case and how can I solve it

No.   Timestamp  (Dir) Address                  SIP Message
===== ========== ============================== ===================================
00000 1654513774 * <== 192.168.1.152:5060       OPTIONS sip:192.168.1.18 SIP/2.0
00001 1654513774 * ==> 192.168.1.152:5060       SIP/2.0 401 Unauthorized
00002 1654513774 * <== 192.168.1.152:5060       OPTIONS sip:192.168.1.18 SIP/2.0
00003 1654513774 * ==> 192.168.1.152:5060       SIP/2.0 200 OK
00004 1654513774 * ==> 192.168.1.202:40590      OPTIONS sip:127@192.168.1.202:40590 SIP/2.0
00005 1654513775 * ==> 192.168.1.202:45568      OPTIONS sip:127@192.168.1.202:45568 SIP/2.0
00006 1654513776 * ==> 192.168.71.207:5060      OPTIONS sip:165@192.168.71.207:5060 SIP/2.0
00007 1654513776 * ==> 192.168.71.207:5060      OPTIONS sip:165@192.168.71.207:5060 SIP/2.0
00008 1654513777 * ==> 192.168.1.202:46576      OPTIONS sip:127@192.168.1.202:46576 SIP/2.0
00009 1654513777 * ==> 192.168.1.202:46576      OPTIONS sip:127@192.168.1.202:46576 SIP/2.0
00010 1654513777 * ==> 192.168.71.207:5060      OPTIONS sip:165@192.168.71.207:5060 SIP/2.0
00011 1654513778 * <== 192.168.1.161:5060       OPTIONS sip:192.168.1.18 SIP/2.0
00012 1654513778 * ==> 192.168.1.161:5060       SIP/2.0 401 Unauthorized
00013 1654513778 * <== 192.168.1.161:5060       OPTIONS sip:192.168.1.18 SIP/2.0
00014 1654513778 * ==> 192.168.1.161:5060       SIP/2.0 200 OK
00015 1654513778 * ==> 192.168.1.202:46576      OPTIONS sip:127@192.168.1.202:46576 SIP/2.0
00016 1654513778 * ==> 192.168.1.202:40590      OPTIONS sip:127@192.168.1.202:40590 SIP/2.0
00017 1654513779 * ==> 192.168.1.202:45568      OPTIONS sip:127@192.168.1.202:45568 SIP/2.0
00018 1654513779 * ==> 192.168.71.207:5060      OPTIONS sip:165@192.168.71.207:5060 SIP/2.0
00019 1654513780 * ==> 192.168.1.101:59792      OPTIONS sip:101@192.168.1.101:59792 SIP/2.0
00020 1654513780 * ==> 192.168.1.152:5060       OPTIONS sip:152@192.168.1.152:5060;line=44e7a748603a80f SIP/2.0
00021 1654513780 * <== 192.168.1.152:5060       SIP/2.0 200 OK
00022 1654513780 * ==> 192.168.1.202:46576      OPTIONS sip:127@192.168.1.202:46576 SIP/2.0
00023 1654513781 * ==> 192.168.1.101:59792      OPTIONS sip:101@192.168.1.101:59792 SIP/2.0
00024 1654513782 * ==> 192.168.1.101:59792      OPTIONS sip:101@192.168.1.101:59792 SIP/2.0
00025 1654513782 * ==> 192.168.1.202:40590      OPTIONS sip:127@192.168.1.202:40590 SIP/2.0
00026 1654513783 * ==> 192.168.71.207:5060      OPTIONS sip:165@192.168.71.207:5060 SIP/2.0
00027 1654513784 * ==> 192.168.1.101:59792      OPTIONS sip:101@192.168.1.101:59792 SIP/2.0
00028 1654513784 * ==> 192.168.1.161:5060       OPTIONS sip:80701@192.168.1.161:5060;line=883b6118c5ca21e SIP/2.0
00029 1654513784 * ==> 192.168.1.202:46576      OPTIONS sip:127@192.168.1.202:46576 SIP/2.0
00030 1654513784 * <== 192.168.1.161:5060       SIP/2.0 200 OK
00031 1654513785 * <== 192.168.71.202:5060      REGISTER sip:192.168.1.18 SIP/2.0
00032 1654513785 * ==> 192.168.71.202:5060      SIP/2.0 401 Unauthorized
00033 1654513785 * <== 192.168.71.202:5060      REGISTER sip:192.168.1.18 SIP/2.0
00034 1654513785 * ==> 192.168.71.202:5060      SIP/2.0 200 OK
00035 1654513786 * ==> 192.168.71.202:5060      OPTIONS sip:70701@192.168.71.202:5060 SIP/2.0
00036 1654513786 * <== 192.168.71.202:5060      SIP/2.0 200 OK
00037 1654513786 * ==> 192.168.1.202:40590      OPTIONS sip:127@192.168.1.202:40590 SIP/2.0
00038 1654513787 * ==> 192.168.71.207:5060      OPTIONS sip:165@192.168.71.207:5060 SIP/2.0
00039 1654513788 * ==> 192.168.1.101:59792      OPTIONS sip:101@192.168.1.101:59792 SIP/2.0
00040 1654513788 * <== 192.168.71.202:5060      INVITE sip:90701@192.168.1.18 SIP/2.0
00041 1654513788 * ==> 192.168.71.202:5060      SIP/2.0 401 Unauthorized
00042 1654513788 * <== 192.168.71.202:5060      ACK sip:90701@192.168.1.18 SIP/2.0
00043 1654513788 * <== 192.168.71.202:5060      INVITE sip:90701@192.168.1.18 SIP/2.0
00044 1654513788 * ==> 192.168.71.202:5060      SIP/2.0 100 Trying
00045 1654513788 * ==> 192.168.1.202:46576      OPTIONS sip:127@192.168.1.202:46576 SIP/2.0
00046 1654513791 * ==> 192.168.71.207:5060      OPTIONS sip:165@192.168.71.207:5060 SIP/2.0
00047 1654513792 * ==> 192.168.1.101:59792      OPTIONS sip:101@192.168.1.101:59792 SIP/2.0
00048 1654513792 * <== 192.168.71.202:5060      OPTIONS sip:192.168.1.18 SIP/2.0
00049 1654513792 * ==> 192.168.71.202:5060      SIP/2.0 401 Unauthorized
00050 1654513792 * <== 192.168.71.202:5060      OPTIONS sip:192.168.1.18 SIP/2.0
00051 1654513792 * ==> 192.168.71.202:5060      SIP/2.0 200 OK
00052 1654513792 * ==> 192.168.1.202:46576      OPTIONS sip:127@192.168.1.202:46576 SIP/2.0
00053 1654513795 * ==> 192.168.71.207:5060      OPTIONS sip:165@192.168.71.207:5060 SIP/2.0
00054 1654513795 * ==> 192.168.1.101:5060       OPTIONS sip:101@192.168.1.101:5060 SIP/2.0
00055 1654513795 * <== 192.168.1.101:5060       SIP/2.0 200 OK
00056 1654513796 * ==> 192.168.1.101:59792      OPTIONS sip:101@192.168.1.101:59792 SIP/2.0
00057 1654513796 * ==> 192.168.1.202:47703      OPTIONS sip:127@192.168.1.202:47703 SIP/2.0
00058 1654513796 * ==> 192.168.1.202:45568      OPTIONS sip:127@192.168.1.202:45568 SIP/2.0
00059 1654513796 * ==> 192.168.1.202:47703      OPTIONS sip:127@192.168.1.202:47703 SIP/2.0
00060 1654513796 * ==> 192.168.1.202:46576      OPTIONS sip:127@192.168.1.202:46576 SIP/2.0
00061 1654513797 * ==> 192.168.1.202:45568      OPTIONS sip:127@192.168.1.202:45568 SIP/2.0
00062 1654513797 * ==> 192.168.1.202:38777      OPTIONS sip:127@192.168.1.202:38777 SIP/2.0
00063 1654513797 * ==> 192.168.1.202:47703      OPTIONS sip:127@192.168.1.202:47703 SIP/2.0
00064 1654513798 * ==> 192.168.1.202:38777      OPTIONS sip:127@192.168.1.202:38777 SIP/2.0
00065 1654513798 * ==> 192.168.1.202:45568      OPTIONS sip:127@192.168.1.202:45568 SIP/2.0
00066 1654513798 * ==> 192.168.1.231:19415      OPTIONS sip:116@192.168.1.231:19415 SIP/2.0
00067 1654513799 * ==> 192.168.1.202:38777      OPTIONS sip:127@192.168.1.202:38777 SIP/2.0
00068 1654513799 * ==> 192.168.1.231:19415      OPTIONS sip:116@192.168.1.231:19415 SIP/2.0
00069 1654513799 * ==> 192.168.1.202:47703      OPTIONS sip:127@192.168.1.202:47703 SIP/2.0
00070 1654513799 * ==> 192.168.71.207:5060      OPTIONS sip:165@192.168.71.207:5060 SIP/2.0
00071 1654513800 * ==> 192.168.1.101:59792      OPTIONS sip:101@192.168.1.101:59792 SIP/2.0
00072 1654513800 * ==> 192.168.1.231:19415      OPTIONS sip:116@192.168.1.231:19415 SIP/2.0
00073 1654513800 * ==> 192.168.1.202:45568      OPTIONS sip:127@192.168.1.202:45568 SIP/2.0
00074 1654513800 * ==> 192.168.1.202:46576      OPTIONS sip:127@192.168.1.202:46576 SIP/2.0
00075 1654513801 * ==> 192.168.1.202:38777      OPTIONS sip:127@192.168.1.202:38777 SIP/2.0
00076 1654513802 * ==> 192.168.1.231:19415      OPTIONS sip:116@192.168.1.231:19415 SIP/2.0
00077 1654513803 * ==> 192.168.1.202:47703      OPTIONS sip:127@192.168.1.202:47703 SIP/2.0
00078 1654513803 * ==> 192.168.71.207:5060      OPTIONS sip:165@192.168.71.207:5060 SIP/2.0
00079 1654513804 * ==> 192.168.1.101:59792      OPTIONS sip:101@192.168.1.101:59792 SIP/2.0
00080 1654513804 * <== 192.168.1.152:5060       OPTIONS sip:192.168.1.18 SIP/2.0
00081 1654513804 * ==> 192.168.1.152:5060       SIP/2.0 401 Unauthorized
00082 1654513804 * <== 192.168.1.152:5060       OPTIONS sip:192.168.1.18 SIP/2.0
00083 1654513804 * ==> 192.168.1.152:5060       SIP/2.0 200 OK
00084 1654513804 * ==> 192.168.1.202:45568      OPTIONS sip:127@192.168.1.202:45568 SIP/2.0
00085 1654513804 * ==> 192.168.1.202:46576      OPTIONS sip:127@192.168.1.202:46576 SIP/2.0
00086 1654513805 * ==> 192.168.1.202:38777      OPTIONS sip:127@192.168.1.202:38777 SIP/2.0
00087 1654513806 * ==> 192.168.1.231:19415      OPTIONS sip:116@192.168.1.231:19415 SIP/2.0
00088 1654513807 * ==> 192.168.1.202:47703      OPTIONS sip:127@192.168.1.202:47703 SIP/2.0
00089 1654513807 * ==> 192.168.71.207:5060      OPTIONS sip:165@192.168.71.207:5060 SIP/2.0
00090 1654513808 * ==> 192.168.1.101:59792      OPTIONS sip:101@192.168.1.101:59792 SIP/2.0
00091 1654513808 * ==> 192.168.1.202:45568      OPTIONS sip:127@192.168.1.202:45568 SIP/2.0
00092 1654513808 * <== 192.168.1.161:5060       OPTIONS sip:192.168.1.18 SIP/2.0
00093 1654513808 * ==> 192.168.1.161:5060       SIP/2.0 401 Unauthorized
00094 1654513808 * <== 192.168.1.161:5060       OPTIONS sip:192.168.1.18 SIP/2.0
00095 1654513808 * ==> 192.168.1.161:5060       SIP/2.0 200 OK
00096 1654513808 * ==> 192.168.1.202:46576      OPTIONS sip:127@192.168.1.202:46576 SIP/2.0
00097 1654513809 * ==> 192.168.1.202:38777      OPTIONS sip:127@192.168.1.202:38777 SIP/2.0
00098 1654513809 * ==> 192.168.1.130:5060       OPTIONS sip:ata-2@192.168.1.130:5060 SIP/2.0
00099 1654513809 * <== 192.168.1.130:5060       SIP/2.0 200 OK
00100 1654513810 * ==> 192.168.1.231:19415      OPTIONS sip:116@192.168.1.231:19415 SIP/2.0
00101 1654513811 * ==> 192.168.1.202:47703      OPTIONS sip:127@192.168.1.202:47703 SIP/2.0
00102 1654513812 * ==> 192.168.1.101:59792      OPTIONS sip:101@192.168.1.101:59792 SIP/2.0
00103 1654513812 * ==> 192.168.1.202:45568      OPTIONS sip:127@192.168.1.202:45568 SIP/2.0
00104 1654513813 * ==> 192.168.1.202:38777      OPTIONS sip:127@192.168.1.202:38777 SIP/2.0
00105 1654513814 * ==> 192.168.1.231:19415      OPTIONS sip:116@192.168.1.231:19415 SIP/2.0
00106 1654513815 * ==> 192.168.1.202:40590      OPTIONS sip:127@192.168.1.202:40590 SIP/2.0
00107 1654513815 * ==> 192.168.1.202:47703      OPTIONS sip:127@192.168.1.202:47703 SIP/2.0
00108 1654513815 * ==> 192.168.1.202:40590      OPTIONS sip:127@192.168.1.202:40590 SIP/2.0
00109 1654513816 * ==> 188.135.85.187:64704     INVITE sip:90701@188.135.85.187:64704;transport=TLS SIP/2.0
00110 1654513816 * <== 188.135.85.187:64704     SIP/2.0 100 Trying
00111 1654513816 * <== 188.135.85.187:64704     SIP/2.0 180 Ringing
00112 1654513816 * ==> 188.135.85.187:64704     PRACK sip:90701@188.135.85.187:64704;transport=TLS SIP/2.0
00113 1654513816 * ==> 192.168.71.202:5060      SIP/2.0 180 Ringing
00114 1654513816 * ==> 192.168.1.202:45568      OPTIONS sip:127@192.168.1.202:45568 SIP/2.0
00115 1654513816 * <== 188.135.85.187:64704     SIP/2.0 200 OK
00116 1654513816 * ==> 188.135.85.187:64704     OPTIONS sip:90701@188.135.85.187:64704;transport=TLS SIP/2.0
00117 1654513816 * <== 188.135.85.187:64704     SIP/2.0 200 OK
00118 1654513816 * ==> 192.168.1.202:40590      OPTIONS sip:127@192.168.1.202:40590 SIP/2.0
00119 1654513817 * ==> 192.168.1.202:38777      OPTIONS sip:127@192.168.1.202:38777 SIP/2.0
00120 1654513818 * ==> 192.168.1.231:19415      OPTIONS sip:116@192.168.1.231:19415 SIP/2.0
00121 1654513818 * ==> 192.168.1.202:40590      OPTIONS sip:127@192.168.1.202:40590 SIP/2.0
00122 1654513819 * ==> 192.168.1.202:47703      OPTIONS sip:127@192.168.1.202:47703 SIP/2.0
00123 1654513820 * ==> 192.168.1.202:45568      OPTIONS sip:127@192.168.1.202:45568 SIP/2.0
00124 1654513821 * ==> 192.168.1.202:38777      OPTIONS sip:127@192.168.1.202:38777 SIP/2.0
00125 1654513821 * ==> 5.37.230.17:57022        OPTIONS sip:141@5.37.230.17:57022;transport=TLS SIP/2.0
00126 1654513821 * <== 5.37.230.17:57022        SIP/2.0 200 OK
00127 1654513821 * ==> 192.168.1.161:5060       OPTIONS sip:161@192.168.1.161:5060;line=0c57db2d55b8030 SIP/2.0
00128 1654513821 * <== 192.168.1.161:5060       SIP/2.0 200 OK
00129 1654513822 * ==> 192.168.1.231:19415      OPTIONS sip:116@192.168.1.231:19415 SIP/2.0
00130 1654513822 * <== 192.168.71.202:5060      OPTIONS sip:192.168.1.18 SIP/2.0
00131 1654513822 * ==> 192.168.71.202:5060      SIP/2.0 401 Unauthorized
00132 1654513822 * <== 192.168.71.202:5060      OPTIONS sip:192.168.1.18 SIP/2.0
00133 1654513822 * ==> 192.168.71.202:5060      SIP/2.0 200 OK
00134 1654513822 * ==> 192.168.1.202:40590      OPTIONS sip:127@192.168.1.202:40590 SIP/2.0
00135 1654513823 * ==> 192.168.1.202:47703      OPTIONS sip:127@192.168.1.202:47703 SIP/2.0
00136 1654513824 * ==> 192.168.1.202:45568      OPTIONS sip:127@192.168.1.202:45568 SIP/2.0
00137 1654513824 * <== 188.135.85.187:64704     SIP/2.0 200 OK
00138 1654513824 * ==> 188.135.85.187:64704     ACK sip:90701@188.135.85.187:64704;transport=TLS SIP/2.0
00139 1654513824 * ==> 192.168.71.202:5060      SIP/2.0 200 OK
00140 1654513824 * <== 188.135.85.187:64704     INFO sip:asterisk@5.37.230.17:5061;transport=TLS SIP/2.0
00141 1654513824 * ==> 188.135.85.187:64704     SIP/2.0 200 OK
00142 1654513824 * ==> 192.168.71.202:5060      INFO sip:70701@192.168.71.202:5060 SIP/2.0
00143 1654513824 * <== 192.168.71.202:5060      ACK sip:192.168.1.18:5060 SIP/2.0
00144 1654513824 * ==> 192.168.71.202:5060      INVITE sip:70701@192.168.71.202:5060 SIP/2.0
00145 1654513824 * <== 192.168.71.202:5060      SIP/2.0 100 Trying
00146 1654513824 * <== 192.168.71.202:5060      SIP/2.0 200 OK
00147 1654513824 * <== 192.168.71.202:5060      SIP/2.0 200 OK
00148 1654513824 * ==> 192.168.71.202:5060      ACK sip:70701@192.168.71.202:5060 SIP/2.0
00149 1654513825 * ==> 192.168.1.202:38777      OPTIONS sip:127@192.168.1.202:38777 SIP/2.0
00150 1654513826 * ==> 192.168.1.231:19415      OPTIONS sip:116@192.168.1.231:19415 SIP/2.0
00151 1654513826 * ==> 192.168.1.202:40590      OPTIONS sip:127@192.168.1.202:40590 SIP/2.0
00152 1654513827 * ==> 192.168.1.202:47703      OPTIONS sip:127@192.168.1.202:47703 SIP/2.0
00153 1654513828 * ==> 192.168.1.202:45568      OPTIONS sip:127@192.168.1.202:45568 SIP/2.0
00154 1654513829 * ==> 192.168.1.202:38777      OPTIONS sip:127@192.168.1.202:38777 SIP/2.0
00155 1654513830 * ==> 192.168.1.231:19415      OPTIONS sip:116@192.168.1.231:19415 SIP/2.0
00156 1654513830 * ==> 192.168.1.202:40590      OPTIONS sip:127@192.168.1.202:40590 SIP/2.0
00157 1654513832 * <== 188.135.85.187:64704     BYE sip:asterisk@5.37.230.17:5061;transport=TLS SIP/2.0
00158 1654513832 * ==> 188.135.85.187:64704     SIP/2.0 200 OK
00159 1654513832 * ==> 192.168.71.202:5060      BYE sip:70701@192.168.71.202:5060 SIP/2.0
00160 1654513832 * <== 192.168.71.202:5060      SIP/2.0 200 OK
00161 1654513834 * <== 192.168.1.152:5060       OPTIONS sip:192.168.1.18 SIP/2.0
00162 1654513834 * ==> 192.168.1.152:5060       SIP/2.0 401 Unauthorized
00163 1654513834 * <== 192.168.1.152:5060       OPTIONS sip:192.168.1.18 SIP/2.0
00164 1654513834 * ==> 192.168.1.152:5060       SIP/2.0 200 OK
00165 1654513834 * ==> 192.168.1.202:40590      OPTIONS sip:127@192.168.1.202:40590 SIP/2.0
00166 1654513836 * ==> 192.168.71.207:5060      OPTIONS sip:165@192.168.71.207:5060 SIP/2.0
00167 1654513836 * ==> 192.168.71.207:5060      OPTIONS sip:165@192.168.71.207:5060 SIP/2.0
00168 1654513837 * ==> 192.168.1.202:46576      OPTIONS sip:127@192.168.1.202:46576 SIP/2.0
00169 1654513837 * ==> 192.168.1.202:46576      OPTIONS sip:127@192.168.1.202:46576 SIP/2.0
00170 1654513837 * ==> 192.168.71.207:5060      OPTIONS sip:165@192.168.71.207:5060 SIP/2.0
00171 1654513838 * <== 192.168.1.161:5060       OPTIONS sip:192.168.1.18 SIP/2.0
00172 1654513838 * ==> 192.168.1.161:5060       SIP/2.0 401 Unauthorized
00173 1654513838 * <== 192.168.1.161:5060       OPTIONS sip:192.168.1.18 SIP/2.0
00174 1654513838 * ==> 192.168.1.161:5060       SIP/2.0 200 OK
00175 1654513838 * ==> 192.168.1.202:46576      OPTIONS sip:127@192.168.1.202:46576 SIP/2.0
00176 1654513838 * ==> 192.168.1.202:40590      OPTIONS sip:127@192.168.1.202:40590 SIP/2.0
00177 1654513839 * ==> 192.168.71.207:5060      OPTIONS sip:165@192.168.71.207:5060 SIP/2.0
00178 1654513840 * ==> 192.168.1.101:59792      OPTIONS sip:101@192.168.1.101:59792 SIP/2.0
00179 1654513840 * ==> 192.168.1.152:5060       OPTIONS sip:152@192.168.1.152:5060;line=44e7a748603a80f SIP/2.0
00180 1654513840 * ==> 192.168.1.202:46576      OPTIONS sip:127@192.168.1.202:46576 SIP/2.0
00181 1654513840 * <== 192.168.1.152:5060       SIP/2.0 200 OK
00182 1654513841 * ==> 192.168.1.101:59792      OPTIONS sip:101@192.168.1.101:59792 SIP/2.0
00183 1654513842 * ==> 192.168.1.101:59792      OPTIONS sip:101@192.168.1.101:59792 SIP/2.0
00184 1654513842 * ==> 192.168.1.202:40590      OPTIONS sip:127@192.168.1.202:40590 SIP/2.0
00185 1654513843 * ==> 192.168.71.207:5060      OPTIONS sip:165@192.168.71.207:5060 SIP/2.0
00186 1654513844 * ==> 192.168.1.101:59792      OPTIONS sip:101@192.168.1.101:59792 SIP/2.0
00187 1654513844 * ==> 192.168.1.161:5060       OPTIONS sip:80701@192.168.1.161:5060;line=883b6118c5ca21e SIP/2.0
00188 1654513844 * <== 192.168.1.161:5060       SIP/2.0 200 OK
00189 1654513844 * ==> 192.168.1.202:46576      OPTIONS sip:127@192.168.1.202:46576 SIP/2.0

Please provide the log, as text, from /var/log/asterisk/full, with verbosity at least 5. The former provides timestamps on each line and the latter ensures we can see what the dialplan is doing. You might even want to enable millisecond timestamps.

The history doesn’t show any undue delays in the bits I’ve sampled, although I wonder if you are overloading the underpowered machine.

Note that the console is a different process from the main Asterisk, and whilst you, hopefully don’t have a swap file, Linux will still swap read only content of the flash memory, if short on RAM.

I will upload the full log in a moment

Regarding the load, is it dependant of the number of endpoints in pjsip.conf or the total contacts registred and active calls?

As far as teh contacts i have the following number of contacts only at this time

It will grow when the system is deployed on production,

There are going to be around 250 or 300 contacts registered at a time

The system is powered by Allwinner A20 dual ARM Cortex-A7 cores, With 1GB of RAM.

Is there a general rule of thumb for calculating RAM and CPU requiremnets against No of endpoints, active contacts and active calls for running astersik ?

full.log.txt (268.1 KB)

Here is the log with the follwoing logger.conf

[general]

dateformat = %F %T.%3q   ; ISO 8601 date format with milliseconds

[logfiles]
console => notice,warning,error,dtmf
messages => notice,warning,error
;verbose => notice,warning,error,verbose
file => notice,warning,error,verbose
;full => notice,warning,error,verbose
full => notice,warning,error,verbose,dtmf,fax```

Nothing stands out except the long delay from the INVITE to the first diaplan line starting, and the large number of OPTIONS requests.

I think my first guess would be that you don’t have even a valid not found for DNS on the reverse resolution or one of the domain names, so Asterisk has to wait for a DNS timeout, before proceeding.

Can you please point to how can the DNS resolve issue can be solved?

Provide /etc/hosts, or locally hosted domain server cover for all IP addresses and domain names that are not covered by external name servers. Make sure that /etc/hosts is first in the search order, if you are relying on it.

I’m not sure what debugging levels you need to see DNS timeout in Asterisk, but you always packet capture port 53 to see what is happening.

More specifically, you get timeouts when there is a DNS server defined, but it is unreachable. If there is no server for a domain, but you can reach the root servers, you will get an authoritative not found, reasonably quickly

Below are my /etc/hosts and etc/resolv.conf files

cat /etc/hosts

127.0.0.1 localhost
127.0.0.1 SHUAL

cat /etc/resolv.conf

# Interface lan
nameserver 8.8.8.8

I am connecting one endpoint via a dyndns.net address . If instead of the ddns address I use the IP address of the asterisk in my sip client app , then the problem doesnt occur.

However I have to use a ddns address as we dont have a fixed IP.

Is there any config for DNS resolvs in asterisk to be made or we do have to handle it on the OS (Openwrt Linux) part.?

When I lookup any domain using nslookup on the linux console I get this

 nslookup myddns.ddns.net
Server:         8.8.8.8
Address:        8.8.8.8#53

Name:      myddns.ddns.net
Address 1: 5.37.230.17
*** Can't find myddns.ddns.net: No answer

You just reproduced the DNS problem without using Asterisk, which should answer your question.

This almost looks as though someone is blocking access to the dynamic DNS name server or you have no external connectivity. Using your, presumably bogus, name, I get:

** server can't find myddns.ddns.net: NXDOMAIN

Although I don’t get the same error as you if go through a machine that isn’t running a name server, but that could be a version difference, or that the recursive server is is detecting the timeout.

root@dhcppc4:~# nslookup  myddns.ddns.net 127.0.0.1
;; connection timed out; no servers could be reached

It might be interesting to try:

nslookup  myddns.ddns.net 204.16.253.53

but with a valid name. This directly accesses one of ddns.net’s name servers.

Sorry the real ddns domain is kindows2.ddns.net

And the nslookup address 1 is the correct IP
Address 1: 5.37.230.17

Resolves for me:

root@dhcppc4:~# nslookup kindows2.ddns.net
Server:		192.168.1.1
Address:	192.168.1.1#53

Non-authoritative answer:
Name:	kindows2.ddns.net
Address: 5.37.230.17

.
Also works through Google:

root@dhcppc4:~# nslookup kindows2.ddns.net 8.8.8.8
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
Name:	kindows2.ddns.net
Address: 5.37.230.17

I don’t understand why it says Address 1, rather than Address, and why it says timeout, after an apparent success.

Can you try dig, as it gives more information:

root@dhcppc4:~# dig @8.8.8.8 kindows2.ddns.net

; <<>> DiG 9.11.5-P4-5.1+deb10u7-Debian <<>> @8.8.8.8 kindows2.ddns.net
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30600
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;kindows2.ddns.net.		IN	A

;; ANSWER SECTION:
kindows2.ddns.net.	60	IN	A	5.37.230.17

;; Query time: 29 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Mon Jun 06 16:07:27 BST 2022
;; MSG SIZE  rcvd: 62
1 Like

Turning on debugging on nslookup, mine seems to be doing an A lookup, followed by an AAAA one (PV4, then IPV6). My guess is that you have triggered an anti-DoS mechanism on the Google server, by having your resolver library send two requests in quick succession, and its is discarding the second, one, causing the resolver library to timeout. I guess you need to use another public name sever, or interpose a caching one. Does your ISP not provide a name server?

Actually, it may be that it is nsllookup that is generating two queries, but overall, you are still tripping a rate limit, possibly combined with other users of your ISP.

root@dhcppc4:~# nslookup -debug kindows2.ddns.net 8.8.8.8
Server:		8.8.8.8
Address:	8.8.8.8#53

------------
    QUESTIONS:
	kindows2.ddns.net, type = A, class = IN
    ANSWERS:
    ->  kindows2.ddns.net
	internet address = 5.37.230.17
	ttl = 60
    AUTHORITY RECORDS:
    ADDITIONAL RECORDS:
------------
Non-authoritative answer:
Name:	kindows2.ddns.net
Address: 5.37.230.17
------------
    QUESTIONS:
	kindows2.ddns.net, type = AAAA, class = IN
    ANSWERS:
    AUTHORITY RECORDS:
    ->  ddns.net
	origin = nf1.no-ip.com
	mail addr = hostmaster.no-ip.com
	serial = 2448925247
	refresh = 10800
	retry = 1800
	expire = 604800
	minimum = 1800
	ttl = 1194
    ADDITIONAL RECORDS:
------------
1 Like

I changed my ddn from free version of no-ip to dyn-dns paid version and it helped solving it. It still sometimes makes some small delays from tiem to time but overall acceptable.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.