By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,346 Members | 2,331 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,346 IT Pros & Developers. It's quick & easy.

How can I manage my Voip Phone calls (HangUp) through an API in JavaScript

P: 6
I would like to connect Softphones with each other.

I would like to check what phone calls are being in progress in the system, more precisely, between the actual phones.
If it is possible, I would like a solution for the case when any of the participants calls the other, I -as a third participant (as an owner)- will receive a notification immediately about the call and its datas.

It would be even better if I had more control in the actions, for example, I would like to interrupt or hang up the call in particular cases.
I found a really good solution for this (http://www.ozekiphone. com/popup-window-during-a-call-1150.html), but I can't step further.
It works until it is written, when I connect two softphones (Bria) to the system, and I call from one of them the other one, then it shows the popup that I have written based on the example.

But how can I solve that, if I want to hang up or interrupt the call, for example, by the action of pressing a button?
Based on the example, I get until this part (The other codes are unvaried in comparison to the downloaded "full example code"). The Popup is shown, but I don't know how could I hang up the call.

Expand|Select|Wrap|Line Numbers
  1.     function showPopUp(caller, callee, direction, state){
  2.         if ($("#NoficationPopup").length > 0){
  3.             /*update the GUI labels*/
  4.         }
  5.         else 
  6.             $('<div id="NoficationPopup" title=\"' + direction + '\">' +
  7.                     '<div align=left>' +
  8.                         '<label id="lbCaller">Caller: '+caller+'</label> <BR />'  +
  9.                         '<label id="lbCallee">Callee: '+callee+'</label> <BR />' +
  10.                         '<label id="lbDirection">Direction: '+direction+'</label> <BR />' +
  11.                         '<label id="lbState">State: '+state+'</label> <BR />' +
  12.                     '</div> ' +
  13.               '</div>')
  14.               .dialog({
  15.                     resizable: false, minWidth: 250, minHeight: 100,
  16.                     /*NEW PART*/
  17.                     buttons: {
  18.                         HangUp: function () {
  19.                             alert("HangUp the line");
  20.                             /*How can I really hung up the line*/
  21.                         }
  22.                     },
  23.                     /*NEW PART END*/
  24.                     close: function () {
  25.                         $(this).dialog("destroy").remove();
  26.                 }});
  27.     }
  28.  
I would be glad to receive any help or idea in connection with this
Oct 22 '13 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.