private void SendConferenceInvitation(AsyncTask task, object state) { task.DoOneStep( delegate() { string uriToDialOutTo = (string)state; McuDialOutOptions options = new McuDialOutOptions(); options.Issuer = this.CustomerSession.CustomerConversation.LocalParticipant; ConferenceInvitationSettings convSettings = new ConferenceInvitationSettings(); convSettings.AvailableMediaTypes.Add(MediaType.Audio); var confInvitation = new ConferenceInvitation(this.CustomerSession.CustomerConversation, convSettings); this.StartMusic(); confInvitation.BeginDeliver( uriToDialOutTo, delegate(IAsyncResult ar) { task.DoFinalStep( delegate() { this.StopMusic(); confInvitation.EndDeliver(ar); }); }, null); }); }
private void InviteToConference(string uri, CompletionDelegate completionDelegate) { Debug.Assert(!string.IsNullOrEmpty(uri), "New user could not be null."); ConferenceInvitationSettings convSettings = new ConferenceInvitationSettings(); convSettings.AvailableMediaTypes.Add(MediaType.Audio); var confInvitation = new ConferenceInvitation(this.CustomerSession.CustomerConversation, convSettings); try { if (this.CustomerSession.RosterTrackingService.ParticipantCount == 1) { this.StartMusic(this.CustomerSession.CustomerServiceChannel.ServiceChannelCall); } confInvitation.BeginDeliver( uri, ar => { try { confInvitation.EndDeliver(ar); completionDelegate(null); } catch (RealTimeException rte) { this.StopMusic(this.CustomerSession.CustomerServiceChannel.ServiceChannelCall); completionDelegate(rte); } }, null); } catch (InvalidOperationException ioe) { this.Logger.Log(Logger.LogLevel.Error, ioe); this.StopMusic(this.CustomerSession.CustomerServiceChannel.ServiceChannelCall); completionDelegate(ioe); } }