API Permission 401 unauthorized when connecting a websocket to /callcontrol/ws

toniSanta

Customer
Joined
Nov 22, 2023
Messages
18
Reaction score
1
I defined a client API app and this seems to work fine. With a Delphi-app I can obtain the API-token throug post ../connect/token, I can make a call with ../callcontrol/makecall, passing the bearer-token in the RequestHeaders. But when I try to connect a WebSocket to the /callcontrol/ws, a "401 unauthorized" status is returned. The bearer-token is passed through the RequestParameters.
the configuration looks in this way
1777386320506.png

the 3CX version is 20.0 Update 8 (Build 1121 Release). On-premise installation.

Any help appreciated. Thanks

Toni Santa
SABE SOFT
 
Hi, Pro / Ent-AI?
 
Hello toniSanta,

Please note that you are requesting 'Call Control', this not available on all license types:

https://www.3cx.com/docs/call-control-api/
On this webpage you will find this remark:
"Please note: You must have an 8SC+ Enterprise license to use 3CX Call Control."

I do hope you have the correct license or it will not work.

Paulo
 
Hi Paulo,
yes, we have the 8SC+ Ent license.
I'm struggling with the websocket-component to understand, if the bearer token is correctly passed to the 3cx-webservice-server. My question in this forum was only intended to understand, if from part of 3CX all should work as expected or if other users have similar problems with the /callcontrol/ws - service, too. If you can confirm the on your part the websocket works as it should and your receive the call-notifications, I 'll investigate on my side how to correctly connect my websocket-client to the websocket-server of 3CX.
regards
Toni