[SR-Users] Kamailio as UAC

Alexandru Covalschi 568691 at gmail.com
Fri Nov 27 12:01:19 CET 2015


Hello everyone!

Subj is an ethernal theme, I know, but odds are so that I just need to do
that.

I've configured UAC auth to successfully register and my route[PSTN] looks
like that

        # check if PSTN GW IP is defined
        if (strempty($sel(cfg_get.pstn.gw_ip))) {
                xlog("SCRIPT: PSTN routing enabled but pstn.gw_ip not
defined\n");
                return;
        }
        if !ds_is_from_list()
                return;
        # route to PSTN dialed numbers starting with '+' or '00'
        #     (international format)
        # - update the condition to match your dialing rules for PSTN
routing
        if(!($rU=~"^(\+|00)[1-9][0-9]{3,20}$"))
                return;
        if (strempty($sel(cfg_get.pstn.gw_port))) {
                $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip);
        } else {
                $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip) + ":"
                                        + $sel(cfg_get.pstn.gw_port);
        }

        remove_hf("To");
        insert_hf("To: <sip:$rU at sipprovider.com>\r\n", "Call-ID");
        uac_replace_from("","sip:user at sipprovider.com");
        route(RELAY);
        exit;

On INVITE's I get 407 PROXY-AUTH, which are transfered to backend FS.
If I try to put
        if ($T_reply_code == 401 or $T_reply_code == 407) {
                xlog("L_NOTICE", "Remote asked for authentication");
                uac_auth();
        }
to MANAGE_FAILURE or MANAGE_REPLY route Kamailio can't start.

Is that even possible?

-- 
Alexandru Covalschi
ABRISS-Solutions
VoIP engineer and system administrator
phone: +37367398493
web: http://abs-telecom.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20151127/567ffa3d/attachment.html>


More information about the sr-users mailing list