drachtio / drachtio-server

A SIP call processing server that can be controlled via nodejs applications
https://drachtio.org
MIT License
237 stars 92 forks source link

CDR stop is not sent to drachtio-srf app #310

Closed spointer closed 12 months ago

spointer commented 1 year ago

Hello Dave,

There are cases where CDR Stop is not sent to drachtio-srf app in case drachtio server receives SIP CANCEL message.

Drachtio log is as follows. (I can't get drachtio debug logs because it's in production server and log level is INFO) It seems there is no cdr stop code in the processMessageStatelessly function.

Thanks!

2023-08-21 19:05:04.530657 recv 1104 bytes from udp/[10.4.32.124]:5090 at 19:05:04.530556: INVITE sip:211027@10.3.41.249:5060;transport=udp SIP/2.0 Via: SIP/2.0/UDP 10.4.32.124:5090;branch=z9hG4bK-524287-1---afd5412bcfd526091666233600 Max-Forwards: 70 Contact: sip:1888887@10.4.32.124:5090 To: sip:211027@cai.com From: sip:1888887@cai.com;tag=20d2f974 Call-ID: 000B451264E336D001F7_fc62bbb01e619dc67743fc9680e5f4c8 CSeq: 1 INVITE Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, INFO, MESSAGE, REFER, PRACK, NOTIFY, SUBSCRIBE Content-Type: application/sdp Date: Mon, 21 Aug 2023 10:05:04 GMT User-Agent: cai/v2.29.0.9 Referred-By: sip:61105@10.3.3.10:5090;type=hunt;dnis=1160605 Allow-Events: talk, hold, conference, refer Content-Length: 316

v=0 o=cai 1692612304 1 IN IP4 10.4.32.124 s=NEX SIP CALL c=IN IP4 10.4.32.124 t=0 0 m=audio 21168 RTP/AVP 0 8 18 101 c=IN IP4 10.4.32.124 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:18 G729/8000 a=fmtp:18 annexb=no a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=ptime:20 a=sendrecv

2023-08-21 19:05:04.530803 send 304 bytes to udp/[10.4.32.124]:5090 at 19:05:04.530751: SIP/2.0 100 Trying Via: SIP/2.0/UDP 10.4.32.124:5090;branch=z9hG4bK-524287-1---afd5412bcfd526091666233600;rport=5090 From: sip:1888887@cai.com;tag=20d2f974 To: sip:211027@cai.com Call-ID: 000B451264E336D001F7_fc62bbb01e619dc67743fc9680e5f4c8 CSeq: 1 INVITE Content-Length: 0

2023-08-21 19:05:31.600138 recv 502 bytes from udp/[10.4.32.124]:5090 at 19:05:31.600061: CANCEL sip:211027@10.3.41.249:5060;transport=udp SIP/2.0 Via: SIP/2.0/UDP 10.4.32.124:5090;branch=z9hG4bK-524287-1---afd5412bcfd526091666233600 Max-Forwards: 70 To: sip:211027@cai.com From: sip:1888887@cai.com;tag=20d2f974 Call-ID: 000B451264E336D001F7_fc62bbb01e619dc67743fc9680e5f4c8 CSeq: 1 CANCEL Date: Mon, 21 Aug 2023 10:05:31 GMT User-Agent: cai/v2.29.0.9 Content-Length: 0

2023-08-21 19:05:31.600214 received quick cancel for invite that is out to client for disposition: 000B451264E336D001F7_fc62bbb01e619dc67743fc9680e5f4c8 2023-08-21 19:05:31.600322 send 318 bytes to udp/[10.4.32.124]:5090 at 19:05:31.600265: SIP/2.0 200 OK Via: SIP/2.0/UDP 10.4.32.124:5090;branch=z9hG4bK-524287-1---afd5412bcfd526091666233600;rport=5090 From: sip:1888887@cai.com;tag=20d2f974 To: sip:211027@cai.com;tag=g6em3cp3410cF Call-ID: 000B451264E336D001F7_fc62bbb01e619dc67743fc9680e5f4c8 CSeq: 1 CANCEL Content-Length: 0

2023-08-21 19:05:31.600413 send 334 bytes to udp/[10.4.32.124]:5090 at 19:05:31.600379: SIP/2.0 487 Request Terminated Via: SIP/2.0/UDP 10.4.32.124:5090;branch=z9hG4bK-524287-1---afd5412bcfd526091666233600;rport=5090 From: sip:1888887@cai.com;tag=20d2f974 To: sip:211027@cai.com;tag=HF8c57661aQZa Call-ID: 000B451264E336D001F7_fc62bbb01e619dc67743fc9680e5f4c8 CSeq: 1 INVITE Content-Length: 0

2023-08-21 19:05:31.600756 recv 364 bytes from udp/[10.4.32.124]:5090 at 19:05:31.600709: ACK sip:211027@35.78.136.127:32359;transport=UDP SIP/2.0 Via: SIP/2.0/UDP 10.4.32.124:5090;branch=z9hG4bK-524287-1---afd5412bcfd526091666233600 Max-Forwards: 70 To: sip:211027@cai.com;tag=HF8c57661aQZa From: sip:1888887@cai.com;tag=20d2f974 Call-ID: 000B451264E336D001F7_fc62bbb01e619dc67743fc9680e5f4c8 CSeq: 1 ACK Content-Length: 0

xquanluu commented 1 year ago

Hi @spointer Could you please tell me which version of drachtio-server you are using?

From the latest source code here, I cannot reproduce the issue.

From this testcase: https://github.com/drachtio/drachtio-server/blob/main/test/test-fixtures-all.json#L70

I can get this cdr:stop event:

{ source: 'network', time: '11:56:14.884678', role: 'call-canceled', msg: SipMessage { headers: { via: 'SIP/2.0/UDP 127.0.0.1:5090;rport;branch=z9hG4bKZjU8Fa3Qte07e', from: 'sip:sipp@127.0.0.1:5090;tag=Z6BQ6tH9ZF5KB', to: 'sip:service@127.0.0.1:5095;tag=29213SIPpTag011', 'call-id': 'e4f4385d-c105-123c-52be-0242ac110002', cseq: '72101294 INVITE', contact: '<sip:127.0.0.1:5095;transport=UDP>', 'content-length': '0' }, raw: 'SIP/2.0 487 Request Terminated\r\n' + 'Via: SIP/2.0/UDP 127.0.0.1:5090;rport;branch=z9hG4bKZjU8Fa3Qte07e\r\n' + 'From: sip:sipp@127.0.0.1:5090;tag=Z6BQ6tH9ZF5KB\r\n' + 'To: sip:service@127.0.0.1:5095;tag=29213SIPpTag011\r\n' + 'Call-ID: e4f4385d-c105-123c-52be-0242ac110002\r\n' + 'CSeq: 72101294 INVITE\r\n' + 'Contact: <sip:127.0.0.1:5095;transport=UDP>\r\n' + 'Content-Length: 0\r\n' + '\r\n', body: '', version: '2.0', status: 487, reason: 'Request Terminated', payload: [ [Object] ] } }

xquanluu commented 1 year ago

Hi @spointer do you have any update? Could you please try with latest drachtio version?

xquanluu commented 12 months ago

Hi @spointer as I'm not able to reproduce the issue on latest version of drachtio server and I have not received any response from you. I'm closing this ticket