I am trying to integrate Asterisk with webRTC. There was a query posted here but it barely provides any solution.
I already have a basic webRTC infrastructure in place which I have tested for proof-of-concept. I use socket.io for signalling, COTURN for STUN/TURN with node.js and supporting modules for my web server. I use MySQL for session persistence. My asterisk installation works fine with SIP phones and a PRI card for my PSTN interface. My Asterisk, webserver and other supporting servers run on the same box.
There are instructions on Asterisk here and on sipjs here (and other similar products site) to integrate Asterisk with WebRTC. From my reading there, it appears that Asterisk has a builtin webserver for wss support, uses pjproject for ICE, TURN/STUN servers, among other things. I see that taking the approach here would mean duplicating the infrastructure.
I would like to implement an audio gateway from WebRTC to a SIP or DAHDI channel. This is essentially an audio call to a PSTN number or a SIP end-point from the browser. The way I see it is that with what I have in place, I will need the following:
- A codec transcoder for audio (Browser codec to Asterisk codec), possibly Kurento.
- Some way to convert a WebRTC SDP to an Asterisk SDP.
- Some way to “register” a logical webRTC peer to the SIP proxy(Asterisk).
- Some intermediate module for Asterisk to think of a WebRTC peer as a SIP end point.
- Anything else?
I think this must have been implemented before. I am unable to find any solution or discussion in this direction.
Am I on the wrong track? Am I reinventing the wheel? Any guidance will be most appreciated.