     callerId
 
 
-app.takeIncoming = (call, name) ->
+app.takeIncomingCall = (call, name) ->
   app.dialog(
     "You have an incoming call from<br /><strong>#{name}</strong>",
     'question', 'Take call', 'I\'m busy'

    data = JSON.parse(event.data)
    console.log('SSE message:', data) if env.debug

    if data.user
      app.updateUserFrom(data)
    else if data.call
      app.updateCallFrom(data)
    else if data.chat_message
      app.createMessageFrom(data)
    else if data.servertime
      app.resetServerTimer()

    if env.railsEnv == 'test' && !data.servertime
      env.messages.push(data)

    if call.incoming
      env.callDialogActive = true
      name = app.getAgentFrom(call.visibleNameCaller)
      app.takeIncomingCall(call, name)

  phone.notifyRemoveCall = (call) ->
    console.log('SIP remove call:', call) if env.debug
