Safe Haskell | None |
---|---|
Language | Haskell2010 |
DMCC XML API implementation for third party call control and monitoring.
Synopsis
- data Session
- startSession :: (MonadUnliftIO m, MonadLoggerIO m, MonadBaseControl IO m, MonadCatch m) => (String, PortNumber) -> Maybe FilePath -> Text -> Text -> Maybe String -> SessionOptions -> m Session
- stopSession :: (MonadUnliftIO m, MonadLoggerIO m, MonadBaseControl IO m, MonadCatch m) => Session -> m ()
- defaultSessionOptions :: SessionOptions
- data AgentHandle
- controlAgent :: (MonadUnliftIO m, MonadLoggerIO m, MonadBaseControl IO m, MonadMask m) => SwitchName -> Extension -> Session -> m (Either AgentError AgentHandle)
- releaseAgent :: (MonadUnliftIO m, MonadLoggerIO m, MonadBaseControl IO m, MonadCatch m) => AgentHandle -> m ()
- data Action
- = MakeCall { }
- | AnswerCall { }
- | EndCall { }
- | HoldCall { }
- | RetrieveCall { }
- | BargeIn { }
- | ConferenceCall {
- activeCall :: CallId
- heldCall :: CallId
- | TransferCall {
- activeCall :: CallId
- heldCall :: CallId
- | SendDigits { }
- | SetState { }
- agentAction :: (MonadLoggerIO m, MonadCatch m) => Action -> AgentHandle -> m ()
- data AgentEvent
- = TelephonyEvent { }
- | StateChange { }
- | TelephonyEventError { }
- | RequestError { }
- data AgentSnapshot = AgentSnapshot {}
- handleEvents :: (MonadLoggerIO m, MonadThrow m) => AgentHandle -> (AgentEvent -> m ()) -> m ThreadId
- getAgentSnapshot :: (MonadLoggerIO m, MonadThrow m) => AgentHandle -> m AgentSnapshot
- module DMCC.Types
Documentation
Library API session.
:: (MonadUnliftIO m, MonadLoggerIO m, MonadBaseControl IO m, MonadCatch m) | |
=> (String, PortNumber) | Host and port of AES server. |
-> Maybe FilePath | AES CA certificates directory for TLS. |
-> Text | DMCC API user. |
-> Text | DMCC API password. |
-> Maybe String | Web hook URL. |
-> SessionOptions | |
-> m Session |
stopSession :: (MonadUnliftIO m, MonadLoggerIO m, MonadBaseControl IO m, MonadCatch m) => Session -> m () Source #
TODO Agent releasing notice
data AgentHandle Source #
Instances
Eq AgentHandle Source # | |
Defined in DMCC.Agent (==) :: AgentHandle -> AgentHandle -> Bool # (/=) :: AgentHandle -> AgentHandle -> Bool # | |
Ord AgentHandle Source # | |
Defined in DMCC.Agent compare :: AgentHandle -> AgentHandle -> Ordering # (<) :: AgentHandle -> AgentHandle -> Bool # (<=) :: AgentHandle -> AgentHandle -> Bool # (>) :: AgentHandle -> AgentHandle -> Bool # (>=) :: AgentHandle -> AgentHandle -> Bool # max :: AgentHandle -> AgentHandle -> AgentHandle # min :: AgentHandle -> AgentHandle -> AgentHandle # | |
Show AgentHandle Source # | |
Defined in DMCC.Agent showsPrec :: Int -> AgentHandle -> ShowS # show :: AgentHandle -> String # showList :: [AgentHandle] -> ShowS # |
controlAgent :: (MonadUnliftIO m, MonadLoggerIO m, MonadBaseControl IO m, MonadMask m) => SwitchName -> Extension -> Session -> m (Either AgentError AgentHandle) Source #
Enable an active agent to be monitored and controlled through DMCC API. If the agent has already been registered, return the old entry (it's safe to call this function with the same arguments multiple times).
releaseAgent :: (MonadUnliftIO m, MonadLoggerIO m, MonadBaseControl IO m, MonadCatch m) => AgentHandle -> m () Source #
Forget about an agent, releasing his device and monitors.
Actions performable by a controlled agent.
agentAction :: (MonadLoggerIO m, MonadCatch m) => Action -> AgentHandle -> m () Source #
Command an agent to do something.
Due to lack of global locking of the agents map an agent may be gone (released) by the time an action arrives to its actionChan. This is by design to avoid congestion during action processing.
data AgentEvent Source #
Events/errors are published to external clients of the agents and may be used by agent subscribers to provide information to user.
TelephonyEvent | A telephony-related event, along with an updated snapshot. |
StateChange | Arrives when an agent state change has been observed. |
TelephonyEventError | An error caused by a telephony-related event. |
RequestError | An error caused by a request from this agent. |
Instances
Show AgentEvent Source # | |
Defined in DMCC.Agent showsPrec :: Int -> AgentEvent -> ShowS # show :: AgentEvent -> String # showList :: [AgentEvent] -> ShowS # | |
ToJSON AgentEvent Source # | |
Defined in DMCC.Agent toJSON :: AgentEvent -> Value # toEncoding :: AgentEvent -> Encoding # toJSONList :: [AgentEvent] -> Value # toEncodingList :: [AgentEvent] -> Encoding # | |
FromJSON AgentEvent Source # | |
Defined in DMCC.Agent parseJSON :: Value -> Parser AgentEvent # parseJSONList :: Value -> Parser [AgentEvent] # |
data AgentSnapshot Source #
Instances
Show AgentSnapshot Source # | |
Defined in DMCC.Agent showsPrec :: Int -> AgentSnapshot -> ShowS # show :: AgentSnapshot -> String # showList :: [AgentSnapshot] -> ShowS # | |
ToJSON AgentSnapshot Source # | |
Defined in DMCC.Agent toJSON :: AgentSnapshot -> Value # toEncoding :: AgentSnapshot -> Encoding # toJSONList :: [AgentSnapshot] -> Value # toEncodingList :: [AgentSnapshot] -> Encoding # | |
FromJSON AgentSnapshot Source # | |
Defined in DMCC.Agent parseJSON :: Value -> Parser AgentSnapshot # parseJSONList :: Value -> Parser [AgentSnapshot] # |
handleEvents :: (MonadLoggerIO m, MonadThrow m) => AgentHandle -> (AgentEvent -> m ()) -> m ThreadId Source #
Attach an event handler to an agent. Exceptions are not handled.
getAgentSnapshot :: (MonadLoggerIO m, MonadThrow m) => AgentHandle -> m AgentSnapshot Source #
module DMCC.Types