Table of Contents
onGotHungUp()
wrtc.onGotHungUp() is an event function called when when person you were in call with ends call, "hungs up the phone". It also occurs if other end denies your call.
(If call was ended by local user wrtc.onHungUp() occurs instead.)
You can use this event to indicate call has ended.
Arguments
wrtc.onGotHungUp(obj, arg)
- obj - call object raising the event
- arg - JSON structure containing {type:"esc", response:…, msg:…, partner:…}
- response - response code:
- 404: address you attempted to call not found
- 480: address you attempted to call temporarily unavailable
- 486: call was denied, busy
- 487: call was terminated (other side called us then hung up before we answer)
- 0 or missing: call ended normal ("hung up" by other side)
- other response codes may also occur
- msg - response description in english
- partner - address of user you attempted to call or were in call with eg “john.doe@company.com”
Return value
Ignored.
Example
wrtc.onGotHungUp = function(obj, arg) {
if (arg.response) {
if (arg.response == 486)
window.alert(arg.partner + " is busy");
else if ((arg.response == 404) || (arg.response == 480))
window.alert(arg.partner + " not found");
else
window.alert(arg.partner + ": " + arg.response + ": " + arg.msg);
}
else {
-- call has ended --
}
}