Synopsis:
SMplaycptone(vox_chan,duration_ms,type,tone_id1,on_cad1_ms,off_cad1_ms[,tone_id2,on_cad2_ms,off_cad2_ms[,toneid3…]])
Arguments:
vox_chan – The voice channel
duration_ms – The duration of the tone (in millseconds) or the number of times the tone should be played (for type repeat).
type – The tone type (0=Once, 1=Repeat, 2=Continuous)
tone_id1 – The tone id of the first tone frequency
on_cad1 – The on time of the fist tone frequency (in ms)
off_cad1 – The off time of the first tone frequency (in ms)
[tone_id2] – The tone id of the second tone frequency
[on_cad2] – The on time of the second tone frequency (in ms)
[off_cad2] – The off time of the second tone frequency (in ms)
etc
Description: This function enables call progress tones to be played made up of one or more frequencies and cadences on the specified vox_chan.
The duration_ms argument specified the number of milliseconds that the tone will be played for. If it is set to 0 then this means that the tone should be played indefinitely until a terminating event occurs (such as SMabort() or hangup signal).
Note that If the type is set to SMPlayCPToneTypeOneShot then the duration_ms is ignored and the set of tone cadences will be played just once.
The type argument can take one of the following values as defined in ACULAB.INC:
# Call Progress tone types
const SMPlayCPToneTypeOneShot =0;
const SMPlayCPToneTypeRepeat =1;
const SMPlayCPToneTypeContinuous =2;
If the type is set to SMPlayCPToneTypeRepeat or SMPlayCPToneTypeContinuous then the duration_ms defines the number of milliseconds that the tone will play before it terminates with a TERM_CPTONE event.
The type SMPlayCPToneTypeContinuous is special (an depreciated by SMplaytone()) since it only plays the first tone specified by tone_id1 as a continuous tone (cadences and subsequent tones are ignore).
The function also takes the set of tones and cadences that make up the tone through the arguments: tone_id1, on_cad1_ms, on_cad1_ms and there may be a number of further tones that make up the call progress tone through the optional arguments: tone_id2, on_cad2_ms, on_cad2_ms , tone_id3, on_cad3_ms, on_cad3_ms and so on..
The tone_id specifies the tone ID of the tone to play, the on_cad_ms specifies the duration (in ms) that the tone is on for, and off_cad_msdefines the duration (in ms) of silence after this tone.
Returns: Returns 0 if successful or a negative error code.