After you have talked to someone the call is ended by either you hanging up or the other end hanging up the call.
You end a call by calling call.hangup().
call.hangup() immediately calls event function wrtc.onHungUp() allowing you to indicate to user call is ended.
If the person you were talking to hangs up the phone event function wrtc.onGotHungUp is called:
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.
After the call has ended the call object is no longer needed and is destroyed. Immediately before the object is destroyed event function 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 call.state == call.stat.disabled