<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi Daniel,</p>
    <p>Seems like I missed your reply.<br>
    </p>
    <p>I've tried with tcp only, and set_forward_no_connect is used also
      now.</p>
    <p>The only log shown with debug=3 is, for the failing branch:<br>
    </p>
    <p>/usr/sbin/kamailio[60054]: [INVITE] ERROR: tm
      [../../forward.h:240]: msg_send_buffer():<br>
       tcp_send failed<br>
      /usr/sbin/kamailio[60054]: [INVITE] DEBUG: tm [t_fwd.c:1524]:
      t_send_branch(): t_send_b<br>
      ranch: send to 67.188.119.56:50239 (3) failed<br>
      /usr/sbin/kamailio[60054]: [INVITE] WARNING: tm [t_fwd.c:1543]:
      t_send_branch(): ERROR:<br>
       t_send_branch: sending request on branch 0 failed<br>
    </p>
    <p>And after ( or before ), the  logs shows sending to the other UA
      registered with the same account, no mention of branch failure
      route and t_relay replies true.<br>
      <br>
      It seems like as there is one branch that was still connected (
      tcp wise ), t_relay does not return a negative status, and the
      branch failure route is never called.<br>
    </p>
    <p>That works as expected if both Contacts have lost their tcp
      connection though ( t_relay returns a negative value ).<br>
    </p>
    Reproduced just now with kamailio 4.4.0.<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 06/04/2015 07:17 AM,
      Daniel-Constantin Mierla wrote:<br>
    </div>
    <blockquote cite="mid:55705DED.8080408@gmail.com" type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      Hello,<br>
      <br>
      have you tested only with tcp and set_forward_no_connect or also
      with udp?<br>
      <br>
      If you run with debug=3, do you get any other hints about what
      happens there? Also, you can use debugger module with cfgtrace
      enabled to see what actions are executed.<br>
      <br>
      Cheers,<br>
      Daniel<br>
      <br>
      <div class="moz-cite-prefix">On 20/05/15 00:31, Tristan Mahé
        wrote:<br>
      </div>
      <blockquote cite="mid:555BB9B3.9050801@b-and-c.net" type="cite">
        <pre wrap="">Hi fellow kamailio users,

I'm playing actually with t_on_branch_failure, in a simultaneous forking
scenario ( lookup("location") returns multiple contacts ).

Any idea on how to get those "on_branch_failure" working ?

Thanks in Advance !

* Test by putting failure_exec_mode:
- at 1 => no branch failure being called, never.
- at 0 => t_relay does not fail if a single branch answers the
transaction, even if all other branches are failing.

* Test by moving the t_on_branch_failure("manage_branch_failure"); line
before or after the lookup("location") or on a _on_branch route to set
it per branch.
- The on_route branch are executed, but never the failure one.
- tried also with failure_exec_mode = 0 or 1.

* Using set_forward_no_connect, I can see in the logs a "Sending to
branch X failed" but no failure route being executed. Without it,
nothing in the logs indicating that the branch has timeout.

* Config extract:

# auto-discard branches from previous serial forking leg
modparam("tm", "failure_reply_mode", 3) # 3 by default
# default retransmission timeout: 30sec
modparam("tm", "fr_timer", 30000)
# default invite retransmission timeout after 1xx: 120sec
modparam("tm", "fr_inv_timer", 120000)
modparam("tm", "reparse_on_dns_failover", 0)
# 1: Allow branches to have a per branch failure route
# 0: t_relay should fail if a branch fail
modparam("tm", "failure_exec_mode", 1)
# Allow locally generated 408 to be forgotten in case a reply is received.
#modparam("tm", "faked_reply_prio", 2000)


# USER location service
route[LOCATION] {
        t_on_branch_failure("manage_branch_failure");
        if (!lookup("location")) {
        ....
        }
        # Let's get back after 2.5s if no 100/Trying received.
        t_set_fr(0, 2500);
        # set_forward_no_connect();
        #t_on_branch("SET_BRANCH_FAILURE");
        route(RELAY);
        exit;
}

route[RELAY] {
        ....
        if (!t_relay()) {
                xlog("L_WARN","$rm|$ci|$fu|$tu|RELAY_FAILED");
                sl_reply_error();
        }
        exit();
}

# set failure route per branch
branch_route[SET_BRANCH_FAILURE] {
        xlog("L_WARN","$rm|$ci|$fu|$tu|SETTING_BrANCH_FAILURE_ROUTE");
        t_on_branch_failure("manage_branch_failure");
}

# manage failure routing cases per branch
event_route[tm:branch-failure:manage_branch_failure] {
       
xlog("L_WARN","$rm|$ci|$fu|$tu[$avp(dest_to)]|MANAGE_BRANCH_FAILURE");
}

</pre>
        <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>
      <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://twitter.com/#%21/miconda">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
    </blockquote>
    <br>
  </body>
</html>