Ignore me, I can get a connection using postman so its something with my code, I will keep at it
Hey Paul - Make sure you/your library is using WSS as opposed to WS.
HI Budd,
I am now getting a sucssefull connection on the WebSocket, but when I try to subscribe to the subscription ID it closes the connection, this is my flow
- Get Auth Token
- Get the WSS URL at (https://notifications.ap.api.mitel.io/2017-09-01/connections)
- Connect to the webscoket URL that I got back from /connections
- Get a subscriptions Id from https://notifications.ap.api.mitel.io/2017-09-01/subscriptions/
{“applicationId”: “7acbcb048814468b99d9be2fdcff81afhfgdfg”,
“applicationId”: “{APP ID}f”,
“deviceId”: “{Device ID}”,
“transport”: “websocket”,
“topic”: “platform-api-media”,
‘subjectFilter’: “/2017-09-01/endpoints/6897/calls”,
} - Then Subscribe with Paho
Clinet client.subscribe({subscription id}, 0)
It’s at this point it disconnects with reason code 7 (MQTT_ERR_CONN_LOST)
Don’t know if you can see from the logs why it’s disconnecting.
Any ideas?
Hey Paul, can you give me a timestamp for the error message (with timezone) and private message me your account number/ID? I’ll take a look at the server logs and see if I can get more context.
For posterity, the issue was on subscription on the format needs to be {clientId/subscriptionId}.