elixir_agi v0.0.14 ElixirAgi.Agi

This module handles the AGI implementation by reading and writing to/from the source.

Copyright 2015 Marcelo Gornstein marcelog@gmail.com

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Summary

Functions

Returns an AGI struct that uses STDIN and STDOUT

Runs an agi command on a channel

Parameters

  • agi: the agi channel to send command to
  • cmd: Asterisk command name
  • args: List of asterisk command parameters in order of asterisk command docs

Types

close :: function
init :: function
reader :: function
t :: ElixirAgi.Agi
writer :: function

Functions

amd(agi, initial_silence, greeting, after_greeting_silence, total_time, min_word_length, between_words_silence, max_words, silence_threshold, max_word_length)

Specs

amd(t, non_neg_integer, non_neg_integer, non_neg_integer, non_neg_integer, non_neg_integer, non_neg_integer, non_neg_integer, non_neg_integer, non_neg_integer) :: ElixirAgi.Agi.Result.t

See: https://wiki.asterisk.org/wiki/display/AST/Application_AMD

control_stream_file(agi, file, escape_digits \\ "", offset \\ 0, forward_digits \\ "", rewind_digits \\ "", pause_digits \\ "")

See: https://wiki.asterisk.org/wiki/display/AST/AGICommand_control+stream+file

dial(agi, dial_string, timeout_seconds, options)

Specs

dial(t, String.t, non_neg_integer, [String.t]) :: ElixirAgi.Agi.Result.t

See: https://wiki.asterisk.org/wiki/display/AST/Application_Dial

get_data(agi, file, timeout \\ 0, max_digits \\ 0)

See: https://wiki.asterisk.org/wiki/display/AST/AGICommand_get+data

get_option(agi, file, escape_digits \\ "", timeout \\ 0)

See: https://wiki.asterisk.org/wiki/display/AST/AGICommand_get+option

new(debug \\ false)

Specs

new(boolean) :: t

Returns an AGI struct that uses STDIN and STDOUT.

new(init, close, reader, writer, debug)

Specs

new(init, close, reader, writer, boolean) :: t

Returns an AGI struct.

read_variables(agi, vars \\ %{})

Specs

read_variables(t, Map.t) :: Map.t
record_file(agi, file, format \\ "wav", escape_digits \\ "", timeout \\ 0, offset \\ 0, bool, silence \\ 0)

See: https://wiki.asterisk.org/wiki/display/AST/AGICommand_record+file

run(agi, cmd, args)

Runs an agi command on a channel

Parameters

  • agi: the agi channel to send command to
  • cmd: Asterisk command name
  • args: List of asterisk command parameters in order of asterisk command docs
say_alpha(agi, number, escape_digits \\ "")

Specs

See: https://wiki.asterisk.org/wiki/display/AST/AGICommand_say+alpha

say_date(agi, elapsed_seconds, escape_digits \\ "")

See: https://wiki.asterisk.org/wiki/display/AST/AGICommand_say+date

say_datetime(agi, elapsed_seconds, escape_digits \\ "", format \\ "", timezone \\ "")

See: https://wiki.asterisk.org/wiki/display/AST/AGICommand_say+datetime TODO: This function needs testing!

say_digits(agi, number, escape_digits \\ "")

Specs

See: https://wiki.asterisk.org/wiki/display/AST/AGICommand_say+digits

say_number(agi, number, escape_digits \\ "", gender \\ "c")

See: https://wiki.asterisk.org/wiki/display/AST/AGICommand_say+number

say_phonetic(agi, string, escape_digits \\ "")

Specs

See: https://wiki.asterisk.org/wiki/display/AST/AGICommand_say+phonetic

say_time(agi, time, escape_digits \\ "")

See: https://wiki.asterisk.org/wiki/display/AST/AGICommand_say+time

wait(agi, seconds)

Specs

wait(t, non_neg_integer) :: ElixirAgi.Agi.Result.t

See: https://wiki.asterisk.org/wiki/display/AST/Application_Wait

wait_for_digit(agi, timeout \\ 0)

Specs

wait_for_digit(t, Integer.t) :: ElixirAgi.Agi.Result.t

See: https://wiki.asterisk.org/wiki/display/AST/AGICommand_wait+for+digit

Macros

log(level, message)