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

 

U 2011/03/24 09:32:44.180633 1.1.1.1:59196 -> 2.2.2.2:5060
INVITE sip:78124485322@2.2.2.2:5060 SIP/2.0.
Via: SIP/2.0/UDP 1.1.1.1:5060;x-route-tag="tgrp:TFOP";branch=z9hG4bK21E40ED7.
From: <sip:8123215695@1.1.1.1>;tag=9CBBDF4-D2B.
To: <sip:78124485322@2.2.2.2>.
Date: Thu, 24 Mar 2011 06:32:40 GMT.
Call-ID: 59DD6AAB-551711E0-9BFBA2C8-C63BD640@1.1.1.1.
Supported: 100rel,timer,resource-priority,replaces,sdp-anat.
Min-SE:  1800.
Cisco-Guid: 1507563059-1427575264-2679242786-2438473264.
User-Agent: Cisco-SIPGateway/IOS-12.x.
Accept-Language: ru.
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, 
NOTIFY, INFO, REGISTER.
CSeq: 101 INVITE.
Max-Forwards: 15.
Timestamp: 1300948360.
Contact: <sip:8123215695@1.1.1.1:5060>.
Expires: 60.
Allow-Events: telephone-event.
P-Asserted-Identity: <sip:8123215695@1.1.1.1>.
Content-Type: application/sdp.
Content-Disposition: session;handling=required.
Content-Length: 422.
.
v=0.
o=CiscoSystemsSIP-GW-UserAgent 9140 2676 IN IP4 1.1.1.1.
s=SIP Call.
c=IN IP4 1.1.1.1.
t=0 0.
m=audio 21598 RTP/AVP 8 0 18 4 98 3 101.
c=IN IP4 1.1.1.1.
a=rtpmap:8 PCMA/8000.
a=rtpmap:0 PCMU/8000.
a=rtpmap:18 G729/8000.
a=fmtp:18 annexb=yes.
a=rtpmap:4 G723/8000.
a=fmtp:4 bitrate=6.3;annexa=yes.
a=rtpmap:98 G726-32/8000.
a=rtpmap:3 GSM/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.


U 2011/03/24 09:32:44.180909 2.2.2.2:5060 -> 1.1.1.1:5060
SIP/2.0 100 Giving a try.
Via: SIP/2.0/UDP 1.1.1.1:5060;x-route-tag="tgrp:TFOP";branch=z9hG4bK21E40ED7.
From: <sip:8123215695@1.1.1.1>;tag=9CBBDF4-D2B.
To: <sip:78124485322@2.2.2.2>.
Call-ID: 59DD6AAB-551711E0-9BFBA2C8-C63BD640@1.1.1.1.
CSeq: 101 INVITE.
Content-Length: 0.
.


U 2011/03/24 09:32:44.181410 2.2.2.2:5060 -> 3.3.3.3:5060
INVITE sip:78124485322@3.3.3.3:5060 SIP/2.0.
Record-Route: <sip:2.2.2.2;lr=on;ftag=9CBBDF4-D2B;did=9a3.8e2c5044>.
Via: SIP/2.0/UDP 2.2.2.2;branch=z9hG4bKb72a.96697e7.0.
Via: SIP/2.0/UDP 1.1.1.1:5060;x-route-tag="tgrp:TFOP";branch=z9hG4bK21E40ED7.
From: <sip:8123215695@1.1.1.1>;tag=9CBBDF4-D2B.
To: <sip:78124485322@2.2.2.2>.
Date: Thu, 24 Mar 2011 06:32:40 GMT.
Call-ID: 59DD6AAB-551711E0-9BFBA2C8-C63BD640@1.1.1.1.
Supported: 100rel,timer,resource-priority,replaces,sdp-anat.
Min-SE:  1800.
Cisco-Guid: 1507563059-1427575264-2679242786-2438473264.
User-Agent: Cisco-SIPGateway/IOS-12.x.
Accept-Language: ru.
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, 
NOTIFY, INFO, REGISTER.
CSeq: 101 INVITE.
Max-Forwards: 15.
Timestamp: 1300948360.
Contact: <sip:8123215695@1.1.1.1:5060>.
Remote-Party-ID:<sip:8123215695@1.1.1.1>;party=calling;screen=yes;privacy=off
Expires: 60.
Allow-Events: telephone-event.
P-Asserted-Identity: <sip:8123215695@1.1.1.1>.
Content-Type: application/sdp.
Content-Disposition: session;handling=required.
Content-Length: 422.
.
v=0.
o=CiscoSystemsSIP-GW-UserAgent 9140 2676 IN IP4 1.1.1.1.
s=SIP Call.
c=IN IP4 1.1.1.1.
t=0 0.
m=audio 21598 RTP/AVP 8 0 18 4 98 3 101.
c=IN IP4 1.1.1.1.
a=rtpmap:8 PCMA/8000.
a=rtpmap:0 PCMU/8000.
a=rtpmap:18 G729/8000.
a=fmtp:18 annexb=yes.
a=rtpmap:4 G723/8000.
a=fmtp:4 bitrate=6.3;annexa=ye

U 2011/03/24 09:32:44.187543 3.3.3.3:5060 -> 2.2.2.2:5060
SIP/2.0 100 Trying.
Via: SIP/2.0/UDP 2.2.2.2;branch=z9hG4bKb72a.96697e7.0.
Via: SIP/2.0/UDP 1.1.1.1:5060;x-route-tag="tgrp:TFOP";branch=z9hG4bK21E40ED7.
From: <sip:8123215695@1.1.1.1>;tag=9CBBDF4-D2B.
To: <sip:78124485322@2.2.2.2>.
Call-ID: 59DD6AAB-551711E0-9BFBA2C8-C63BD640@1.1.1.1.
CSeq: 101 INVITE.
Server: Telphin SoftSwitch.
Content-Length: 0.
.


U 2011/03/24 09:32:44.344351 3.3.3.3:5060 -> 2.2.2.2:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 2.2.2.2;branch=z9hG4bKb72a.96697e7.0.
Via: SIP/2.0/UDP 1.1.1.1:5060;x-route-tag="tgrp:TFOP";branch=z9hG4bK21E40ED7.
Record-Route: <sip:79.175.9.163;lr=on;ftag=9CBBDF4-D2B;did=c8.022531d7>.
Record-Route: <sip:78124485322@3.3.3.3;lr=on;ftag=9CBBDF4-D2B;did=9a3.172068a3>.
Record-Route: <sip:2.2.2.2;lr=on;ftag=9CBBDF4-D2B;did=9a3.8e2c5044>.
From: <sip:8123215695@1.1.1.1>;tag=9CBBDF4-D2B.
To: <sip:78124485322@2.2.2.2>;tag=as46e83f94.
Call-ID: 59DD6AAB-551711E0-9BFBA2C8-C63BD640@1.1.1.1.
Contact: <sip:00081425@79.175.9.163:5060>.
CSeq: 101 INVITE.
Server: Hosted.telphin.ru.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO.
Supported: replaces, timer.
Require: timer.
Session-Expires: 1800;refresher=uas.
Content-Type: application/sdp.
Content-Length: 261.
.
v=0.
o=root 1387413634 1387413634 IN IP4 79.175.9.163.
s=Asterisk PBX 1.6.1.20.
c=IN IP4 79.175.9.163.
t=0 0.
m=audio 17816 RTP/AVP 0 8 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=ptime:20.
a=sendrecv.


U 2011/03/24 09:32:44.344773 2.2.2.2:5060 -> 1.1.1.1:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 1.1.1.1:5060;x-route-tag="tgrp:TFOP";branch=z9hG4bK21E40ED7.
Record-Route: <sip:79.175.9.163;lr=on;ftag=9CBBDF4-D2B;did=c8.022531d7>.
Record-Route: <sip:78124485322@3.3.3.3;lr=on;ftag=9CBBDF4-D2B;did=9a3.172068a3>.
Record-Route: <sip:2.2.2.2;lr=on;ftag=9CBBDF4-D2B;did=9a3.8e2c5044>.
From: <sip:8123215695@1.1.1.1>;tag=9CBBDF4-D2B.
To: <sip:78124485322@2.2.2.2>;tag=as46e83f94.
Call-ID: 59DD6AAB-551711E0-9BFBA2C8-C63BD640@1.1.1.1.
Contact: <sip:00081425@79.175.9.163:5060>.
CSeq: 101 INVITE.
Server: Hosted.telphin.ru.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO.
Supported: replaces, timer.
Require: timer.
Session-Expires: 1800;refresher=uas.
Content-Type: application/sdp.
Content-Length: 261.
.
v=0.
o=root 1387413634 1387413634 IN IP4 79.175.9.163.
s=Asterisk PBX 1.6.1.20.
c=IN IP4 79.175.9.163.
t=0 0.
m=audio 17816 RTP/AVP 0 8 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=ptime:20.
a=sendrecv.


U 2011/03/24 09:32:44.353249 1.1.1.1:59196 -> 2.2.2.2:5060
ACK sip:00081425@79.175.9.163:5060 SIP/2.0.
Via: SIP/2.0/UDP 1.1.1.1:5060;x-route-tag="tgrp:TFOP";branch=z9hG4bK21E411802.
From: <sip:8123215695@1.1.1.1>;tag=9CBBDF4-D2B.
To: <sip:78124485322@2.2.2.2>;tag=as46e83f94.
Date: Thu, 24 Mar 2011 06:32:40 GMT.
Call-ID: 59DD6AAB-551711E0-9BFBA2C8-C63BD640@1.1.1.1.
Route: 
<sip:2.2.2.2;lr=on;ftag=9CBBDF4-D2B;did=9a3.8e2c5044>,<sip:78124485322@3.3.3.3;lr=on;ftag=9CBBDF4-D2B;did=9a3.172068a3>,<sip:79.175.9.163;lr=on;ftag=9CBBDF4-D2B;did=c8.022531d7>.
Max-Forwards: 15.
CSeq: 101 ACK.
Allow-Events: telephone-event.
Content-Length: 0.
.


U 2011/03/24 09:32:44.353540 2.2.2.2:5060 -> 3.3.3.3:5060
ACK sip:00081425@79.175.9.163:5060 SIP/2.0.
Record-Route: <sip:2.2.2.2;lr=on;ftag=9CBBDF4-D2B>.
Via: SIP/2.0/UDP 2.2.2.2;branch=z9hG4bKb72a.96697e7.2.
Via: SIP/2.0/UDP 1.1.1.1:5060;x-route-tag="tgrp:TFOP";branch=z9hG4bK21E411802.
From: <sip:8123215695@1.1.1.1>;tag=9CBBDF4-D2B.
To: <sip:78124485322@2.2.2.2>;tag=as46e83f94.
Date: Thu, 24 Mar 2011 06:32:40 GMT.
Call-ID: 59DD6AAB-551711E0-9BFBA2C8-C63BD640@1.1.1.1.
Route: 
<sip:78124485322@3.3.3.3;lr=on;ftag=9CBBDF4-D2B;did=9a3.172068a3>,<sip:79.175.9.163;lr=on;ftag=9CBBDF4-D2B;did=c8.022531d7>.
Max-Forwards: 15.
CSeq: 101 ACK.
Allow-Events: telephone-event.
Content-Length: 0.
.


U 2011/03/24 09:33:35.613932 1.1.1.1:59196 -> 2.2.2.2:5060
BYE sip:00081425@79.175.9.163:5060 SIP/2.0.
Via: SIP/2.0/UDP 1.1.1.1:5060;x-route-tag="tgrp:TFOP";branch=z9hG4bK21E8C3AA.
From: <sip:8123215695@1.1.1.1>;tag=9CBBDF4-D2B.
To: <sip:78124485322@2.2.2.2>;tag=as46e83f94.
Date: Thu, 24 Mar 2011 06:32:40 GMT.
Call-ID: 59DD6AAB-551711E0-9BFBA2C8-C63BD640@1.1.1.1.
User-Agent: Cisco-SIPGateway/IOS-12.x.
Max-Forwards: 15.
Route: 
<sip:2.2.2.2;lr=on;ftag=9CBBDF4-D2B;did=9a3.8e2c5044>,<sip:78124485322@3.3.3.3;lr=on;ftag=9CBBDF4-D2B;did=9a3.172068a3>,<sip:79.175.9.163;lr=on;ftag=9CBBDF4-D2B;did=c8.022531d7>.
P-Asserted-Identity: <sip:8123215695@1.1.1.1>.
Timestamp: 1300948411.
CSeq: 102 BYE.
Reason: Q.850;cause=16.
Content-Length: 0.
.


U 2011/03/24 09:33:35.614215 2.2.2.2:5060 -> 3.3.3.3:5060
BYE sip:00081425@79.175.9.163:5060 SIP/2.0.
Record-Route: <sip:2.2.2.2;lr=on;ftag=9CBBDF4-D2B>.
Via: SIP/2.0/UDP 2.2.2.2;branch=z9hG4bK872a.87784fe4.0.
Via: SIP/2.0/UDP 1.1.1.1:5060;x-route-tag="tgrp:TFOP";branch=z9hG4bK21E8C3AA.
From: <sip:8123215695@1.1.1.1>;tag=9CBBDF4-D2B.
To: <sip:78124485322@2.2.2.2>;tag=as46e83f94.
Date: Thu, 24 Mar 2011 06:32:40 GMT.
Call-ID: 59DD6AAB-551711E0-9BFBA2C8-C63BD640@1.1.1.1.
User-Agent: Cisco-SIPGateway/IOS-12.x.
Max-Forwards: 15.
Route: 
<sip:78124485322@3.3.3.3;lr=on;ftag=9CBBDF4-D2B;did=9a3.172068a3>,<sip:79.175.9.163;lr=on;ftag=9CBBDF4-D2B;did=c8.022531d7>.
P-Asserted-Identity: <sip:8123215695@1.1.1.1>.
Timestamp: 1300948411.
CSeq: 102 BYE.
Reason: Q.850;cause=16.
Content-Length: 0.
.


U 2011/03/24 09:33:35.617429 3.3.3.3:5060 -> 2.2.2.2:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 2.2.2.2;branch=z9hG4bK872a.87784fe4.0.
Via: SIP/2.0/UDP 1.1.1.1:5060;x-route-tag="tgrp:TFOP";branch=z9hG4bK21E8C3AA.
Record-Route: <sip:79.175.9.163;lr=on;ftag=9CBBDF4-D2B>.
Record-Route: <sip:00081425@3.3.3.3;lr=on;ftag=9CBBDF4-D2B>.
Record-Route: <sip:2.2.2.2;lr=on;ftag=9CBBDF4-D2B>.
From: <sip:8123215695@1.1.1.1>;tag=9CBBDF4-D2B.
To: <sip:78124485322@2.2.2.2>;tag=as46e83f94.
Call-ID: 59DD6AAB-551711E0-9BFBA2C8-C63BD640@1.1.1.1.
CSeq: 102 BYE.
Server: Hosted.telphin.ru.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO.
Supported: replaces, timer.
Content-Length: 0.
.


U 2011/03/24 09:33:35.617505 2.2.2.2:5060 -> 1.1.1.1:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 1.1.1.1:5060;x-route-tag="tgrp:TFOP";branch=z9hG4bK21E8C3AA.
Record-Route: <sip:79.175.9.163;lr=on;ftag=9CBBDF4-D2B>.
Record-Route: <sip:00081425@3.3.3.3;lr=on;ftag=9CBBDF4-D2B>.
Record-Route: <sip:2.2.2.2;lr=on;ftag=9CBBDF4-D2B>.
From: <sip:8123215695@1.1.1.1>;tag=9CBBDF4-D2B.
To: <sip:78124485322@2.2.2.2>;tag=as46e83f94.
Call-ID: 59DD6AAB-551711E0-9BFBA2C8-C63BD640@1.1.1.1.
CSeq: 102 BYE.
Server: Hosted.telphin.ru.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO.
Supported: replaces, timer.
Content-Length: 0.
.


U 2011/03/24 12:20:09.977300 2.2.2.2:5060 -> 1.1.1.1:5060
BYE sip:8123215695@1.1.1.1:5060 SIP/2.0.
Via: SIP/2.0/UDP 2.2.2.2;branch=z9hG4bK872a.97784fe4.0.
To: <sip:8123215695@1.1.1.1>;tag=9CBBDF4-D2B.
From: <sip:78124485322@2.2.2.2>;tag=as46e83f94.
CSeq: 102 BYE.
Call-ID: 59DD6AAB-551711E0-9BFBA2C8-C63BD640@1.1.1.1.
Content-Length: 0.
Max-Forwards: 70.
.


U 2011/03/24 12:20:09.977368 2.2.2.2:5060 -> 3.3.3.3:5060
BYE sip:00081425@79.175.9.163:5060 SIP/2.0.
Via: SIP/2.0/UDP 2.2.2.2;branch=z9hG4bK872a.a7784fe4.0.
To: <sip:78124485322@2.2.2.2>;tag=as46e83f94.
From: <sip:8123215695@1.1.1.1>;tag=9CBBDF4-D2B.
CSeq: 102 BYE.
Call-ID: 59DD6AAB-551711E0-9BFBA2C8-C63BD640@1.1.1.1.
Route: 
<sip:78124485322@3.3.3.3;lr=on;ftag=9CBBDF4-D2B;did=9a3.172068a3>,<sip:79.175.9.163;lr=on;ftag=9CBBDF4-D2B;did=c8.022531d7>.
Content-Length: 0.
Max-Forwards: 70.
.


U 2011/03/24 12:20:09.980280 1.1.1.1:59196 -> 2.2.2.2:5060
SIP/2.0 481 Call Leg/Transaction Does Not Exist.
Via: SIP/2.0/UDP 2.2.2.2;branch=z9hG4bK872a.97784fe4.0.
From: <sip:78124485322@2.2.2.2>;tag=as46e83f94.
To: <sip:8123215695@1.1.1.1>;tag=9CBBDF4-D2B.
Call-ID: 59DD6AAB-551711E0-9BFBA2C8-C63BD640@1.1.1.1.
CSeq: 102 BYE.
Content-Length: 0.
.


U 2011/03/24 12:20:09.981975 3.3.3.3:5060 -> 2.2.2.2:5060
SIP/2.0 481 Call leg/transaction does not exist.
Via: SIP/2.0/UDP 2.2.2.2;branch=z9hG4bK872a.a7784fe4.0.
From: <sip:8123215695@1.1.1.1>;tag=9CBBDF4-D2B.
To: <sip:78124485322@2.2.2.2>;tag=as46e83f94.
Call-ID: 59DD6AAB-551711E0-9BFBA2C8-C63BD640@1.1.1.1.
CSeq: 102 BYE.
Server: Hosted.telphin.ru.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO.
Supported: replaces, timer.
Content-Length: 0.
.
_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to