public async Task <PlaySilenceAndCollectAction> PlaySilenceAndCollectAsync(CallMedia.SilenceParams silence, CallCollect collect) { CallMedia media = new CallMedia() { Type = CallMedia.MediaType.silence, Parameters = JObject.FromObject(silence) }; PlayMediaAndCollectAction playMediaAndCollectAction = await PlayMediaAndCollectAsync(new List <CallMedia> { media }, collect); return(new PlaySilenceAndCollectAction(playMediaAndCollectAction)); }
public async Task <PlayTTSAndCollectAction> PlayTTSAndCollectAsync(CallMedia.TTSParams tts, CallCollect collect) { CallMedia media = new CallMedia() { Type = CallMedia.MediaType.tts, Parameters = JObject.FromObject(tts) }; PlayMediaAndCollectAction playMediaAndCollectAction = await PlayMediaAndCollectAsync(new List <CallMedia> { media }, collect); return(new PlayTTSAndCollectAction(playMediaAndCollectAction)); }
public async Task <PlayAudioAndCollectAction> PlayAudioAndCollectAsync(CallMedia.AudioParams audio, CallCollect collect) { CallMedia media = new CallMedia() { Type = CallMedia.MediaType.audio, Parameters = JObject.FromObject(audio) }; PlayMediaAndCollectAction playMediaAndCollectAction = await PlayMediaAndCollectAsync(new List <CallMedia> { media }, collect); return(new PlayAudioAndCollectAction(playMediaAndCollectAction)); }
public async Task <PlayMediaAndCollectAction> PlayMediaAndCollectAsync(List <CallMedia> media, CallCollect collect) { // Create the action first so it can hook events and not potentially miss anything PlayMediaAndCollectAction action = new PlayMediaAndCollectAction(this, Guid.NewGuid().ToString(), media, collect); Task <CallPlayAndCollectResult> taskCallPlayAndCollectResult = mAPI.LL_CallPlayAndCollectAsync(new CallPlayAndCollectParams() { NodeID = mNodeID, CallID = mCallID, ControlID = action.ControlID, Play = media, Collect = collect, }); // The use of await ensures that exceptions are rethrown, or OperationCancelledException is thrown CallPlayAndCollectResult callPlayAndCollectResult = await taskCallPlayAndCollectResult; // If there was an internal error of any kind then throw an exception mAPI.ThrowIfError(callPlayAndCollectResult.Code, callPlayAndCollectResult.Message); return(action); }
internal PlaySilenceAndCollectAction(PlayMediaAndCollectAction action) { mAction = action; }
internal PlayAudioAndCollectAction(PlayMediaAndCollectAction action) { mAction = action; }
internal PlayTTSAndCollectAction(PlayMediaAndCollectAction action) { mAction = action; }