Python
Create the WebSocket
Create a route handler for the /socket route. This listens for a message event which is raised every time the WebSocket receives audio from the call. Your application should respond by echoing the audio back to the caller with the send() method:
@sock.route("/socket", methods=["GET"])
def echo_socket(ws):
while True:
data = ws.receive()
ws.send(data)
Connect to a WebSocket
Connect an inbound call to a WebSocket with the Voice API
手順
1
Introduction2
Prerequisites3
Buy a Vonage number4
Create a Voice Application5
Link a Vonage number6
Create the project7
Write your answer webhook8
Write your event webhook9
Create the WebSocket10
Test your application11
Conclusion12
What's next?