Just a questions on how to do this properly. The configuration below works if I dial the number like +18888888888@sip.ca.didlogic.net (thats the gateway). But it fails with below log if I try to dial it like +18888888888@mykamailioserver.com. I'm trying to get the kamailio to rewrite the request URI so the user doesn't have to type in the gateway. So the users just need to type in the phone number, but for some reason it's not working, any ideas what i'm doing wrong?.

Thanks again in advance!

Feb 12 01:18:38 sipr /usr/local/sbin/kamailio[24307]: INFO: <script>: Request coming from WS
Feb 12 01:18:38 sipr /usr/local/sbin/kamailio[24307]: ERROR: tm [t_fwd.c:755]: add_uac(): ERROR: add_uac: maximum number of branches exceeded
Feb 12 01:18:38 sipr /usr/local/sbin/kamailio[24307]: ERROR: tm [t_fwd.c:1711]: t_forward_nonack(): ERROR: t_forward_nonack: failure to add branches
Feb 12 01:18:38 sipr /usr/local/sbin/kamailio[24307]: ERROR: tm [tm.c:1466]: _w_t_relay_to(): ERROR: w_t_relay_to: t_relay_to failed
Feb 12 01:18:38 sipr /usr/local/sbin/kamailio[24307]: ERROR: <script>: RELAY -> !t_relay
Feb 12 01:18:38 sipr /usr/local/sbin/kamailio[24307]: ERROR: sl [sl_funcs.c:363]: sl_reply_error(): ERROR: sl_reply_error used: I'm terribly sorry, server error occurred (1/SL)
route[RELAY] {
  if (is_method("INVITE")) {
    dlg_manage();
    route(SETUP_BY_TRANSPORT);
    if(!t_is_set("failure_route")) t_on_failure("MANAGE_FAILURE");
  }

  t_set_disable_internal_reply(1); # turn off sending internal reply on error
  rewritehostport("sip.ca.didlogic.net:5060");
  if (!t_relay()) {
    xlog("RELAY -> !t_relay");
    sl_reply_error();
  }
  exit;
}
failure_route[MANAGE_FAILURE] {

   xlog("DEBUG: MANAGE FAILURE ROUTE: ");

   if ($T_reply_code == "407")  # there's also 401
    {

        $avp(arealm) = GATEWAY;
        $avp(auser) = USERNAME;
        $avp(apass) = PASSWORD;

        uac_auth();

        rtpengine_offer("force trust-address replace-origin replace-session-connection ICE=remove RTP/AVP");
        route(NATMANAGE);
        route(RELAY);
        exit;
    }
}


Reply to this email directly or view it on GitHub.