示例#1
0
        /// <summary>
        /// Execute a request against the phone system.
        /// </summary>
        /// <param name="method">The Switchvox XML API Method to execute. For more information, please see http://developers.digium.com/switchvox/wiki/index.php/WebService_methods</param>
        /// <returns>A <see cref="XDocument"/> containing the XML returned by the phone system.</returns>
        internal XDocument Execute(RequestMethod method)
        {
            var xmlRequestBytes = method.ToBytes();

            return(ExecuteRequest(xmlRequestBytes));
        }
示例#2
0
        /// <summary>
        /// Execute a request against the phone system.
        /// </summary>
        /// <param name="method">The Switchvox XML API Method to execute. For more information, please see http://developers.digium.com/switchvox/wiki/index.php/WebService_methods </param>
        /// <returns>A <see cref="T:SwitchvoxAPI.SwitchvoxResponse"/> encapsulating the XML returned by the phone system.</returns>
        internal SwitchvoxResponse Execute(RequestMethod method)
        {
            var xmlRequestBytes = method.ToBytes();

            return(ExecuteRequest(xmlRequestBytes));
        }
示例#3
0
        /// <summary>
        /// Execute and deserialize a request against the phone system.
        /// </summary>
        /// <typeparam name="T">The type to deserialize the XML response from the phone system to.</typeparam>
        /// <param name="method">The Switchvox XML API Method to execute. For more information, please see http://developers.digium.com/switchvox/wiki/index.php/WebService_methods</param>
        /// <returns>An object representing the data returned from the phone system.</returns>
        internal T Execute <T>(RequestMethod method) where T : new()
        {
            var response = Execute(method);

            return(Deserializer.Deserialize <T>(response));
        }