Solved 3cx Phone API issue

Status
Not open for further replies.

JZF

Forum User
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");
}
 
This API is 3rd-party and not provided by 3CX. Please refer to the GitHub page.

Also, the Call Control API is unsupported and undocumented, so it should not be used by 3rd-party scripts like that or it could cause very serious issues.
 
  • Like
Reactions: edossantos
ok, I see. So what is the solution now for integrating client with 3cx PhoneforWindows App? I also tried directly using that CallTriggeredcmd.exe installed by default with Command-line interface, and again , the activate/mute/hold don't work,but MakeCall ,list call,etc work work well.
 
Are you using the 3CX client in softphone mode or CTI mode controlling a desk phone? Maybe that's the issue, not all phones allow all commands from what I remember.
 
I am using the App in softphone mode, did I miss some configurations or this .exe is outdated?
 
I am using the App in softphone mode, did I miss some configurations or this .exe is outdated?
The client is still supported. You should check the logs in the folder "C:\Users\USER_NAME\AppData\Roaming\3CXPhone for Windows\Logs" and see if there is any error. Also, I'm not sure if this is a feature only available in PRO, are you using a STD license by any chance?
 
@edossantos Hi, I realized I passed the wrong arguments which was pretty stupid, Now the API works well , I think this thread can somehow be closed or deleted :D
 
  • Like
Reactions: edossantos
Status
Not open for further replies.

Forum statistics

Threads
112,323
Messages
591,891
Members
165,470
Latest member
Robert Lee