How to grab inbound caller's phone number
# support
s
I'm wondering is that possible to write custom function to send sms to client's phone number which is calling my agent
@Vapi
v
@Szyman33 Certainly! To send an SMS to a client's phone number during a call with your agent, you would typically use a third-party SMS service API that allows programmatic sending of text messages. You would write a custom function that integrates with this SMS service, and then you could trigger this function during the call when needed. Here's a high-level overview of the steps you would take: 1. Choose an SMS service provider that offers an API for sending SMS messages, such as Twilio, Nexmo, or Plivo. 2. Register for an account with the provider and obtain the necessary API credentials (like an API key). 3. Write a custom function in your agent's codebase that makes an HTTP request to the SMS service's API endpoint. This function would accept parameters such as the phone number to send the message to and the message content. 4. Ensure that your function handles any authentication required by the SMS service and that it processes the API's response to confirm whether the message was sent successfully. 5. Integrate this function into your agent's workflow so that it can be called with the appropriate parameters during a call. If you need assistance with the specifics of writing the function or integrating it with your agent, please let me know, and I can provide further guidance. If you have any other questions or need additional support, feel free to ask!
s
When VAPI triggers certain tool and post request is sent to provided url endpoint, Is there already callers phone number in parameters automatically?
@Vapi
v
@Szyman33 In the context of VAPI (Voice API), when a certain tool is triggered and a POST request is sent to a provided URL endpoint, the inclusion of the caller's phone number in the parameters is not automatic. It depends on how the VAPI is configured and what data it is set to send. Typically, you would configure your VAPI to include relevant information, such as the caller's phone number, as part of the POST request payload. This configuration is usually done when setting up the webhook or API endpoint that VAPI will call. If you're expecting the caller's phone number to be included and it's not currently being sent, you may need to adjust the configuration of your VAPI to ensure that the caller's phone number is included in the data payload of the POST request. If you need assistance with configuring your VAPI to include the caller's phone number or any other details, please let me know, and I can provide further support or direct you to the appropriate resources.
v
Hi! Can you help me with configuring VAPI to include the caller's phone number🦝
k
The tool call payload contains a property named call which contains the customer phone number. Using it you can trigger SMS to the customer phone number. So just look for the caller call property inside the server request payload.