darkjonter / sipml5

Automatically exported from code.google.com/p/sipml5
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Hangup does not work if I dial #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Cannot cancel dialing out from browser. Only calls that get in. And the server 
keeps ringing.

What steps will reproduce the problem?
1. Connect to server
2. Dial out from browser any number/extension
3. Try to HangUp before the other party answers, it keeps ringing.

What is the expected output? What do you see instead?

It should hangup the call. The browser shows Call terminating, but the server 
keeps ringing. It sends CANCEL instead of DECLINE or BYE
because "this.o_session.b_server" is False and "this.e_state" is "Early" on if 
conditions in t_sip_dialog.js line 731 where is decided what action to take.

What version of the product are you using? On what operating system?
10. Windows 8. (tested on Chrome ws and also on Firefox udp)

Original issue reported on code.google.com by cristian...@gmail.com on 22 Sep 2012 at 1:51

GoogleCodeExporter commented 9 years ago
Forgot to mention that when dialing in the "hang up" works fine.

Original comment by cristian...@gmail.com on 22 Sep 2012 at 1:53

GoogleCodeExporter commented 9 years ago
This is conform to RFC 3261
BYE is sent if the call is connected (200 OK)
DECLINE is sent in response to INVITE
CANCEL is send to abort pending outgoing INVITE

Original comment by boss...@yahoo.fr on 22 Sep 2012 at 4:14

GoogleCodeExporter commented 9 years ago
Hi,

Don't get me wrong. I am not a specialist, it is just my outgoing calls to
sip trunks were not hanging up. I think the CANCEL is sent accoringly to
RFC, but the state of the call is tsip_dialog_state_e.EARLY and it should
send HANGUP, not CANCEL.
So it hangs up also the trunk peer, not only the connection between client
and asterisk.

I commented /*&& this.o_session.b_server*/  and the dialouts are going and
hanging up fine. (I am sure that the comment is wrong but i do not know how
to do it better) at the moment it just works.

Thank you,
Cristi.

tsip_dialog.prototype.hangup = function (o_action) {

    if (this.e_state == tsip_dialog_state_e.ESTABLISHED || (this.o_session
/*&& this.o_session.b_server*/ && this.e_state ==
tsip_dialog_state_e.EARLY) || this.e_type != tsip_dialog_type_e.INVITE) {
        return this.fsm_act(tsip_action_type_e.HANGUP, null, o_action); //
603 Decline or BYE
    }
    else {
        return this.fsm_act(tsip_action_type_e.CANCEL, null, o_action); //
CANCEL -> only for INVITE dialog
    }
}

Original comment by cristian...@gmail.com on 27 Sep 2012 at 1:17