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

Closing browser window doesn't "hang up" the current call #42

Open
arielscarpinelli opened this issue Aug 26, 2013 · 0 comments
Open

Closing browser window doesn't "hang up" the current call #42

arielscarpinelli opened this issue Aug 26, 2013 · 0 comments

Comments

@arielscarpinelli
Copy link

To reproduce:

Use the following code, set sip address to a sip address where you can actually receive a call:

    var call = null;
    var sipAddress = "sip:3366@login.zipdx.com";
    var phono = $.phono({
        apiKey : "C17D167F-09C6-4E4C-A3DD-2025D48BA243",
        onReady : function() {
            call = phono.phone.dial(sipAddress);
        },
    });

During the call, close the browser window.
Bug: Notice that where you received the call, it is still active. It should had been hang up.

Workaround:

Based on this: http://chad.ill.ac/post/43030182362/strophe-js-disconnect-on-page-unload

    $(window).on('unload', function() {
        phono.connection.sync = true;
        if(call) call.hangup();
        phono.connection.flush();
        phono.connection.disconnect();        
    });
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

1 participant