Skip to main content

Presence & BLF

Subscribe to real-time presence updates for other users in the account. This powers busy lamp field (BLF) indicators and contact status displays.

Subscribing

// Subscribe to all users in the account
phone.subscribePresence();

// Or subscribe to specific users
phone.subscribePresence(['user_01h2xcejqtf2nbrexx3vqjhp42', 'user_01h2xcejqtf2nbrexx3vqjhp43']);

// Get initial presence snapshot
phone.on('presenceList', (users) => {
// [{ userId, name, status, statusText, updatedAt }]
updateBuddyList(users);
});

// Listen for changes
phone.on('presenceUpdate', (update) => {
// { userId, status, statusText, updatedAt }
updateBuddyListEntry(update);
});

Presence Statuses

StatusDescription
availableUser is online and can receive calls
on_callUser is on an active call (set automatically)
dndDo Not Disturb — calls go to voicemail
awayUser is away (idle timeout or manual)
offlineNo active WebRTC or SIP registration

Setting Your Status

// Set yourself as Do Not Disturb
await phone.setPresence('dnd');

// Set yourself as available
await phone.setPresence('available');

// Set with custom status text
await phone.setPresence('away', 'In a meeting until 3pm');

The on_call and offline statuses are managed automatically — you cannot set them manually.

REST API

You can also read and update your own presence via the REST API:

# Get current presence
curl https://api.dialstack.ai/v1/me/presence \
-H "Authorization: Bearer USER_TOKEN"

# Update presence
curl -X PUT https://api.dialstack.ai/v1/me/presence \
-H "Authorization: Bearer USER_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "status": "dnd", "status_text": "In a meeting" }'