Changing the User-Name value from a request
Hello. I'm using freeRADIUS to authenticate SIP requests and I'm having problems processing the users. In a request I receive a User-Name that isn't useful, and a Sip-URI-User value which contains the real User-Name that I need. I've tried if(Sip-URI-User) { update request { User-Name = Sip-URI-User } } in default's authorize section, but it says "request returns notfound". I've tried User-Name = Sip-URI-User in the preprocess section of radiusd.conf but it doesn't seem to do anything. So, how can I switch the two before proceeding to authenticate the user? Where and what conditions should be placed? I'm kind of in a time crisis and I don't know what to try anymore. Advice is welcome. Thank you.
Tiberiu Breana wrote:
in default's authorize section, but it says "request returns notfound".
Your configuration is close, but wrong: if (Sip-URI-User) { update request { User-Name = "%{Sip-URI-User}" } } That will work. Ignore the return code. If it says "request returns notfound", it will still work. Alan DeKok.
On 28/06/11 16:22, Tiberiu Breana wrote:
Hello. I'm using freeRADIUS to authenticate SIP requests and I'm having problems processing the users. In a request I receive a User-Name that isn't useful, and a Sip-URI-User value which contains the real User-Name that I need.
I've tried if(Sip-URI-User) { update request { User-Name = Sip-URI-User } }
Try ":=" instead of "=". See "man unlang" for details. Beware that changing the username can cause things to break e.g. digest auth.
participants (3)
-
Alan DeKok -
Phil Mayers -
Tiberiu Breana