Phone Number Hooks: Say Message on Call Ringing
# support
m
Hi Support Team, We’re currently using the call.ringing event hook with the say action to play a message, as shown in your example: curl -X PATCH "https://api.vapi.ai/phone-number/" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "hooks": [{ "on": "call.ringing", "do": [{ "type": "say", "exact": "inbound calling is disabled." }] }] }' Our question: • Is it possible to replace the say action with an audio mp3 file so that instead of text-to-speech, the caller hears a pre-recorded message? • If yes, could you please provide instructions or an example payload showing how to configure this? Thanks in advance for your help!
@User Can I have an updat on this?
c
Hi Mark Clint, You can set up a phone number hook to play a message when a call is ringing by defining a hook on the
call.ringing
event. Here is an example of how you can configure this using a PATCH request:
Copy code
bash
curl -X PATCH "https://api.vapi.ai/phone-number/<id>" \
     -H "Authorization: Bearer <auth>" \
     -H "Content-Type: application/json" \
     -d '{
  "hooks": [{
    "on": "call.ringing",
    "do": [{
      "type": "say",
      "exact": "inbound calling is disabled."
    }]
  }]
}'
Replace
<id>
with your phone number ID and
<auth>
with your authorization token. For more details, you can refer to the [Phone Number Hooks documentation](https://docs.vapi.ai/phone-numbers/phone-number-hooks).
m
Is there a way to play audio instead of using ‘say’ during the call ringing?
@User can I have an update on my inquiry please?
c
Unfortunately, it is not currently possible to replace the say action with an audio MP3 file in phone number hooks. Based on the codebase analysis, the call.ringing event hook only supports two action types: 1. say - Text-to-speech message 2. transfer - Transfer the call to another destination With that being said, it would be best to configure the hook for the "say" request to play your text to speech as your "pre recorded message"