Skip to main content
The First Step
Jun 17, 2021 6:02 PM UTC
Question

Obtaining real-time presence updates

I am struggling to find the subscription filter to receive presence information. What I want is when user changes state (e.g. Available to Busy) and telephony information (incoming call, call answered, etc.). I have an engine working for SMS and Fax, but presence baffling me. This is what I have for my filter:


eventFilters: ['/restapi/v1.0/account/~/extension/~/message-store/instant?type=SMS', '/restapi/v1.0/account/~/extension/~/fax?direction=Inbound', '/restapi/v1.0/account/~/presence', '/restapi/v1.0/account/~/telephony/sessions', '/restapi/v1.0/account/~/extension/~/telephony/sessions', '/restapi/v1.0/account/~/extension/~/presence?detailedTelephonyState=true', '/restapi/v1.0/account/~/extension/~/presence'],

What should I be using? Thanks!

3 replies

PhongVu
Community Manager
Community Manager
Jun 17, 2021 10:06 PM UTC

You can use this ones

Extension level:

'/restapi/v1.0/account/~/extension/~/presence?detailedTelephonyState=true'

Account level:

'/restapi/v1.0/account/~/presence?detailedTelephonyState=true'
ajprokopThe First StepAuthor
The First Step
Jun 18, 2021 1:19 PM UTC

My webhook is still not invoked when I call the extension or main number associated with my account. The phone rings, I can answer the call, but my code is not invoked. Here is my current list of filters. As before, my webhook is invoked when I text to my number.


eventFilters: ['/restapi/v1.0/account/~/extension/~/message-store/instant?type=SMS', '/restapi/v1.0/account/~/extension/~/fax?direction=Inbound', '/restapi/v1.0/account/~/presence', '/restapi/v1.0/account/~/telephony/sessions', '/restapi/v1.0/account/~/extension/~/telephony/sessions', '/restapi/v1.0/account/~/extension/~/presence?detailedTelephonyState=true', '/restapi/v1.0/account/~/extension/~/presence', '/restapi/v1.0/account/~/extension/~/presence?detailedTelephonyState=true', '/restapi/v1.0/account/~/presence?detailedTelephonyState=true']


PhongVu
Community Manager
Community Manager
Jun 18, 2021 3:37 PM UTC

It's redundant to subscribe for both user and account levels for the same type of event. Also, the presence event notification with the detailedTelephonyState=true' will give you basic presence status info and telephony status info. I believe that during testing, you might create and subscribe for notification several times (every time you run your code), you might end up in running out of subscription limit (20 max). So do read existing subscription and delete them before you create a new one.

eventFilters: [
'/restapi/v1.0/account/~/extension/~/message-store/instant?type=SMS',
'/restapi/v1.0/account/~/extension/~/fax?direction=Inbound',
'/restapi/v1.0/account/~/presence',
'/restapi/v1.0/account/~/telephony/sessions',
'/restapi/v1.0/account/~/extension/~/presence?detailedTelephonyState=true'
]