how can i detect if the call is a direct webcall o...
# support
b
I need to be able to detect if its a web call because in web calls, the user cannot be forwarded to another phone number and i need to handle that gracefully.
v
@Bishop Certainly! To detect if a call is a web call, you can check the
phoneCallTransport
parameter in the context of the call. If the
phoneCallTransport
is not set to
sip
or
pstn
, it's likely a web call. For web calls, you would handle the call within the web environment and provide alternative solutions to the user, such as offering a callback option or providing assistance through a web-based chat or support system. If you need to implement this detection in your system, you may need to write a conditional check in your code. If you provide me with more details on how you're handling calls, I can give you a more specific solution.
You can continue this conversation by mentioning me in the message.
s
@Bishop can you help me with how your getting the calls and where your getting the calls? With this I will get to know about your environment and then it will be exact help. For Generic Answer with each request to your server Vapi includes the call type under property named
type
.
b
Appreciate the answer. So when you say 'for each request to your server' do you mean via the webhooks and tool calls from vapi?
It seems if I call an initial webhook I can receive variables back and access them with the curly brace format?
I see. I need to populate it using server URL and it'll be available
this is a server url for an assistant
s