[Kamailio-Users] Avoid encoding of CDR's written to database by Radius

CSB kjcsb at xnet.co.nz
Sat Jun 20 03:39:05 CEST 2009


When a CDR is written that contains certain characters (e.g. +, ;) it is
encoded (like a URL gets encoded).

The SQL insert statement query is produced by OpenSER/Radius:
                  10625 Query       INSERT INTO radacct
(RadAcctId, AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress,
NASPortId, AcctStartTime, AcctStopTime, AcctSessionTime,
AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId,
AcctTerminateCause, ServiceType, FramedProtocol,          FramedIPAddress,
AcctStartDelay, AcctStopDelay, SipResponseCode, SipMethod,
SipTranslatedRequestURI, SipToTag, SipFromTag,              SipRPID,
SourceIP, SourcePort, CanonicalURI)      VALUES                (NULL,
'149a4cbd403b071e109d89b50a17b3a5 at 202.180.1.1', 'e04d0b07ab2eca3e',
SUBSTRING_INDEX('sip:094455667 at 202.180.1.1',':',-1),
SUBSTRING_INDEX('sip:094455667 at 202.180.1.1', '@',-1),          '127.0.0.1',
'5060', '2009-06-20 11:44:49', '0', '0', '0', '0',
SUBSTRING_INDEX('sip:=2B6012345678 at 147.202.1.1',':',-1),
SUBSTRING_INDEX('sip:094455667 at 202.180.1.1',':',-1),            '200',
'SIP', '', '', '0', '0',                 '200', 'Invite',
SUBSTRING_INDEX('',':',-1), 'as03a3d864', 'as69938f56', '',            '',
'', SUBSTRING_INDEX('',':',-1))

However the records written to the file system by OpenSER/Radius are not
encoded:
Sat Jun 20 11:44:49 2009
        Acct-Status-Type = Start
        Service-Type = SIP
        Sip-Response-Code = 200
        Sip-Method = Invite
        Event-Timestamp = "Jun 20 2009 11:44:49 NZST"
        Sip-From-Tag = "as69938f56"
        Sip-To-Tag = "as03a3d864"
        Acct-Session-Id = "149a4cbd403b071e109d89b50a17b3a5 at 202.180.1.1"
        Called-Station-Id = "sip:+6012345678 at 147.202.1.1"
        Calling-Station-Id = "sip:094455667 at 202.180.1.1"
        User-Name = "sip:094455667 at 202.180.1.1"
        NAS-Port = 5060
        Acct-Delay-Time = 0
        NAS-IP-Address = 127.0.0.1
        Client-IP-Address = 127.0.0.1
        Acct-Unique-Session-Id = "e04d0b07ab2eca3e"
        Timestamp = 1245455089

So how can I write +6012345678 to the database, rather than =2B6012345678?

Any advice appreciated.

Regards
Cameron





More information about the sr-users mailing list