<div dir="ltr"><div><div><div><div><div>Thanks for the response Daniel,<br></div>I was trying to force the socket from the tm:local-request and this was causing me the crash. About this crash I wasn't aware about the ulimit -c.... I will change that in my servers!<br></div></div>And about mtree, do you have some explanation on how to use that for prefix routing purposes? Before choosing LCR as the prefix routing module for my solution I saw you mentioning to use it, but I could not find any explanation on how to use it for this purpose... So I chose LCR... It is complex but is Ok, however (taking the chance for a feedback) I do feel kamailio has a big problem with prefix routing.... all solutions/modules seem clumsy to manage and there isn't a no-brainer choice....<br><br></div>Thanks,<br></div>Patrick Wakano<br><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 22 September 2017 at 17:18, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>Hello,<br>
    </p><span class="">
    <br>
    <div class="m_-7521742980525346340moz-cite-prefix">On 22.09.17 04:42, Patrick Wakano
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div>
          <div>Hello list,</div>
          <div><br>
          </div>
          After deep investigation I found out that the issue is
          happening because of the mechanism Kamailio uses to find the
          most appropriate socket combined with the virtual IP usage....<br>
          For socket selection, Kamailio first asks Linux which would be
          the routing for a certain destination, then matches this
          outcome with the list of listened sockets.</div>
        <div>By default Linux will always return the local IP instead of
          the virtual one. So if Kamailio only binds to the virtual IP,
          the Linux's returned IP won't match our socket list and then
          the socket selection fails....</div>
        <div>So currently Kamailio active/stand-by HA setup with virtual
          IP in a multi-homed environment does not work properly...</div>
        <div>We can overcome this by listening to all addresses, but
          then Kamailio will decide to use the local IP instead of the
          virtual one, and then the HA idea end up broken....<br>
        </div>
        We can also force socket for everything. For regular call
        routing, this options actually works fine if the script always
        force some socket, but it seems to be not always possible for
        local generated messages.</div>
    </blockquote>
    <br></span>
    do you have an event_route[tm:local-request] in your config? There
    you should be able to force send socket for local requests, iirc.<span class=""><br>
    <br>
    <blockquote type="cite">
      <div dir="ltr"> By disabling mhomed and using the dispatcher
        socket attr to send the OPTIONS message it works for example.
        But for the LCR module we have no option because apparently the
        LCR module has only one socket option, and so I am not able have
        a different socket per gateway. <br>
        We can also explicitly set the src address for a routing rule to
        be the virtual IP instead of the local one. This makes Linux to
        return the virtual IP instead of the local one. This solution
        seems fine, but since it is done at linux level, every other
        service on the box would be affected and every route on the box
        would needed to be changed..<br>
        <div>Another problem I found out is that I am not able to force
          the socket for local generated messages. It actually crashes
          Kamailio, and I always get a "core was not generated" msg....
          anyone aware of that?</div>
      </div>
    </blockquote>
    <br></span>
    Have you done 'ulimit -c unlimited' and then run kamailio as root?<span class=""><br>
    <br>
    <blockquote type="cite">
      <div dir="ltr">
        <div>The actual fix for this, would be having Kamailio to search
          the most appropriate socket in a different manner. It could
          loop the sockets and see which one reaches the destination
          instead of asking Linux to do it, or it could have some
          routing directives which could be consulted before selecting a
          socket.... (just ideas, not sure how feasible they are...)<br>
        </div>
      </div>
    </blockquote>
    <br></span>
    Should anyone make a PR for such a change, it will be obviously
    considered for merging.<span class=""><br>
    <br>
    <blockquote type="cite">
      <div dir="ltr">
        <div>I am considering using the Linux routing change option, but
          has anyone faced such situation before?</div>
      </div>
    </blockquote>
    <br></span>
    I typically do lcr by combining mtree+dispatcher, never run in such
    issue myself, but I also do mainly force send socket explicitly
    because makes it more clear in config.<br>
    <br>
    Cheers,<br>
    Daniel<div><div class="h5"><br>
    <br>
    <blockquote type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div>Regards,</div>
        <div>Patrick Wakano<br>
        </div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On 24 August 2017 at 09:18, Patrick
          Wakano <span dir="ltr"><<a href="mailto:pwakano@gmail.com" target="_blank">pwakano@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div>
                <div>
                  <div>Hello Daniel,<br>
                  </div>
                  I still couldn't make this SIP probing work.... So
                  currently my setup cannot actively check for GW
                  availability...<br>
                  Any idea about what may be causing it?<br>
                  <br>
                </div>
                Thanks for your time,<br>
              </div>
              Patrick Wakano<br>
            </div>
            <div class="m_-7521742980525346340HOEnZb">
              <div class="m_-7521742980525346340h5">
                <div class="gmail_extra"><br>
                  <div class="gmail_quote">On 16 August 2017 at 13:01,
                    Patrick Wakano <span dir="ltr"><<a href="mailto:pwakano@gmail.com" target="_blank">pwakano@gmail.com</a>></span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div dir="auto">Forgot to mention it is a centos7
                        box...</div>
                      <div class="m_-7521742980525346340m_-6397899599530126820HOEnZb">
                        <div class="m_-7521742980525346340m_-6397899599530126820h5">
                          <div class="gmail_extra"><br>
                            <div class="gmail_quote">On 16 Aug. 2017
                              11:02 am, "Patrick Wakano" <<a href="mailto:pwakano@gmail.com" target="_blank">pwakano@gmail.com</a>>
                              wrote:<br type="attribution">
                              <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                                <div dir="ltr">
                                  <div>
                                    <div>
                                      <div>
                                        <div>
                                          <div>Hi Daniel!<br>
                                          </div>
                                          Very grateful for your
                                          attention!<br>
                                          <br>
                                        </div>
                                        Apologies for lacking important
                                        info, check below the version
                                        and sockets.<br>
                                        It may be worth mentioning these
                                        IPs are virtual ones and I am
                                        using <span style="font-family:monospace,monospace">net.ipv4.ip_nonlocal_bind
                                          = 1</span>(in this case the
                                        virtual IP is assigned to the
                                        box)<br>
                                        Interesting that it has a "<span style="font-family:monospace,monospace">mhomed: no"</span><span style="font-family:monospace,monospace">
                                        </span>for all sockets but I do
                                        have mhomed=1 in my cfg file....
                                        could that be the issue?<br>
                                        <span style="font-family:monospace,monospace"></span>Also
                                        there is no message before this
                                        one: <span style="font-family:monospace,monospace">/usr/sbin/kamailio[6164]:
                                          ERROR: <core>
                                          [core/forward.c:181]:
                                          get_out_socket(): no socket
                                          found</span><br>
                                      </div>
                                      This is the first one that pops
                                      when dispatcher tries to ping....<br>
                                      <br>
                                    </div>
                                    Thanks,<br>
                                  </div>
                                  Patrick<br>
                                  <br>
                                  <div>
                                    <div>
                                      <div><span style="font-family:monospace,monospace">kamailio
                                          -v<br>
                                          version: kamailio 5.0.2
                                          (x86_64/linux) <br>
                                          flags: STATS: Off, USE_TCP,
                                          USE_TLS, USE_SCTP, TLS_HOOKS,
                                          DISABLE_NAGLE, USE_MCAST,
                                          DNS_IP_HACK, SHM_MEM,
                                          SHM_MMAP, PKG_MALLOC,
                                          Q_MALLOC, F_MALLOC,
                                          TLSF_MALLOC, DBG_SR_MEMORY,
                                          USE_FUTEX,
                                          FAST_LOCK-ADAPTIVE_WAIT,
                                          USE_DNS_CACHE,
                                          USE_DNS_FAILOVER, USE_NAPTR,
                                          USE_DST_BLACKLIST,
                                          HAVE_RESOLV_RES<br>
                                          ADAPTIVE_WAIT_LOOPS=1024,
                                          MAX_RECV_BUFFER_SIZE 262144,
                                          MAX_LISTEN 16, MAX_URI_SIZE
                                          1024, BUF_SIZE 65535, DEFAULT
                                          PKG_SIZE 8MB<br>
                                          poll method support: poll,
                                          epoll_lt, epoll_et, sigio_rt,
                                          select.<br>
                                          id: unknown <br>
                                          compiled on 12:03:49 Jun 26
                                          2017 with gcc 4.8.5<br>
                                          <br>
                                          kamcmd> core.sockets_list<br>
                                          {<br>
                                              socket: {<br>
                                                  proto: udp<br>
                                                  address:
                                          172.28.128.100<br>
                                                  ipaddress:
                                          172.28.128.100<br>
                                                  port: 5060<br>
                                                  mcast: no<br>
                                                  mhomed: no<br>
                                              }<br>
                                              socket: {<br>
                                                  proto: udp<br>
                                                  address:
                                          192.168.33.100<br>
                                                  ipaddress:
                                          192.168.33.100<br>
                                                  port: 5060<br>
                                                  mcast: no<br>
                                                  mhomed: no<br>
                                              }<br>
                                              socket: {<br>
                                                  proto: tcp<br>
                                                  address:
                                          172.28.128.100<br>
                                                  ipaddress:
                                          172.28.128.100<br>
                                                  port: 5060<br>
                                                  mcast: no<br>
                                                  mhomed: no<br>
                                              }<br>
                                              socket: {<br>
                                                  proto: tcp<br>
                                                  address:
                                          192.168.33.100<br>
                                                  ipaddress:
                                          192.168.33.100<br>
                                                  port: 5060<br>
                                                  mcast: no<br>
                                                  mhomed: no<br>
                                              }<br>
                                              socket: {<br>
                                                  proto: tcp<br>
                                                  address:
                                          172.28.128.100<br>
                                                  ipaddress:
                                          172.28.128.100<br>
                                                  port: 8080<br>
                                                  mcast: no<br>
                                                  mhomed: no<br>
                                              }<br>
                                          }<br>
                                        </span><br>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                                <div class="gmail_extra"><br>
                                  <div class="gmail_quote">On 15 August
                                    2017 at 17:24, Daniel-Constantin
                                    Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span>
                                    wrote:<br>
                                    <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                                      <div text="#000000" bgcolor="#FFFFFF">
                                        <p>Hello,</p>
                                        <p>what are the sockets kamailio
                                          is listening on? See `kamcmd
                                          help` for the command that
                                          lists the sockets.</p>
                                        <p>Also, what is the log
                                          messages before the first one
                                          you pasted, there should be
                                          another one printed from <span style="font-family:monospace,monospace">get_out_socket().</span></p>
                                        It is always important to
                                        provide kamailio version
                                        (kamailio -v) and the operating
                                        system you are using.<br>
                                        <br>
                                        Cheers,<br>
                                        Daniel
                                        <div>
                                          <div class="m_-7521742980525346340m_-6397899599530126820m_5693305556384801093m_2265864410434847987h5"><br>
                                            <br>
                                            <div class="m_-7521742980525346340m_-6397899599530126820m_5693305556384801093m_2265864410434847987m_5394055170380308788moz-cite-prefix">On
                                              14.08.17 14:41, Patrick
                                              Wakano wrote:<br>
                                            </div>
                                          </div>
                                        </div>
                                        <blockquote type="cite">
                                          <div>
                                            <div class="m_-7521742980525346340m_-6397899599530126820m_5693305556384801093m_2265864410434847987h5">
                                              <div dir="ltr">
                                                <div>Hello Kamailio
                                                  list,<br>
                                                </div>
                                                <div><br>
                                                  Hope you all doing
                                                  well!<br>
                                                  <br>
                                                </div>
                                                <div>I am stuck with one
                                                  problem that should be
                                                  incredibly easy to be
                                                  done, but apparently
                                                  it is not.... I want
                                                  my dispatcher, LCR and
                                                  nathelper modules to
                                                  always SIP ping my SIP
                                                  clients. I have a
                                                  Kamailio based SBC
                                                  that is separating two
                                                  networks, and so I am
                                                  using the 'mhomed'
                                                  flag, but none of
                                                  these SIP pings are
                                                  working.... for now I
                                                  will only ask about
                                                  the dispatcher....<br>
                                                </div>
                                                <div>My dispatcher
                                                  module has to talk
                                                  with SIP servers in
                                                  both networks, the
                                                  thing is when I enable
                                                  SIP ping for it (<span style="font-family:monospace,monospace">modparam("dispatcher",
                                                    "ds_probing_mode",
                                                    1)</span>), it gives
                                                  me this type of error:<br>
                                                  <span style="font-family:monospace,monospace">/usr/sbin/kamailio[6164]:
                                                    ERROR: <core>
[core/forward.c:181]: get_out_socket(): no socket found<br>
/usr/sbin/kamailio[6164]: ERROR: <core> [core/forward.c:183]:
                                                    get_out_socket(): no
                                                    corresponding socket
                                                    found for(udp:<a href="http://192.168.33.110:6060" target="_blank">192.168.33.110:6060</a>)<br>
/usr/sbin/kamailio[6164]: ERROR: tm [ut.h:317]: uri2dst2(): no
                                                    corresponding socket
                                                    found for
                                                    "192.168.33.110" af
                                                    2 (udp:<a href="http://192.168.33.110:6060" target="_blank">192.168.33.110:6060</a>)<br>
/usr/sbin/kamailio[6164]: ERROR: tm [uac.c:443]: t_uac_prepare(): no
                                                    socket found<br>
/usr/sbin/kamailio[6164]: ERROR: dispatcher [dispatch.c:2652]:
                                                    ds_ping_set():
                                                    unable to ping [sip:<a href="http://192.168.33.110:6060" target="_blank">192.168.33.110:6060</a>]<br>
                                                  </span><br>
                                                </div>
                                                <div>After research it
                                                  seems I need to
                                                  manually set a
                                                  "socket" attribute for
                                                  each of my GWs in
                                                  dispatcher list. After
                                                  putting the socket
                                                  parameter for the GW,
                                                  I got another error:<br>
                                                  <span style="font-family:monospace,monospace">/usr/sbin/kamailio[14190]:
                                                    ERROR: <core>
[core/socket_info.c:2046]: parse_protohostport(): bad port number in
                                                    udp:<a href="http://192.168.33.100:5060" target="_blank">192.168.33.100:5060</a><br>
/usr/sbin/kamailio[14190]: ERROR: <core> [core/forward.c:181]:
                                                    get_out_socket(): no
                                                    socket found<br>
/usr/sbin/kamailio[14190]: ERROR: <core> [core/forward.c:183]:
                                                    get_out_socket(): no
                                                    corresponding socket
                                                    found for(udp:<a href="http://192.168.33.110:6060" target="_blank">192.168.33.110:6060</a>)<br>
/usr/sbin/kamailio[14190]: ERROR: tm [ut.h:317]: uri2dst2(): no
                                                    corresponding socket
                                                    found for
                                                    "192.168.33.110" af
                                                    2 (udp:<a href="http://192.168.33.110:6060" target="_blank">192.168.33.110:6060</a>)<br>
/usr/sbin/kamailio[14190]: ERROR: tm [uac.c:443]: t_uac_prepare(): no
                                                    socket found<br>
/usr/sbin/kamailio[14190]: ERROR: dispatcher [dispatch.c:2652]:
                                                    ds_ping_set():
                                                    unable to ping [sip:<a href="http://192.168.33.110:6060" target="_blank">192.168.33.110:6060</a>]</span><br>
                                                  <br>
                                                  What can be wrong in
                                                  my port info in the
                                                  socket config? (I
                                                  tried the socket with
                                                  and without quotes but
                                                  had no luck...)<br>
                                                  <span style="font-family:monospace,monospace">select
                                                    * from dispatcher
                                                    where id=2;<br>
                                                     id | setid |      
                                                    destination       |
                                                    flags | priority
                                                    |                   
attrs                    |     description     <br>
----+-------+-----------------<wbr>--------+-------+----------+--<wbr>------------------------------<wbr>-------------+----------------<wbr>-----<br>
                                                      2 |     2 | sip:<a href="http://192.168.33.110:6060" target="_blank">192.168.33.110:6060</a>
                                                    |     0 |        0 |
                                                    socket="udp:<a href="http://192.168.33.100:5060" target="_blank">192.168.33.100:506<wbr>0</a>";rweight=50
                                                    | <br>
                                                    (1 row)<br>
                                                  </span><br>
                                                </div>
                                                <div>Anyhow, I was
                                                  expecting the 'mhomed'
                                                  parameter to do the
                                                  socket selection for
                                                  me. Regular call
                                                  routing either by the
                                                  dispatcher or by LCR,
                                                  also seems to require
                                                  me to explicitly set
                                                  the socket otherwise
                                                  Kamailio (or the OS)
                                                  may end up using the
                                                  wrong socket. So,
                                                  another question is
                                                  why 'mhomed' does not
                                                  dictate the whole
                                                  socket selection
                                                  Kamailio has to do
                                                  regardless the module
                                                  it is using to send
                                                  SIP requests?<br>
                                                  <br>
                                                </div>
                                                <div>Sorry for the long
                                                  e-mail....<br>
                                                </div>
                                                <div>Best regards,<br>
                                                </div>
                                                <div>Patrick Wakano<br>
                                                </div>
                                              </div>
                                              <br>
                                              <fieldset class="m_-7521742980525346340m_-6397899599530126820m_5693305556384801093m_2265864410434847987m_5394055170380308788mimeAttachmentHeader"></fieldset>
                                              <br>
                                            </div>
                                          </div>
                                          <pre>______________________________<wbr>_________________
Kamailio (SER) - Development Mailing List
<a class="m_-7521742980525346340m_-6397899599530126820m_5693305556384801093m_2265864410434847987m_5394055170380308788moz-txt-link-abbreviated" href="mailto:sr-dev@lists.kamailio.org" target="_blank">sr-dev@lists.kamailio.org</a>
<a class="m_-7521742980525346340m_-6397899599530126820m_5693305556384801093m_2265864410434847987m_5394055170380308788moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">https://lists.kamailio.org/cgi<wbr>-bin/mailman/listinfo/sr-dev</a><span class="m_-7521742980525346340m_-6397899599530126820m_5693305556384801093m_2265864410434847987HOEnZb"><font color="#888888">
</font></span></pre>
                                          <span class="m_-7521742980525346340m_-6397899599530126820m_5693305556384801093m_2265864410434847987HOEnZb"><font color="#888888"> </font></span></blockquote>
                                        <span class="m_-7521742980525346340m_-6397899599530126820m_5693305556384801093m_2265864410434847987HOEnZb"><font color="#888888"> <br>
                                            <pre class="m_-7521742980525346340m_-6397899599530126820m_5693305556384801093m_2265864410434847987m_5394055170380308788moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="m_-7521742980525346340m_-6397899599530126820m_5693305556384801093m_2265864410434847987m_5394055170380308788moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="m_-7521742980525346340m_-6397899599530126820m_5693305556384801093m_2265864410434847987m_5394055170380308788moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - <a class="m_-7521742980525346340m_-6397899599530126820m_5693305556384801093m_2265864410434847987m_5394055170380308788moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
Kamailio World Conference - <a class="m_-7521742980525346340m_-6397899599530126820m_5693305556384801093m_2265864410434847987m_5394055170380308788moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a></pre>
                                          </font></span></div>
                                    </blockquote>
                                  </div>
                                  <br>
                                </div>
                              </blockquote>
                            </div>
                          </div>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    <pre class="m_-7521742980525346340moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="m_-7521742980525346340moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="m_-7521742980525346340moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - <a class="m_-7521742980525346340moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
Kamailio World Conference - <a class="m_-7521742980525346340moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a></pre>
  </div></div></div>

</blockquote></div><br></div>