Before the Call Starts
# support
a
Is there a way to call a tool before the assistant picks up an inbound call? I've got two custom tools that checks if the caller's number is already registered in our CRM. so by the time it returns the response, there's a noticible delay. Ideally I'd like to increase the ring time so that when the assistant answers it already knows who the customer is and if they are registered.
v
To ensure your assistant has CRM data ready before answering, configure your phone number to use a server endpoint for personalization. When a call comes in, Vapi will POST to your endpoint, allowing you to run your CRM checks and return assistant details before the call is picked up.
Copy code
json
PATCH /phone-number/{id}
{
  "assistantId": null,
  "server": {
    "url": "https://your-server.com/api/assistant-selector"
  }
}
This setup lets you perform pre-call lookups and pass the results to the assistant instantly when the call starts ([see documentation](https://docs.vapi.ai/assistants/personalization)). Source: - [Personalization with user information](https://docs.vapi.ai/assistants/personalization)
u
Do the CRM lookup pre-answer via n8n and pass the context into the assistant at start, eliminates lookup latency entirely.
a
I'm actually using a custom node server so can't use n8n
u
No problem, n8n was just an example. The important part is pre-answer enrichment.
your node server can run crm lookup on the inbound call webhook and pass the context into assistant before it answers, eliminating the delay.
a
the inbound call webhook is going to be on the phone number's server endpoint right?
u
yeah, right
a
thanks
u
Glad it helped. Happy to jump in if you want to explore it further.
c
Hi, you can use the assistant-request webhook for your use case. This way you can fetch the phone number information before the call starts and either attend or reject the call based on your needs. You can more information here • https://docs.vapi.ai/server-url/events#retrieving-assistantshttps://docs.vapi.ai/server-url/spam-call-rejection (this resource can help with your use case as well)
a
Can the server event be used for a squad? since that's what my inbound phone number is assigned to
s
Happy to help if you are still having issue. Connect me in linkedin.
c
Hi @ali1103, Yes, your squads will also send server events, as long as each of your assistant inside your squad has server events enabled.