[OpenSIPS-Users] OpenSIPS 3.1 DB logging INVITEs but not BYEs

Răzvan Crainea razvan at opensips.org
Fri Apr 9 11:10:23 EST 2021


Hi, Marcin, Kingsley!

Indeed, if you'll be running only do_accounting("db", "cdr"), you will 
only get one record, at the end of the call, containing the `INVITE` 
method. That's more or less hardcoded there, and can't be changed. 
Giving a second thought about it, I somehow agree that's not 100% 
suggestive or correct, although I was the one who wrote that code :).
The idea was to create a CDR format compatible with previous formats of 
acc, which were requiring a method. But since a call consists of several 
methods, the easiest way to pick one was to pick the first one, namely 
INVITE. Hence the CDR always has an INVITE method.
If you have other thoughts on this, any feedback is welcome.

Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 4/8/21 8:26 PM, Marcin Groszek wrote:
> At initial invite some information are stored like a start time, this is 
> needed to calculate the duration at the call end.
> 
> I believe if you do: do_accounting("db","cdr") this will write only 1 
> invite entry in acc at the end of the call,
> 
> but if you do: do_accounting("db") this will write your invite and bye 
> as 2 entries in acc table.
> 
> make a call, select * from acc at your db hung up the call and select 
> again you will see when the entries are written.
> 
> You may also use ngrep -port 3306 -dlo to monitor db access by opensips 
> but you have to change localhost to 127.0.0.1 in modparam.
> 
> modparam("acc", "db_url", "mysql://opensips:opensipsrw@127.0.0.1/opensips")
> 
> 
> 
> On 4/8/2021 11:09 AM, Kingsley Tart wrote:
>> I would prefer a single record as well. I don't understand why using
>> the dialog module makes it write a new "INVITE" record at BYE time
>> instead of either writing a BYE record, or allowing me to update it
>> with a few custom fields, one of which would be t_end or something.
>>
>> Cheers,
>> Kingsley.
>>
>> On Thu, 2021-04-08 at 09:17 -0500, Marcin Groszek wrote:
>>> Because you are using dialog that invite entry in acc table is
>>> written at the time of bye.
>>> I prefer a single entry in acc table for each call, not 2
>>>
>>> Best regards:
>>> Marcin Groszek
>>>
>>>> On Apr 8, 2021, at 8:15 AM, Kingsley Tart <kingsley at dns99.co.uk>
>>>> wrote:
>>>>
>>>> Thanks, though that didn't seem to have made any difference :(
>>>>
>>>> It *is* logging durations though (something you mentioned in your
>>>> other
>>>> email).
>>>>
>>>> Cheers,
>>>> Kingsley.
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>



More information about the Users mailing list