I wrote a code using vapi APIs for
# general-english
s
I wrote a code using vapi APIs for inbound call. I have 2 numbers - one is a Vapi number and other is imported from Twilio. As mentioned by Shubham on the call this morning, I did not assign an agent to my phone numbers. When I call the Vapi number, I see the call logs getting populated but I get a message that an agent must be assigned to the number, (spoken by Vapi) when I call the Twilio number, I do not get the "agent must be assigned..." message, but my call logs are not captured. It reads the prompts I created when I first created (I made changes to first sentence but it is not recognizing it) wondering if there is special setup needs to be made for Twilio number. I have this in my webhook code: if event_type == 'call.received' response = { assistantId: "c2eb2fbf-23fa-4a9c-a6cc-0fcae52b3faa" } } I even tried creating a new agent and used that agent's ID - still no change
s
you haven't assign the server url to the phone number.
s
Shubham, I assigned the server URL to the phone number Updating phone number 2d4a1f57-67c6-48ce-9168-b75bf0647b56... āœ… Successfully updated server URL to: https://e70a-2601-644-8f01-27c0-b949-14cf-80d0-dfd7.ngrok-free.app/webhook New details: {'id': '2d4a1f57-67c6-48ce-9168-b75bf0647b56', 'orgId': 'b0230dbc-2784-4391-9d63-0b06159c66ef', 'number': '+16504145193', 'createdAt': '2025-05-02T03:58:40.666Z', 'updatedAt': '2025-05-02T14:49:47.221Z', 'twilioAccountSid': 'ACe34a6dff39406b986fe0a11efd8a5144', 'name': 'Paul Twilio', 'serverUrl': 'https://e70a-2601-644-8f01-27c0-b949-14cf-80d0-dfd7.ngrok-free.app/webhook', 'provider': 'twilio', 'status': 'active', 'smsEnabled': True} Current number: +16504145193 Current server URL: https://e70a-2601-644-8f01-27c0-b949-14cf-80d0-dfd7.ngrok-free.app/webhook
I created a new agent and set the First Message as "Hello, this is SK from CardinalTalent.ai, I am testing the agent" When I call the #, it still says the old prompt
s
@Sai set the serverUrl to null its depricated, instead use server.url. "server": { "url": }
s
thank you - will try now.
Thank you. I made the change but the call is getting disconnected as soon as I make the call: Updating phone number 2d4a1f57-67c6-48ce-9168-b75bf0647b56... āœ… Successfully updated server URL to: https://e70a-2601-644-8f01-27c0-b949-14cf-80d0-dfd7.ngrok-free.app/webhook New details: {'id': '2d4a1f57-67c6-48ce-9168-b75bf0647b56', 'orgId': 'b0230dbc-2784-4391-9d63-0b06159c66ef', 'number': '+16504145193', 'createdAt': '2025-05-02T03:58:40.666Z', 'updatedAt': '2025-05-02T16:29:59.032Z', 'twilioAccountSid': 'ACe34a6dff39406b986fe0a11efd8a5144', 'name': 'Paul Twilio', 'provider': 'twilio', 'server': {'url': 'https://e70a-2601-644-8f01-27c0-b949-14cf-80d0-dfd7.ngrok-free.app/webhook'}, 'status': 'active', 'smsEnabled': True} Current number: +16504145193 Current server.url: https://e70a-2601-644-8f01-27c0-b949-14cf-80d0-dfd7.ngrok-free.app/webhook Current server URL: None
This is how I set the ServerURL to null and server.url value: try: payload = { "serverUrl": None, "server":{"url": server_url} } response = requests.patch( f"{self.base_url}/phone-number/{phone_id}", headers=self.get_headers(), json=payload )
s
@Sai Did you get a chance to look into your Twilio logs? Why calls are not connecting?
4 Views