dmcc-1.1.0.2: AVAYA DMCC API bindings and WebSockets server for AVAYA

Safe HaskellNone
LanguageHaskell2010

DMCC.Session

Description

DMCC session handling.

Synopsis

Documentation

data Session Source #

Library API session.

Constructors

Session 

Fields

Instances
Show Session Source # 
Instance details

Defined in DMCC.Session

startSession Source #

Arguments

:: (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 DMCCHandle Source #

Low-level DMCC API plumbing.

Constructors

DMCCHandle 

Fields

sendRequestSync Source #

Arguments

:: (MonadUnliftIO m, MonadLoggerIO m, MonadBaseControl IO m, MonadCatch m) 
=> DMCCHandle 
-> Maybe AgentId

Push erroneous responses to this agent's event processor.

TODO Disallow unknown agents on type level (use AgentHandle).

-> Request 
-> m (Maybe Response) 

Send a request and block until the response arrives or a write exception occurs. No request is sent until a connection and an application session become available. Write exceptions cause a reconnection and a session restart, Nothing is returned in this case.

This must not be used to for session setup as this requires an active DMCC application session!

Write errors are made explicit here because sendRequestSync is called from multiple locations, making it tedious to install the reconnection handler everywhere.

sendRequestAsync Source #

Arguments

:: (MonadUnliftIO m, MonadLoggerIO m, MonadBaseControl IO m, MonadCatch m) 
=> DMCCHandle 
-> Maybe AgentId

Push erroneous responses to this agent's event processor.

-> Request 
-> m () 

Like sendRequestAsync, but do not wait for a result.