Exemplo n.º 1
0
        public TelephonyProfileInfoResult TelephonyProfileUpdate(TelephonyProfileUpdateItem updateItem, bool isUpdate)
        {
            // act: "telephony-profile-update"
            if (updateItem == null)
            {
                throw new ArgumentNullException(nameof(updateItem));
            }

            var commandParams = QueryStringBuilder.EntityToQueryString(updateItem);

            if (updateItem.ProviderFields != null)
            {
                commandParams += updateItem.ProviderFields.ToQueryString();
            }

            StatusInfo status;
            var        doc = this.requestProcessor.Process(Commands.Telephony.ProfileUpdate, commandParams, out status);

            if (!ResponseIsOk(doc, status))
            {
                return(new TelephonyProfileInfoResult(status));
            }

            if (isUpdate)
            {
                return(this.TelephonyProfileInfo(updateItem.ProfileId));
            }

            // notice: no 'profile' will be returned during update!!
            //https://helpx.adobe.com/adobe-connect/webservices/telephony-provider-update.html
            var detailNode = doc.SelectSingleNode("results/telephony-profile");

            if (detailNode == null || detailNode.Attributes == null)
            {
                return(new TelephonyProfileInfoResult(status));
            }

            TelephonyProfile detail = null;

            try
            {
                detail = TelephonyProfileParser.Parse(detailNode);
            }
            catch (Exception ex)
            {
                TraceTool.TraceException(ex);
                status.Code    = StatusCodes.invalid;
                status.SubCode = StatusSubCodes.format;
                status.UnderlyingExceptionInfo = ex;
            }

            return(new TelephonyProfileInfoResult(status, detail));
        }
Exemplo n.º 2
0
        public AudioProfileDto(TelephonyProfile x)
        {
            if (x == null)
            {
                throw new ArgumentNullException(nameof(x));
            }

            // NOTE: other properties are not in use

            //this.adaptorId = x.AdaptorId;
            //this.name = x.Name;
            this.ProfileId   = x.ProfileId;
            this.ProfileName = x.ProfileName;
            //this.profileStatus = x.ProfileStatus;
            //this.providerId = x.ProviderId;
        }
Exemplo n.º 3
0
 public TelephonyProfileInfoResult(StatusInfo status, TelephonyProfile telephonyProfile, IDictionary <string, string> telephonyProfileFields)
     : base(status)
 {
     TelephonyProfile       = telephonyProfile;
     TelephonyProfileFields = telephonyProfileFields;
 }
Exemplo n.º 4
0
 public TelephonyProfileInfoResult(StatusInfo status, TelephonyProfile telephonyProfile)
     : base(status)
 {
     TelephonyProfile = telephonyProfile;
 }