none
Is there an error in the SupervisedTransfer example RRS feed

  • Question

  • Why does the TelephonySession_SpeakCompleted terminate the original phone call?

     

    I would expect it to say "can't connect call", resume the original call but as it stands it always closes the original and generates an exception in my code.

     

    Surely it should look like this

     

         private void TelephonySession_SpeakCompleted(object sender, AsyncCompletedEventArgs e)
            {
                _telephonySession.Synthesizer.SpeakCompleted -= TelephonySession_SpeakCompleted;

                this.Close(null);
                // Close the original telephony session
                //_telephonySession.Closed += TelephonySession_Closed;
                //_telephonySession.Close();
            }

    Tuesday, May 1, 2007 1:14 PM

Answers

  • TelephonySession_SpeakCompleted should occur after saying the message "I'm sorry, I cannot connect your call" to the original session and there is nothing left to do but to terminate the original phone call. It is not easy to reach this state via the debugger since you can only debug either the new session or the old session, and TelephonySession_SpeakCompleted should only be called if you debug the new session and refuse the call. While this is difficult to reproduce in the debugger, in a deployed environment you should hear the "cannot connect your call" prompt prior to the call ending.

     

    What is the exception you see in your code when you run this?

     

     

    Tuesday, May 1, 2007 10:35 PM
  • Your fix is right.  We still need to call Close on the activity so the activity exits properly, but passing e.Error as a parameter would be better than passing null.

     

      private void TelephonySession_SpeakCompleted(object sender, AsyncCompletedEventArgs e)
            {
                _telephonySession.Synthesizer.SpeakCompleted -= TelephonySession_SpeakCompleted;

                this.Close(e.Error);
            }

     

    Tuesday, May 15, 2007 10:34 PM

All replies

  • TelephonySession_SpeakCompleted should occur after saying the message "I'm sorry, I cannot connect your call" to the original session and there is nothing left to do but to terminate the original phone call. It is not easy to reach this state via the debugger since you can only debug either the new session or the old session, and TelephonySession_SpeakCompleted should only be called if you debug the new session and refuse the call. While this is difficult to reproduce in the debugger, in a deployed environment you should hear the "cannot connect your call" prompt prior to the call ending.

     

    What is the exception you see in your code when you run this?

     

     

    Tuesday, May 1, 2007 10:35 PM
  • Your fix is right.  We still need to call Close on the activity so the activity exits properly, but passing e.Error as a parameter would be better than passing null.

     

      private void TelephonySession_SpeakCompleted(object sender, AsyncCompletedEventArgs e)
            {
                _telephonySession.Synthesizer.SpeakCompleted -= TelephonySession_SpeakCompleted;

                this.Close(e.Error);
            }

     

    Tuesday, May 15, 2007 10:34 PM