<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:2.0cm 42.5pt 2.0cm 3.0cm;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1023631525;
        mso-list-template-ids:-491093540;}
@list l0:level1
        {mso-level-text:%1;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:32.25pt;
        text-indent:-32.25pt;}
@list l0:level2
        {mso-level-text:"%1\.%2";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:32.25pt;
        text-indent:-32.25pt;}
@list l0:level3
        {mso-level-text:"%1\.%2\.%3";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:36.0pt;
        text-indent:-36.0pt;}
@list l0:level4
        {mso-level-text:"%1\.%2\.%3\.%4";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:36.0pt;
        text-indent:-36.0pt;}
@list l0:level5
        {mso-level-text:"%1\.%2\.%3\.%4\.%5";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:54.0pt;
        text-indent:-54.0pt;}
@list l0:level6
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:54.0pt;
        text-indent:-54.0pt;}
@list l0:level7
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:72.0pt;
        text-indent:-72.0pt;}
@list l0:level8
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:72.0pt;
        text-indent:-72.0pt;}
@list l0:level9
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8\.%9";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:72.0pt;
        text-indent:-72.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=RU link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hello <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>In SIP trace <o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-36.0pt;mso-list:l0 level4 lfo1'><![if !supportLists]><span lang=EN-US><span style='mso-list:Ignore'>1.1.1.1<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=EN-US>– callee<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>2.2.2.2 – Opensips<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>3.3.3.3 – callee<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>I have Opensips 1.6.4-2.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>….<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("dialog", "hash_size", 4096)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("dialog", "log_profile_hash_size", 12)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("dialog", "default_timeout", 1800)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("dialog", "timeout_avp", "$avp(i:995)")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("dialog", "dlg_match_mode", 1)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("dialog", "db_mode", 1)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("dialog", "db_url", "mysql://xxxx:xxxx@localhost/xxxx")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("dialog", "profiles_with_value", "client;tgrp;tgrpin;tgrpout;answer;outdir;outdiranswer")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("dialog", "profiles_no_value", "callin;callout")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>….<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("acc", "early_media", 0)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("acc", "report_ack", 0)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("acc", "report_cancels", 1)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("acc", "detect_direction", 1)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("acc", "db_flag", 15)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("acc", "db_missed_flag", 16)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("acc", "failed_transaction_flag", 17)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("acc", "db_table_acc", "acc")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("acc", "db_table_missed_calls", "acc")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>…<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("acc", "cdr_flag", 22)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("acc", "db_url", "mysql://xxxx:xxxx@localhost/xxxx")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>modparam("acc", "db_extra","src_in=$avp(i:600);src_user=$avp(i:500);src_domain=$si;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> 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)")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>…..<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>route {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US> if (is_method("BYE")) xlog("L_INFO", "…."); <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> if (has_totag()) {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> if (is_method("BYE")) xlog("L_INFO", "…."); <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> record_route();<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> if (loose_route()) {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> if (is_method("BYE")) xlog("L_INFO", "…."); <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> if (!$DLG_status == NULL) {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> if (is_method("BYE")) {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> xlog("L_INFO", "….");<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>…<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> }<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>…<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>For accounting purposes I am using cdr_flag.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>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.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>All 4 xlog("L_INFO", "…."); for the first BYE I can see in log file of Opensips.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Thank you for any help<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>