Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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

robert_andersonrobert_anderson Posts: 0Member

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.

function showPopUp(caller, callee, direction, state){
    if ($("#NoficationPopup").length > 0){
        /*update the GUI labels*/
    }
    else 
        $('<div id="NoficationPopup" title=\"' + direction + '\">' +
                '<div align=left>' +
                    '<label id="lbCaller">Caller: '+caller+'</label> <BR />'  +
                    '<label id="lbCallee">Callee: '+callee+'</label> <BR />' +
                    '<label id="lbDirection">Direction: '+direction+'</label> <BR />' +
                    '<label id="lbState">State: '+state+'</label> <BR />' +
                '</div> ' +
          '</div>')
          .dialog({
                resizable: false, minWidth: 250, minHeight: 100,
                /*NEW PART*/
                buttons: {
                        HangUp: function () {
                            alert("HangUp the line");
                        /*How can I really hung up the line*/
                        }
                    },
                /*NEW PART END*/
                close: function () {
                    $(this).dialog("destroy").remove();
            }});
}

I would be glad to receive any help or idea in connection with this

Sign In or Register to comment.