Safe Haskell | None |
---|---|
Language | Haskell2010 |
DMCC XML API implementation for third party call control and monitoring.
- data Session
- data ConnectionType
- startSession :: (MonadUnliftIO m, MonadLoggerIO m, MonadBaseControl IO m, MonadCatch m) => (String, PortNumber) -> ConnectionType -> 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
:: (MonadUnliftIO m, MonadLoggerIO m, MonadBaseControl IO m, MonadCatch m) | |
=> (String, PortNumber) | Host and port of AES server. |
-> ConnectionType | Use 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 #
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. |
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