Hello,

Submit a ticket in GitHub apologize about that I should have sent my question here. 
I would like some help in configuring the uac module to route to an gateway without specifically setting the URI-domain from the UAC. I would like to set change it in the Kamailio side.

Currently I use uac_auth on failure route. All is working if I set the URI from on the client to xxx@gatewayaddress.com. But if I just dial just the number as is which translate to xxx@kamailioserver.com the invite doesnt go anywhere. 


My failure route is like so

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;
     

        #$ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip) + ":" + $sel(cfg_get.pstn.gw_port);
        #rewritehost("sip.ca.didlogic.net");

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

Thank you