Realms based on called-station-id
I am trying to direct users on the same nas to different realms based on the called-station-id I have tried the following wtihout success. if ("%{Called-Station-Id}") == "6165551212" { update control{Proxy-To--Realm == myrealm}} Can anyone see what is wrong wtih the syntax in that?
On 24-07-14 19:45, Tim King wrote:
I am trying to direct users on the same nas to different realms based on the called-station-id I have tried the following wtihout success. if ("%{Called-Station-Id}") == "6165551212" { update control{Proxy-To--Realm == myrealm}} Can anyone see what is wrong wtih the syntax in that?
Beside the newlines that are really required in unlang: move the ")" so in looks like this: if ("%{Called-Station-Id}" == "6165551212") -- Herwin Weststrate
Tim King wrote:
I am trying to direct users on the same nas to different realms based on the called-station-id I have tried the following wtihout success. if ("%{Called-Station-Id}") == "6165551212" { update control{Proxy-To--Realm == myrealm}} Can anyone see what is wrong wtih the syntax in that?
Formatting, for one. The text you posted is NOT what's in your configuration. It's not appropriate to post random crap here, and hope someone else figures it out. You should instead post *exactly* what's in your configuration file. For another, see the FAQ for "it doesn't work". The debug output will VERY OFTEN tell you exactly what's wrong. But you need to (a) run the server in debug mode, and (b) read it. And see "man unlang". The "if" condition is unnecessarily complicated. The "update" section uses == instead of :=. This is documented. Try this: if (Called-Station-Id == "6165551212") { update control{ Proxy-To--Realm := myrealm } } And read the debug output. Really. It helps. Alan DeKok.
participants (3)
-
Alan DeKok -
Herwin Weststrate -
Tim King