úΖE     -The AMI monad 4Info needed to connect and authenticate in Asterisk  Host with Asterisk server (e.g.  localhost) 'Port of Asterisk server (usually 5038)  Username Secret AMI monad internal state )Handle for socket of Asterisk connection ActionID of last action Responses for sent actions Event handlers &Event packet (received from Asterisk)  )Response packet (received from Asterisk) !Action packet (sent to Asterisk) 'Action or response or event parameters !Sort-of Control.Monad.State.gets  Sort-of Control.Monad.State.put #Sort-of Control.Monad.State.modify !Return next ActionID "Get connection handle Add an event handler /Send an Action packet and return the response. 9CAUTION: the response value should be evaluated in order 6 to be removed from internal responses queue. Leaving 6 response value un-evaluated (e.g. unused) will cause  memory leak. #/Open a connection to Asterisk and authenticate $COpen a connection to Asterisk and authenticate using MD5 challenge %Close Asterisk connection $Connect, execute acions, disconnect :Connect (using MD5 challenge), execute acions, disconnect &Send one AMI packet 'Run AMI actions ()*+,     -        !"#$%&'()*AMI-0.1 Network.AMIAMI ConnectInfociHostciPort ciUsernameciSecretEventResponseAction EventHandler ResponseTypeActionID EventType ActionType Parameters handleEventquerywithAMI withAMI_MD5AMIState amiHandle amiActionID amiResponsesamiEventHandlerspackIDgetAMIputAMI modifyAMIinc getHandleopenopenMD5close sendPacketrunAMIreadUntilEmptyLineforkAnswersReaderparseformat formatParams