Call on hold
# support
r
Hey, I recently came into a problem I didn't even think of. Some people are able to pause the call somehow and then it keeps telling the same phrase that assistant must wait, because the call is on hold. How do I solve this, is there a sollution to this? Call Id: e24a3f82-00f9-426c-9b6d-eada2362d137 @User
v
Solution: To handle users putting the call "on hold" (causing the assistant to loop), you can configure your assistant to end the call after a period of silence. In your assistant's hooks, add a filter for the
silence-timed-out
ended reason and perform an action, such as ending the call or transferring to a fallback. Example hook:
Copy code
json
{
  "hooks": [{
    "on": "call.ending",
    "filters": [{
      "type": "oneOf",
      "key": "call.endedReason",
      "oneOf": ["silence-timed-out"]
    }],
    "do": [{
      "type": "say",
      "exact": "It seems you've stepped away, so I'll end the call now. Goodbye!"
    }]
  }]
}
This will gracefully end calls where the user is silent (or on hold) for too long. Sources: - [Assistant Hooks](https://docs.vapi.ai/assistants/assistant-hooks) - [Call Control Features](https://docs.vapi.ai/calls/call-features) - [Call Ended Reasons](https://docs.vapi.ai/calls/call-ended-reason)
Solution: To handle users putting the call "on hold" (causing the assistant to loop), you can configure your assistant to end the call after a period of silence. In your assistant's hooks, add a filter for the
silence-timed-out
ended reason and perform an action, such as ending the call or transferring to a fallback. Example hook:
Copy code
json
{
  "hooks": [{
    "on": "call.ending",
    "filters": [{
      "type": "oneOf",
      "key": "call.endedReason",
      "oneOf": ["silence-timed-out"]
    }],
    "do": [{
      "type": "say",
      "exact": "It seems you've stepped away, so I'll end the call now. Goodbye!"
    }]
  }]
}
This will gracefully end calls where the user is silent (or on hold) for too long. Sources: - [Assistant Hooks](https://docs.vapi.ai/assistants/assistant-hooks) - [Call Control Features](https://docs.vapi.ai/calls/call-features) - [Call Ended Reasons](https://docs.vapi.ai/calls/call-ended-reason)
r
Is this true Support team? It kept saying that message for 10 minutes, until it exceeded the maximum lenght. I didn't look into these new hooks, wasn't here when I was making my assistant.
BTW please tag me when you respond to me, thanks in advance
s
@Radim Kopp
k
Hey! To help track down this issue, could you share: - What response you expected to get This would really help us figure out what went wrong!
r
I would like the assistant to end the call in this case. Just detect that itโ€™s a machine speaking and end the call, stop wasting minutes on the call with it.
k
You can set up a prompt for specific machine messages, like "Please hold on the line while we connect you with the user," to trigger the endCall tool. This should help resolve the issue.
r
Yes! That worked, thank you. I didnt know the AI could do things while do user is speaking. Thanks, solved.
v
I'm glad to hear that setting up a prompt to detect specific machine messages and triggering the endCall tool worked for you! It's great that you were able to resolve the issue and that the assistant can now handle these "on hold" scenarios more efficiently. If you have any more questions or run into anything else, feel free to ask!
v
Message marked as helpful by @Radim Kopp! ๐ŸŽ‰
r
Nah, just mark this post as solved
thanks
v
Great to hear that the solution worked for you and your assistant is now handling these scenarios as expected! If anything else comes up, feel free to reach out.
Your request to mark the post as solved has been noted! If you have any more questions or need further assistance in the future, feel free to reach out. And I'll make sure to tag you in future responses as requested!