Functions | |
| agi & | astxx::agi::answer () |
| Answer the channel. | |
| int | astxx::agi::channel_status (const std::string &channel="") const |
| Get the status of a channel. | |
| char | astxx::agi::control_stream_file (const std::string &filename, const std::string &escape_digits="", int skip_time=control_stream_file_skip_time, char fastforward=0, char rewind=0, char pause=0) const |
| Play a file on the channel with the option to control playback. | |
| agi & | astxx::agi::database_del (const std::string &family, const std::string &key) |
| Delete a database key. | |
| agi & | astxx::agi::database_deltree (const std::string &family, const std::string &keytree="") |
| Delete a database family or keytree. | |
| std::string | astxx::agi::database_get (const std::string &family, const std::string &key) const |
| Get a value out of the Asterisk database. | |
| agi & | astxx::agi::database_put (const std::string &family, const std::string &key, const std::string &value) |
| Put a value in the database. | |
| int | astxx::agi::exec (const std::string &app, const std::string &options="") const |
| Execute a given application. | |
| std::string | astxx::agi::get_data (const std::string &file, int timeout=0, int max_digits=get_data_max_digits) const |
| Stream a file and receive DTMF data. | |
| std::string | astxx::agi::get_full_variable (const std::string &variable, const std::string &channel="") const |
| More robust version of astxx::agi::get_variable. | |
| char | astxx::agi::get_option (const std::string &file, const std::string &escape_digits="", int timeout=0) const |
| Stream a file and read a digit. | |
| std::string | astxx::agi::get_variable (const std::string &variable) const |
| Get the value of a channel variable. | |
| agi & | astxx::agi::hangup (const std::string &channel="") |
| Hangup a channel. | |
| agi & | astxx::agi::noop () |
| Does nothing. | |
| char | astxx::agi::receive_char (int timeout=0) const |
| Receive a character from channels that support it. | |
| std::string | astxx::agi::receive_text (int timeout=0) const |
| Receive text from channels that support it. | |
| char | astxx::agi::record_file (const std::string &filename, const std::string &format, const std::string &escape_digits="", int timeout=-1, int silence=0, bool beep=true, long offset=0) const |
| Record audio and store it in the given location. | |
| char | astxx::agi::say_alpha (int number, const std::string &escape_digits="") const |
| Say a given character string. | |
| char | astxx::agi::say_alpha (const std::string &alphanum, const std::string &escape_digits="") const |
| Say a given character string. | |
| char | astxx::agi::say_date (time_t date, const std::string &escape_digits="") const |
| Say a given date. | |
| char | astxx::agi::say_datetime (time_t date, const std::string &escape_digits="", const std::string &format="", const std::string &timezone="") const |
| Say a given date in the format specfied. | |
| char | astxx::agi::say_digits (int digits, const std::string &escape_digits="") const |
| Say a given digit string as indiviual digits. | |
| char | astxx::agi::say_number (int number, const std::string &escape_digits="") const |
| Say a given number. | |
| char | astxx::agi::say_phonetic (const std::string &characters, const std::string &escape_digits="") const |
| Say a given character string with phonetics (alpha, bravo, charile. | |
| char | astxx::agi::say_time (time_t time, const std::string &escape_digits="") const |
| Says a given time. | |
| agi & | astxx::agi::send_image (const std::string &image) |
| Send an image to channels that support it. | |
| agi & | astxx::agi::send_text (const std::string &text) |
| Send text to channels that support it. | |
| agi & | astxx::agi::set_autohangup (int delay) |
| Hangup a channel after the specified time has passed. | |
| agi & | astxx::agi::set_callerid (const std::string &cid) |
| Set the callerid for the current channel. | |
| agi & | astxx::agi::set_callerid (int number) |
| Set the callerid for the current channel. | |
| agi & | astxx::agi::set_context (const std::string &context) |
| Set the channel context. | |
| agi & | astxx::agi::set_extension (const std::string &extension) |
| Set the channel extension. | |
| agi & | astxx::agi::set_extension (int extension) |
| Set the channel extension. | |
| agi & | astxx::agi::set_music (bool enable, const std::string &music_class="") |
| Enable/Disable music on hold generator. | |
| agi & | astxx::agi::set_priority (const std::string &priority) |
| Set the priority of the channel. | |
| agi & | astxx::agi::set_priority (int priority) |
| Set the priority of the channel. | |
| agi & | astxx::agi::set_variable (const std::string &variable, const std::string &value) |
| Set a given variable. | |
| char | astxx::agi::stream_file (const std::string &filename, const std::string &escape_digits="", long offset=0) const |
| Plays a given file on the audio channel. | |
| agi & | astxx::agi::tdd_mode (const std::string &mode) |
| Change the TDD mode of the channel. | |
| agi & | astxx::agi::tdd_mode (bool enable) |
| Toggles TDD mode on or off (for the deaf). | |
| agi & | astxx::agi::verbose (const std::string &text, int level=1) |
| Log a message to the Asterisk verbose log. | |
| char | astxx::agi::wait_for_digit (long timeout=-1) const |
| Wait for a digit to be pressed. | |
| agi & agi::answer | ( | ) | [inherited] |
Answer the channel.
Answers the channel if not already in answer state. Throws an exception on error.
Definition at line 312 of file agi.cc.
References astxx::agi::execute().
| int agi::channel_status | ( | const std::string & | channel = "" |
) | const [inherited] |
Get the status of a channel.
Returns the status of the specified channel. If no channel is given then the status of the current channel is used.
Return values:
| channel | the channel to get the status of |
Definition at line 338 of file agi.cc.
References astxx::agi::execute(), astxx::agi::quote(), and astxx::agi::result::result.
| char agi::control_stream_file | ( | const std::string & | filename, | |
| const std::string & | escape_digits = "", |
|||
| int | skip_time = control_stream_file_skip_time, |
|||
| char | fastforward = 0, |
|||
| char | rewind = 0, |
|||
| char | pause = 0 | |||
| ) | const [inherited] |
Play a file on the channel with the option to control playback.
| filename | the file to stream (no extension should be specfied) | |
| escape_digits | digits to break on | |
| skip_time | the number of milliseconds to skip in a fastforward or rewind operation | |
| fastforward | the character to use for fastforwarding the stream | |
| rewind | the character to use for rewinding the stream | |
| pause | the character to use to pause the stream |
Definition at line 354 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| agi & agi::database_del | ( | const std::string & | family, | |
| const std::string & | key | |||
| ) | [inherited] |
Delete a database key.
| family | the family to delete from | |
| key | the key to delete |
| agi::database_error | thown when there is a error deleting a key/value |
Definition at line 385 of file agi.cc.
References astxx::agi::execute(), astxx::agi::quote(), and astxx::agi::result::result.
| agi & agi::database_deltree | ( | const std::string & | family, | |
| const std::string & | keytree = "" | |||
| ) | [inherited] |
Delete a database family or keytree.
| family | the family to delete or delete from | |
| keytree | the key tree to delete |
| agi::Database | thown when there is a error deleting a family/value |
Definition at line 403 of file agi.cc.
References astxx::agi::execute(), astxx::agi::quote(), and astxx::agi::result::result.
| string agi::database_get | ( | const std::string & | family, | |
| const std::string & | key | |||
| ) | const [inherited] |
Get a value out of the Asterisk database.
This function may throw an exception in the future. Currently it returns an empty string if the value does not exist in the database.
| family | the family the key is in | |
| key | the key to look up |
Definition at line 420 of file agi.cc.
References astxx::agi::result::data, astxx::agi::execute(), and astxx::agi::quote().
| agi & agi::database_put | ( | const std::string & | family, | |
| const std::string & | key, | |||
| const std::string & | value | |||
| ) | [inherited] |
Put a value in the database.
| family | the database family to use | |
| key | the database key to use | |
| value | the value to put in the database |
| agi::database_error | thrown if there are any problems inserting the value into the database |
Definition at line 435 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| int agi::exec | ( | const std::string & | app, | |
| const std::string & | options = "" | |||
| ) | const [inherited] |
Execute a given application.
| app | the application to execute | |
| options | options for the application (these should be seperated with pipes (|)) |
Definition at line 453 of file agi.cc.
References astxx::agi::execute(), astxx::agi::quote(), and astxx::agi::result::result.
| string agi::get_data | ( | const std::string & | file, | |
| int | timeout = 0, |
|||
| int | max_digits = get_data_max_digits | |||
| ) | const [inherited] |
Stream a file and receive DTMF data.
| file | the file to be streamed | |
| timeout | a timeout to wait for digits in seconds | |
| max_digits | the maximum number of digits to receive |
Definition at line 465 of file agi.cc.
References astxx::agi::execute().
| string agi::get_full_variable | ( | const std::string & | variable, | |
| const std::string & | channel = "" | |||
| ) | const [inherited] |
More robust version of astxx::agi::get_variable.
This function returns the specfied variable name. It differs from astxx::agi::get_variable in that it handles complex variable names and builtin variables.
Variable names should take the same format they do in the dialplan (ie. ${VARIABLE_NAME}). This is different from agi::get_variable in that get_variable accepts a plain variable name and will not parse complex names.
| variable | the variable to retrieve | |
| channel | the channel to look in |
Definition at line 495 of file agi.cc.
References astxx::agi::result::data, astxx::agi::execute(), astxx::agi::quote(), and astxx::agi::result::result.
| char agi::get_option | ( | const std::string & | file, | |
| const std::string & | escape_digits = "", |
|||
| int | timeout = 0 | |||
| ) | const [inherited] |
Stream a file and read a digit.
Definition at line 523 of file agi.cc.
References astxx::agi::execute(), astxx::agi::quote(), and astxx::agi::result::result.
| string agi::get_variable | ( | const std::string & | variable | ) | const [inherited] |
Get the value of a channel variable.
| variable | the variable to retrieve |
Definition at line 543 of file agi.cc.
References astxx::agi::result::data, astxx::agi::execute(), astxx::agi::quote(), and astxx::agi::result::result.
| agi & agi::hangup | ( | const std::string & | channel = "" |
) | [inherited] |
Hangup a channel.
| channel | hangup the channel to hang up, if omitted, use the current channel. |
Definition at line 564 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| agi & agi::noop | ( | ) | [inherited] |
Does nothing.
Definition at line 572 of file agi.cc.
References astxx::agi::execute().
| char agi::receive_char | ( | int | timeout = 0 |
) | const [inherited] |
Receive a character from channels that support it.
Definition at line 583 of file agi.cc.
References astxx::agi::execute().
| std::string agi::receive_text | ( | int | timeout = 0 |
) | const [inherited] |
Receive text from channels that support it.
| agi::application_error | when a timeout occurs |
Definition at line 596 of file agi.cc.
References astxx::agi::execute().
| char agi::record_file | ( | const std::string & | filename, | |
| const std::string & | format, | |||
| const std::string & | escape_digits = "", |
|||
| int | timeout = -1, |
|||
| int | silence = 0, |
|||
| bool | beep = true, |
|||
| long | offset = 0 | |||
| ) | const [inherited] |
Record audio and store it in the given location.
Record an audio stream to a file until a given dtmf digit is pressed or a timeout is reached.
| filename | the name of the file to record to | |
| format | the format of the file | |
| escape_digits | a string of digits to return on | |
| timeout | a timeout in milliseconds (use -1 for no timeout) | |
| silence | the maximum amount of silence to accept at the end of the (use 0 for no silence timeout) recording in seconds | |
| beep | whether to beep or not before begining the recording | |
| offset | the offset to begin writing at |
Definition at line 619 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| char agi::say_alpha | ( | int | number, | |
| const std::string & | escape_digits = "" | |||
| ) | const [inherited] |
Say a given character string.
| number | the number to say | |
| escape_digits | digits to break on |
Definition at line 653 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| char agi::say_alpha | ( | const std::string & | alphanum, | |
| const std::string & | escape_digits = "" | |||
| ) | const [inherited] |
Say a given character string.
| alphanum | the string to say | |
| escape_digits | digits to break on |
Definition at line 642 of file agi.cc.
References astxx::agi::execute(), astxx::agi::quote(), and astxx::agi::result::result.
| char agi::say_date | ( | time_t | date, | |
| const std::string & | escape_digits = "" | |||
| ) | const [inherited] |
Say a given date.
| date | the date in seconds since the epoch | |
| escape_digits | digits to break on |
Definition at line 666 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| char agi::say_datetime | ( | time_t | date, | |
| const std::string & | escape_digits = "", |
|||
| const std::string & | format = "", |
|||
| const std::string & | timezone = "" | |||
| ) | const [inherited] |
Say a given date in the format specfied.
Say a given date and/or time in the format specfied. Return early if any of the given DTMF digits are pressed. See voicemail.conf for formatting options. The format defaults to "ABdY 'digits/at' IMp".
| date | the date/time to say in seconds since the epoch | |
| escape_digits | digits to break on | |
| format | the format to use (see voicemail.conf) | |
| timezone | the timezone the time is in (acceptable values can be found in /usr/share/zoneinfo) |
Definition at line 686 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| char agi::say_digits | ( | int | digits, | |
| const std::string & | escape_digits = "" | |||
| ) | const [inherited] |
Say a given digit string as indiviual digits.
| digits | the digits to say | |
| escape_digits | digits to break on |
Definition at line 706 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| char agi::say_number | ( | int | number, | |
| const std::string & | escape_digits = "" | |||
| ) | const [inherited] |
Say a given number.
| number | the number to say | |
| escape_digits | digits to break on |
Definition at line 719 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| char agi::say_phonetic | ( | const std::string & | characters, | |
| const std::string & | escape_digits = "" | |||
| ) | const [inherited] |
Say a given character string with phonetics (alpha, bravo, charile.
..).
| characters | the string to say | |
| escape_digits | digits to break on |
Definition at line 732 of file agi.cc.
References astxx::agi::execute(), astxx::agi::quote(), and astxx::agi::result::result.
| char agi::say_time | ( | time_t | time, | |
| const std::string & | escape_digits = "" | |||
| ) | const [inherited] |
Says a given time.
| time | the time to say in seconds since the epoch | |
| escape_digits | digits to break on |
Definition at line 743 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| agi & agi::send_image | ( | const std::string & | image | ) | [inherited] |
Send an image to channels that support it.
Most channels do not support the transmission of images.
| image | the name of the image, should not include an extension |
Definition at line 757 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| agi & agi::send_text | ( | const std::string & | text | ) | [inherited] |
Send text to channels that support it.
Most channels do not support the transmission of text.
| text | the text to send |
Definition at line 770 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| agi & agi::set_autohangup | ( | int | delay | ) | [inherited] |
Hangup a channel after the specified time has passed.
| delay | the number of seconds to wait before hanging up, 0 will disable any pending auto hangups |
Definition at line 782 of file agi.cc.
References astxx::agi::execute().
| agi & agi::set_callerid | ( | const std::string & | cid | ) | [inherited] |
Set the callerid for the current channel.
| cid | the callerid to set, should be a number or in the form "name" <number> or name <number> |
Definition at line 809 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| agi & agi::set_callerid | ( | int | number | ) | [inherited] |
Set the callerid for the current channel.
| number | the callerid to set |
Definition at line 795 of file agi.cc.
References astxx::agi::execute().
| agi & agi::set_context | ( | const std::string & | context | ) | [inherited] |
Set the channel context.
Sets the context for continuation upon exiting the application.
| context | the context to use |
Definition at line 822 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| agi & agi::set_extension | ( | const std::string & | extension | ) | [inherited] |
Set the channel extension.
Sets the extension for continuation upon exiting the application.
| extension | the extension to use |
Definition at line 850 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| agi & agi::set_extension | ( | int | extension | ) | [inherited] |
Set the channel extension.
Sets the extension for continuation upon exiting the application.
| extension | the extension to use |
Definition at line 835 of file agi.cc.
References astxx::agi::execute().
| agi & agi::set_music | ( | bool | enable, | |
| const std::string & | music_class = "" | |||
| ) | [inherited] |
Enable/Disable music on hold generator.
| enable | enable or disable music on hold. | |
| music_class | the music on hold class to use |
Definition at line 862 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| agi & agi::set_priority | ( | const std::string & | priority | ) | [inherited] |
Set the priority of the channel.
Sets the priority for continuation upon exiting the application.
| priority | the priority to use |
Definition at line 901 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| agi & agi::set_priority | ( | int | priority | ) | [inherited] |
Set the priority of the channel.
Sets the priority for continuation upon exiting the application.
| priority | the priority to use |
Definition at line 886 of file agi.cc.
References astxx::agi::execute().
| agi & agi::set_variable | ( | const std::string & | variable, | |
| const std::string & | value | |||
| ) | [inherited] |
Set a given variable.
| variable | the variable to set | |
| value | the value to use |
Definition at line 913 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| char agi::stream_file | ( | const std::string & | filename, | |
| const std::string & | escape_digits = "", |
|||
| long | offset = 0 | |||
| ) | const [inherited] |
Plays a given file on the audio channel.
| filename | the file to stream (no extension should be specfied) | |
| escape_digits | digits to break on | |
| offset | the offset to begin playback at |
Definition at line 926 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| agi & agi::tdd_mode | ( | const std::string & | mode | ) | [inherited] |
Change the TDD mode of the channel.
| mode | the mode to set (on, off, tdd, mate) |
Definition at line 958 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| agi & agi::tdd_mode | ( | bool | enable | ) | [inherited] |
Toggles TDD mode on or off (for the deaf).
| enable | wheather to enable or disable TDD on the channel |
Definition at line 942 of file agi.cc.
References astxx::agi::execute().
| agi & agi::verbose | ( | const std::string & | text, | |
| int | level = 1 | |||
| ) | [inherited] |
Log a message to the Asterisk verbose log.
Feel free to pass newlines (\n) in your text string as this function handles parsing them out into multiple verbose commands.
| text | the message to log | |
| level | the level to log at |
Definition at line 973 of file agi.cc.
References astxx::agi::execute(), and astxx::agi::quote().
| char agi::wait_for_digit | ( | long | timeout = -1 |
) | const [inherited] |
1.5.6