Looking at mysql's log, this is what I see:
---> BY OPENSER_:
24 Query INSERT INTO radacct (RadAcctId, AcctSessionId,
AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, AcctStartTime,
AcctStopTime, AcctSessionTime, AcctInputOctets,
AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause,
ServiceType, ENUMtld, FramedIPAddress, AcctStartDelay,
AcctStopDelay, SipResponseCode, SipMethod, SipTranslatedRequestURI,
SipToTag, SipFromTag, SipRPID, SourceIP, SourcePort,
CanonicalURI) VALUES (NULL,
'OWNhNDAwMmIyOTM5NDU3MjQ4MGJjMTk2YWIwZmE0NGE.', 'd986b295f8a55559',
'',
SUBSTRING_INDEX('', '@',-1), '1.2.3.4',
'5060', '2008-06-17
08:27:52', '0', '0', '0', '0',
trim(leading 'sip:' from
trim(leading 'sips:' from 'sip:0013058883456@1.2.3.4')),
trim(leading 'sip:' from trim(leading 'sips:' from
'sip:915568911@1.2.3.4')), '200', 'Sip-Session',
'', '',
'0', '0', '200', 'Invite',
trim(leading
'sip:' from trim(leading 'sips:' from
'sip:13058883456@5.6.7.8:5060=3Btransport=3Dudp')),
'17062708081947605004610377', '34794a17', '',
'9.8.7.6',
'27374', trim(leading 'sip:' from trim(leading
'sips:' from
'')) )
---------------------------------------------------------------------------
----------------------------------------------------------------------
---> THE CALL DROPS, THE BY MEDIAPROXY:
29 Connect openser@localhost on radius
29 Query SET NAMES latin1
29 Query UPDATE
radacct
SET
AcctSessionTime = AcctSessionTime + IF(ConnectInfo_stop IS
NULL, 53, 0), AcctStopTime = DATE_ADD(AcctStartTime, INTERVAL
AcctSessionTime SECOND), AcctInputOctets = AcctInputOctets + 77488,
AcctOutputOctets = AcctOutputOctets + 152760,
SipUserAgents = 'eyeBeam release 1014c stamp 46090 +
unknown-agent', SipCodecs = 'G729',
SipApplicationType = 'Audio',
MediaInfo = '', <------------------ LOOK AT
THIS! ITS AN EMPTY STRING!! Normalized = '0'
WHERE
AcctSessionId = 'OWNhNDAwMmIyOTM5NDU3MjQ4MGJjMTk2YWIwZmE0NGE.'
AND SipFromTag = '34794a17' AND SipToTag = '17062708081947605004610377'
---------------------------------------------------------------------------
----------------------------------------------------------------------
---> THEN BY CDRTOOL, GETTING CDRs TO RATE:
select *, UNIX_TIMESTAMP(AcctStartTime) as timestamp
from radacct
where
(1=1) and
Normalized = '0' and
AcctStopTime != '0000-00-00 00:00:00' and
(ConnectInfo_stop is not NULL or MediaInfo is NULL or MediaInfo != '')
<------------- CDRTOOL DOESN'T WANT AN EMPTY STRING!!
---------------------------------------------------------------------------
----------------------------------------------------------------------
this of course will never work, I wonder whether it is a configuration
problem or a cdrtool/mediaproxy bug...
Any thoughts?
David
----- Original Message -----
From: David Villasmil
To: openser users
Sent: Tuesday, June 17, 2008 1:38 PM
Subject: Re: [OpenSER-Users] OPenser+mediaproxy
select *, UNIX_TIMESTAMP(AcctStartTime) as
timestamp from radacct
where (1=1) and Normalized = '0' and AcctStopTime != '0000-00-00
00:00:00' and (ConnectInfo_stop is not NULL or MediaInfo is NULL
or MediaInfo != '')
MediaInfo (after update from mediaproxy) is NOT null... the rest of
the fields are ok.
Look again at the SQL query of above:
MediaInfo is NULL or MediaInfo != ''
It's not needed that MediaInfo is NULL, it can be any value except
NULL or empty string.
That's it, it IS an empry string, so it will never rate it
The UPDATE query MUST be:
WHERE \
AcctSessionId = '%{Acct-Session-Id}' \
AND SipToTag = '%{Sip-To-Tag}' AND SipFromTag
= '%{Sip-From-Tag}' \
AND (MediaInfo IS NULL OR MediaInfo != 'timeout')"
Look at the MediaProxy changelog, there are two updates in this issue.
--
Iñaki Baz Castillo
ibc(a)in.ilimit.es