!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"You may instance this class if you'3d like to use a different handle type (or just read/1write to the normal Handle in some special way.) Read one line from the handle. 2Read a specified amount of bytes from the handle. Write to the handle Flush the handle. *Check if the handle is ready for reading. ,Just a simple map ByteString to ByteString. &UUIDs are currently just bytestrings. XBasically, an event. Used and returned by some of the lower level Eventsocket routines. Type of the event. The headers FreeSwitch sent. Is this a positive response? JEither a ByteString or a parsed KV map depending on the type of response. ,Error type thrown when something goes boom. 4Stores a session. Two user accessible fields exist:  sessUUID :: . -- The UUID this session is associated with.  sessVariables :: h -- Variables associated with this channel, updated when receiving CHANNEL_DATA events from FreeSwitch. *The state of the event socket connection. %Eventsocket should continue running. Usually a network socket. "Hostname for incoming connection. Port for incoming connection. !Pending events. Used internally. Use "event-lock: true" in outgoing commands. (Run event handlers for incoming events. [Currently used UUID. Set from the initial response to connect, and possibly changed later. PSequence number used for generating events or other session-unique identifiers.  Sessions. 3The global session. (Used for global events, etc.) MRecursion depth, used for detecting nested eventSocketReadEventsUntil calls. 7Event Socket commands. This list is far from complete. More information is available:  1http://wiki.freeswitch.org/wiki/Command_reference  Sync point. !Binds a meta application.  Bhttp://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_bind_meta_app "#$%&Records a sound file.  ;http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_record '(Plays a sound file.  =http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_playback )*-Can speak arbitrary text using a TTS engine.  :http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_speak +-Can speak simple output like digits or time.  8http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_say ,-Bridges a call.  ?http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_bridgecall ./(Plays a sound file and waits for input.  Hhttp://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_play_and_get_digits 0123456789Answers the call. :-Sleeps the specified number of milliseconds.  :http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_sleep ;Duration to sleep. <>Hangs up the call. (Uses the UUID in the event socket state.) =Reason for hangup:  -http://wiki.freeswitch.org/wiki/Hangup_causes >Sets a channel variable. ? Set key. @ Set value. AsTurns on event socket linger, causing the event socket to send all remaining events before closing the connection. B 3http://wiki.freeswitch.org/wiki/Event_Socket#filter C(Delete this filter instead of creating. DHeader to allow. EValue to allow. F 2http://wiki.freeswitch.org/wiki/Event_Socket#event G#Event format, either plain or XML. H Event types. IMainly FreeSwitch events. 1More information for FreeSwitch-specific events:  *http://wiki.freeswitch.org/wiki/Event_list JKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~FreeSwitch command reply. FreeSwitch API reply. 9Sent when the Freeswitch event name could not be parsed. Sent when ending. +Sent when the initial negotiation is done. )Runs the event socket monad transformer. Monadic action to run. Initial state (possibly from ) MReturns a tuple with either the final result or error, and the ending state. Basic listen socket creation. Basic example accept loop. @Starts a listen socket for incoming EventSocket connections. You'll generally want to call ! after the handler is triggered. Hostname to listen on. Port number to listen on. +Action to run on each incoming connection. sCreates a new EventSocketState. You may use your own handle type and functions for reading and writing data to it. Connection handle.  Hostname of incoming connection Port of incoming connection.  New state. SyncMode controls whether Event-Lock: true is sent with commands. yModifies the debug level. At high values, the event socket library will spit out massive amounts of data to the console. ;Given an event ID, it will remove that event if it exists. Event ID to unregister. wRegisters an event handler. If the UUID is left blank, it will trigger globally on all events of the appropriate type. Some event types (example E_CommandReply, E_APIResponse) do not have a UUID and therefore must be added as an global event if you wish to catch it. |Since the event may return a new handler function on each invocation, an event handler may maintain private state this way. {The event handler may return EHContinue to continue processing, EHStopEvents to stop processing events for that message or : EHStopReading to exit the event reading loop entirely. +Event handlers are only called from within  (and functions that use this: , , ). 8Global events are processed first, then session events. You may not recurse into eventSocketReadEventUntil from within an event handler. +UUID for event handler, blank for globalr. Type of event to trigger on. /Priority, with lower events processed earlier. Event handler. Returns new Event ID. BRun a monadic action with the specified UUID as the current UUID. e Once the action completes, the previous UUID is restored iff it is the same as the original UUID.  UUID to use. Monadic action to run. ,Waits forever for the specified event type. Event type to wait for. CReturns a list of messages up to and include the the ending event. /Sends a command and then waits for a response. Command name. $Command arguments. (Blank if none.) %Sends a command to the event socket. Command name. Command arguments. ]Sends a raw command (such as an API command) to the event socket and waits for the response. API action name. API action arguments. )Sends a raw command to the event socket. API action name. API action arguments. ;Sends the initial connect message and receives a response. Plays a 0 length tone stream to force a CHANNEL_EXECUTE_COMPLETE event as a synchronization point. Will wait forever if events aren' t turned on. @Reads messages from the event socket until a condition is true. The handler is called with Nothing to detect whether messages should be read (for example, check if the socket has data waiting.) At that point, the handler returns whether more messages should be read (True for more messages, False to stop reading messages.) 0The handler is called on each received message. pAt that the handler returns whether it is done (True for no more messages, False to continue reading messages.) Condition function. Gets a session if it exists. 0UUID to look for. If blank, uses the main UUID. &Returns the session wrapped in Maybe. "Get the UUID of the main session. Runs a sequence of s. List of commands to perform. !Result is all messages returned. Runs a command of type . Behaves roughly the same as . Command to run. FList of messages up to the terminating command reply or API response. ,There exists a default instance for Handle.   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ I~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJFBA><:9/-+*(&! GHCDE?@=;012345678.,,))'"#$% +FBA><:9/-+*(&! GHCDE?@=;012345678.,,))'"#$% !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIK~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~EventSocket-0.1Network.EventSocket EventSocketIO esioBReadLine esioBRead esioBWrite esioFlush esioReadyEvtKVMapESUUIDEventSocketMessageesmType esmHeaders esmSuccessesmDataEventSocketError GeneralError ProtocolError ParseError NetworkError UnknownErrorEventHandlerFuncEventIdEventHandlerResult EHStopReading EHContinue EHStopEvents SessionStatesessUUID sessVariablesEventSocketStateEventSocketCommandCmdSync CmdMetaApp listenKeylistenTo respondOn appString CmdRecord maxLengthCmdPlayfilenameCmdSpeakCmdSaytext CmdBridge destinations CmdPlayGather minDigits maxDigitstriestimeout terminatorsfile invalidFilevarNameregexp CmdAnswerCmdSleepduration CmdHangupreasonCmdSetkeyval CmdLinger CmdFilterisDelete eventHeader eventValue CmdEventsformatevents EventTypeE_EXE_SCHEDULEE_DEL_SCHEDULEE_ADD_SCHEDULEE_TRAPE_PRIVATE_COMMANDE_DETECTED_SPEECHE_CODECE_ROSTERE_MESSAGE_QUERYE_MESSAGE_WAITINGE_PRESENCE_PROBEE_PRESENCE_OUT E_PRESENCE_IN E_MESSAGEE_DTMFE_SESSION_CRASHE_NOTALKE_TALK E_UNPUBLISH E_PUBLISH E_STARTUPE_OUTBOUND_CHANE_INBOUND_CHANE_LOGE_ALLE_DETECTED_TONE E_HEARTBEAT E_RE_SCHEDULEE_CUSTOME_BACKGROUND_JOBE_API E_CALL_UPDATE E_RECORD_STOPE_RECORD_STARTE_NAT E_CALL_SECURE E_RECV_INFO E_SEND_INFOE_SERVER_DISCONNECTEDE_CLIENT_DISCONNECTEDE_SESSION_HEARTBEAT E_COMMAND E_GENERALE_CHANNEL_DATAE_REQUEST_PARMSE_RECV_MESSAGEE_SEND_MESSAGEE_NOTIFY E_RELOADXMLE_MODULE_UNLOAD E_MODULE_LOAD E_SHUTDOWNE_CHANNEL_UUIDE_CHANNEL_ORIGINATEE_CHANNEL_APPLICATIONE_CHANNEL_UNPARKE_CHANNEL_PARKE_CHANNEL_OUTGOINGE_CHANNEL_PROGRESS_MEDIAE_CHANNEL_PROGRESSE_CHANNEL_UNBRIDGEE_CHANNEL_BRIDGEE_CHANNEL_EXECUTE_COMPLETEE_CHANNEL_EXECUTEE_CHANNEL_HANGUP_COMPLETEE_CHANNEL_HANGUPE_CHANNEL_ANSWERE_CHANNEL_STATEE_CHANNEL_DESTROYE_CHANNEL_CREATEE_CommandReply E_APIResponseE_OtherE_EndE_Start EventSocketTrunEventSocketTstartEventSocketnewEventSocketStatemodifySyncModemodifyDebugLevelunregisterEventHandlerregisterEventHandlerwithUUID waitForEventcommandAndReply sendCommand apiAndReplysendAPIconnectInbound syncPointeventSocketReadEventsUntil getSessiongetUUID esRunActionsesRun EventHandlerehID ehPriority ehHandler sessEvents esRunningesHandle esHostName esPortNumberesEvents esSyncModeesHandleEventsesUUIDesSeq esSessionsesGlobalSessionesDepth esDebugLevelunEventSocketTmakeListenSocket acceptLoop updateSession runEvents updateEvent buildMessagereadRawMessage readEvtKVMap eReadLineeReadeBSToInteWritedbug parseKVMap urlDecode$fEventSocketIOHandle