Network.AGI
- data Digit
- data AGI a
- run :: AGI a -> Handler -> IO a
- ppDigit :: Digit -> Char
- ppEscapeDigits :: [Digit] -> String
- data SoundType
- sendRecv :: Command -> AGI String
- answer :: AGI Bool
- hangUp :: Maybe String -> AGI Bool
- getData :: FilePath -> Maybe Integer -> Maybe Integer -> AGI (Maybe ([Digit], Bool))
- data RecordResult
- = FailureToWrite
- | FailureOnWaitFor
- | HangUp
- | Interrupted Digit
- | Timeout
- | RandomError String
- sayDigits :: [Digit] -> [Digit] -> AGI (Maybe (Maybe Digit))
- sayNumber :: Integer -> [Digit] -> AGI (Maybe (Maybe Digit))
- streamFile :: FilePath -> [Digit] -> Maybe Integer -> AGI (Either Integer (Maybe Digit, Integer))
- waitForDigit :: Integer -> AGI (Maybe (Maybe Digit))
- record :: FilePath -> SoundType -> [Digit] -> Maybe Integer -> Maybe Integer -> Bool -> Maybe Integer -> AGI (RecordResult, Integer)
Documentation
ppEscapeDigits :: [Digit] -> StringSource
answer channel if not already in answer state
data RecordResult Source
Constructors
| FailureToWrite | |
| FailureOnWaitFor | |
| HangUp | |
| Interrupted Digit | |
| Timeout | |
| RandomError String |
Instances
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
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.
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 |