forked from Montesuma80/3cx-web-API
-
Notifications
You must be signed in to change notification settings - Fork 0
/
park.cs
43 lines (42 loc) · 1.34 KB
/
park.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.Text;
using TCX.Configuration;
using TCX.PBXAPI;
using System.Threading;
using System.IO;
using System.Reflection;
using System.Linq;
using System.Net;
namespace WebAPI
{
public class park
{
public static string call(string args1)
{
int mod2 = 0;
using (var dn = PhoneSystem.Root.GetDNByNumber(args1))
{
using (var connections = dn.GetActiveConnections().GetDisposer())
{
var alltakenconnections = connections.ToDictionary(x => x, y => y.OtherCallParties);
foreach (var kv in alltakenconnections)
{
var owner = kv.Key;
string result = owner.Status.ToString();
Logger.WriteLine("Owner: " + owner);
Logger.WriteLine("Owner Status:" + result);
mod2 = owner.CallID;
Logger.WriteLine("CallID: " + mod2);
string ParkPos = "*00";
Logger.WriteLine("Park Position: " + ParkPos);
PhoneSystem.Root.TransferCall(mod2, owner, ParkPos);
return "true";
}
Logger.WriteLine("keine offene Connection gefunden");
return "false";
}
}
}
}
}