Greetings. First I'd like to thank everyone who works on this project. Freeradius is amazing. For our issue, I have browsed the online documentation, faq, and mailing lists. We have a need to alter the accounting records that we proxy to another company. The attribute that we need to rewrite is the Calling-Station-Id. Basically what we need to do is have Freeradius do a database query (via a script) to lookup the "new" number that it should use in place of the original value for Calling-Station-Id. Here is what I have tried: In radiusd.conf: ##Added by Jason attr_rewrite mintomdn { searchin = packet attribute = Calling-Station-Id searchfor = %i #replacewith = %{exec:/usr/local/freeradius/bin/mdn_lookup.sh %{Calling-Station-Id}} replacewith = %{exec:/usr/local/freeradius/bin/mdn_lookup.sh %i} ################################################################ #This works #replacewith = "%{callingstationid}jasontest" ################################################################ ignore_case = no new_attribute = no max_matches = 1 append = no } ##End Added by Jason ... and in the pre_proxy stage: pre-proxy { #Added by Jason mintomdn #End Added by Jason pre_proxy_log } Here are the debug results: radius_xlat: '00000210xxxxxxx' radius_xlat: Running registered xlat function of module exec for string '/usr/local/freeradius/bin/mdn_lookup.sh' rlm_exec (exec): Executing /usr/local/freeradius/bin/mdn_lookup.sh rlm_exec (exec): result 0 radius_xlat: '' rlm_attr_rewrite: xlat on replace string failed. Thoughts? What have I missed? Any assistance on this would be greatly appreciated. Thanks in advance for your time. Regards, Jason ____________________________________________________________________________________ 8:00? 8:25? 8:40? Find a flick in no time with the Yahoo! Search movie showtime shortcut. http://tools.search.yahoo.com/shortcuts/#news
Jason Hodges wrote: ...
Here are the debug results: radius_xlat: '00000210xxxxxxx' radius_xlat: Running registered xlat function of module exec for string '/usr/local/freeradius/bin/mdn_lookup.sh' rlm_exec (exec): Executing /usr/local/freeradius/bin/mdn_lookup.sh rlm_exec (exec): result 0 radius_xlat: '' rlm_attr_rewrite: xlat on replace string failed.
Thoughts? What have I missed?
The script you write didn't output anything. Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog
Thank you for the response. I did cover that base as well. I should have pasted the script into the original email. Here is the script that I tested with (where xxx are numbers): #!/bin/sh if [ "$1" = "" ]; then #Example 00000xxxxxxxxxx echo "00000xxxxxxxxxx" else echo "11111xxxxxxxxxx" fi Even if no variable was passed to the script, it outputs something. I also used other system commands (exec:/bin/echo testing ... exec:/bin/cat <some file>) just in case. It seems as long as I was using exec, I got that same error. If I just substituted with a static value, it worked fine. Your time is appreciated. Thanks again for the response. Regards, Jason --- Alan DeKok <aland@deployingradius.com> wrote:
Jason Hodges wrote: ...
Here are the debug results: radius_xlat: '00000210xxxxxxx' radius_xlat: Running registered xlat function of module exec for string '/usr/local/freeradius/bin/mdn_lookup.sh' rlm_exec (exec): Executing /usr/local/freeradius/bin/mdn_lookup.sh rlm_exec (exec): result 0 radius_xlat: '' rlm_attr_rewrite: xlat on replace string failed.
Thoughts? What have I missed?
The script you write didn't output anything.
Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
____________________________________________________________________________________ Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/features_spam.html
participants (2)
-
Alan DeKok -
Jason Hodges