stephenlb / webrtc-sdk

WebRTC Simple Calling API + Mobile SDK - A simplified approach to RTCPeerConnection for mobile and web video calling apps.

Home Page:https://stephenlb.github.io/webrtc-sdk/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Access Manager for Security

sagar-spkt opened this issue · comments

Allow only some users for call.

That is a really cool feature!

Is there any milestone for this new feature?

You can add a "Accept Call" phase before the parties video/audio starts. This isn't planned at this time. You can add this feature here near this function: https://github.com/stephenlb/webrtc-sdk/blob/master/index.html#L196-L208

I'll walk you through this:

Before the Sending the Video/Audio Stream, send a signal to ask for call permission:

let user_number = "1235445"; // my friends number
phone.send( { "accept" : "Would you like to accept this call?" }, user_number );

Like this:

function call_request(number) {
    phone.send( { "accept" : "Would you like to accept this call?" }, user_number );
}
function call_accepted() {
    // start voice/video session
    phone.dial(user_number);
}
function call_rejected() {
    // show call rejected screen
}