<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">The easiest solution is to add in the kamailio machine <i><b>/etc/hosts</b></i> file the ip addresses associated to <b>asterisk</b> and <b>asterisk2</b> hosts.<div><br>Hope to have helped.</div><div><br></div><div>Kind regards</div><div><br><div dir="ltr"><div class=""><span style="background-color: rgba(255, 255, 255, 0);">Federico Santulli</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);"><br class=""></span></div><div class=""><b class="" style="background-color: rgba(255, 255, 255, 0);">NHM s.r.l.</b></div><div class="">Via Raffaello Sanzio, 88</div><div class="">81031 Aversa (CE)</div><div class="">Italy</div><div class=""><span style="background-color: rgba(255, 255, 255, 0);"><i class="">E-Mail</i> <u class=""><a href="mailto:federico.santulli@nhm.it" class="">federico.santulli@nhm.it</a></u></span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);"><i class="">Mobile</i> +39.335.466645</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);"><i class="">Office</i> +39.081.18396200</span></div><div class=""><span style="background-color: rgba(255, 255, 255, 0);"><i class="">Fax</i> +39.081.18396299</span></div></div><div dir="ltr"><br>Il giorno 14 lug 2019, alle ore 10:33, Amir <<a href="mailto:gheshlaghy@gmail.com">gheshlaghy@gmail.com</a>> ha scritto:<br><br></div><blockquote type="cite"><div dir="ltr"><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">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">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">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 <a href="sip:asterisk:5060">sip:asterisk:5060</a><br>
> 1 <a href="sip:asterisk2:5060">sip:asterisk2:5060</a><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 [<a href="sip:asterisk2:5060">sip:asterisk2:5060</a>]<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">sr-users@lists.kamailio.org</a><br>
> <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">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">sr-users@lists.kamailio.org</a><br>
> <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">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">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>
</div></blockquote><blockquote type="cite"><div dir="ltr"><span>_______________________________________________</span><br><span>Kamailio (SER) - Users Mailing List</span><br><span><a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a></span><br><span><a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a></span><br></div></blockquote></div></body></html>