[OpenSIPS-Users] opensips-cp CDR correlation

Brett Nemeroff brett at nemeroff.com
Tue Apr 28 20:34:07 CEST 2009


At Bogdan's request, I checked out the stored proc for CDR Correlation in
the opensips-cp project.
I see the Invite cursor declared as:
  DECLARE inv_cursor CURSOR FOR SELECT time, callid, from_tag, to_tag FROM
opensips.acc where method='INVITE' and cdr_id='0';

This seems like a problem to me.. Imagine a call with several invites in it
(SST for example). It could pick up an INVITE in the middle of the call as
the "initial invite" and then improperly account duration, etc.

Furthermore picking the BYE:
SELECT 1, time INTO bye_record, v_bye_time FROM opensips.acc WHERE
method='BYE' AND callid=v_callid AND ((from_tag=v_from_tag AND
to_tag=v_to_tag) OR (from_tag=v_to_tag AND to_tag=v_from_tag)) ORDER BY time
ASC LIMIT 1;

Shouldn't that ordering at the end be DESC instead of ASC.. point is, don't
you want the absolute FIRST invite per callid and the absolute last BYE per
callid? (sure there shouldn't be much after the FIRST BYE, but still..)

BTW, Please redirect me if it's not appropriate to ask opensips-cp questions
here..

-Brett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20090428/085fbf31/attachment.htm 


More information about the Users mailing list