TwiML <Stream> won't stream constantly

元气小坏坏 提交于 2019-12-24 03:45:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!