How can I use the same extension for WebRTC and normal SIP phones?

Hi everyone,

I’m having a bit of trouble and I hope someone can explain if what I’m trying to do is possible.

I have a FreePBX system with PJSIP extensions.
One of my extensions (1001) works perfectly with a web application that connects through WebRTC (WSS / DTLS-SRTP).
Another extension (1004) works fine with Zoiper or Bria softphones (SIP over UDP/TLS).

What I’d like to do is use the same extension (for example 1001) with both:

  • a WebRTC client in the browser
  • and a normal SIP softphone like Zoiper or Bria

When I try to connect Zoiper or Bria to the WebRTC extension, the registration works, but when I make a call I get this error:


res_pjsip_session.c: Couldn't negotiate stream 0:audio-0:audio:sendrecv (nothing)

I guess it’s because of encryption or codec differences (DTLS vs RTP, Opus vs G711?), but I’m not sure.

:backhand_index_pointing_right: My question is:
Is there any way to make a single FreePBX extension work for both WebRTC and classic SIP softphones, or do I really need to create two different extensions (one for WebRTC and one for SIP)?

I’d really appreciate a simple explanation or example setup if someone managed to make it work.

Thanks a lot in advance!

WebRTC and normal SIP are incompatible from an SDP perspective. You can’t use the same PJSIP endpoint for both.

In your opinion, what’s the best setup to allow a single user to make and receive calls both through WebRTC and a mobile VoIP app like Bria at the same time?

I think you need to define an explicit ring group, rather than the implicit one that happens with chan_pjsip multiple registrations. This is easy with Asterisk. I’m sure it isn’t difficult with FreePBX, but that confuses extension numbers with endpoint IDs, so you may have to cope with having to define more than one extension as the source of calls from the user.