Esempio n. 1
0
        /// <summary>
        /// Commit Agent Dialog Complete Handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        internal void AgentHuntCompleteHandler(object sender, DialogCompletedEventArgs e)
        {
            Dictionary <string, object> output = e.Output;
            TryCommitAgentAsyncResult   ar;
            bool agentApproval          = output.ContainsKey("QaAgentOfferApproval") ? Convert.ToBoolean(output["QaAgentOfferApproval"]) : false;
            InstantMessagingCall imCall = output.ContainsKey("Call") ? output["Call"] as InstantMessagingCall : null;

            _dictionaryOfTryCommitAsyncResults.TryGetValue((Guid)output["InstanceId"], out ar);
            _dictionaryOfTryCommitAsyncResults.Remove((Guid)output["InstanceId"]);

            if (ar == null)
            {
                Debug.Assert(false, "failed to get TryCommitAgentAsyncResult");
            }

            if (agentApproval)
            {
                ar.SetAsCompleted(imCall, false);
            }

            else
            {
                if (null != imCall)
                {
                    imCall.BeginTerminate(ter => { imCall.EndTerminate(ter); }, null);
                    ar.SetAsCompleted(null, false);
                }
                else
                {
                    ar.SetAsCompleted(new OperationFailureException("AcdAgentHunter: DialogTerminated is getting hit"), false);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Get buddy dialog completion handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GetContactDialogCompleted(object sender, DialogCompletedEventArgs e)
        {
            ContactInformation selectedContact;

            selectedContact   = e.Output["selectedContact"] as ContactInformation;
            m_selectedContact = null;

            if (this.CustomerSession.IsTerminatingTerminated)
            {
                this.EndService(null);
                return;
            }
            if (selectedContact == null)
            {
                //No contact was selected, return the customer
                //back to default routing.
                this.RestartDtmfCommand();
            }
            else
            {
                m_selectedContact = selectedContact;

                var    statement  = m_configuration.InviteUserStatement;
                string mainPrompt =
                    string.Format(
                        CultureInfo.InvariantCulture,
                        statement.MainPrompt,
                        selectedContact.DisplayName);

                this.StartSimpleDialog(mainPrompt, new EventHandler <DialogCompletedEventArgs>(this.InviteUserStatementDialogCompleted));
            }
        }
Esempio n. 3
0
        /// <summary>
        /// DtmfDialog completed handler.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DtmfDialogCompleted(object sender, DialogCompletedEventArgs e)
        {
            DtmfMenuDialog.SelectedMenuItem selectedMenuItem = (DtmfMenuDialog.SelectedMenuItem)e.Output["SelectedMenuItem"];
            switch (selectedMenuItem)
            {
            case DtmfMenuDialog.SelectedMenuItem.None:
                this.RestartDtmfCommand();
                break;

            case DtmfMenuDialog.SelectedMenuItem.AddNumber:
                this.AddNumberToConference();
                break;

            case DtmfMenuDialog.SelectedMenuItem.AddContact:
                this.AddNewContactToConference();
                break;

            //Added case of dialog is failed, do nothing.
            case DtmfMenuDialog.SelectedMenuItem.Failed:
                break;

            default:
                Debug.Fail("Unexpected state");
                break;
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Dialup dialog complettion event handler.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DialupDialogCompleted(object sender, DialogCompletedEventArgs e)
        {
            string number = e.Output.ContainsKey("Number") ? e.Output["Number"] as string : string.Empty;

            if (string.IsNullOrEmpty(number))
            {
                this.BeginShutdown(ar => this.EndShutdown(ar), null);
                return;
            }

            string telUri = string.Format(CultureInfo.InvariantCulture, "tel:+{0}", number);

            System.Threading.ThreadPool.QueueUserWorkItem(this.Dialup, telUri);
        }
Esempio n. 5
0
        /// <summary>
        ///  Get buddy dialog completion event handler.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GetContactDialogCompleted(object sender, DialogCompletedEventArgs e)
        {
            ContactInformation selectedContact;

            selectedContact = e.Output["selectedContact"] as ContactInformation;
            if (selectedContact == null)
            {
                //No contact was selected, end the service to return
                //back to the main menu.
                this.EndService(null);
                return;
            }
            System.Threading.ThreadPool.QueueUserWorkItem(this.StartCallbackDialog, selectedContact);
        }
Esempio n. 6
0
        /// <summary>
        /// Dialup dialog completion event handler.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DialupDialogCompleted(object sender, DialogCompletedEventArgs e)
        {
            this.ReturnCustomerToDefaultRouting();
            string number = e.Output.ContainsKey("Number") ? e.Output["Number"] as string : string.Empty;

            if (!string.IsNullOrEmpty(number))
            {
                string telUri = string.Format(CultureInfo.InvariantCulture, "tel:+{0}", number);
                this.DialOut(telUri, telUri, telUri, this.UserInvitationWorkCompleted);
            }
            else
            {
                this.StartDtmfMenuDialog();
            }
        }
Esempio n. 7
0
        /// <summary>
        /// callback dialog completion handler.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CallbackDialogCompleted(object sender, DialogCompletedEventArgs e)
        {
            CallbackAction nextAction;
            string         contactUri;

            nextAction = (CallbackAction)e.Output["NextAction"];
            contactUri = e.Output.ContainsKey("ContactURI") ? e.Output["ContactURI"] as string : string.Empty;
            if (nextAction == CallbackAction.None || nextAction == CallbackAction.SetupCallback)
            {
                this.EndService(null);
            }
            else
            {
                System.Threading.ThreadPool.QueueUserWorkItem(this.InviteUser, contactUri);
            }
        }
Esempio n. 8
0
 /// <summary>
 ///  Invite user dialog completion handler.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void InviteUserStatementDialogCompleted(object sender, DialogCompletedEventArgs e)
 {
     this.InviteUserStatementCompleted();
 }
Esempio n. 9
0
 /// <summary>
 /// Start Dtmf menu dialog
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 internal void StartDtmfMenuDialog(object sender, DialogCompletedEventArgs e)
 {
     this.StartDtmfMenuDialog();
 }
Esempio n. 10
0
 /// <summary>
 /// Dialog complete handler.
 /// </summary>
 protected override void DialogCompleteHandler(DialogCompletedEventArgs e)
 {
     base.DialogCompleteHandler(e);
 }
Esempio n. 11
0
 /// <summary>
 /// Dialog completion handler of user declined call speaking dialog.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void DeclinedDialogCompleted(object sender, DialogCompletedEventArgs e)
 {
     this.EndService(null);
 }
Esempio n. 12
0
 /// <summary>
 /// Dialog completion event handler for time out statement dialog.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void TimeOutDialogCompleted(object sender, DialogCompletedEventArgs e)
 {
     //No code is provided as nothing has to do after completion of this.
 }