-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inbound calls from classic sip endpoint (RTP) to WebRTC endpoint (SRTP) not working. #39
Comments
The issue is that freeswitch does not support currently (as best I can tell, after reviewing the code and discussions with some freeswitch devs) generating an SRTP offer from an incoming 3pcc INVITE. Stepping back, the way we generate an outbound call leg from drachtio where the local endpoint is freeswitch is that we send a 3pcc INVITE (an INVITE with no sdp) to freeswitch; we take the sdp from the 200 OK response freeswitch and send out our INVITE with that as the offer. (When we get a 200 OK to our INVITE we send the ACK to freeswitch with that sdp, thereby connecting the media stream). So therefore, the only solution I see to making this work is for me to add this feature (returning srtp sdp offer in response to 3pcc INVITE) to my fork of freeswitch. Its a bit of work, which I have not yet found time for. It also has the downside of forcing people to use my freeswitch build rather than a stock build, though I am not sure how much of a downside that is at this point since most people using my freeswitch plugins (for google speech, transcribe, dialogflow, or forking audio) probably are using my build scripts already. Anyways, that is what needed. |
To summarize things: Your suggestion for Freeswitch: Returning SRTP SDP offer in response to 3PCC INVITE. If it requires some modifications in the C files of Freeswitch we best wait for you to complete this. SRTP -> RTP Outbound call:
RTP -> SRTP Inbound call: |
The flow will be pretty simple. You will create an endpoint (there will need to be a new option to request SRTP) then use Srf#createUAC to send an invite, e.g.
|
Just to keep track for everyone
Maybe the same pattern they used for mod_verto can be used: This function switch_core_media_gen_local_sdp seems to be the one to create the RTP SDP: There are 3 conditions to enable SRTP:
The conditions to put CF_AVPF flag are calling switch_core_session_set_ice or:
The conditions to put CF_DTLS flag are the same as above (CF_AVPF) or calling check_ice:
There is also the possibility to send true for the secure parameter but the conditions are many. The conditions to put CF_AVPF_MOZ flag:
Hope this can help to prove or disprove your assumption that freeswitch does not support currently generating an SRTP offer from an incoming 3PCC INVITE @davehorton Do you think you can alter these conditions from drachtio-fsmrf for 3PCC invite without changing the source code of Freeswitch? |
According to this answer:
This should work to allow us to get back SRTP SDP for 3PCC INVITE. |
Unfortunately....nope. That answer betrays a lack of understanding of how 3PCC works on Freeswitch. The SDP is generated (in this case) before any application is run. And before any channel variables can be set. I still think it will take a patch to the freeswitch core. Something I still plan to do, but a question of time (/ working on open source once I pay my bills haha :) |
Feel free to try though, if you think for some reason it will work. Let me know if you prove me wrong |
Sure! Just wanted to confirm nobody can provide an answer to this question with Freeswitch. |
I believe this issues is the only thing left for a truly functional Drachtio framework with all web capabilities. Please consider this contribution to this amazing framework as it truly what it takes to make it possible for everbody to get far with this framework! If you have any response I will truly appreciate it @davehorton |
Honestly this project is kind of useless for me in today's world where everything is about the web and something as necessary as the webrtc cannot play at all with this project. I will abandon this project in search for alternatives. Kind of hoped that after trying so hard to get some attention with both money and emails we will be able to move a step forward in the right direction for this library. Anyway thanks @davehorton for all the hard work! for people who really just need the old fashioned deskphones or fully native sip clients I guess it will be great to continue with this. |
leaving this issue open for now, in case I implement this feature later. For others coming across this thread in the future with similar needs, I suggest doing what I do which is to use an rtpengine (with my npmjs rtpengine-client module) in front of freeswitch, and let rtpengine handle the SRTP/RTP transcoding. rtpengine provides much more configurability in this regard than freeswitch |
Do you have any example to show how to do it? |
I was checking both: https://github.com/davehorton/drachtio-rtpengine-webrtcproxy and didn't see any example of the idea to put RTPengine in front of Freeswitch. |
Here are a few notes... So you can either run rtpengine on the same server as freeswitch, or different. If the same, make sure each is configured with a non-overlapping rtp port range. First you are going to want to get familiar with its ng protocol. In your node app, use my rtpengine-client to control rtpengine using ng protocol. So then, for an outbound call you would do this:
At that point the call will be connected from freeswitch to rtpengine (plain RTP) and from rtpengine to your far end client (SRTP). Make sure to call ng |
Hi many thanks! Do you have any gist on Github to show the code example for the steps you mentioned? |
I have plenty of projects where I've used rtpengine but no git showing exactly what I outline above |
Still no plans to make drachtio-fsmrf capable of providing incoming calls to WebRTC? @davehorton |
We started this conversation privately but just so everyone else can follow
and track our progress I will put it here too:
This module is currently in a state that allows us to make outbound calls from WebRTC client such as SIP.js to classic sip endpoint such as Bria but not the other way around (meaning we cannot receive any inbound calls from Bria endpoints to SIP.js endpoints.
The problem is with RTP (Bria) -> SRTP (SIP.js) invitation.
Looking for any ideas what is the blueprint to implement this.
Thanks!
The text was updated successfully, but these errors were encountered: