Skip to content
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

DID length to decide if buddy is extension or contact #29

Closed
vieridipaola opened this issue Jun 8, 2020 · 1 comment
Closed

DID length to decide if buddy is extension or contact #29

vieridipaola opened this issue Jun 8, 2020 · 1 comment

Comments

@vieridipaola
Copy link

Hi,

I'd like to customize the way phone.js decides how to create a "buddy" from an incoming call. This patch is trivial, but at least it allows to enable video calls for certain contacts even if not "local".

--- phone.original.js   2020-06-08 13:24:31.741407729 +0200
+++ phone.js    2020-06-08 14:06:34.090022002 +0200
@@ -162,6 +162,8 @@
 var RecordingVideoFps = parseInt(getDbItem("RecordingVideoFps", 12));       // The Frame Per Second of the Video Track recording
 var RecordingLayout = getDbItem("RecordingLayout", "them-pnp");         // The Layout of the Recording Video Track (side-by-side | us-pnp | them-pnp | us-only | them-only)

+var DIDlength = parseInt(getDbItem("DIDlength", 6));  // DID length from which to decide if an incoming caller is a "contact" or an "extension".
+
 // Utilities
 // =========
 function uID(){
@@ -1648,7 +1650,7 @@
         var json = JSON.parse(localDB.getItem("UserBuddiesJson"));
         if(json == null) json = InitUserBuddies();

-        if(did.length > 6){
+        if(did.length > DIDlength){
             // Add Regular Contact
             var id = uID();
             var dateNow = utcDateNow();

I then call a custom "pre" script loaded before phone.js with:

customLocalDB.setItem("DIDlength", 7);

This is a quick fix for my specific setup, but it might be of use to others.

@InnovateAsterisk InnovateAsterisk added the TODO Something that should be completed by the next build, or soon after label Jun 8, 2020
@InnovateAsterisk
Copy link
Owner

No problem

InnovateAsterisk added a commit that referenced this issue Jun 9, 2020
@InnovateAsterisk InnovateAsterisk removed the TODO Something that should be completed by the next build, or soon after label Jun 26, 2020
dmb-dev87 added a commit to dmb-dev87/webrtc_brower-phone that referenced this issue Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants