Fixed path for telephone/handler in handle_incoming_call (#280)

Co-authored-by: Freddy Boulton <41651716+freddyaboulton@users.noreply.github.com>
This commit is contained in:
Aman Chauhan
2025-04-23 22:09:45 +05:30
committed by GitHub
parent 16bfb5be13
commit f3308b6e81

View File

@@ -785,7 +785,8 @@ class Stream(WebRTCConnectionMixin):
response = VoiceResponse()
response.say("Connecting to the AI assistant.")
connect = Connect()
connect.stream(url=f"wss://{request.url.hostname}/telephone/handler")
path = request.url.path.removesuffix("/telephone/incoming")
connect.stream(url=f"wss://{request.url.hostname}{path}/telephone/handler")
response.append(connect)
response.say("The call has been disconnected.")
return HTMLResponse(content=str(response), media_type="application/xml")