Functions | |
PyObject * | capisuite_log (PyObject *, PyObject *args) |
Write an informational message to the CapiSuite log. | |
PyObject * | capisuite_error (PyObject *, PyObject *args) |
Write an error message to the CapiSuite error log. | |
PyObject * | capisuite_audio_send (PyObject *, PyObject *args) |
Send an audio file in a speech mode connection. | |
PyObject * | capisuite_audio_receive (PyObject *, PyObject *args) |
Receive an audio file in a speech mode connection. | |
PyObject * | capisuite_fax_receive (PyObject *, PyObject *args) |
Receive a fax in a fax mode connection. | |
PyObject * | capisuite_fax_send (PyObject *, PyObject *args) |
Send a fax in a fax mode connection. | |
PyObject * | capisuite_disconnect (PyObject *, PyObject *args) |
Disconnect connection. | |
PyObject * | capisuite_reject (PyObject *, PyObject *args) |
Reject an incoming call. | |
PyObject * | capisuite_connect_voice (PyObject *, PyObject *args) |
Accept an incoming call and connect with voice service. | |
PyObject * | capisuite_connect_faxG3 (PyObject *, PyObject *args) |
Accept an incoming call and connect with fax (analog, group 3) service. | |
PyObject * | capisuite_call_voice (PyObject *, PyObject *args) |
Initiate an outgoing call with service voice and wait for successful connection. | |
PyObject * | capisuite_call_faxG3 (PyObject *, PyObject *args) |
Initiate an outgoing call with service faxG3 and wait for successful connection. | |
PyObject * | capisuite_switch_to_faxG3 (PyObject *, PyObject *args) |
Switch a connection from voice mode to fax mode. | |
PyObject * | capisuite_enable_DTMF (PyObject *, PyObject *args) |
Enable recognition of DTMF tones. | |
PyObject * | capisuite_disable_DTMF (PyObject *, PyObject *args) |
Disable recognition of DTMF tones. | |
PyObject * | capisuite_read_DTMF (PyObject *, PyObject *args) |
Read the received DTMF tones or wait for a certain amount of them. |
All CapiSuite-commands available in Python will stay in a python module called capisuite. This module and all its functions are defined here.
There's a general scheme for mapping the names of the C wrapper functions to python names:
Python command "capisuite.command()" will be defined in the wrapper function "capisuite_command()".
So you can use this document as reference to all available CapiSuite Python commands. For example, if you read the documentation for the capisuite_audio_send function here, you can use it as capisuite.audio_send in your Python scripts.
|
Receive an audio file in a speech mode connection. This functions receives an audio file. It can recognize silence in the signal and timeout after a given period of silence, after a general timeout or after the reception of a DTMF signal. If the recording was finished because of silence_timeout, the silence will be truncated away. If DTMF abort is enabled, the command will also abort immediately if DTMF was received before it is called. That allows you 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 (use capisuite_connect_voice()), otherwise an exception will be caused. The created file will be saved in bit-reversed A-Law format, 8 kHz mono. Use sox to convert it to a normal wav file.
|
|
Send an audio file in a speech mode connection. This function sends 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 command will also abort immediately if DTMF was received before it is called. That allows you 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 (use capisuite_connect_voice()), otherwise an exception will be caused.
|
|
Initiate an outgoing call with service faxG3 and wait for successful connection. This will initiate an outgoing call and choose fax group 3 as service, so you can use the fax commands (like fax_send and fax_receive) with this connection. After this command has finished, the call is connected successfully or the given timeout has exceeded. The timeout is measured beginning at the moment when the call is signalled (it's "ringing") to the called party. A python tuple (call,result) is returned by this function. It contains:
|
|
Initiate an outgoing call with service voice and wait for successful connection. This will initiate an outgoing call and choose voice as service, so you can use the audio commands (like audio_receive and audio_send) with this connection. After this command has finished, the call is connected successfully or the given timeout has exceeded. The timeout is measured beginning at the moment when the call is signalled (it's "ringing") to the called party. A python tuple (call,result) is returned by this function. It contains:
|
|
Accept an incoming call and connect with fax (analog, group 3) service. This will accept an incoming call and choose fax group 3 as service, so you can use the fax commands (like fax_receive) with this connection. After this command has finished, the call is connected successfully. It's also possible to accept a call with some delay. This is for example useful if you want to have the chance to get a call with your phone before your computer answers it.
|
|
Accept an incoming call and connect with voice service. This will accept an incoming call and choose voice as service, so you can use the audio commands (like audio_receive and audio_send) with this connection. After this command has finished, the call is connected successfully. It's also possible to accept a call with some delay. This is for example useful for an answering machine if you want to have the chance to get a call with your phone before your computer answers it.
|
|
Disable recognition of DTMF tones. You can disable the recognition of DTMF tones again if you want to.
|
|
Disconnect connection. This will cause an immediate disconnection. It should be always the last command in every flow of a script. It will return a tuple of two result values. The first is the disconnect cause of the physical connection, the second the disconnect cause of the logical connection. See CAPI spec for the logical causes and ETS 300 102-01 for the physical causes.
|
|
Enable recognition of DTMF tones. You have to enable the recognition of DTMF tones if you want to use them in your script.
|
|
Write an error message to the CapiSuite error log. This function writes a message to the CapiSuite error log. It should be used to output error messages so they appear in the normal error log.
|
|
Receive a fax in a fax mode connection. This command receives an analog fax (fax group 3). It starts the reception and waits for the end of the connection. So it should be the last command before capisuite_disconnect. The connction must be in fax mode (use capisuite_connect_faxG3 or capisuite_switch_to_faxG3), otherwise an exception will be caused. The created file will be saved in the Structured Fax File (SFF) format.
|
|
Send a fax in a fax mode connection. This command sends an analog fax (fax group 3). It starts the send and waits for the end of the connection. So it should be the last command before capisuite_disconnect. The connction must be in fax mode (use capisuite_call_faxG3 or capisuite_switch_to_faxG3), otherwise an exception will be caused. The created file will be saved in the Structured Fax File (SFF) format.
|
|
Write an informational message to the CapiSuite log. This function writes a message to the CapiSuite log. It's helpful if you want to write messages in the debug log in your scripts. The message can be either logged with the general CapiSuite prefix if they are of global nature or with the Connection prefix if they're associated with a special connection.
|
|
Read the received DTMF tones or wait for a certain amount of them. This function allows to just read in the DTMF tones which were already received. But it also supports to wait for a certain amount of DTMF tones if you want the user to always input some digits at a certain step in your script. You can specify how much DTMF tones you want in several ways - see the parameter description. To just see if something was entered before, use capisuite.read_DTMF(0). If you want to get at least 1 and mostly 4 digits and want to wait 5 seconds for additional digits, you'll use capisuite.read_DTMF(5,1,4). Valid DTMF characters are '0'...'9','A'...'D' and two special fax tones: 'X' (CNG), 'Y' (CED)
|
|
Reject an incoming call. If you don't want to accept an incoming call for any reason (e.g. if it has a service or comes from a number you don't want to accept), use this command. There are several reasons you can give when rejecting a call. Some important ones are:
You can find many more reasons in the ETS 300 201-01 specification or on the web (search for ISDN cause) if you really need them.
|
|
Switch a connection from voice mode to fax mode. This will switch from voice mode to fax group 3 after you have connected, so you can use the fax commands afterwards. Attention: This command isn't supported by every ISDN card / CAPI driver!
|