Hi, imagine I need to log two extra fields in accounting:
- Source-IP - Proxy-IP
"Source-IP" will be dynamic containing the value of $si. "Proxy-IP" is a fixed string value = "88.88.88.88", but... how to log this value?:
* modparam("acc", "radius_extra", "Source-IP=$si; Proxy-IP=88.88.88.88") Of course the above line fails since the IP string should be a text so should be between " ":
* modparam("acc", "radius_extra", "Source-IP=$si; Proxy-IP="88.88.88.88"") This fails obviously.
* modparam("acc", "radius_extra", "Source-IP=$si; Proxy-IP="88.88.88.88"") This fails too.
* modparam("acc", "radius_extra", "Source-IP=$si; Proxy-IP='88.88.88.88' ") This fails too.
Is it impossible? any suggestion?
PD: Yes, I know I can do a bit "dirty" trick: modparam("acc", "radius_extra", "Source-IP=$si; Proxy-IP=$var(proxy-ip)") ... $var(proxy-ip) = "88.88.88.88";
but I'd prefer not to do it.
Hola Iñaki,
Hi, imagine I need to log two extra fields in accounting:
- Source-IP
- Proxy-IP
"Source-IP" will be dynamic containing the value of $si. "Proxy-IP" is a fixed string value = "88.88.88.88", but... how to log this value?:
- modparam("acc", "radius_extra", "Source-IP=$si; Proxy-
IP=88.88.88.88") Of course the above line fails since the IP string should be a text so should be between " ":
- modparam("acc", "radius_extra", "Source-IP=$si; Proxy-
IP="88.88.88.88"") This fails obviously.
- modparam("acc", "radius_extra", "Source-IP=$si; Proxy-IP=
"88.88.88.88"") This fails too.
- modparam("acc", "radius_extra", "Source-IP=$si; Proxy-
IP='88.88.88.88' ") This fails too.
Is it impossible? any suggestion?
PD: Yes, I know I can do a bit "dirty" trick: modparam("acc", "radius_extra", "Source-IP=$si; Proxy-IP=$var(proxy- ip)") ... $var(proxy-ip) = "88.88.88.88";
but I'd prefer not to do it.
Try something like:
modparam("acc", "radius_extra", "SrcIP=$avp(srcip); ProxyIP= $avp(proxyip)") ... if is_method("INVITE") { /* or the logic you need */ $avp(srcip) = $si; $avp(proxyip)= "whatever_string_you_want"; }
After that just define both SrcIP and ProxyIP attributes in your radius dictionaries (both client and server).
Saludos JesusR.
------------------------------------ Jesus Rodriguez VozTelecom Sistemas, S.L. jesusr@voztele.com http://www.voztele.com Tel. 902360305 -------------------------------------
El Viernes, 8 de Febrero de 2008, Jesus Rodriguez escribió:
PD: Yes, I know I can do a bit "dirty" trick: modparam("acc", "radius_extra", "Source-IP=$si; Proxy-IP=$var(proxy- ip)") ... $var(proxy-ip) = "88.88.88.88";
but I'd prefer not to do it.
Try something like:
modparam("acc", "radius_extra", "SrcIP=$avp(srcip); ProxyIP= $avp(proxyip)") ... if is_method("INVITE") { /* or the logic you need */ $avp(srcip) = $si; $avp(proxyip)= "whatever_string_you_want"; }
Thanks Jesus, sure it works. But I'd prefer to avoid using an innecesary AVP (so using memory during transaction) just to store a fixed string which never changes. That's why I tryed to log the fixed string directly in "acc" "radius_ extra" parameter.
Is then not possible?
Thanks.
Hi Iñaki,
Iñaki Baz Castillo wrote:
El Viernes, 8 de Febrero de 2008, Jesus Rodriguez escribió:
PD: Yes, I know I can do a bit "dirty" trick: modparam("acc", "radius_extra", "Source-IP=$si; Proxy-IP=$var(proxy- ip)") ... $var(proxy-ip) = "88.88.88.88";
but I'd prefer not to do it.
Try something like:
modparam("acc", "radius_extra", "SrcIP=$avp(srcip); ProxyIP= $avp(proxyip)") ... if is_method("INVITE") { /* or the logic you need */ $avp(srcip) = $si; $avp(proxyip)= "whatever_string_you_want"; }
Thanks Jesus, sure it works. But I'd prefer to avoid using an innecesary AVP (so using memory during transaction) just to store a fixed string which never changes. That's why I tryed to log the fixed string directly in "acc" "radius_ extra" parameter.
Is then not possible?
No this is not possible - acc extra engine log only PVs and not fixed strings.
Regards, Bogdan