CAF: Working With Cmc Mixers
Contents |
Audio Mixers Definition
Audio mixers are used to mix audio from multiple call legs and provide mixed output to each call leg. At any time during a call flow the application can join call legs to one (or multiple) audio mixer.
An audio mixer is represented by an instance of the CTBCMCMixer class. Call legs ([CTBCMCLeg]) can be joined to this audio mixer as talkers, listeners, or both.
In addition to call legs joining/unjoining, the CTBCMCMixer class allows some media functions such as playing audio files or tones to all listeners of the mixer, or recording all active talkers of the mixer.
Other member functions are available to retrieve (and change in some cases) the mixer attributes, and the way different call legs are joined to the mixer (talker/listener)
It is important to note that this class is protocol-agnostic and can handle any type of supported call legs (e.g. SIP/VOIP, ISDN, SS7, Media only, etc).
todo
- Max size of mixers
Caveats
- Do not confuse the base class CTBCMCMixer with the class CTBCAFMixer. The later is an implementation class specialized to be used by the ITBCAFCallFlow interface when dealing with multiple legs and mixers.
Command Flow for Mixer Actions in CAF
All actions requested on a mixer are executed asynchronously. For each action DoSomething() on a mixer, a corresponding OnDoSomethingResponse() event will be received on the mixer once Toolpack starts processing the command. If the OnSomethingResponse() function does not handle the response (the default implementation is empty) and the result of the action was a failure, the default error handling function OnMixerError() will be called. In some cases, when the action is completed, an event will be received on the mixer (OnSomethingDone() for example).
For example, to play a digit sequence, one would call MixerPlayDigit(). It would then almost immediately receive the OnMixerPlayDigitResponse() event indicating that Toolpack has received the command. At the same time this event is called, Toolpack will start playing the digits on the mixer. Once the digits play is completed, the user will receive an OnMixerDigitPlayingDone() event.