Web call support
# support
f
I want to process web calls in my server, instead of user the
web-sdk
library. I want to open a websocket connection between the user and my server, and another one between the server and vapi. This way, I can monitor both ends of the call. I am creating a web call, getting the websocket url and listening to it. However, I was not able to find anywhere in the documentation where you explain the format of the data I can send and will be receiving from Vapi. Any insights about the matter? Thanks.
v
@Fire Certainly! To integrate VAPI with your server using websockets, you'll need to understand the format of the messages that are sent and received through the websocket connection. When you establish a websocket connection with VAPI, you will typically receive JSON-formatted messages. These messages can contain various types of information, such as call status updates, user input, and other call-related events. Here's a general idea of what you can expect: 1. **Connection Initialization**: When the websocket connection is first established, you may receive an initial message confirming the connection. 2. **Call Events**: As the call progresses, you will receive messages indicating call events such as call started, call ended, user input received, etc. 3. **Sending Commands**: You can send commands to VAPI through the websocket to perform actions like initiating a call, sending DTMF tones, or terminating a call. 4. **Receiving Responses**: After sending a command, you will receive a response indicating the success or failure of the command. The exact structure of these messages will depend on the VAPI's specifications. Unfortunately, if this information is not available in the documentation you have, I won't be able to provide the exact formats and structures. For the specifics on the data format and the available commands and events, you would need to refer to the official VAPI documentation or contact their support team. If the documentation is lacking this information, reaching out to support is the best way to get detailed technical guidance. If you have any other questions or need further assistance, feel free to ask!
You can continue this conversation by mentioning me in the message.
f
I was not able to find the relevant docs
s
Copy code
ts
const vapi = new Vapi('your-public-key', https://api.yourdomain.com/voice);
@Fire This implementation would interact with your API through proxying or direct forwarding. The process involves request and response routing between your client and our service, with data transformation optional based on your requirements. Do let me know what do you think.
f
Hello, any documentation on this implementation?
@Shubham Bajaj
s
@Fire There is no documentation available. You will need to implement proxy middleware between the API and your client. Please let me know how can I help you next.
f
No issue with creating the proxy. But I need to know what the routes are, methods, data types, etc…
I need to know what to route
@Shubham Bajaj
s
@Fire can you join Discord office hours today? I will answer all of your questions there. Meanwhile, if you miss it by any chance, you can take a look at our Web SDK. We are just a thin wrapper over Daily's Web SDK, and all of our data types, DTOs, APIs, routes etc. are listed here https://github.com/VapiAI/client-sdk-web/tree/main
f
@Shubham Bajaj When are the discord office hours?
f
When's the next one? same time tomorrow? Because I am not available at the moment
s
I will be taking the next OH on thursday.
f
can we then have a conversation here instead?
s
@Fire You can use this message as a base: https://discord.com/channels/1211482211119796234/1327598293508816946/1328424454455431370 And refer to this GitHub repository as statrting point for your work: https://github.com/VapiAI/client-sdk-web/tree/main
f
@Shubham Bajaj I already have worked with the websdk and have a website up and running perfectly. However, my issue is that I do not want anyone to be able to vew on the console and network tab that we are making calls to the vapi server. I want the calls to be made to my server, and then from my server to vapi's. I can create the necessary proxy for that but I need to know what are the the routes and methods involved.
@Sanjukta Singha why is this marked as solved? it is not.
s
@Fire check your DM I have shared call link with you.
b
Hey, did you figure this out? I'm interested in the same use-case for my service https://finevoicing.com but I cannot figure out where to find the websocket URL when creating calls, and the server / client events Vapi would emit/accepte
@Sanjukta Singha @Fire
s
@Bubu You do not need to set up WebSocket connections manually. Instead, proxy the request through your server, as the handshake is handled by the Daily web SDK. Direct connection attempts will not function properly. Do let me know how can i help you next, happy to help you both @Bubu @Fire
b
Where do I get the URL to listen/post audio?
@Shubham Bajaj
f
I was able to setup a proxy on my server and all, but there is still 1 API call being shown in the network tab I need to hide:
https://gs.daily.co/rooms/check/vapi/{id}
@Shubham Bajaj
b
Looking at Daily.co docs, it seems it's a WebRTC based protocol, so not offering directly websocket to read/write an audio stream. Am I guessing this right @Fire or did I miss something important here?
f
Im not sure we on the same page here. What I am looking to do is hide any “vapi” related call from my network tab. I do not want my users to know I am using vapi. I was able to mask the create call api called by vapi web sdk by changing the bas url to my server’s and then adding a proxy there to api.vapi.ai. However, there is still this api call to faily.co that i was not able to hide.
b
@Fire Gotcha, indeed it's not exactly what I'm looking for, so I'm going to spawn another thread! Good luck with your implementation work and thanks for following up
f
No worries, good luck
s
@Bubu If you only want live audio, you can get it from the live call listen control. https://docs.vapi.ai/calls/call-features
b
@Shubham Bajaj so call control to send audio and call listen to retrieve the agent stream?
s
@Bubu only for listening to audio, not for sending the audio. In case you want to send audio you can setup custom-voice provider.
b
@Bubu is there a guide for that?
s
@Bubu Custom text-to-speech (TTS) can be configured by searching for "CustomVoice" in the API documentation at https://api.vapi.ai/api or through the CreateAssistantDTO. Documentation is currently being updated and will be available soon in the docs. https://cdn.discordapp.com/attachments/1327598293508816946/1329808646921785364/image.png?ex=678bb050&is=678a5ed0&hm=a3ff45790ed317b5990bcbac19bcaa5e7ee5304e55709cbddb48a8e012b4bd4a&
b
@Shubham Bajaj sorry not sure to see how it matches my use case. I need a way to interact with a Vapi agent over a programmatic way, likely websocket
The agent should remains as is, my service pretends it is a human interacting with it to test its flow
s
@Bubu this is completely different you need to create a test both which calls your prod bot instead.
I suggest creating a new #1211483291191083018 ticket with detailed information about your issue instead of troubling the original ticket owner.
b
3 Views