Hello Victor,
as i understand you want to rewrite the Acct-Session-Id from "123456/*" to
"123456" but the part behind the slash is variable and rlm_attr_rewrite
cant to regular expression as far as i know.
I dont know which module can rewrite accounting packets too besides
rlm_attr_rewrite.
Would be very interesting to know how this could be accomplished.
Maybe anyone from the list does have an answer...
regards,
christian
--On Tuesday, October 11, 2005 15:43:46 +0400 "Vicor M. Polukcht"
<[EMAIL PROTECTED]> wrote:
Hi all. I have a hardware that sends me accounting using radius protocol
i have two records:
(Acct-Session-Id, Start Record)
14346//[EMAIL PROTECTED]/40AB4B43 ADA86932 80450002
401E622/originate/VoIP////62.152.64.32
(Acct-Session-Id, Stop Record)
14346///40AB4B43 ADA86932 80450002 A401E622/answer/VoIP/13:08:48.000
GMT Tue Oct 11 2005/13:09:03.000 GMT Tue Oct 11 2005/16/62.152.64.203
You see that the only common part of records is first 5 digits at the
beginning.
I need to change these attribute to 14346 before it is uploaded to the
database. I have a script that cuts digits:
# !/bin/bash
echo $1 | awk -F / {'print "Acct-Session-Id = " $1'}
exit 0
But i don't know what to write in radiusd.conf
Now i did:
radiusd.conf
...
exec {
wait = yes
program = "/opt/gk/radius/bin/acct_parse %{Acct-Session-Id}"
input_pairs = request
output_pairs = request
packet_type = Accounting-Request
}
accounting {
exec
.....
}
But it doesn't work
In debug mode i see:
radius_xlat: '/opt/gk/radius/bin/acct_parse 14405///22CE4B43 EF5D8704
806B0002 A401E622/answer/VoIP/15:37:36.000 GMT Tue Oct 11
2005/15:37:50.000 GMT Tue Oct 11 2005/16/62.152.64.203'
Exec-Program: /opt/gk/radius/bin/acct_parse 14405///22CE4B43 EF5D8704
806B0002 A401E622/answer/VoIP/15:37:36.000 GMT Tue Oct 11
2005/15:37:50.000 GMT Tue Oct 11 2005/16/62.152.64.203
Exec-Program output: Acct-Session-Id = 14405
Exec-Program-Wait: value-pairs: Acct-Session-Id = 14405
Exec-Program: returned: 0
modcall[accounting]: module "exec" returns ok for request 1
What am i doing wrong and what should i do?
PS: Sorry for terrible english
--
Victor M. Polukcht
mailto:[EMAIL PROTECTED]
callto://vpolukcht/
-
List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html