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: https://github.com/kamailio/kamailio/issues/507
Closed #507.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/507#event-548220928
I think it keeps receiving 401 and then you create a new branch, forward again until the max number of branches is exceeded (by default is 12, it can be changed via max_branches global parameter, up to 31 iirc -- see core cookbook for proper details).
For discussing further, use sr-users@lists.sip-router.org, the issue tracker here is intended for bugs and feature requests, to keep it focused on development related matters. Sorting out configuration file issues is for users mailing lists.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/507#issuecomment-183221055