Example #1
0
        public JSONResult<string> AddDialPlan(SIPDialPlanJSON sipDialPlan)
        {
            try
            {
                var customer = AuthoriseRequest();

                if (sipDialPlan.ScriptTypeDescription.IsNullOrBlank())
                {
                    sipDialPlan.ScriptTypeDescription = SIPDialPlanScriptTypesEnum.Ruby.ToString();
                }

                SIPDialPlan entityDialPlan = sipDialPlan.ToSIPDialPlan();
                m_service.InsertSIPDialPlan(customer.Name, entityDialPlan);

                return new JSONResult<string>() { Success = true, Result = entityDialPlan.ID };
            }
            catch (Exception excp)
            {
                return new JSONResult<string>() { Success = false, Error = excp.Message };
            }
        }
Example #2
0
        public JSONResult<string> UpdateDialPlan(SIPDialPlanJSON sipDialPlan)
        {
            try
            {
                var customer = AuthoriseRequest();

                SIPDialPlan entityDialPlan = sipDialPlan.ToSIPDialPlan();
                m_service.UpdateSIPDialPlan(customer.Name, entityDialPlan);

                return new JSONResult<string>() { Success = true, Result = entityDialPlan.ID };
            }
            catch (Exception excp)
            {
                return new JSONResult<string>() { Success = false, Error = excp.Message };
            }
        }