2 small questions about API
# support
p
1. I'm wondering: can I access inbound phone number in the context of a toolCall or shall I do some matching by using call status payload to associate a phone number to a tool call? 2. is it a specific way to tell open ai model to redirect the called to the fallback phone number? When i tell him to forward me to an human being he seems stuck even tho I gave him instruction such as, "forward the call to the forward phone number you have access to if the user want to speak to the standard"
on the logs it says: Assistant forwarded call but the forward phone number isn't ringing.
(we are in production)
v
@paul gaston 1. To access an inbound phone number in the context of a tool call, you typically need to use the call status payload, which should include details about the inbound call, such as the phone number. This payload is usually provided as part of the webhook event data when a call is received. You would match the incoming call details with the tool call using this information. 2. To redirect a call to a fallback phone number, you would need to set up call forwarding rules within your voice API platform. If you have already provided instructions for forwarding, ensure that the assistant is programmed to recognize the user's request to speak to a human and execute the forwarding action. If the assistant seems stuck, it might be due to a misconfiguration or a misunderstanding in the instructions given to the assistant. You should review the assistant's settings and the forwarding instructions to ensure they are clear and correctly implemented. If you have a specific command or keyword for forwarding, make sure it is recognized by the assistant and triggers the correct action. If you continue to experience issues, please ask support for more info on this.
You can continue this conversation by mentioning me in the message.
p
i don't think he is stuck as the logs clearly display: Assistant forwarded call as end of call reason.
v
Got it. Tagging @User for additional help.
p
i understand, this feature only works for phone calls not web testing I assume.
s
Hey @paul gaston your ticket was auto marked as looking because of it I couldn't get to know about it. 1. You get call object in tool call payload using it you can get the customer phone number.
call.customer.number
2. Can you share the call id?
p
i figured out for phone numbers, i use call status and use a small session redis server for the matching
oh wait you say i can do it directly in the tool using call.customer.number?
that would be crazy, such as calling a tool with a variable called userPhoneNumber whose value would be call.customer.number?
i just see phone number in status not in tool payload but maybe it's on me as i didn't wtch carefully
my question is: does model knows about called phone number or not?
also, do you think you can help me on this question? https://discord.com/channels/1211482211119796234/1307195940389654538
sincerely paul
@User
s
> my question is: does model knows about called phone number or not? No model doesn't know by default phone number, but you can share with the model using dyanmic variables.
@paul gaston we send call object with each server message payload, so you can get in your tool call payload as well.
p
ok so phone number is in tool payloads? I didn't find it but i'll watch that again closely tomorrow as I wake up. When you say sharing it with model do you mean: - backed extracts it and put it into response so model know about it - directly using some specific syntax in the model? Sincerely truly appreciate the help man, i'm thanksful for you replying now
s
> When you say sharing it with model do you mean: You can insert the phone number as dynamic variables and later can use in the call. Check this documentation it explains how to assign server url to the phone number to pass dynamic variables into the assistant right before the call https://shmbajaj.notion.site/Setting-Up-Dynamic-Variables-for-Your-Vapi-Calls-A-Quick-Guide-14077ff426238037b101f91a446f7f6a?pvs=4 . This server call also has call object so you can extract the phone number from there and use it in assistant.
Do let me know if you require further help.
p
thank you i'm looking into this asap
if i understand correctly you get variable from your own server in order to set it in this approach, correct?
it make sense. my question was about called phone number so it doesn't make much difference as long as my server has to get this information before exposing it. I though it was an "easier" was to associate it directly in tool calls but thats not the phylosophy if I understand correctly
s
@paul gaston do let me if you have recieved your answers and I can close this ticket.
p
sure
i think i'm good
2 Views