You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am facing an issue.
When I deploy this to EC2 voice is not coming from server to my phone.
It is working on local environment.
I am getting response from gpt and text to speech service is also working I think.
What could be the issue?
The text was updated successfully, but these errors were encountered:
BhargabSixthSens
changed the title
Voice is not coming from server to phone on EC2 deployment
Voice is not coming from server to phone on EC2 deployment | Working on local environment
Jun 25, 2024
This is due to start event is not coming in hosted server.
For some reason first few events are missing. so you will miss connected and start event.
So the following code won't execute
if(msg.event==='start'){streamSid=msg.start.streamSid;callSid=msg.start.callSid;streamService.setStreamSid(streamSid);gptService.setCallSid(callSid);// Set RECORDING_ENABLED='true' in .env to record callsrecordingService(ttsService,callSid).then(()=>{console.log(`Twilio -> Starting Media Stream for ${streamSid}`.underline.red);ttsService.generate({partialResponseIndex: null,partialResponse: 'Hello! I understand you\'re looking for a pair of AirPods, is that correct?'},0);});}
One workaround I found
You can pass the callSid from body as a param in wss link here
use callSid to set gpservice callSid
and in media event you will get streamSid set it in streamService
something like this
elseif(msg.event==='media'){if(!streamService.streamSid){streamService.setStreamSid(msg.streamSid);recordingService(ttsService,callSid).then(()=>{console.log(`Twilio -> Starting Media Stream for ${streamSid}`.underline.red);ttsService.generate({partialResponseIndex: null,partialResponse: 'Hello! I understand you\'re looking for a pair of AirPods, is that correct?'},0);});}transcriptionService.send(msg.media.payload);}
Hi, I am facing an issue.
When I deploy this to EC2 voice is not coming from server to my phone.
It is working on local environment.
I am getting response from gpt and text to speech service is also working I think.
What could be the issue?
The text was updated successfully, but these errors were encountered: