kirm / sip.js

Session Initiation Protocol for node.js
MIT License
427 stars 171 forks source link

Need Help #159

Open Syed-AliHamza opened 6 months ago

Syed-AliHamza commented 6 months ago

---------------------------------------------------NOT A BUG / ISSUE----------------------------------------------------------

I know this is not the platform for this question, i have posted it on other platform as well but i am interested on getting your point of view. This question is already asked by someone else on stackoverflow, but no one has answered it.

In the development of the communication infrastructure, three key entities are involved 1- PSTN + Session Border Controller (SBC) alias ExtVoipGW (Freeswitch) 2- A Gateway (Node JS) 3- Node JS Server AI Bot

I'm building the Gateway which will receive sip signaling and and Real time audio from the first entity and it will then send the audio to the AI Bot via websocket. Bot will send back real time audio packets via websocket and We (Gateway) will send it back to the first entity.

My question is, should i consider the first and third entity as user agent and build a proxy sip server in place of gateway will it do the job? if yes then how can we get the real time audio of the user agents communicating?

I found an udp port in the INVITE req.content. I tried to listen to that port using dgram but i didn't received any audio packet. Can we setup user agent on node js? I have tried setting it up by using git+https://github.com/Winston87245/SIP.js.git#node-environment but it does not receive any media.

Right now, i'm testing my proxy server implementation with https://tryit.jssip.net/. It would be helpful if you suggest some tool to test this application as well

I'm stuck and need direction on whether to use a SIP server and how to handle real-time audio between the phone system and AI Bot. Any guidance would be helpful.

Syed-AliHamza commented 6 months ago

Update: I noticed that during the sip communication while invite it send a response to the caller with reason: "OK" and a different udp port. Upon listening to that port i received buffer when user end the call. But the requirement is to get the real time audio stream.