Proxying/Rewriting Accounting Packets

Jason Hodges jpmantx at yahoo.com
Tue Mar 20 16:46:17 CET 2007


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



More information about the Freeradius-Users mailing list