Skip to content

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

@arielscarpinelli

Description

@arielscarpinelli

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();        
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions