Picture of mitop
Registered 3 years 153 days
mitop Tuesday, 21 February 2023, 04:21 PM
SetPresence from PbxApi, usage of "params"
Hi,

the SetPresence interface has no possibility to specify "params" itself. If I enter " #myindent:somevalue" in "note" this own value appears in the "params" list, at least in the "PresenceUpdated" message sent to the frontend, the "PresenceUpdate" message to the backend has no "params" but "#myindent:somevalue" appears in "note".
Is it possible to extend the SetPresence Interface to hand over "params" instead of putting everything inside "note"? And can the "PresenceUpdate" message send to the service backend include the params too? Usage would become more easy and consistent (no string parsing, same convention, etc.).


Best regards
Mladen Topic


Andreas Fink
Moderator Registered 12 years 278 days
Andreas Fink (innovaphone) Friday, 24 February 2023, 12:36 PM
Re: SetPresence from PbxApi, usage of "params"
Hello Mladen,

could you send examples of complete JSON messages you are referencing to?

Best Regards
Andreas Fink
Picture of mitop
Registered 3 years 153 days
mitop Thursday, 2 March 2023, 06:08 PM
Re: SetPresence from PbxApi, usage of "params"
Hi Andreas,

here are the examples of complete JSON messages:
---

This is the message send to change the presence:
{
 "api": "PbxApi",
 "mt": "SetPresence",
 "src": "788f2cc0d2b44a3480cd8b30cc166779",
 "sip": "user2",
 "activity": "away",
 "note": "Lunch break #away #len:13:13 #until:1677602836553"
}


This is what user receives (PresenceUpdated):
{
 "mt": "ApiResult",
 "api": "com.innovaphone.client",
 "provider": "@client",
 "consumer": "presencefavourites",
 "msg": {
 "mt": "PresenceUpdated",
 "sip": "user2",
 "up": true,
 "ep": {
 "sip": "user2",
 "dn": "User2",
 "num": "302",
 "email": "user2@someemail.com"
},
 "presence": [
{
 "contact": "tel:",
 "activity": "away",
 "note": "Lunch break #away #len:13:13 #until:1677602836553",
 "status": "closed",
 "displayNote": "Lunch break until 05:47 PM",
 "params": {
 "away": "",
 "len": 13,
 "until": 1677602836553
}
},
{
 "contact": "im:",
 "activity": "",
 "status": "open",
 "displayNote": "",
 "params": {}
}
]
}
}


This is what the backend receives (PresenceUpdate without d at the end):
{
 "api": "PbxApi",
 "src": "788f2cc0d2b44a3480cd8b30cc166779",
 "mt": "PresenceUpdate",
 "presence": [
{
 "contact": "tel:",
 "status": "closed",
 "activity": "away",
 "note": "Lunch break #away #len:13:13 #until:1677602836553"
},
{
 "contact": "im:",
 "status": "open"
}
]
}


Best regards
Mladen Topic
← You can define your color theme preference here