-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
RealTime billing is ok, but after there is still '+' in radacct table in
Canonical-URI and called-Station, so when CDRTool Normalize the radacct table
avery 5 minutes, CDRTool failed to calculate the price!
The strip / prefix functions replace correctly the URI field, but it doesn't change
the Canonical-URI,
I have tried to change the Canonical-URI with $ai, but it doesn't work
Is is possible to stip char in avp??
Have a nice afternoon
Iñaki Baz Castillo a écrit :
El Monday 03 March 2008 12:46:04 Marc LEURENT
escribió:
Hello
I have trouble with number dialed starting with +
CDRTool doesn' understand it.
Yes, I revised the PHP code and it's not possible to set "+" as
international
prefix, just numbers :(
So I have to strip it from the request and
replace it by 00!
The problem is that even using this at the begenning of OpenSER script,
it's not working (see CDRTool log below)
Any idea how to solve it?
Thanks
# normalization to e164
if($ruri.user =~ "^\+[1-9][0-9]+") {
xlog("STRIPING + For e164 NORMALIZATION \r\n");
strip(1);
prefix("00");
subst('/^To:(.*)sip:\+(.*)$/To:\1sip:00\2/ig');
};
Please, don't change the "To", it's not necessary at all !
OpenSER config extract:
# ATTENTION: DO NOT PUT ; at the end of the radius_extra attribute
modparam("acc", "radius_extra", "
Called-Station-Id=$tu;
Calling-Station-Id=$fu;
Canonical-URI=$avp(to_destination);
User-Name=$avp(user_name);
Billing-Party=$avp(billing_party);
Sip-User-Realm=$ar;
SIP-Proxy-IP=$Ri;
Source-IP=$si;
Source-Port=$sp;
Acct-Authentic=$avp(s:authentic);
From-Header=$hdr(from);
User-Agent=$hdr(user-agent);
Contact=$hdr(contact);
Event=$hdr(event)")
# Set the acc flags
xlog("JUSTE BEFORE SETTING FLAGS FOR RADIUS\r\n");
if(is_method("INVITE") && !has_totag()) {
xlog("L_INFO", "I AM SETTING THE FLAGS FOR RADIUS
\r\n");
# $avp(s:authentic) = 1;
# $avp(can_uri) = $ru; # SIP Request's URI
$avp(user_name) = $au + "@" + $ar;
$avp(billing_party) = $au + "@" + $ar;
$avp(to_destination) = $tu;
xlog("SETTING FLAGS 1 FOR RADIUS \r\n");
setflag(1); # radius_flag
xlog("SETTING FLAGS 2 FOR RADIUS \r\n");
setflag(2); # radius_missed_flag
};
CDRTool looks for the Canonical-URI radius attribute, and you don't set it.
Note that in "radius_extra" you set
"Canonical-URI=$avp(to_destination)", so
add this after RURI transformation ("+" -> "00").
$avp(to_destination) = $ru;
Just it.
;)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org
iD8DBQFHzB9PrxOjjFYWQtoRAkXQAJwPs+CMWesf9bmtH6vyOdoa0MJRsgCePguJ
KnY06BtvklCzJOvL9CIvXjI=
=JQGg
-----END PGP SIGNATURE-----