#include <audiosend.h>
Inheritance diagram for AudioSend:
Public Member Functions | |
AudioSend (Connection *conn, string file, bool DTMF_exit) throw (CapiExternalError) | |
Constructor. Test if we are in speech mode and create an object. | |
void | mainLoop () throw (CapiError,CapiWrongState,CapiExternalError,CapiMsgError) |
Start file transmission, wait for the end of the file or the connection, stop file transmission. | |
void | transmissionComplete () |
finish main loop if file is completely received | |
long | duration () |
Return the time in seconds since start of mainLoop(). | |
Private Attributes | |
string | file |
name of the file to send | |
long | start_time |
time in seconds since the epoch when the module was started |
This module handles the sending of an audio file. The audio file must be in bit-inversed A-Law format. It can be created for example with sox using the suffix ".la". It supports abortion if DTMF signal is received.
If DTMF abort is enabled, the module will abort immediately if the DTMF receiving buffer (see Connection::getDTMF) isn't empty when it is created. That allows the user to abort subsequent audio receive and send commands with one DTMF signal w/o needing to check for received DTMF after each command.
The connction must be in audio mode (by connecting with service VOICE), otherwise an exception will be caused.
|
Constructor. Test if we are in speech mode and create an object.
|
|
Return the time in seconds since start of mainLoop().
|
|
Start file transmission, wait for the end of the file or the connection, stop file transmission.
Reimplemented from CallModule.
|
|
finish main loop if file is completely received
Reimplemented from CallModule.
|
|
name of the file to send
|
|
time in seconds since the epoch when the module was started
|