<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    On 10/25/11 10:09 PM, Asgaroth wrote:
    <blockquote cite="mid:4EA71796.9070403@gmail.com" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      Hi Daniel,<br>
      <br>
      I'm wondering if the change you made to the dev branch for setting
      the state via fifo command is what could be causing this issues
      (just guessing, I am more than likely worng :)), see my subsequent
      testing below:<br>
    </blockquote>
    the purpose with three states (active, inactive and disabled) was
    not to relate probing to selection of gateways, as one may want to
    have even active gateways in probing mode to detect when they go
    down. So, in other words, if probing mode is not checked when a
    gateways is selected, but only if the gateway has the state active.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <blockquote cite="mid:4EA71796.9070403@gmail.com" type="cite"> <br>
      Just a little further digging on this, seems to show that kamailio
      v3.2.0 acts differently than 3.3.0 dev branch.<br>
      <br>
      Below is the log output of my routing logic using v3.2.0:<br>
      <br>
      at this point dispatcher is loaded with both destinations set in
      AX (Active) state, I then shutdown the 2 destination port(s),
      then, request comes in:<br>
      <br>
      route[MAIN] : REGISTER : Initial route request
      (if=10.10.10.1:5060/src=10.10.10.10:29822/ru=<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:mydomain.com/ct=">sip:mydomain.com/ct=</a><a
        moz-do-not-send="true" class="moz-txt-link-rfc2396E"
        href="sip:s@10.10.10.10:5060">&lt;sip:s@10.10.10.10:5060&gt;</a>)<br>
      route[MAIN] : REGISTER : SBC selected for mydomain.com is <a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10000">sip:10.10.10.11:10000</a><br>
      route[TO_SBC] : REGISTER : timeout and no reply
      (10.10.10.10:29822-&gt;10.10.10.1:5060-&gt;<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10000">sip:10.10.10.11:10000</a>) <br>
      route[TO_SBC] : REGISTER : setting <a moz-do-not-send="true"
        class="moz-txt-link-freetext" href="sip:10.10.10.11:10000">sip:10.10.10.11:10000</a>
      to probing state<br>
      route[TO_SBC] : REGISTER : next destination select (<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10001">sip:10.10.10.11:10001</a>) <br>
      route[TO_SBC] : REGISTER : timeout and no reply
      (10.10.10.10:29822-&gt;10.10.10.1:5060-&gt;<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10000">sip:10.10.10.11:10000</a>) <br>
      route[TO_SBC] : REGISTER : setting <a moz-do-not-send="true"
        class="moz-txt-link-freetext" href="sip:10.10.10.11:10000">sip:10.10.10.11:10000</a>
      to probing state<br>
      route[TO_SBC] : REGISTER : No destinations available for
      mydomain.com<br>
      <br>
      This request responds as expected, however, both destinations are
      now set in AP mode, then some more requests come in:<br>
      NOTE: $du seems to be causing issue here as well, but i think $du
      is cosmetic (I have previously sent the routing logic that
      displays this).<br>
      <br>
      route[MAIN] : REGISTER : Initial route request
      (if=10.10.10.1:5060/src=10.10.10.10:29822/ru=<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:mydomain.com/ct=">sip:mydomain.com/ct=</a><a
        moz-do-not-send="true" class="moz-txt-link-rfc2396E"
        href="sip:s@10.10.10.10:5060">&lt;sip:s@10.10.10.10:5060&gt;</a>)<br>
      route[MAIN] : REGISTER : No destinations available for
      mydomain.com<br>
      route[MAIN] : REGISTER : Initial route request
      (if=10.10.10.1:5060/src=10.10.10.10:29822/ru=<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:mydomain.com/ct=">sip:mydomain.com/ct=</a><a
        moz-do-not-send="true" class="moz-txt-link-rfc2396E"
        href="sip:s@10.10.10.10:5060">&lt;sip:s@10.10.10.10:5060&gt;</a>)<br>
      route[MAIN] : REGISTER : No destinations available for
      mydomain.com<br>
      route[MAIN] : REGISTER : Initial route request
      (if=10.10.10.1:5060/src=10.10.10.10:29822/ru=<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:mydomain.com/ct=">sip:mydomain.com/ct=</a><a
        moz-do-not-send="true" class="moz-txt-link-rfc2396E"
        href="sip:s@10.10.10.10:5060">&lt;sip:s@10.10.10.10:5060&gt;</a>)<br>
      route[MAIN] : REGISTER : No destinations available for
      mydomain.com<br>
      route[MAIN] : REGISTER : Initial route request
      (if=10.10.10.1:5060/src=10.10.10.10:29822/ru=<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:mydomain.com/ct=">sip:mydomain.com/ct=</a><a
        moz-do-not-send="true" class="moz-txt-link-rfc2396E"
        href="sip:s@10.10.10.10:5060">&lt;sip:s@10.10.10.10:5060&gt;</a>)<br>
      route[MAIN] : REGISTER : No destinations available for
      mydomain.com<br>
      <br>
      This is behaiving as I understand it from the docs. Both
      destinations are in Active-Probing state, and, because they are in
      probing state, ds_select_dst will not use them in the selection
      process for subsequent requests.<br>
      <br>
      Now, when testing with 3.3.0 dev branch:<br>
      <br>
      Below is log output of my routing script logic using 3.3.0 dev:<br>
      <br>
      at this point dispatcher is loaded with both destinations set in
      AX (Active) state, I then shutdown the 2 destination port(s),
      then, request comes in:<br>
      <br>
      route[MAIN] : REGISTER : Initial route request
      (if=10.10.10.1:5060/src=10.10.10.10:44502/ru=<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:mydomain.com:5060/ct=">sip:mydomain.com:5060/ct=</a><a
        moz-do-not-send="true" class="moz-txt-link-rfc2396E"
        href="sip:s@10.10.10.10:5080">&lt;sip:s@10.10.10.10:5080&gt;</a>)<br>
      route[MAIN] : REGISTER : SBC selected for mydomain.com is <a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10000">sip:10.10.10.11:10000</a><br>
      route[TO_SBC] : REGISTER : timeout and no reply
      (10.10.10.10:44502-&gt;10.10.10.1:5060-&gt;<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10000">sip:10.10.10.11:10000</a>)<br>
      route[TO_SBC] : REGISTER : setting <a moz-do-not-send="true"
        class="moz-txt-link-freetext" href="sip:10.10.10.11:10000">sip:10.10.10.11:10000</a>
      to probing state<br>
      route[TO_SBC] : REGISTER : next destination select (<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10001">sip:10.10.10.11:10001</a>)<br>
      route[TO_SBC] : REGISTER : timeout and no reply
      (10.10.10.10:44502-&gt;10.10.10.1:5060-&gt;<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10000">sip:10.10.10.11:10000</a>)<br>
      route[TO_SBC] : REGISTER : setting <a moz-do-not-send="true"
        class="moz-txt-link-freetext" href="sip:10.10.10.11:10000">sip:10.10.10.11:10000</a>
      to probing state<br>
      route[TO_SBC] : REGISTER : No destinations available for
      mydomain.com<br>
      <br>
      This request responds as expected, however, both destinations are
      now set in AP mode, then some more requests come in:<br>
      NOTE: $du seems to be causing issue here as well, but i think $du
      is cosmetic (I have previously sent the routing logic that
      displays this).<br>
      <br>
      route[MAIN] : REGISTER : Initial route request
      (if=10.10.10.1:5060/src=10.10.10.10:44502/ru=<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:mydomain.com:5060/ct=">sip:mydomain.com:5060/ct=</a><a
        moz-do-not-send="true" class="moz-txt-link-rfc2396E"
        href="sip:s@10.10.10.10:5080">&lt;sip:s@10.10.10.10:5080&gt;</a>)<br>
      route[MAIN] : REGISTER : SBC selected for mydomain.com is <a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10001">sip:10.10.10.11:10001</a><br>
      route[TO_SBC] : REGISTER : timeout and no reply
      (10.10.10.10:44502-&gt;10.10.10.1:5060-&gt;<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10001">sip:10.10.10.11:10001</a>)<br>
      route[TO_SBC] : REGISTER : setting <a moz-do-not-send="true"
        class="moz-txt-link-freetext" href="sip:10.10.10.11:10001">sip:10.10.10.11:10001</a>
      to probing state<br>
      route[TO_SBC] : REGISTER : next destination select (<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10000">sip:10.10.10.11:10000</a>)<br>
      route[TO_SBC] : REGISTER : timeout and no reply
      (10.10.10.10:44502-&gt;10.10.10.1:5060-&gt;<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10001">sip:10.10.10.11:10001</a>)<br>
      route[TO_SBC] : REGISTER : setting <a moz-do-not-send="true"
        class="moz-txt-link-freetext" href="sip:10.10.10.11:10001">sip:10.10.10.11:10001</a>
      to probing state<br>
      route[TO_SBC] : REGISTER : No destinations available for
      mydomain.com<br>
      route[MAIN] : REGISTER : Initial route request
      (if=10.10.10.1:5060/src=10.10.10.10:44502/ru=<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:mydomain.com:5060/ct=">sip:mydomain.com:5060/ct=</a><a
        moz-do-not-send="true" class="moz-txt-link-rfc2396E"
        href="sip:s@10.10.10.10:5080">&lt;sip:s@10.10.10.10:5080&gt;</a>)<br>
      route[MAIN] : REGISTER : SBC selected for mydomain.com is <a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10000">sip:10.10.10.11:10000</a><br>
      route[TO_SBC] : REGISTER : timeout and no reply
      (10.10.10.10:44502-&gt;10.10.10.1:5060-&gt;<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10000">sip:10.10.10.11:10000</a>)<br>
      &nbsp;route[TO_SBC] : REGISTER : setting <a moz-do-not-send="true"
        class="moz-txt-link-freetext" href="sip:10.10.10.11:10000">sip:10.10.10.11:10000</a>
      to probing state<br>
      route[TO_SBC] : REGISTER : next destination select (<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10001">sip:10.10.10.11:10001</a>)<br>
      route[TO_SBC] : REGISTER : timeout and no reply
      (10.10.10.10:44502-&gt;10.10.10.1:5060-&gt;<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10000">sip:10.10.10.11:10000</a>)<br>
      route[TO_SBC] : REGISTER : setting <a moz-do-not-send="true"
        class="moz-txt-link-freetext" href="sip:10.10.10.11:10000">sip:10.10.10.11:10000</a>
      to probing state<br>
      route[TO_SBC] : REGISTER : No destinations available for
      mydomain.com<br>
      route[MAIN] : REGISTER : Initial route request
      (if=10.10.10.1:5060/src=10.10.10.10:44502/ru=<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:mydomain.com:5060/ct=">sip:mydomain.com:5060/ct=</a><a
        moz-do-not-send="true" class="moz-txt-link-rfc2396E"
        href="sip:s@10.10.10.10:5080">&lt;sip:s@10.10.10.10:5080&gt;</a>)<br>
      route[MAIN] : REGISTER : SBC selected for mydomain.com is <a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10001">sip:10.10.10.11:10001</a><br>
      route[TO_SBC] : REGISTER : timeout and no reply
      (10.10.10.10:44502-&gt;10.10.10.1:5060-&gt;<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10001">sip:10.10.10.11:10001</a>)<br>
      route[TO_SBC] : REGISTER : setting <a moz-do-not-send="true"
        class="moz-txt-link-freetext" href="sip:10.10.10.11:10001">sip:10.10.10.11:10001</a>
      to probing state<br>
      route[TO_SBC] : REGISTER : next destination select (<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10000">sip:10.10.10.11:10000</a>)<br>
      route[TO_SBC] : REGISTER : timeout and no reply
      (10.10.10.10:44502-&gt;10.10.10.1:5060-&gt;<a
        moz-do-not-send="true" class="moz-txt-link-freetext"
        href="sip:10.10.10.11:10001">sip:10.10.10.11:10001</a>)<br>
      route[TO_SBC] : REGISTER : setting <a moz-do-not-send="true"
        class="moz-txt-link-freetext" href="sip:10.10.10.11:10001">sip:10.10.10.11:10001</a>
      to probing state<br>
      route[TO_SBC] : REGISTER : No destinations available for
      mydomain.com<br>
      <br>
      This is not behaving as I understand the docs to explain. The only
      difference between the 2 versions of the script logic is the
      version of kamailio, the exact same routing script is used in both
      scenarios.<br>
      <br>
      The "working as understood from docs" version is as follows:<br>
      <br>
      # ./kamailio -V<br>
      version: kamailio 3.2.0 (i386/linux) e19bb8<br>
      flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS,
      USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM,
      SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, 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 4MB<br>
      poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.<br>
      id: e19bb8 <br>
      compiled on 15:04:46 Oct 25 2011 with gcc 4.1.2<br>
      <br>
      The "not working as understood from docs" version is as follows:<br>
      <br>
      # /kamailio -V<br>
      version: kamailio 3.3.0-dev0 (i386/linux) 25bedc<br>
      flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS,
      USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM,
      SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, 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 4MB<br>
      poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.<br>
      id: 25bedc <br>
      compiled on 09:18:41 Oct 21 2011 with gcc 4.1.2<br>
      <br>
      I hope I'm not going crazy here :/<br>
      <br>
      Thanks<br>
      <br>
      <br>
      <br>
      <br>
      On 25/10/2011 16:52, Asgaroth wrote:
      <blockquote cite="mid:4EA6DB57.6050303@gmail.com" type="cite">
        <meta content="text/html; charset=ISO-8859-1"
          http-equiv="Content-Type">
        Hi Daniel,<br>
        <br>
        Thanks for the clarrification,<br>
        <br>
        On 25/10/2011 16:30, Daniel-Constantin Mierla wrote:
        <blockquote cite="mid:4EA6D630.6020001@gmail.com" type="cite">
          <h3 class="title">4.6.&nbsp; <code class="function">ds_mark_dst("s")</code>
          </h3>
          <p> Mark the last used address from destination set as
            inactive ("i"/"I"/"0"), active ("a"/"A"/"1") or probing
            ("p"/"P"/"2"). With this function, an automatic detection of
            failed gateways can be implemented. When an address is
            marked as inactive or probing, it will be ignored by
            'ds_select_dst' and 'ds_select_domain'. </p>
        </blockquote>
        <br>
        Above is the part that is a little misleading, it says that <br>
        <br>
        "When an address is marked as inactive or probing, it will be
        ignored by 'ds_select_dst' and 'ds_select_domain'."<br>
        <br>
        This, to me, means that if a gateway is in probing mode
        (Active-Probing) then it wont be selected in the destination set
        because it is in probing mode, if this is not the case then
        maybe the above line should read:<br>
        <br>
        "When an address is marked as inactive or inactive-probing, it
        will be ignored by 'ds_select_dst' and 'ds_select_domain'."<br>
        <br>
        This brings me to my next question then, how would I set the
        state of a destination to Inactive-Probing (state: IP) from the
        routing script. The ds_mark_dst() function only allows one of
        "a", "i", "p". <br>
        <br>
        If I do a ds_mark_dst("i"), then the state changes to "IX",
        Inactive with no probing to tell when gateway is back up. <br>
        <br>
        If I do a ds_mark_dst("i") and then right after
        ds_mark_dst("p"), a log is printed saying that you cannot put a
        destination into probing state when it is marked as inactive.<br>
        <br>
        Is it possible to set the state of a gateway to inactive-probing
        from the routing script?<br>
        <br>
        Thanks<br>
        <br>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
      </blockquote>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Kamailio Advanced Training, Dec 5-8, Berlin: <a class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a>
<a class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a></pre>
  </body>
</html>