<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello Amir,</p>
<p>what is your issue exactly:<br>
</p>
<p>- because of the missing DNS entry the dispatcher module would not detect the asterisk server as "down"</p>
<p>- because of the missing DNS entry your Kamailio would not (re)start properly</p>
<p>You could try with flag 16 to disable DNS resolution at startup in your dispatcher file:</p>
<p><a class="moz-txt-link-freetext" href="https://kamailio.org/docs/modules/5.2.x/modules/dispatcher.html#idm1020020140">https://kamailio.org/docs/modules/5.2.x/modules/dispatcher.html#idm1020020140</a><br>
</p>
<p>Cheers,</p>
<p>Henning<br>
</p>
<div class="moz-cite-prefix">Am 14.07.19 um 09:33 schrieb Amir:<br>
</div>
<blockquote type="cite" cite="mid:CAGYPPrxXsCps_kFu=JPwtT4QR4UOe_eHvd4KV2xPKTcFYMbzyQ@mail.gmail.com">
<div dir="ltr">
<div>I do not have a DNS server, Docker User-defined networks has it's own built in DNS server,</div>
<div>The problem is when I stop a container its DNS record would be deleted and therefore kamailio server could not check server health.</div>
<div>I think if I could tell kamailio server that IF you did not find a DNS record it means that a server is down my solution would work.<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sat, Jul 13, 2019 at 10:56 PM Mojtaba <<a href="mailto:mespio@gmail.com" moz-do-not-send="true">mespio@gmail.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">
Hello,<br>
Did you add SRV record for each server in your DNS server?<br>
<br>
On Sat, Jul 13, 2019 at 6:07 PM Fred Posner <<a href="mailto:fred@palner.com" target="_blank" moz-do-not-send="true">fred@palner.com</a>> wrote:<br>
><br>
> The error indicates kamailio can not resolve the location of asterisk2. Try checking the dns (can you resolve it on the kamailio box?) or using the IP.<br>
><br>
> -- Fred<br>
><br>
><br>
> On Jul 13, 2019, at 07:09, Amir <<a href="mailto:gheshlaghy@gmail.com" target="_blank" moz-do-not-send="true">gheshlaghy@gmail.com</a>> wrote:<br>
><br>
> Hi<br>
> I have created a kamailio container with docker and two asterisk container<br>
> And this is my dispatcher list:<br>
> 1 sip:asterisk:5060<br>
> 1 sip:asterisk2:5060<br>
> and this is my both asterisk SIP.conf<br>
> [Kamailio]<br>
> host=kamailio<br>
> port=5060<br>
> insecure=invite<br>
> type=friend<br>
> context=from-internal<br>
><br>
> The problem is that I use User-defined networks which has its own DNS<br>
> when a container starts a dns record would be set<br>
> If I start a kamailio first then start two asterisks the asterisk works fine<br>
> because the name "kamailio" has been set in docker dns<br>
> but I should restart the kamailio because at startup It could not resolve astersik dns records<br>
> after the everything works fine but if the any of the asterisk instances crash/stop kamailio<br>
> can not detect that because a dns record would not be available:<br>
><br>
> 17(22) ERROR: <core> [core/resolve.c:1684]: sip_hostport2su(): could not resolve hostname: "asterisk2"<br>
> 17(22) ERROR: tm [ut.h:309]: uri2dst2(): failed to resolve "asterisk2"<br>
> 17(22) ERROR: tm [uac.c:452]: t_uac_prepare(): no socket found<br>
> 17(22) ERROR: dispatcher [dispatch.c:3110]: ds_ping_set(): unable to ping [sip:asterisk2:5060]<br>
><br>
><br>
> It is kind of loop , I think maybe I can fix asterisk problem with asterisk realtime and<br>
> set the sip.conf in database.<br>
> anyone has any suggestion for this problem?<br>
><br>
> _______________________________________________<br>
> Kamailio (SER) - Users Mailing List<br>
> <a href="mailto:sr-users@lists.kamailio.org" target="_blank" moz-do-not-send="true">
sr-users@lists.kamailio.org</a><br>
> <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank" moz-do-not-send="true">
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
><br>
> _______________________________________________<br>
> Kamailio (SER) - Users Mailing List<br>
> <a href="mailto:sr-users@lists.kamailio.org" target="_blank" moz-do-not-send="true">
sr-users@lists.kamailio.org</a><br>
> <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank" moz-do-not-send="true">
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br>
<br>
<br>
-- <br>
--Mojtaba Esfandiari.S<br>
<br>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">-- 
Henning Westerholt - <a class="moz-txt-link-freetext" href="https://skalatan.de/blog/">https://skalatan.de/blog/</a>
Kamailio services - <a class="moz-txt-link-freetext" href="https://skalatan.de/services">https://skalatan.de/services</a></pre>
</body>
</html>