Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

AudioSend Class Reference

Call Module for sending an A-Law file. More...

#include <audiosend.h>

Inheritance diagram for AudioSend:

CallModule CallInterface List of all members.

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

Detailed Description

Call Module for sending an A-Law file.

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.

Author:
Gernot Hillier


Constructor & Destructor Documentation

AudioSend::AudioSend Connection conn,
string  file,
bool  DTMF_exit
throw (CapiExternalError)
 

Constructor. Test if we are in speech mode and create an object.

Parameters:
conn reference to Connection object
file name of file to send
DTMF_exit set to true, if you want to finish when DTMF signal is received
Exceptions:
CapiExternalError Thrown if speech mode isn't established before.


Member Function Documentation

long AudioSend::duration  ) 
 

Return the time in seconds since start of mainLoop().

Returns:
time in seconds since start of mainLoop()

void AudioSend::mainLoop  )  throw (CapiError,CapiWrongState,CapiExternalError,CapiMsgError) [virtual]
 

Start file transmission, wait for the end of the file or the connection, stop file transmission.

Exceptions:
CapiWrongState Thrown when disconnection takes place.
CapiExternalError Thrown by Connection::start_file_transmission, see there for explanation.
CapiMsgError Thrown by Connection::start_file_transmission, see there for explanation.
CapiError Thrown by Connection::start_file_transmission, see there for explanation.

Reimplemented from CallModule.

void AudioSend::transmissionComplete  )  [virtual]
 

finish main loop if file is completely received

Reimplemented from CallModule.


Member Data Documentation

string AudioSend::file [private]
 

name of the file to send

long AudioSend::start_time [private]
 

time in seconds since the epoch when the module was started


The documentation for this class was generated from the following files:
Generated on Sun Nov 28 14:37:44 2004 for CapiSuite by doxygen 1.3.8