From e0175d19df8e3ba3bf84adff74df975e4dd88697 Mon Sep 17 00:00:00 2001 From: lazedo Date: Sat, 11 Jan 2020 11:30:30 +0000 Subject: [PATCH] create common routine AUTH_XAVP_TOKEN --- kamailio/auth.cfg | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/kamailio/auth.cfg b/kamailio/auth.cfg index da10e32..47c2deb 100644 --- a/kamailio/auth.cfg +++ b/kamailio/auth.cfg @@ -67,22 +67,14 @@ route[SETUP_AUTH_HEADERS] if (registered("location","sip:$Au", 2, 1) == 1) { $avp(is_registered) = "true"; $avp(auth_allowed) = "true"; - #!ifdef WITH_AUTH_TOKEN - route(AUTH_TOKEN); - #!else - route(AUTH_CCVS) - #!endif + route(AUTH_XAVP_TOKEN); return; } else if(is_present_hf("Proxy-Authorization")) { if(registered("location", "sip:$au@$ar", 2, 1) == 1) { xlog("L_INFO", "$ci|auth|from sip:$au@$ar\n"); $avp(is_registered) = "true"; $avp(auth_allowed) = "true"; - #!ifdef WITH_AUTH_TOKEN - route(AUTH_TOKEN); - #!else - route(AUTH_CCVS) - #!endif + route(AUTH_XAVP_TOKEN); return; } } @@ -116,6 +108,15 @@ route[SETUP_AUTH_HEADERS] #!ifdef REGISTRAR_ROLE +route[AUTH_XAVP_TOKEN] +{ + #!ifdef WITH_AUTH_TOKEN + route(AUTH_TOKEN); + #!else + route(AUTH_CCVS) + #!endif +} + route[AUTH_TOKEN] { if($(xavp(ulattrs=>token){s.len}) > 0) {