WebPhone SDK events
The WebPhoneSDK makes a number of events available to subscribe to. There are two categories of events:
- webPhone events
- callSession events
Subscribing to events
Subscribing to events is done using the on
method as shown below.
webPhone.on("inboundCall", (inboundCall: InboundCallSession) => {
// do something with the inbound call
});
callSession.on("disposed", () => {
// do something when the call session is disposed
});
WebPhone events
Event | Description |
---|---|
inboundCall |
Triggered when a call is received. |
outboundCall |
Triggered when a call is placed. |
CallSession events
Event | Description |
---|---|
answered |
Triggered when the call is answered. |
disposed |
For answered calls, this event is triggered when someone hangs up. For inbound calls, it is triggered if the caller hangs up or if the call is answered on another device. |
inboundMessage |
Triggered when you receive a SIP message. |
outboundMessage |
Triggered when a SIP message is sent. |
ringing |
This event does exist, but it is effectively implied by the existence of other events. |