 #
 
 exports.debug = false
+
+#### Client Example
+# The following code does the equivalent of "fs_cli -x".
+#
+#     esl = require 'esl'
+#
+#     # Open connection, send arbitrary API command, disconnect.
+#     fs_command = (cmd,cb) ->
+#       client = esl.createClient()
+#       client.on 'esl_auth_request', (req,res) ->
+#         res.auth 'ClueCon', (req,res) ->
+#           res.api cmd, (req,res) ->
+#             res.exit ->
+#               client.end()
+#       if cb?
+#         client.on 'close', cb
+#       client.connect(8021, '127.0.0.1')
+#
+#     # Example
+#     fs_command "reloadxml"
+#
+#  Note: Use
+#
+#     res.event_json 'HEARTBEAT'
+#
+#  to start receiving event notifications.
+
+#### CallServer Example
+#
+#     server = new esl.CallServer()
+#
+#     server.on 'CONNECT', (req,res) ->
+#       # Start processing the call
+#       # Channel data is available as req.channel_data
+#       # For example:
+#       uri = req.channel_data.variable_sip_req_uri
+#
+#     # Other FreeSwitch channel events are available as well:
+#     server.on 'CHANNEL_ANSWER', (req,res) ->
+#       util.log 'Call was answered'
+#     server.on 'CHANNEL_HANGUP_COMPLETE', (req,res) ->
+#       # Call was disconnected.
+#
+#     server.listen port
+#
 
 #### Headers parser
 # ESL framing contains headers and a body.


exports.CallServer = class CallServer extends require('events').EventEmitter

  constructor: (port) ->

    super()

    Unique_ID = 'Unique-ID'

    server = new eslServer (res) ->
      res.connect (req,res) =>
        # Channel data
        channel_data = req.body


exports.createClient = () -> return new eslClient()

#### CallServer: a higher-level interface
#
# This interface is based on my
