drachtio / drachtio-siprec-recording-server

SIPREC recording server based on drachtio and rtpengine
MIT License
81 stars 32 forks source link

ORACLE SBC + Drachtio + rtpengine - No connected clients found to handle incoming invite request #10

Closed ivlovric closed 5 years ago

ivlovric commented 5 years ago

Hi Dave and thanks for this unique repo.

I am having this error above in title where my call is not being recorded and hope you can help.

this is complete log:

INVITE sip:10.116.28.171:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.50.140:5060;branch=z9hG4bKc835p1201oejvmt2e4i0 Max-Forwards: 70 Call-ID: 323d4a19f0eeb1d10283c935f80d0c16@10.116.28.171 To: <sip:10.116.28.171:5060;transport=udp> Contact: sip:acmeSrc@192.168.50.140:5060;transport=udp;+sip.src From: sip:acmeSrc@192.168.50.140:5060;tag=817c6996f978f421a0ca64181959e0c5 CSeq: 100021 INVITE Require: siprec Content-Type: multipart/mixed; boundary=unique-boundary-1 Content-Length: 1873 MIME-Version: 1.0

--unique-boundary-1 Content-Type: application/sdp

v=0 o=- 1300 112633 IN IP4 192.168.50.140 s=- c=IN IP4 192.168.50.140 t=0 0 m=audio 20026 RTP/AVP 0 a=rtpmap:0 PCMU/8000 a=label:16777219 a=sendonly m=audio 20030 RTP/AVP 0 a=rtpmap:0 PCMU/8000 a=maxptime:150 a=label:16777220 a=sendonly

--unique-boundary-1 Content-Type: application/rs-metadata+xml Content-Disposition: recording-session

<?xml version='1.0' encoding='UTF-8'?>

complete 2019-03-09T11:37:23 9000 KgEqFsw3SW1H4oLaSgPqKA== 2019-03-09T11:37:23 true 1002 O8ImD6Y6SEVHzyLEDisAlw== 2019-03-09T11:37:23 false separate 2019-03-09T11:37:23 separate 2019-03-09T11:37:34

--unique-boundary-1-- 2019-03-09 12:42:11.659057 nta.c:2968 agent_recv_request() nta: received INVITE sip:10.116.28.171:5060 SIP/2.0 (CSeq 100021) 2019-03-09 12:42:11.659106 nta.c:3183 agent_recv_request() nta: INVITE (100021) to message callback 2019-03-09 12:42:11.659127 processMessageStatelessly - incoming message with call-id 323d4a19f0eeb1d10283c935f80d0c16@10.116.28.171 does not match an existing call leg, processed in thread 140133265098880 2019-03-09 12:42:11.659326 send 325 bytes to udp/[192.168.50.140]:5060 at 12:42:11.659262: SIP/2.0 100 Trying Via: SIP/2.0/UDP 192.168.50.140:5060;branch=z9hG4bKc835p1201oejvmt2e4i0;rport=5060 From: sip:acmeSrc@192.168.50.140:5060;tag=817c6996f978f421a0ca64181959e0c5 To: <sip:10.116.28.171:5060;transport=udp> Call-ID: 323d4a19f0eeb1d10283c935f80d0c16@10.116.28.171 CSeq: 100021 INVITE Content-Length: 0

2019-03-09 12:42:11.659390 No connected clients found to handle incoming invite request 2019-03-09 12:42:11.659419 processNewRequest - No providers available for INVITE 2019-03-09 12:42:11.659552 send 356 bytes to udp/[192.168.50.140]:5060 at 12:42:11.659516: SIP/2.0 503 Service Unavailable Via: SIP/2.0/UDP 192.168.50.140:5060;branch=z9hG4bKc835p1201oejvmt2e4i0;rport=5060 From: sip:acmeSrc@192.168.50.140:5060;tag=817c6996f978f421a0ca64181959e0c5 To: <sip:10.116.28.171:5060;transport=udp>;tag=ZSXH7a2t1jNNc Call-ID: 323d4a19f0eeb1d10283c935f80d0c16@10.116.28.171 CSeq: 100021 INVITE Content-Length: 0

2019-03-09 12:42:11.660644 recv 361 bytes from udp/[192.168.50.140]:5060 at 12:42:11.660602: ACK sip:10.116.28.171:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.50.140:5060;branch=z9hG4bKc835p1201oejvmt2e4i0 CSeq: 100021 ACK Max-Forwards: 70 Call-ID: 323d4a19f0eeb1d10283c935f80d0c16@10.116.28.171 To: <sip:10.116.28.171:5060;transport=udp>;tag=ZSXH7a2t1jNNc From: sip:acmeSrc@192.168.50.140:5060;tag=817c6996f978f421a0ca64181959e0c5 Content-Length: 0

2019-03-09 12:42:11.660687 nta.c:2968 agent_recv_request() nta: received ACK sip:10.116.28.171:5060 SIP/2.0 (CSeq 100021) 2019-03-09 12:42:11.660714 nta.c:3183 agent_recv_request() nta: ACK (100021) to message callback 2019-03-09 12:42:11.660734 processMessageStatelessly - incoming message with call-id 323d4a19f0eeb1d10283c935f80d0c16@10.116.28.171 does not match an existing call leg, processed in thread 140133265098880


Thanks and regards, I

ivlovric commented 5 years ago

update: My drachtio-siprec-recording-server was not running, but here is new output from drachtio-siprec

{"level":30,"time":1552145809169,"msg":"received SIPREC invite: sip:10.116.28.171:5060","pid":5806,"hostname":"siprec-drachtio","callid":"513724f0448795cafb0323fb1ab1cba0@10.116.28.171","v":1} {"level":50,"time":1552145809173,"msg":"Error connecting call: Error: expected multipart SIPREC body","pid":5806,"hostname":"siprec-drachtio","callid":"513724f0448795cafb0323fb1ab1cba0@10.116.28.171","v":1}

Thanks, I

davehorton commented 5 years ago

As you've noted, there are two logs - the drachtio server log and the application log. Would it be possible for you to post a gist of the drachtio server log showing when the SIPREC call arrives? I would like to see what that INVITE looks like because it seems as if there was an error parsing it for some reason.

ivlovric commented 5 years ago

Thanks for reply! In debugging of payload-parser.js I noticed that in function parseSiprecPayload in "switch" loop, variable req.payload[0].type gets value of "multipart/mixed; boundary=unique-boundary-1" and that whole array is length of 1 instead of 3, so there seems to be the issue.

Please find INVITE attached.

image

SIPREC-INVITE.txt

davehorton commented 5 years ago

I think I see the problem. I had an issue in a dependent library parsing the Content-Type header with multipart content when there was whitespace before the boundary delimiter. In any case, I've checked in a fix, so can you pull the latest and retest? Make sure to run npm install after getting the latest to install the fixed library

ivlovric commented 5 years ago

Thanks! Now its parsed correctly. :) Now whats left for me is to have call recorded in rtpengine, so far directories pcaps and metadata are empty.

davehorton commented 5 years ago

Hmm, interesting because the app definitely sends the record call: yes instruction to rtpengine.

Are you running rtpengine from a docker image or a native build?

If the latter, I would say to check the rtpengine configuration options to make sure they are set up properly to record.

Here is an example rtpengine systemd file for running rtpengine.

The best way to troubleshoot is to turn log levels for rtpengine up to debug and then watch the syslog on the rtpengine server when you place a call. You should see all of the commands and responses from the drachtio app

ivlovric commented 5 years ago

I was using custom build on Centos 7, which was not so easy to build and I suspect rtpengine is somewhat broken. Building from ground now up using Debian which seems to be much easier regarding all dependencies. I guess we can close this issue now as it is resolved. Thanks once gain!

davehorton commented 5 years ago

ok, lets leave open until you are successful with rtpengine on debian.

ivlovric commented 5 years ago

I am able to record calls to pcap format, but as we dont necessarily like to use any post-processing converting pcap to something more friendly, my next task is to record directly to wav/mp3 using rtpengine-recording. :) Components used (latest drachtio-server, drachtio-siprec-recording-server, latest rtpengine compiled from master).

One question regarding large scale deployment with more control: how is it possible to control what is recorded and what is not as I have ideas to build multi-tenant and controllable call recording solution?

Also, we like to use ansible here and it seems you like it too, so once Ansible role is ready with all components using rtpengine, I can provide it here.

Thanks!

davehorton commented 5 years ago

with rtpengine, you can indicate that you want the call to be recorded when you send the 'offer' command (which is what we are doing), or alternatively during the call you can send a start recording command (and later, if you want, send a stop recording command). I don't know, though, if you can start and stop recording multiple times for a single call though.

If you want to change the app to have it be configurable by call whether or not you are recording, then change the setting in the offer command here:

to set the 'record call' property based on a variable in your application.

rojover commented 2 years ago

Hi there. I'm sorry to post here but i would like to ask a question related to a very similar scenario. In my case there's an oracle SBC which would operate as siprec client. My intention is to use Drachtio siprec server to get the siprec RTP audio stream and instead of actually recording it, buffer and send it to other destinations for real time transcriptions or other actions. I would very much appreciate it if you could just give me your perspective on this idea. Do you think it's doable or see some clear obstacle which would make it not doable or very complex? Many many thanks.

Mickaelh51 commented 2 years ago

Hi, We do that for realtime transcription. We receive siprec call throuh opensips After that we forward call to drachtio server. And finaly, we send call to our asterisk cluster for realtime transcription. It works like a charm ++

Le ven. 8 oct. 2021 à 20:20, rojover @.***> a écrit :

Hi there. I'm sorry to post here but i would like to ask a question related to a very similar scenario. In my case there's an oracle SBC from which would operate as siprec client. My intention is to use Drachtio siprec server to get the RTP audio stream and instead of actually recording it, buffer and send it to other destinations for real time transcriptions or other actions. I would very much appreciate it if you could just give me your perspective on this idea. Do you think it's doable or see some clear obstacle which would make it not doable or very complex? Many many thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/drachtio/drachtio-siprec-recording-server/issues/10#issuecomment-939032603, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACLNNXBEPU6QYNNR4AWCVI3UF4ZAJANCNFSM4G42RSPA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

davehorton commented 2 years ago

Yes, I don't see any reason you could not do that. One option would be to use Freeswitch with my mod_audio_fork to send the audio over a websocket to downstream processing, though you can really handle it any way you want

rojover commented 2 years ago

Many thanks for that feedback! I'll be looking at the Oracle SBC -> SIPREC -> Drachtio SIPREC using Freeswitch with the mod_audio_fork scenario first. Thanks again!