Phone Number Hooks
Phone Number Hooks
Phone number hooks allow you to configure actions that will be performed when specific events occur during a call. Currently, hooks support the call.ringing
event (which is triggered when a call is ringing).
Usage
Hooks are defined in the hooks
array of a phone number. Each hook consists of:
on
: The event that triggers the hook (supportscall.ringing
)do
: The actions to perform when the hook triggers (supportstransfer
andsay
)
Example: Say Message on Call Ringing
This example shows how to play a message when a call is ringing:
Example: Transfer on Call Ringing
This example shows how to transfer a call when it starts ringing:
You can also transfer to a SIP destination:
Common use cases for phone number hooks include:
- Disabling inbound calling by playing a message or transferring