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

Static phone number

lekarinfo opened this issue · comments

is it possible to have only one (static) phone number? So anyone who wanna use video chat can chose only one phone number. Every time page loads there is different number so where in code is possibility to make it static. Thank you for answer.

Yes! You are correct. You can pick the static phone number. You can either set one per user, or you can use localStorage.

Thank you for your answer. Can you tell me where in code i need to set up static phone number?

Static Number Example

// create static number
let number = localStorage.getItem('static-number') || (''+Math.random()).split('.').join('');
localStorage.setItem( 'static-number', number );

var phone = PHONE({
    number        : number,
    publish_key   : 'pub-c-561a7378-fa06-4c50-a331-5c0056d0163c',
    subscribe_key : 'sub-c-17b7db8a-3915-11e4-9868-02ee2ddab7fe',
    ssl           : true
});