rlm_exec question

Vicor M. Polukcht vpolukcht at gmail.com
Tue Oct 11 13:43:46 CEST 2005


Hi all. I have a hardware that sends me accounting using radius protocol

i have two records:

(Acct-Session-Id, Start Record)
14346//testgw at voip/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:vpolukcht at gmail.com
callto://vpolukcht/




More information about the Freeradius-Users mailing list