====== Ending call ====== After you have talked to someone the call is ended by either you hanging up or the other end hanging up the call. ===== You hang up ===== ==== call.hangup() ==== You end a call by calling [[ixnx:wrtc:js:api:call:hangup|call.hangup()]]. ==== wrtc.onHungUp() ==== [[ixnx:wrtc:js:api:call:hangup|call.hangup()]] immediately calls event function [[ixnx:wrtc:js:api:wrtc:onhungup|wrtc.onHungUp()]] allowing you to indicate to user call is ended. ===== Other end hangs up ===== If the person you were talking to hangs up the phone event function [[ixnx:wrtc:js:api:wrtc:ongothungup|wrtc.onGotHungUp]] is called: ==== wrtc.onGotHungUp() ==== [[ixnx:wrtc:js:api:wrtc:ongothungup|wrtc.onGotHungUp]] is called when other end "hangs up the phone" and ends the call. You can use this event function to indicate to user call has ended. ===== wrtc.onEndCallObject() ===== After the call has ended the call object is no longer needed and is destroyed. Immediately before the object is destroyed event function [[ixnx:wrtc:js:api:wrtc:onendcallobject|wrtc.onEndCallObject()]] is called allowing you to remove any GUI elements that may be linked to the dying call object. Due to the nature of javascript the actual call object may still hang around and be reachable even after it has been destroyed. Such "zombie" objects can be identified by them having [[ixnx:wrtc:js:api:call:state|call.state == call.stat.disabled]]