2

I'm attempting to build out an application that will allow me to record in real-time an outbound call that I'm making, and stream that live audio (in small chunks) from the call as it's happening directly to my server.

I've looked into SIP trunking and using a PBX server, but I don't quite understand what the approach would look like in terms of actually setting up a server that will capture that audio as it's being transmitted, and then route the inbound audio to my server to process. I also checked out quite a number of VoIP solutions such as Twilio, Nexmo, Plivo, and Bandwidth to see if any of them provide real-time audio recording and direct streaming, but none of them do. They only provide a recording after the call has already been completed.

I'm really looking for any kind of advice or nudges in the right direction as to what path I should be looking for. Thanks in advance!

msafi
  • 377
  • 1
  • 5
  • 19
  • ;you could look over webrtc where you can use the api :: audio streaming :: to get at the audio.buffer.byteArray . with that area of memory , you can then do whatever additional ( arrayCopy to encoder to remoteStream ) that you like. reason for webrtc over sip is that its more flexible. follow links - https://github.com/oney/react-native-webrtc/issues/99 ... see example code - https://recordtest-1e799.firebaseapp.com/ note example #3 – Robert Rowntree Aug 30 '18 at 05:47
  • @RobertRowntree is it possible to to call a regular phone number using webrtc (e.g calling ###-###-#### aka a telephony system)? – msafi Aug 30 '18 at 11:43
  • no idea.. i point to webrtc out of confidence that #1 it provides access to the audio buffers bytes #2 it accommodates downstream actions like create audio stream from source or encode and feed encoded to recorder.js type actions . http://flats.github.io/blog/2016/01/25/audiorecorder-walkthrough-web-audio-and-webrtc/ – Robert Rowntree Aug 30 '18 at 16:53
  • focus on #1 access via api to audios buffer < raw PCM audio > #2 reference to buffer vs a vs streamin api < https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API > #3 various streaming api's vs explicit use of remote comms layer < https and or sockets > – Robert Rowntree Aug 30 '18 at 17:09
  • @msafi did you solve your issue? – user867662 Mar 06 '19 at 10:10
  • 1
    @user867662 my only solution was to use one of the VoIP audio providers in a headless browser running on the server. Providers like Twilio, Nexmo, and Sinch over client-side calling. I was then able to transmit the audio data from the headless browser and store it in 5 second segments, and then convert the file to MP2 format for an endpoint that supports continuous live stream broadcasting. I can write something up if you wouldn't mind using the approach I described above. – msafi Mar 06 '19 at 14:19
  • @msafi can you give more details on your solution please? I am also having the same problem. – user867662 Mar 21 '19 at 12:43
  • 1
    @user867662 i put the code up on Github: https://github.com/munirsafi/NodeJS-Phone-Recording. Let me know if you have any other questions. – msafi Apr 01 '19 at 17:24

1 Answers1

0

Have you looked into Plivo Conference Calls to see if that can help you out?

ACetin
  • 97
  • 7