Example #1
0
        /// <summary>
        /// Refreshes the state of this phone call.
        /// </summary>
        public void Refresh()
        {
            PhoneCall phoneCall = service.UnifiedMessaging.GetPhoneCallInformation(this.id);

            this.state = phoneCall.State;
            this.connectionFailureCause = phoneCall.ConnectionFailureCause;
            this.sipResponseText        = phoneCall.SIPResponseText;
            this.sipResponseCode        = phoneCall.SIPResponseCode;
        }
Example #2
0
        /// <summary>
        /// Refreshes the state of this phone call.
        /// </summary>
        public async System.Threading.Tasks.Task Refresh()
        {
            PhoneCall phoneCall = await service.UnifiedMessaging.GetPhoneCallInformation(this.id).ConfigureAwait(false);

            this.state = phoneCall.State;
            this.connectionFailureCause = phoneCall.ConnectionFailureCause;
            this.sipResponseText        = phoneCall.SIPResponseText;
            this.sipResponseCode        = phoneCall.SIPResponseCode;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="GetPhoneCallResponse"/> class.
        /// </summary>
        /// <param name="service">The service.</param>
        internal GetPhoneCallResponse(ExchangeService service)
            : base()
        {
            EwsUtilities.Assert(
                service != null,
                "GetPhoneCallResponse.ctor",
                "service is null");

            this.phoneCall = new PhoneCall(service);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="GetPhoneCallResponse"/> class.
        /// </summary>
        /// <param name="service">The service.</param>
        internal GetPhoneCallResponse(ExchangeService service)
            : base()
        {
            EwsUtilities.Assert(
                service != null,
                "GetPhoneCallResponse.ctor",
                "service is null");

            this.phoneCall = new PhoneCall(service);
        }
        /// <summary>
        /// Calls a phone and reads a message to the person who picks up.
        /// </summary>
        /// <param name="itemId">The Id of the message to read.</param>
        /// <param name="dialString">The full dial string used to call the phone.</param>
        /// <returns>An object providing status for the phone call.</returns>
        public PhoneCall PlayOnPhone(ItemId itemId, string dialString)
        {
            EwsUtilities.ValidateParam(itemId, "itemId");
            EwsUtilities.ValidateParam(dialString, "dialString");

            PlayOnPhoneRequest request = new PlayOnPhoneRequest(service);
            request.DialString = dialString;
            request.ItemId = itemId;
            PlayOnPhoneResponse serviceResponse = request.Execute();

            PhoneCall callInformation = new PhoneCall(service, serviceResponse.PhoneCallId);

            return callInformation;
        }
        /// <summary>
        /// Calls a phone and reads a message to the person who picks up.
        /// </summary>
        /// <param name="itemId">The Id of the message to read.</param>
        /// <param name="dialString">The full dial string used to call the phone.</param>
        /// <returns>An object providing status for the phone call.</returns>
        public PhoneCall PlayOnPhone(ItemId itemId, string dialString)
        {
            EwsUtilities.ValidateParam(itemId, "itemId");
            EwsUtilities.ValidateParam(dialString, "dialString");

            PlayOnPhoneRequest request = new PlayOnPhoneRequest(service);

            request.DialString = dialString;
            request.ItemId     = itemId;
            PlayOnPhoneResponse serviceResponse = request.Execute();

            PhoneCall callInformation = new PhoneCall(service, serviceResponse.PhoneCallId);

            return(callInformation);
        }
        /// <summary>
        /// Calls a phone and reads a message to the person who picks up.
        /// </summary>
        /// <param name="itemId">The Id of the message to read.</param>
        /// <param name="dialString">The full dial string used to call the phone.</param>
        /// <returns>An object providing status for the phone call.</returns>
        public async Task <PhoneCall> PlayOnPhone(ItemId itemId, string dialString, CancellationToken token = default(CancellationToken))
        {
            EwsUtilities.ValidateParam(itemId, "itemId");
            EwsUtilities.ValidateParam(dialString, "dialString");

            PlayOnPhoneRequest request = new PlayOnPhoneRequest(service);

            request.DialString = dialString;
            request.ItemId     = itemId;
            PlayOnPhoneResponse serviceResponse = await request.Execute(token).ConfigureAwait(false);

            PhoneCall callInformation = new PhoneCall(service, serviceResponse.PhoneCallId);

            return(callInformation);
        }