Example #1
0
        /// <summary>
        /// Park a call on a parked channel and reteurn the associated extension
        /// </summary>
        /// <param name="ami">Manager connection</param>
        /// <param name="channel">The channel to park</param>
        /// <returns></returns>
        public async static Task <int> ParkChannel(ManagerConnection ami, string channel)
        {
            var parkList = new List <int>()
            {
                701,
                702,
                703,
                704,
                705
            };
            int open = -1;
            await Task.Run(() =>
            {
                foreach (var p in parkList)
                {
                    if (GetExtensionStatus(ami, p) == 0)
                    {
                        open = p;
                        break;
                    }
                }
            });

            if (open != -1)
            {
                PABX.RedirectCall(ami, $"{open}", channel);
            }
            return(open);
        }
Example #2
0
 /// <summary>
 /// Update a specific extensions group on the server end
 /// </summary>
 /// <param name="ext">Extension</param>
 public async static void UpdateExtensionsGroup(Extension ext)
 {
     using (HttpClient client = new HttpClient())
     {
         string url = PABX.FormatInterfaceQuery("windows_groups.php", $"type=update&ext={ext.Number}&val={ext.GroupId}");
         await client.GetStringAsync(url);
     }
 }
Example #3
0
 /// <summary>
 /// Save credentials, calls, user details and extension groups
 /// </summary>
 public static void SaveAll()
 {
     PABX.SaveCreds(PABX.CurrentUser);
     PABX.SaveSettings();
     PABX.SaveContacts();
     PABX.SaveCallData();
     PABX.SaveGroups();
     PABX.SaveSmartLinks();
 }
Example #4
0
 /// <summary>
 /// Load credentials, calls, user details and extension groups
 /// </summary>
 public static void LoadAll(bool includeCreds = false)
 {
     if (includeCreds)
     {
         PABX.LoadCreds();
     }
     PABX.LoadSettings();
     PABX.LoadContacts();
     PABX.LoadCalls();
     PABX.LoadGroups();
     PABX.LoadSmartLinks();
 }