Help on adding value to mysql

2009-10-16 Thread Simone Felici


Hello to all,

I've freeradius installed on a CentOS 4.5: freeradius-1.1.5-0.
I would like to add a new field to my radacct table to log a new value taken from sip/ser accounting. Until here ok, 
It's sufficient to alter the table, add the value into proper dictionary and alter the sql inserts to add the value.

What I would like to do is to modify the value BEFORE insert it into mysql.
The detail-file logs the following value:

(...)
Sip-Translated-Request-ID = 
"sip:@:;transport=udp"
(...)

Also I would like to add to MySQL (radacct) the Sip-Translated-Request-ID field, BUT 
ONLY the .
I should execute a sort of regexp or something that gives me the following 
result, for example:

Sip-Translated-Request-ID = `echo "sip:@:;transport=udp" |  awk -F@ '{ print $2 }' | awk 
-F: '{ print $1 }'`


This would return me only the IP-ADDRESS to add within 
'%{Sip-Translated-Request-ID}'.

Can someone help me a little bit?

Thank's

Simon
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: Help on adding value to mysql

2009-10-19 Thread Simone Felici

No ideas to help me a little?
At least to know if what described is possible.

Thank's

Simon

Simone Felici ha scritto in data 16/10/2009 11.26:


Hello to all,

I've freeradius installed on a CentOS 4.5: freeradius-1.1.5-0.
I would like to add a new field to my radacct table to log a new value
taken from sip/ser accounting. Until here ok, It's sufficient to alter
the table, add the value into proper dictionary and alter the sql
inserts to add the value.
What I would like to do is to modify the value BEFORE insert it into mysql.
The detail-file logs the following value:

(...)
Sip-Translated-Request-ID =
"sip:@:;transport=udp"
(...)

Also I would like to add to MySQL (radacct) the
Sip-Translated-Request-ID field, BUT ONLY the .
I should execute a sort of regexp or something that gives me the
following result, for example:

Sip-Translated-Request-ID = `echo
"sip:@:;transport=udp" | awk -F@ '{
print $2 }' | awk -F: '{ print $1 }'`

This would return me only the IP-ADDRESS to add within
'%{Sip-Translated-Request-ID}'.

Can someone help me a little bit?

Thank's

Simon
-
List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html




--
Simone FeliciE-Mail: s.fel...@alpikom.it
Divisione TecnicaTel:0461 030 111
Alpikom S.p.A.   Fax:0461 030 112
v.Fersina, 23 - 38123 Trento URL:http://www.alpikom.it
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html