Giter VIP home page Giter VIP logo

innovateasterisk / browser-phone Goto Github PK

View Code? Open in Web Editor NEW
433.0 35.0 226.0 17.05 MB

A fully featured browser based WebRTC SIP phone for Asterisk

Home Page: https://www.innovateasterisk.com

License: GNU Affero General Public License v3.0

HTML 2.59% CSS 7.66% JavaScript 72.83% Less 8.40% SCSS 8.51%
webrtc browser-phone asterisk-pbx audio-calls video-calls voip asterisk asterisk-server asterisk-dialplan asterisk-webui

browser-phone's People

Contributors

amitiyer avatar brambruning avatar desmondsimcode avatar gxovano avatar innovateasterisk avatar wangzhenzhe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

browser-phone's Issues

share a hi-res image

Hi,

I can see that Browser-Phone can share quite a few things (very nice!) during a call.
I was wondering what would the best approach be if I wanted a patient to share a high resolution picture with his/her doctor while on a video call. Suppose it's a session of dermatology teleconsultation and that the MD needs to see the patient's skin up close because he/she has a rash or whatever. The video call will not be enough. Sharing a video is OK but still not quite right. Sharing a picture taken by the patient with his/her camera on PC might be better (higher resolution, etc.) just as long as the doctor can actually zoom in and out (or simply download it -- but without the need to ask the patient to send it via e-mail with all the legal issues related to privacy). Ideally, it would all be done within the Browser-Phone app. I don't know if it would be easy to "share a picture from local hard disk" just like it is currently possible with videos.
Another possibility is that if the patient's webcam is good enough and configured to the max of its resolution in the video call, the doctor could be able to "capture" a video frame at any given moment and then analyze it on his/her PC (by simply downloading it and using local software to zoom in/out, take measurements, etc.).
Would it be possible to allow an endpoint to "capture" a high-res video frame and save it locally as a picture with just a click of a button?

I'm just asking to get an idea as to how far we can stretch this great piece of software...

Thanks

Blacklists & Whitelists

Blacklists can prevent users being "bugged" based on caller ID
Whitelists can be used in combination with extreme blacklists.

Firefox & Safari Present Video

Can't present video in Firefox and Safari. Video loads, but does not play automatically, and the video is not presented to the B side.

DID length to decide if buddy is extension or contact

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.

setting for video calls in fullscreen

Hi,

Another interesting improvement would be to add yet another setting via setItem to decide, upon user login, if video calls should start in fullscreen mode or not.
That would be useful for specific patient profiles calling in: they would receive a URL via SMS, they click and open Browser-Phone which identifies them as patients, auto-launch freedial to enter an Asteisk queue right away, and in fullscreen.
Simple and with a clean trimmed down UI for no-hassle patients.

Fix a dialplan issue in the send-text context

Hello,

Can you fix another typo in the send-text context (The FROM variable setting):
This is the original context:

[send-text]
exten => s,1,NoOp(Sending Text To: ${ARG1})
exten => s,n,Set(PEER=${CUT(CUT(CUT(MESSAGE(from),@,1),<,2),:,2)})
exten => s,n,Set(FROM=${SHELL(asterisk -rx 'sip show peer ${PEER}' | grep 'Callerid' | cut -d':' -f2- | sed /^\ *//' | tr -d '\n')})
exten => s,n,Set(CALLERID_NUM=${CUT(CUT(FROM,>,1),<,2)})
exten => s,n,Set(FROM_SIP=${STRREPLACE(MESSAGE(from),<sip:${PEER}@,<sip:${CALLERID_NUM}@)})
exten => s,n,MessageSend(sip:${ARG1},${FROM_SIP})
exten => s,n,Hangup()

Please fix to:

[send-text]
exten => s,1,NoOp(Sending Text To: ${ARG1})
exten => s,n,Set(PEER=${CUT(CUT(CUT(MESSAGE(from),@,1),<,2),:,2)})
exten => s,n,Set(FROM=${SHELL(asterisk -rx 'sip show peer ${PEER}' | grep 'Callerid' | cut -d':' -f2- | sed 's/^\ *//' | tr -d '\n')})
exten => s,n,Set(CALLERID_NUM=${CUT(CUT(FROM,>,1),<,2)})
exten => s,n,Set(FROM_SIP=${STRREPLACE(MESSAGE(from),<sip:${PEER}@,<sip:${CALLERID_NUM}@)})
exten => s,n,MessageSend(sip:${ARG1},${FROM_SIP})
exten => s,n,Hangup()

Thank you,

Daniel Friedman

disable account settings

Hi,

The option:

setItem("EnableAccountSettings", "0")

works fine as it grays out the tab element to configure account details.

However, when I click on the "configure extension" from the user's dropdown menu, this very tab is shown first and, even if it's grayed out, I can still see all the settings, scroll down and press the save button.
A possible solution would be to only display the "enabled tabs", or focus on an enabled tab on window open.

Trim Buddy Stream

Rather than a full delete, the Delete option could offer a trim, to remove events in the stream up to a specific number or date.

adding buddies and starting calls automatically

Hi,

I was wondering if we could get this patch upstream somehow. It is incomplete, and that's why I'm posting it here instead of filing a PR. The idea is simple. If a user types in a number or extension on the buddy search input box, a buddy will be created automatically, and a call will also be initiated. My patch below will disable the "addsomeonewindow" which, of course, is not desired (but due to lack of time, I need to finish other tasks first).

--- phone.original.js   2020-06-09 18:10:35.034098297 +0200
+++ phone.js    2020-06-11 12:22:41.712065649 +0200
@@ -300,6 +300,88 @@
     HidePopup();
 }

+// CUSTOM: automatically add buddy and start call
+// ==========
+function AutoAddBuddy(peerid){
+    peerid = peerid.trim();
+    if(peerid.length == 0){
+       console.log("Cannot Auto Add Buddy");
+       return;
+    }
+    console.log("Auto Add Buddy " + peerid);
+
+    var CurrentCalls = CallSessions.length;
+
+    var buddyObj = FindBuddyByNumber(peerid);
+    if(buddyObj == null) buddyObj = FindBuddyByExtNo(peerid);
+    // Make new contact of its not there
+    if(buddyObj == null) {
+        var json = JSON.parse(localDB.getItem("UserBuddiesJson"));
+        if(json == null) json = InitUserBuddies();
+
+        if(peerid.length > DidLength){
+            // Add Regular Contact
+            var id = uID();
+            var dateNow = utcDateNow();
+            json.DataCollection.push(
+                {
+                    Type: "contact",
+                    LastActivity: dateNow,
+                    ExtensionNumber: "",
+                    MobileNumber: "",
+                    ContactNumber1: peerid,
+                    ContactNumber2: "",
+                    uID: null,
+                    cID: id,
+                    gID: null,
+                    DisplayName: "",
+                    Position: "",
+                    Description: "",
+                    Email: "",
+                    MemberCount: 0
+                }
+            );
+            buddyObj = new Buddy("contact", id, "", "", "", peerid, "", dateNow, "", "");
+            AddBuddy(buddyObj, true, (CurrentCalls==0));
+        }
+        else {
+            // Add Extension
+            var id = uID();
+            var dateNow = utcDateNow();
+            json.DataCollection.push(
+                {
+                    Type: "extension",
+                    LastActivity: dateNow,
+                    ExtensionNumber: peerid,
+                    MobileNumber: "",
+                    ContactNumber1: "",
+                    ContactNumber2: "",
+                    uID: id,
+                    cID: null,
+                    gID: null,
+                    DisplayName: "",
+                    Position: "",
+                    Description: "",
+                    Email: "",
+                    MemberCount: 0
+                }
+            );
+            buddyObj = new Buddy("extension", id, "", peerid, "", "", "", dateNow, "", "");
+            AddBuddy(buddyObj, true, (CurrentCalls==0), true);
+        }
+        // Update Size:
+        json.TotalRows = json.DataCollection.length;
+
+        // Save To DB
+        localDB.setItem("UserBuddiesJson", JSON.stringify(json));
+
+        UpdateBuddyList();
+    }
+    var buddy = buddyObj.identity;
+
+    VideoCall(buddy);
+}
+
 // UI Windows
 // ==========
 function AddSomeoneWindow(){
@@ -1433,7 +1515,9 @@
         CreateGroupWindow();
     });
     $("#BtnAddSomeone, #BtnAddSomeone1").on('click', function(event){
-        AddSomeoneWindow();
+        // AddSomeoneWindow();
+        // CUSTOM: add as contact buddy whatever is in txtFindBuddy (TODO: make sure buddy doesn't already exist, allow to add as extension too)
+        AutoAddBuddy($("#txtFindBuddy").val());
     });
     $("#ConfigureExtension").on('click', function(event){
         ConfigureExtensionWindow();

Do you think you can modify this and merge it in?
The idea is to keep the original behavior/design the same (add a buddy with all its details), but adding the ability to quickly dial someone. In some hectic environments (as in a hospital), users are often impatient, and they will find that the manual creation of a buddy in order to simply dial out (eg. a patient) is overly time consuming.
So, if you have the time (or I can try to pick this up again later), the idea is that when a user clicks on the "Add someone" icon, there should be a dropdown menu with "Add with details" and "Quick Add and Call". The first option would open the addsomeonewindow form (and mayube even pass it the extension or number), and the second one would launch the code I wrote (AutoAddBuddy).

Thanks

dialpad with letters

Hi,

A simple but useful improvement would be to add letters beneath each number in the dialpads, especially the one used during an active call.
For instance, add "ABC" under "2", "DEF" under "3", and so on.
That's because sometimes it's an easy way to remember how to use some IVRs.
For instance, one might prefer to think that one is dialing "derma" instead of the extension "33762".
Also, we have some accesses / calls restricted and require some sort of PIN or authentication. It's often easier to remember a name instead of a number even if the digits sent are numbers, of course.

[WISHLIST] dialpad

Hi,

I don't know if it's a "hidden" feature or if it's simply not implemented, but is it possible to have a dialpad on the main screen or a simple text input field to write a number and press enter or click a dial button? Once the SIP extension is registered, it would be easier to just dial or type a number that Asterisk then takes care of. Requiring to "add a contact" before placing a call is a show stopper when you want to either quickly dial short dynamic Asterisk extensions or call out to, say, hundreds of different destinations that you will probably only use once.

Regards,

Vieri

profileUserID and uID()

Hi,

I'd like to understand how profileUserID and uID() work.
The problem I'm facing is that unfortunately some users don't log out of their OS session, so basically several users might end up "sharing" an OS user session/profile even though I set up LDAP/AD authentication to access Browser-Phone. Authentication works fine, and each user registers with his/her Asterisk extension. The problem is that all "Browser-Phone users" share the same buddy list, among other parameters. So, in order to address this, I wonder if I just need to set myself the value of profileUserID to a value derived from the LDAP/AD user login (eg. username+random_string).

Any thoughts?

debugging remote devices

Hi,

I was wondering what would the best approach be to try to debug errors in remote handheld devices such as smartphones or tablets. Not having control over these end-user devices, whatever goes to console.log is basically unavailable. Could it be possible to make a function that sends each console message to a custom server via ajax calls? Something like consoleRemote(msg); when one would need to "setItem" a web service URL. That would allow admins to see at least some of the erro message that could occur.
Yet another workaround would be to open a window wth all the debugging info displayed in it, but only if the admin sets a specific "setItem" variable for a given user login. The user would then have to copy all of the on-screen text and manually send it somehow to the admin.

Do you have any other ways of debugging remote client-side issues?

I'm asking because I've had two cases of clients unable to call using this app, and it was impossible to get enough info from the users. Maybe issues detecting the microphone, no idea.

Thanks

dependency

This isn't really an issue... Anyway, I guess I can post this here.

Just a note on the dependency list (README): fontawesome 4.7.0 should be added, and I believe the Roboto fonts are also missing.

download recording

Is it possible for the user to download a call recording? The feature is really useful and elegantly displayed, but the user would rather save a copy in a server's directory (with backup support) instead of the browser's cache (which can easily be erased for many reasons).
Minor issue but useful.

welcome window on Chrome

Hi,

Is it just me or is the WelcomeWindow not displaying the buttons below to dismiss it in Chrome?
Git cloned today.

video calls between two webrtc peers

Hi,

I noticed that video calls between two webrtc peers are not working as expected.

First of all, when both peers use Firefox ESR there's no option to make a video call -- only audio calls from both ends.

When using Chrome, in my case I see that only one of the two peers can initiate a video call (when both have cameras). The "video icon" is missing in one of the two.

The webrtc extensions are defined in Asterisk as (pjsip):

[doctor]
type=aor
max_contacts=5
remove_existing=yes

[doctor]
type=auth
auth_type=userpass
username=doctor
password=doctor 

[doctor]
type=endpoint
aors=doctor
auth=doctor
dtls_auto_generate_cert=yes
webrtc=yes
context=default
disallow=all
allow=alaw,ulaw,opus,gsm,vp8,h264
rtp_symmetric=yes
force_rport=yes

[patient]
type=aor
max_contacts=5
remove_existing=yes

[patient]
type=auth
auth_type=userpass
username=patient
password=patient

[patient]
type=endpoint
aors=patient
auth=patient
dtls_auto_generate_cert=yes
webrtc=yes
context=default
disallow=all
allow=alaw,ulaw,opus,gsm,vp8,h264
rtp_symmetric=yes
force_rport=yes

Is this a bug, something I misconfigured, or a network-related issue?

Regards,

Vieri

DialByLine and extensions that are not numbers

Hi,

I usually have numbers for extensions, but in some cases I use alphanumeric strings such as "patient", "doctor", etc. In other words, I have pjsip extensions registering as strings without numbers or containing numbers and letters.

The problem is now with the DialByLine function as it tries to extract the number with \d before @ in the URI. It fails of course if it's not an integer, and the peer can't be contacted.

Can't an "extension" be just about anything?

Call button and text within search input box

Hi,

If user types something in the "Find someone" text input field then maybe when click the "call" button next to it, it should simply take its value and DialByLine (directly, without the need to show the dialpad). Actually, even an ENTER key event could be enough to trigger the call.

Ideally, it would default to a video call with a downgrade to audio if one of the two peers does not support video.

provisioning upon authentication

Hi,

I was wondering if provisioning is contemplated somehow, or what would the best approach be.
The idea in my case is that a user needs to authenticate in order to open the "webphone". Each authenticated user would then have their account set up automatically, and probably even the contact list.
For instance, if I use Apache HTTP I can force LDAP authentication, just to name one, and then somehow override the window.localStorage items. This is not my domain, and I usually don't program in javascript, but is there an "elegant" way to override what phone.js does? Can I call localStorage.setItem() in another custom js and load it in the html?
I don't care if the user can then modify the account details -- I just need to provision the SIP login details on HTTP authentication (they would be overwritten on each Apache HTTP login).

Provisioning the contact list actually doesn't make much sense to me right now. However, allowing an LDAP search for contacts to be "imported" would be neat. The "Find someone" input text field could be linked to an LDAP query, and the user would then have the option of importing contacts to his/her "buddy list". That would be useful when there are hundreds of internal extensions. Then again, all this can be outsourced on an intranet site, just as long as Browser-Phone can receive a contact/phone number via GET, POST, whatever, and eg. ask the user to import it.
Is there a way to fire up the AddSomeoneWindow function on demand?

Regards,

Vieri

Scratchpad Toolbar

Add a toolbar to the Scratchpad feature. Allow users to change colour, prush, add a picture, and clear the screen.

Scaling Up

Yes, I'm doing that now, but am facing a new problem. The idea of provisioning "buddies" is a great way to help people search through a large directory. Unfortunately, I have to provision hundreds of contacts/buddies (healthcare facility) even if I try to trim these down according to who logs in. The problem I see is that the browser becomes sluggish (too many contacts make the whole page slower). I also have a UI problem because some contact/extension names are long and wrap around in a second line. That causes overlapping with the next element (the hint/presence status of the next buddy is partially hidden). Anyway, I'm going to have to rethink how and if I'm going to provision buddies.
So at this point, I guess we can close this issue.
Thanks!

Originally posted by @vieridipaola in #37 (comment)

allow disabling of specific elements

I currently disable a few things when a specific user logs in:

document.getElementById("BtnFreeDial").style.display = "none";
document.getElementById("BtnAddSomeone").style.display = "none";
document.getElementById("BtnCreateGroup").style.display = "none";
document.getElementById("txtFindBuddy").style.display = "none";

I would also like to remove the "Add someone" option from the profile menu, but that requires changing some js code.

In:
function ShowMyProfileMenu

the dhtmlx menu ids can be modified with:

menu.splice

as it is already the case for 'enabledGroupServices'.

Could another setting be created so that these elements can be hidden?

eg.

enabledAddSomeone
enabledFreeDial
enabledFindBuddy

Auto Answer with Video

Hi,

The "Auto Answer" feature only answers an audio call.
Is it possible to Auto Answer with Video?

Regards,

Vieri

Naming

Hi,

Thank you so much for developing and publishing this amazing project. It's really impressive what you have achieved. Thank you also for publishing it under a free software license.

Either knowingly or unknowingly, by choosing Asterisk as a backend, you created the most efficient browser softphone / web video conferencing application. This is because Asterisk is written in C, the most efficient programming language for server resources usage. Jitsi Meet is also an interesing web conferencing application but because the developers made the wrong choice when they used Java as programming language for the backend, Jitsi Meet will never surpass your application in performance and popularity. Thank you also for not using node.js and the related frameworks. I'm strongly convinced that node.js is a big failure: because of the wrong programming language it uses: JavaScript is only suitable for client-side programming, people shouldn't have 'stretched' it to use it for server-side programming. So, by using only HTML, JavaScript and CSS for the frontend and Asterisk as backend, you created the best architecture possible for this kind of application.

I think your application will be the only complete, free and open source, self-hosted, Skype replacement and also a self-hosted Zoom replacement. But for this to happen I think a new name, simple and easy to pronounce would fit better than 'Browser Phone'. What do you think about Sipspace or sipspace ?

Voicemail Notification

If a user has unread voicemail, there should be an icon display, and audio response. Clicking the icon should dial the voicemail feature code (if set). Setting the voicemail feature code should be done in the settings section.

Busy Tone

Play an audible busy tone if call is hungup or call not answered.

XMPP support

Allow a user to select between xmpp and sip in the type configuration.

Action URLs

Create a configurable set of Action URLs / Web Hooks.

messages within a call

Hi,

I don't know if I have to set up something specifically in Asterisk so that "instant messages" work properly in Browser-Phone.

When I'm on a call, if I type anything in the "Type your message here" input field then an "anonymous" call is initiated to the peer. Even if the peer answers this anonymous call, there's no visual on the message interchange.

I'll look into this further if I get the chance and give some more info, but I think it's easy to reproduce.

Thanks

Raspbx Instructions

As raspbx is a famous image to start using asterisk/freepbx on raspberry pi , would be great if you add intructions to setup with it.
Thx

app view and screen scroll when in video call

Depending on screen resolution, etc., the text input section "Type your message here" can disappear way below the screen area when on a video call. Since there's no scroll, it is difficult to write text messages there.
Tested on a desktop PC with Firefox.

video calls and optional input

Hi,

Currently, it seems that for a one-on-one video call to succeed, both webrtc clients need to have a webcam + microphone available as input devices. Would it make sense to ignore an input web cam if it's not connected, thus allowing a video call with video only one way? For instance, browser A with a camera video calls browser B without a camera. Currently, if B "answers with video", the call fails and hangs up. If B answers "with audio only" then all's well.
So maybe, B could answer with video, and A would stream it's video source to B even though B wouldn't stream any video to A, just audio.

I don't know if it's hard to implement, but it's just one of those things that might come in handy.

Provisioning buddies and auto-dial

Hi,

I was wondering if we could add a simple way to automatically add a list of buddies/contacts. Some kind of provisioning (of a contact list)...

Here's what I do now. In my index file I include a 'custom_post.php' file right after phone.js.

# cat custom_post.php
<?php

header('Content-Type: application/javascript');

?>
function ProvisionBuddyList(number, displayName, mobileNum, contactNum1, contactNum2, position, description, email){
    number = number.trim();
    if(number.length == 0){
        console.log("Cannot provision buddy");
        return;
    }
    console.log("Provisioning buddy " + displayName + " with number " + number);

    var buddyObj = FindBuddyByNumber(number);
    if(buddyObj == null) buddyObj = FindBuddyByExtNo(number);
    // Make new contact of its not there
    if(buddyObj == null) {

        // Add Contact / Extension
        var json = JSON.parse(localDB.getItem(profileUserID + "-Buddies"));
        if(json == null) json = InitUserBuddies();

        if(number.length > DidLength){
            // Add Regular Contact
            var id = uID();
            var dateNow = utcDateNow();
            json.DataCollection.push(
                {
                    Type: "contact",
                    LastActivity: dateNow,
                    ExtensionNumber: "",
                    MobileNumber: mobileNum,
                    ContactNumber1: number,
                    ContactNumber2: contactNum2,
                    uID: null,
                    cID: id,
                    gID: null,
                    DisplayName: displayName,
                    Position: "",
                    Description: description,
                    Email: email,
                    MemberCount: 0
                }
            );
            var buddyObj = new Buddy("contact", id, displayName, "", mobileNum, number, contactNum2, dateNow, description, email);
            AddBuddy(buddyObj, false, false);
        }
        else {
            // Add Extension
            var id = uID();
            var dateNow = utcDateNow();
            json.DataCollection.push(
                {
                    Type: "extension",
                    LastActivity: dateNow,
                    ExtensionNumber: number,
                    MobileNumber: mobileNum,
                    ContactNumber1: contactNum1,
                    ContactNumber2: contactNum2,
                    uID: id,
                    cID: null,
                    gID: null,
                    DisplayName: displayName,
                    Position: position,
                    Description: "",
                    Email: email,
                    MemberCount: 0
                }
            );
            var buddyObj = new Buddy("extension", id, displayName, number, mobileNum, contactNum1, contactNum2, dateNow, position, email);
            AddBuddy(buddyObj, false, false, true);
        }
        // Update Size:
        json.TotalRows = json.DataCollection.length;

        // Save To DB
        localDB.setItem(profileUserID + "-Buddies", JSON.stringify(json));

    }
}

$(document).ready(function () {

console.log('Start provisioning buddies');

<?php

@require_once('custom_buddies.php');

?>

console.log('Update buddy list');
UpdateBuddyList();

});

The file custom_buddies.php is generated by another script, and it's basically a list of calls to the function defined above:

ProvisionBuddyList('1234', 'John Doe', '', '', '', '', '', '');
ProvisionBuddyList('5678', 'Mr Smith', '', '', '', '', '', '');
...etc...

I usually have hundreds of these function calls.

Now, in order to not have to maintain this provisioning function myself, would it be possible to somehow include it in phone.js?
I know that calling this function hundreds of times can block the UI, but I can live with that. Maybe a "worker" would be better off, but I'm not sure how to program that just yet.
I also know that calling this may occur before userAgent is not null.

I would also like to expand on this topic and ask if it is possible to implement some sort of auto-dial.
In this case, what I need to do is:

  1. not provide hundreds of buddies but just one (actually it would be an Asterisk extension leading to a 'queue')
  2. disable the "Find someone" and "Add someone" UI elements
  3. remove or disable 'Add someone' from the user's dropdown menu
  4. on page load, auto-dial the buddy that has been provisioned (auto-dial with video if available)

Can't cancell incomming call

Hello.
Thx for you job! Very nice project!
Please fix this:

function RejectCall(buddy) {
    var session = getSession(buddy);
    if (session = null) {
        console.warn("Reject failed, null session");
        $("#contact-" + buddy + "-msg").html(lang.call_failed);
        $("#contact-" + buddy + "-AnswerCall").hide();
    }

i think need
if (session == null) {

Race condition on delete Buddy

Race condition on delete Buddy when buddy type is extension. Occurs when the unsubscribe() is called and removed from the subscriptions array.

http.conf is missing

Hello,

Can you update the configuration of the http.conf? it is confusing the users that install this project from your manual.

post js script and user agent

Hi,

What is the best way to call custom code as soon as the user agent is ready and registered?

This is what I currently wrote in a custom js script loaded right after phone.js:

$(document).ready(function () {
    var onUserAgent = window.setInterval(function () {
        if ( userAgent != null && userAgent.isRegistered() == true ) {
            console.log("This clause should be called only once as soon as the user agent is ready.");
	    // do stuff...
            console.log('Removing setInterval');
            clearInterval(onUserAgent);
        }
    }, 4 * 1000);
});

However, I'm seeing the 2 console log messages twice instead of just once.
So, either clearInterval is not working as I expect it to, or I've misunderstood the whole logic.

ring/dial tone never stops

Hi,

When dialing a number that's really an IVR reachable through a IAX2 trunk on a LAN Asterisk server, sometimes the "ring tone" goes on forever, even after the call is answered by the IVR. At times, there is no "ring tone", ever, not even while waiting for the IVR to start.
This is probably not a Browser Phone issue because the ring tone or dial tone I'm hearing is non of the mp3 files in the project. It's surely the dial tone of the second Asterisk server I'm connecting to where the IVR resides.

Likewise though, the ring tone that's shipped in this project sometimes plays, and sometimes it doesn't. When receiving call, I understand it should always "ring", but it sometimes doesn't. This is probably a client browser issue, but I haven't seen anything weird in the console so far.

I'm just posting this here if anyone has seen this before.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.