<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 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">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>