[OpenSIPS-Users] dialog and accounting problem

Bogdan-Andrei Iancu bogdan at opensips.org
Wed Apr 6 16:30:02 CEST 2011


Hi Denis,

I agree with you on the 4th xlog - it should be printed only if the BYE 
matched the dialog - of course, if you identified the xlog sequence 
correctly :)

If the BYE matched the dialog, then the dialog should be terminated and 
no timeout.

What I can think of is that the BYE is not considered by opensips - do 
you see any errors in logs related to the BYE processing ?

Regards,
Bogdan

On 03/30/2011 06:29 AM, Denis Putyato wrote:
> Hello Bogdan
>
> I have a lot of calls through Opensips. I found such call accidentally by looking another problem calls which has expired dialogs.
> I will try to use debug 4 but I want pay your attention to fourth xlog. This xlog appear only when condition if (!$DLG_status == NULL) is true.
> I see this xlog in log file, so Opensips as I understand, matched BYE to the dialog.
>
>
> -----Original Message-----
> From: users-bounces at lists.opensips.org [mailto:users-bounces at lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu
> Sent: Tuesday, March 29, 2011 6:01 PM
> To: OpenSIPS users mailling list
> Subject: Re: [OpenSIPS-Users] dialog and accounting problem
>
> Hi Denis,
>
> Indeed, the SIP capture looks like opensips is not matching the received
> BYE to the dialog....This is why the timeout is fired. But is strange, I
> do no see any obvious reason for the the matching to fail...
>
> If you can reproduce this case, could you enable full debug in opensips
> (debug=4) in order to get more info regarding the BYE
> processing...Assuming that what you say is true - you get all 4 xlogs
> for the BYE.
>
> Regards,
> Bogdan
>
>
> Denis Putyato wrote:
>> Hello
>>
>> In SIP trace
>>
>> 1.1.1.1 – callee
>>
>> 2.2.2.2 – Opensips
>>
>> 3.3.3.3 – callee
>>
>> I have Opensips 1.6.4-2.
>>
>> ….
>>
>> modparam("dialog", "hash_size", 4096)
>>
>> modparam("dialog", "log_profile_hash_size", 12)
>>
>> modparam("dialog", "default_timeout", 1800)
>>
>> modparam("dialog", "timeout_avp", "$avp(i:995)")
>>
>> modparam("dialog", "dlg_match_mode", 1)
>>
>> modparam("dialog", "db_mode", 1)
>>
>> modparam("dialog", "db_url", "mysql://xxxx:xxxx@localhost/xxxx")
>>
>> modparam("dialog", "profiles_with_value",
>> "client;tgrp;tgrpin;tgrpout;answer;outdir;outdiranswer")
>>
>> modparam("dialog", "profiles_no_value", "callin;callout")
>>
>> ….
>>
>> modparam("acc", "early_media", 0)
>>
>> modparam("acc", "report_ack", 0)
>>
>> modparam("acc", "report_cancels", 1)
>>
>> modparam("acc", "detect_direction", 1)
>>
>> modparam("acc", "db_flag", 15)
>>
>> modparam("acc", "db_missed_flag", 16)
>>
>> modparam("acc", "failed_transaction_flag", 17)
>>
>> modparam("acc", "db_table_acc", "acc")
>>
>> modparam("acc", "db_table_missed_calls", "acc")
>>
>>>>
>> modparam("acc", "cdr_flag", 22)
>>
>> modparam("acc", "db_url", "mysql://xxxx:xxxx@localhost/xxxx")
>>
>> modparam("acc",
>> "db_extra","src_in=$avp(i:600);src_user=$avp(i:500);src_domain=$si;
>>
>> src_out=$avp(i:30);dst_in=$avp(s:dstin);dst_user=$avp(s:callee);dst_out=$avp(s:out);dst_domain=$avp(s:domain)")
>>
>> …..
>>
>> route {
>>
>> if (is_method("BYE")) xlog("L_INFO", "….");
>>
>> if (has_totag()) {
>>
>> if (is_method("BYE")) xlog("L_INFO", "….");
>>
>> record_route();
>>
>> if (loose_route()) {
>>
>> if (is_method("BYE")) xlog("L_INFO", "….");
>>
>> if (!$DLG_status == NULL) {
>>
>> if (is_method("BYE")) {
>>
>> xlog("L_INFO", "….");
>>
>>>>
>> }
>>
>> }
>>
>>>>
>> }
>>
>> For accounting purposes I am using cdr_flag.
>>
>> For the certain call, the SIP trace of which you can see in
>> attachment, there is $avp(i:995) = 9999. The call was successful,
>> duration is about 50 s (if you see SIP trace). but in acc table I have
>> a record with duration 10045. As you can see Opensips tries to finish
>> the call by sending BYE to both callee and caller after timeout of
>> $avp(i:995) expired although BYE from callee has been received before
>> and has been successfully sent by Opensips to caller. And as I suppose
>> Opensips for some reason didn’t indicate the end of call when received
>> first BYE.
>>
>> All 4 xlog("L_INFO", "…."); for the first BYE I can see in log file of
>> Opensips.
>>
>> Thank you for any help

-- 
Bogdan-Andrei Iancu
OpenSIPS eBootcamp - 2nd of May 2011
OpenSIPS solutions and "know-how"




More information about the Users mailing list