       track.enabled = enabled
 
   hangUp: ->
-    @_stop()
+    @onHangedUp()
+    @_sendMessage(JSON.stringify(type: 'hangUp'))
+    @_hangedUp = true
 
   # private
 
+  _hangedUp: true
   _localStream: null
   _peerConnection: null
   _peerStarted: false

class @WebRTC
  constructor: (userID, @localOutput, @remoteOutput) ->
    @_startOutput(@localOutput.tagName.toUpperCase() == 'VIDEO')
    @wsRails = new WebSocketRails(location.host + "/websocket?webrtc=true&user_identifier=" + userID)

          candidate: event.candidate.candidate
        )

    peer.oniceconnectionstatechange = (event) =>
      switch peer.iceConnectionState
        when 'disconnected'
          @onReconnectingStarted()
        when 'connected', 'completed'
          if @_hangedUp
            @onConnected()
          @_hangedUp = false

    peer.addStream(@_localStream)
    peer.addEventListener('addstream', onRemoteStreamAdded, false)
    peer.addEventListener('removestream', onRemoteStreamRemoved, false)
