Part of aculab.speech View Source View In Hierarchy
A full duplex Prosody channel.
Logging: SpeechChannels are prefixed withsc- and
the log name is speech.
| Method | __init__ | Allocate a full duplex Prosody channel. |
| Method | __del__ | Close the channel if it is still open. |
| Method | _close | Finalizes the shutdown of a speech channel. |
| Method | close | Close the channel. |
| Method | set_event | Create and set an event for the channel. |
| Method | tdm_connect | Connect the channel to a timeslot on its DSP's timeslot range. |
| Method | get_module | Return a unique identifier for module comparisons. |
| Method | get_switch | Return a unique identifier for switch card comparisons. |
| Method | get_timeslot | Get the tx timeslot for TDM switch connections. |
| Method | get_datafeed | Get the datafeed. |
| Method | listen_to | Listen to a timeslot or a tx instance. |
| Method | speak_to | Speak to a timeslot. |
| Method | listen_for | Start DTMF/Tone detection. |
| Method | dc_config | Configure the channel for data communications. |
| Method | start | Start a job. |
| Method | play | Play a file. |
| Method | record | Record to a file. |
| Method | tone | Send a predefined output tone. |
| Method | digits | Send a string of DTMF digits. |
| Method | silence | Play silence. |
| Method | faxrx | Receive a FAX. |
| Method | faxtx | Transmit a FAX. |
| Method | on_recog | Reactor callback. |
| Method | stop | Stop the current job. |
| Method | job_done | Internal job support. |
| Parameters | controller | This object will receive notifications about completed jobs. Controllers
must implement:
|
| card | either a card offset or a snapshot.Card
instance.
| |
| module | either the Prosody Sharc DSP offset or a snapshot.Module
instance.
| |
| user_data | The data associated with this channel. In MVC terms, this would be the
model. In most of the examples, this is Glue or a subclass.
| |
| ts_type | The encoding to use on the timeslot, either alaw, mulaw or raw data. Related Aculab documentation: sm_config_module_switching. | |
| reactor | The reactor used to dispatch controller methods. By default, a single
Reactor is used for all channels.
|
Close the channel.
If the channel is active, all pending jobs will be stopped before the channel is freed.| Parameters | *args | this can be a list of VMPrx, VMPtx, FMPtx, FMPrx, TDMtx, TDMrx, Connection or Call that will be
closed when the channel is idle. . The FAX libraries in particular will
gladly dump core when VMPs or FMPs are closed before the job is
finished.
|
Create and set an event for the channel.
Used internally.| Parameters | _type | One of:
|
Connect the channel to a timeslot on its DSP's timeslot range.
See ProsodyTimeslots.
| Parameters | source | a tuple (stream, timeslot, [timeslot_type]) or a transmitter instance (VMPtx, FMPtx or TDMtx), which must be on the same module. Applications should normally useswitching.connect.
|
Speak to a timeslot.
Applications should normally use switching.connect.
connect will
automatically use the datafeed API.
| Parameters | sink | a tuple (stream, timeslot). |
Start DTMF/Tone detection.
Related Aculab documentation: sm_listen_for.| Parameters | toneset | toneset for DTMF/tone detection. The default toneset will recognize DTMF
only. The magic string 'dtmf/fax' will activate a combined
DTMF/FAX toneset.
|
| mode | the algorithm to use for tone detection. See sm_listen_for for a list of available algorithms. |
Start a job.
Only a single job may run at the same time. This is a somewhat arbitrary limitation that merely simplifies the implementation.| Parameters | file | The name of a TIFF file that will receive the image. |
| subscriber_id | The alphanumerical id of the station. | |
| transport | A pair of (vmptx, vmprx) or (fmptx, fmprx) if this FAX is to be received on a RTP/UDPTL connection. | |
| trace | File name of a trace file. Default is None |
| Parameters | file | The name of a TIFF file that contains the image to send. |
| subscriber_id | The alphanumerical id of the station. | |
| transport | A pair of (vmptx, vmprx) or (fmptx, fmprx) if this FAX is to be sent on a RTP/UDPTL connection. | |
| trace | File name of a trace file. Default is None |