AGI-1.1.1: A library for writing AGI scripts for Asterisk

Network.AGI

Synopsis

Documentation

run :: AGI a -> Handler -> IO aSource

data SoundType Source

Constructors

WAV 
GSM 

sendRecv :: Command -> AGI StringSource

answerSource

Arguments

:: AGI Bool

True on success, False on failure

answer channel if not already in answer state

getDataSource

Arguments

:: FilePath

file to stream

-> Maybe Integer

timout in ms after keypress (default: 2000 ms)

-> Maybe Integer

max

-> AGI (Maybe ([Digit], Bool))

Nothing on failure, Just (digits, timeout) on success

sayNumberSource

Arguments

:: Integer

number to say

-> [Digit]

return early if any of these digits are received

-> AGI (Maybe (Maybe Digit))

Nothing on failure, Just Nothing on success, Just (Just digit) if key is pressed

sayNumber says the specified number

streamFileSource

Arguments

:: FilePath

file to stream

-> [Digit]

escape digits

-> Maybe Integer

sample offset

-> AGI (Either Integer (Maybe Digit, Integer))

On failure: Left endpos. On success: Right (Maybe Digit, endpos)

waitForDigitSource

Arguments

:: Integer

timeout in milliseconds, -1 to block indefinitely

-> AGI (Maybe (Maybe Digit))

|Nothing| on error, |Just Nothing| on timeout, |Just (Just digit)| on success

wait for channel to receive a DTMF digit.

recordSource

Arguments

:: FilePath

record to this file

-> SoundType

|GSM | WAV|

-> [Digit]

stop recording if one of these digits is entered

-> Maybe Integer

maximum record time in milliseconds, -1 for no timeout

-> Maybe Integer

offset samples

-> Bool

beep to indicate recording has begun

-> Maybe Integer

stop recording if this many seconds of silence passes

-> AGI (RecordResult, Integer)

exit condition, endpos=offset