int sm_play_cptone_status(struct sm_play_cptone_status_parms *statusp)
typedef struct sm_play_cptone_status_parms {
tSMChannelId channel; /* inout */
enum kSMPlayCPToneStatus {
kSMPlayCPToneStatusComplete,
kSMPlayCPToneStatusOngoing,
} status; /* out */
} SM_PLAY_CPTONE_STATUS_PARMS;
This call, typically invoke in response to a write event being signalled, allows an application to determine the status of a specific on-going call-progress tone generation job.
In order to determine the status of a specific call-progress tone generation job on a particular output channel, the application should set channel to specify the job concerned. On successful completion, the status parameter will indicate the status of that channel.
In order to poll multiple call-progress tone generation jobs to
see if any have completed, the application should set
channel
to kSMNullChannelId. On successful completion, if
any call-progress tone generation job has completed, the
status
parameter will be set to
kSMPlayCPToneStatusComplete
and
channel
will indicate which channel has completed tone generation.
If no such channel exists, then
channel
will remain set to kSMNullChannelId and the call
will return ERR_SM_NO_SUCH_CHANNEL.
kSMNullChannelId, the only channels which can
be indicated as being ready are those which have been
registered for 'any channel' write operation using
sm_channel_set_event()
See Prosody TiNG: any channel operation
for how to do this.
When this function reports that the channel status is
kSMPlayCPToneStatusComplete,
this also marks the end of the use of the channel for playing a
tone, returning the channel output to an idle state ready to
start a new replay or other output operation. Note that this
means that if
sm_play_cptone_status()
is used again on the channel before starting a new tone, then it
will report the error ERR_SM_WRONG_CHANNEL_STATE.
0 if call completed successfully, otherwise a standard error such as:
This function is part of the Prosody speech processing API.