 #
 # If you'd like to get realtime channel variables and synchronous commands, do
 #
-#     server = esl.createCallServer true
+#     server = esl.createCallServer()
 #
 #     server.on 'CONNECT', (req,res) ->
-#       res.execute 'verbose_events', null, (req,res) ->
-#         # You may now access realtime variables as
+#       # "verbose_events" will send us channel data after each "command".
+#       res.command 'verbose_events', null, (req,res) ->
+#         # You may now access realtime variables from req.body
 #         foo = req.body.variable_foo
-#         res.execute 'play-file', 'voicemail/vm-hello', (req,res) ->
-#           # This call with wait for the command to finish
-#           # Your application continues here
+#         res.command 'play-file', 'voicemail/vm-hello', (req,res) ->
+#           # Wait for the command to finish.
+#           # The application continues here
 #
 #     server.listen 7000
 #
-# Note that although the socket command was called (in the dialplan above) with
-# the "async" parameter, createCallServer is processing the commands synchronously.
-# Of course you can work synchronously without using verbose_events; you may still
-# obtain realtime values by using the API (lookup the "eval" command).
-# However you cannot use verbose_events asynchronously, unless you capture the
-# CHANNEL_EXECUTE_COMPLETE event.
+# The asynchronous version of "command" is "execute".
 #
 # An asynchronous server will look this way:
 #
 #     server = esl.createCallServer()
 #
 #     server.on 'CONNECT', (req,res) ->
-#       # Start processing the call
-#       # Channel data is available as req.channel_data
-#       # Channel UUID is available as req.unique_id
-#       # For example:
-#       uri = req.channel_data.variable_sip_req_uri
+#       uri = req.body.variable_sip_req_uri
 #
 #     # Other FreeSwitch channel events are available as well:
 #     server.on 'CHANNEL_ANSWER', (req,res) ->

  #         # Start sending other commands here.
  #     client.connect ...
  #
  auth: (password,cb)       -> @send "auth #{password}", null, cb

  # connect() and linger() are used in server mode.
  connect: (cb)             -> @send "connect", null, cb    # Outbound mode

  linger: (cb)              -> @send "linger", null, cb     # Outbound mode

  # Send the exit command to the FreeSwitch socket.
  exit: (cb)                -> @send "exit", null, cb

  #### Event logging commands
  log: (level,cb) ->
    [level,cb] = [null,level] if typeof(level) is 'function'
    if level?
      @send "log #{level}", null, cb
    else
      @send "log", null, cb

  nolog: (cb)                 -> @send "nolog", null, cb

  #### Message sending
  # Send Message (to a UUID)

      'execute-app-arg':  app_arg
    @sendmsg_uuid uuid, 'execute', options, cb

  # Execute an application synchronously.
  # The callback is only called when the command has completed.
  command_uuid: (uuid,app_name,app_arg,cb) ->
    @socket.on "CHANNEL_EXECUTE_COMPLETE #{app_name} #{app_arg}", cb
    @execute_uuid uuid,app_name,app_arg

  # Hangup a call

  hangup_uuid: (uuid,hangup_cause,cb) ->
