- Joined
- Sep 7, 2021
- Messages
- 4
- Reaction score
- 1
Hi
I am using the 3cx Phone API found on the 3cx github webpage, but the problem is only the MakeCall() method can work well, and I can't get the Activate()/ Hold()/Mute() methods to work,
Below is the sample code snippet I wrote, the create() method is used to connect to namped pipe, So when I click the corresponding buttons on the UI, the call() and pick() methods will be triggered accordingly, the thing is I can make call to ID=08, but when I receive incoming call from ID=08, then I click the pick-up button, the call will not get picked up. I can't figure out why, and the code doesn't throw any exception. Thanks for the help
public void create()
{
binding = new NetNamedPipeBinding();
key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\3CX");
uri = key.GetValue("CallTriggerCmdUri");
Console.WriteLine(uri);
if (uri == null)
throw new Exception("User specific 3CXPhone CallTrigger uri is not found");
address = new EndpointAddress(uri.ToString());
channelFactory = new DuplexChannelFactory<ICallTriggerService>(
new ServiceCallback(), binding, address);
service = channelFactory.CreateChannel();
service.Subscribe();
}
public void call()
{
service.MakeCall("08");
}
public void pick()
{
service.Activate("08");
}
I am using the 3cx Phone API found on the 3cx github webpage, but the problem is only the MakeCall() method can work well, and I can't get the Activate()/ Hold()/Mute() methods to work,
Below is the sample code snippet I wrote, the create() method is used to connect to namped pipe, So when I click the corresponding buttons on the UI, the call() and pick() methods will be triggered accordingly, the thing is I can make call to ID=08, but when I receive incoming call from ID=08, then I click the pick-up button, the call will not get picked up. I can't figure out why, and the code doesn't throw any exception. Thanks for the help
public void create()
{
binding = new NetNamedPipeBinding();
key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\3CX");
uri = key.GetValue("CallTriggerCmdUri");
Console.WriteLine(uri);
if (uri == null)
throw new Exception("User specific 3CXPhone CallTrigger uri is not found");
address = new EndpointAddress(uri.ToString());
channelFactory = new DuplexChannelFactory<ICallTriggerService>(
new ServiceCallback(), binding, address);
service = channelFactory.CreateChannel();
service.Subscribe();
}
public void call()
{
service.MakeCall("08");
}
public void pick()
{
service.Activate("08");
}