View Source Fastagi.Session (Fastagi v0.1.0)
Link to this section Summary
Functions
Initiate FastAGI session on new connection. Parse AGI input and setup connection socket.
Answers channel if not already in answer state.
Interrupts Async AGI. Interrupts expected flow of Async AGI commands and returns control. to previous source (typically, the PBX dialplan)
Cause the channel to automatically hangup at time seconds in the future. Of course it can be hungup before then as well. Setting to 0 will cause the autohangup feature to be disabled on this channel
Returns status of the connected channel. If no channel name is given (empty line) then returns the status of the current channel
Close session connection
Sends audio file on channel and allows the listener to control the stream.
Deletes an entry in the Asterisk database for a given family and key
Deletes a family or specific keytree within a family in the Asterisk database
Retrieves an entry in the Asterisk database for a given family and key
Adds or updates an entry in the Asterisk database for a given family, key, and value
Get AGI environment variable by key
Executes application with given options
Stream the given file, and receive DTMF data. Returns the digits received from the channel at the other end
Evaluates the given expression against the channel specified by channelname, or the current channel if channelname is not provided
Stream file, prompt for DTMF, with timeout. Behaves similar to STREAM FILE but used with a timeout option.
Gets a channel variable
Cause the channel to execute the specified dialplan subroutine
Hangup a channel
Initiate from new AGI session
Receives one character from channels supporting it
Receives text from channels supporting it
Record to a file until a given dtmf digit in the sequence is received
Says a given character string
Says a given date. date - Is number of seconds elapsed since 00:00:00 on January 1, 1970. Coordinated Universal Time (UTC).
Says a given time as specified by the format given
Say a given digit string, returning early if any of the given DTMF digits are received on the channel
Say a given number, returning early if any of the given DTMF digits are received on the channel
Say a given character string with phonetics, returning early if any of the given DTMF digits are received on the channel
Say a given time, returning early if any of the given DTMF digits are received on the channel
Sends the given image on a channel. Most channels do not support the transmission of images
Sends the given text on a channel. Most channels do not support the transmission of text
Changes the callerid of the current channel
Sets the context for continuation upon exiting the application
Changes the extension for continuation upon exiting the application
Enables/Disables the music on hold generator. If class is not specified, then the default music on hold class will be used
Changes the priority for continuation upon exiting the application. The priority must be a valid priority or label
Sets a variable to the current channel
Send the given file, allowing playback to be interrupted by the given digits, if any
Enable/Disable TDD transmission/reception on a channel
Sends message to the console via verbose message system. level is the verbose level (1-4)
Waits up to timeout milliseconds for channel to receive a DTMF digit
Link to this section Types
@type response() :: {:ok, Fastagi.Response.t()} | {:error, term()} | :hangup
@type t() :: %Fastagi.Session{conn: term(), envs: Map.t()}
Link to this section Functions
Initiate FastAGI session on new connection. Parse AGI input and setup connection socket.
Run commands in current session.
Answers channel if not already in answer state.
Interrupts Async AGI. Interrupts expected flow of Async AGI commands and returns control. to previous source (typically, the PBX dialplan)
Cause the channel to automatically hangup at time seconds in the future. Of course it can be hungup before then as well. Setting to 0 will cause the autohangup feature to be disabled on this channel
Returns status of the connected channel. If no channel name is given (empty line) then returns the status of the current channel
@spec close(sess :: t()) :: :ok
Close session connection
control_stream_file(sess, filename, escape_digits, skip_ms, ff_chr, rew_chr, pause_chr, offset_ms)
View Source@spec control_stream_file( sess :: t(), filename :: String.t(), escape_digits :: String.t(), skip_ms :: integer(), ff_chr :: String.t(), rew_chr :: String.t(), pause_chr :: String.t(), offset_ms :: integer() ) :: response()
Sends audio file on channel and allows the listener to control the stream.
Deletes an entry in the Asterisk database for a given family and key
Deletes a family or specific keytree within a family in the Asterisk database
Retrieves an entry in the Asterisk database for a given family and key
@spec database_put( sess :: t(), family :: String.t(), key :: String.t(), value :: String.t() ) :: response()
Adds or updates an entry in the Asterisk database for a given family, key, and value
Get AGI environment variable by key
Executes application with given options
@spec get_data( sess :: t(), file :: String.t(), timeout :: integer(), maxdigits :: integer() ) :: response()
Stream the given file, and receive DTMF data. Returns the digits received from the channel at the other end
Evaluates the given expression against the channel specified by channelname, or the current channel if channelname is not provided
@spec get_option( sess :: t(), filename :: String.t(), escape_digits :: String.t(), timeout :: integer() ) :: response()
Stream file, prompt for DTMF, with timeout. Behaves similar to STREAM FILE but used with a timeout option.
Gets a channel variable
@spec gosub( sess :: t(), context :: String.t(), exten :: String.t(), priority :: String.t(), args :: String.t() ) :: response()
Cause the channel to execute the specified dialplan subroutine
Hangup a channel
Initiate from new AGI session
Receives one character from channels supporting it
Receives text from channels supporting it
record_file(sess, fname, fmt, escdig, timeout, offset, beep, silence)
View Source@spec record_file( sess :: t(), filename :: String.t(), format :: String.t(), escape_digits :: String.t(), timeout :: integer(), offset :: integer(), beep :: boolean(), silence :: integer() ) :: response()
Record to a file until a given dtmf digit in the sequence is received
Says a given character string
Says a given date. date - Is number of seconds elapsed since 00:00:00 on January 1, 1970. Coordinated Universal Time (UTC).
@spec say_datetime( sess :: t(), time :: integer(), escape_digits :: String.t(), format :: String.t(), timezone :: String.t() ) :: response()
Says a given time as specified by the format given
Say a given digit string, returning early if any of the given DTMF digits are received on the channel
@spec say_number( sess :: t(), number :: String.t(), escape_digits :: String.t(), gender :: String.t() ) :: response()
Say a given number, returning early if any of the given DTMF digits are received on the channel
Say a given character string with phonetics, returning early if any of the given DTMF digits are received on the channel
Say a given time, returning early if any of the given DTMF digits are received on the channel
Sends the given image on a channel. Most channels do not support the transmission of images
Sends the given text on a channel. Most channels do not support the transmission of text
Changes the callerid of the current channel
Sets the context for continuation upon exiting the application
Changes the extension for continuation upon exiting the application
Enables/Disables the music on hold generator. If class is not specified, then the default music on hold class will be used
Changes the priority for continuation upon exiting the application. The priority must be a valid priority or label
Sets a variable to the current channel
@spec stream_file( sess :: t(), file :: String.t(), escape_digits :: String.t(), offset :: integer() ) :: response()
Send the given file, allowing playback to be interrupted by the given digits, if any
Enable/Disable TDD transmission/reception on a channel
Sends message to the console via verbose message system. level is the verbose level (1-4)
Waits up to timeout milliseconds for channel to receive a DTMF digit