An event dispatched by Telnyx to notify the client of changes to the session or call.
The conditions of the event can be identified by the type property.
type
callUpdate
call
userMediaError
error
Usage with TelnyxRTC Client .on:
.on
client.on('telnyx.notification', (notification) => { if (notification.type === 'callUpdate') { console.log(notification.call); // Do something with the call and update UI accordingly } else if (notification.type === 'userMediaError') { console.log(notification.error); // Handle the error and update UI accordingly }}); Copy
client.on('telnyx.notification', (notification) => { if (notification.type === 'callUpdate') { console.log(notification.call); // Do something with the call and update UI accordingly } else if (notification.type === 'userMediaError') { console.log(notification.error); // Handle the error and update UI accordingly }});
The notification structure is determined by its type.
{ type: 'callUpdate', call: Call // current call} Copy
{ type: 'callUpdate', call: Call // current call}
{ type: 'userMediaError', error: Error} Copy
{ type: 'userMediaError', error: Error}
Notification
Optional
The current call. Reference this call state to update your UI. See Call documentation.
Call
Error from the userMediaError event. Check your audio and video constraints for browser support.
audio
video
Identifies the event case.
An event dispatched by Telnyx to notify the client of changes to the session or call.
The conditions of the event can be identified by the
type
property.type
callUpdate
call
userMediaError
error
Examples
Usage with TelnyxRTC Client
.on
:Data structure
The notification structure is determined by its
type
.callUpdate
userMediaError
Apialias
Notification