Accept/Reject a call

437 views
Skip to first unread message

Umesh Kumar

unread,
Mar 24, 2019, 3:06:20 AM3/24/19
to discuss-webrtc
Hi All,

I want to implement audio only p2p calling solution.

Most of the example i have seen, on https://webrtc.github.io/samples/ or any other resource.

But  I am not able to find a single example where user get the prompt to Accept or Reject the call.
The call either audio or video got connected to the second peer directly. 

I tried peerJS, simple-peer but not able to find any method or event where i can implement the accept/reject prompt for user.


Guys, do you have any idea how can i implement that?




Regards,
Umesh K.

Tsahi Levent-Levi

unread,
Mar 24, 2019, 3:12:32 AM3/24/19
to discuss...@googlegroups.com
Umesh,

Interestingly, that's just what I am publishing tomorrow on my blog... the decoupling between WebRTC and its signaling.

The accept/reject notion doesn't exist in WebRTC because WebRTC doesn't deal with signaling directly.

What WebRTC has is JSEP - the offer/answer paradigm where one device sends an OFFER and the other replies with an ANSWER. The actual sending and replying happens out of the scope of WebRTC itself.

What you need to do, with whatever signaling mechanism you select (be it peerJS or other), is to find the place where the receiver creates a peer connection and processes the offer and just not create an answer or even not create the peer connection - you need to short circuit that and send back a proprietary message of your own to reject the incoming call/session request and handle that message in the dialer's side on your own.

BTW - I wouldn't use peerJS in 2019 (see https://bloggeek.me/mistakes-developing-webrtc-applications/)

-- 
Regards,
Tsahi Levent-Levi
Analyst & Consultant

H.264 or VP8? Enroll to my free video course about Picking a WebRTC Video Codec: http://bit.ly/2fMUd2T


--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/1f9c3125-d0c5-4644-9c3b-df4189419242%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Regards,
Tsahi Levent-Levi
Analyst & Consultant

H.264 or VP8? Enroll to my free video course about Picking a WebRTC Video Codec: http://bit.ly/2fMUd2T

Neil Young

unread,
Mar 24, 2019, 3:33:10 AM3/24/19
to discuss...@googlegroups.com
For the sake of simplicity all these examples are having sender and receiver as two separated objects in one javascript file. This makes signaling simple, since you just have to directly stuff the offer from one peer into the other. Same with ICE candidates. 

You would either have to adapt to existing signaling servers (never investigated that), write your own (that's what I did)  or go with simple solutions like key-value stores on the web (like Firebase). Basically YOU are responsible, how one's OFFER reaches the other, how the OFFER is presented there (maybe by an "accept call dialog"), how the ANSWER is traversed back to the callee, how the hangup is done. And you need to organize the exchange of ICE.

It is really a simple task, not rocket-science. If you like you can also use my experimental signaling server, which has a simple socket.io based protocol. Just drop me a PN on interest


Reply all
Reply to author
Forward
0 new messages