问题
I have Twilio API with flask and python as a development platform, i'm following.
TwiML TwiML <Stream>
Now i have the server endpoint to receive the message in JSON and at the end i can parse the bytes out of it.
But just like the API says it gets connected and gets disconnected if it does not have a proceeding instruction in our case TwiML Verb. The most obvious verb seems to be a <Dial>
verb.
here is the referrence https://stackoverflow.com/a/36315684/6215280
Now our main goal is to just receive bytes from the caller and send him back the processed data. But here since the call gets disconnected i am limited to call to other person to keep the TwiML Bin running.
I have looked for API and haven't found any way to keep the <Stream>
in loop.
Is there any way without <Dial>
to person B i can receive and send bytes.
Any help would be appreciated @philnash
Thanks
回答1:
In the Twilio Media Streams github repo, a TwiML Pause verb is used for that purpose, if you don't want to Dial or Conference.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Start>
<Stream url="wss://<ngrok url>/"></Stream>
</Start>
<Pause length="40"/>
</Response>
来源:https://stackoverflow.com/questions/58797589/twiml-stream-wont-stream-constantly