Picture of JiangNan
Registered 5 years 240 days
JiangNan Sunday, 20 November 2022, 07:08 PM
PbxApi SubscribePresence in Master/Slave environment
Hi Andreas,

Is there any additional requirement to retrieve presence status in MASTER/SLAVE environment?

We have the following configuration enabled:

  • Pbx instance has 'Group Default Visibility' with all boxes ticked.
  • Each user object has 'Presence', 'On the phone' and 'Presence note' ticked for my 'App' object on 'Visibility' column.
The code is written as this:
var subscribe = new SubscribePresence
{
src = userInfo.e164,
num = userInfo.e164 //e164 number from UserInfo object
};


But 'PresenceState' indicates presence status is disconnected:

11:44:34.49 [TP05] InnovaPbx: OnPresenceState: {
"mt": "PresenceState",
"up": false,
"sip": null,
"dn": null,
"email": null,
"api": "PbxApi",
"src": "263"
}

Also we don't receive any 'PresenceUpdae' at all.

Is there anything else we need to do to get it going in MASTER/SLAVE environment as the same code works in single pbx setup?

Thank you!

Josie
Andreas Fink
Moderator Registered 12 years 277 days
Andreas Fink (innovaphone) Friday, 25 November 2022, 11:20 AM
Re: PbxApi SubscribePresence in Master/Slave environment
Hello Josie,

PresenceSubscription should work between Master/Slave PBXes the same way as it works on one local PBX.

Why do you think the Master/Slave is an issue here? Have you tested it wihtout Master/Slave and it worked?

Did you get any SubscribePresenceResult for your SubscribePresence message?

Is the SubscribePresence message sent on a WebSocket connection from PBX to App Service?

The PbxApi is a user centric API, that is usually used from a client, on a WebSocket connection from the client to the PBX, in context of a logged in user. In case you are using this API on a connection from the PBX App Object to the App Service, the context here is of the App Object, not a specific User Object. To fix this you would need to use Impersonation and PbxApi APIs together to set context of a specific User Object, that is allowed to subscribe for presence.

Best Regards
Andreas Fink

P.S.: i have created a new thread here, because of a new discussion subject
Picture of JiangNan
Registered 5 years 240 days
JiangNan Sunday, 27 November 2022, 09:06 PM
Re: PbxApi SubscribePresence in Master/Slave environment
Hi Andreas,

After I sorted out the number plan stuff, the presence status started working. So it is no longer an issue.

Thank you for your help

Josie
← You can define your color theme preference here