TwiML< Stream>不会持续流 [英] TwiML <Stream> won't stream constantly

查看:60
本文介绍了TwiML< Stream>不会持续流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有烧瓶和python的Twilio API作为开发平台,

I have Twilio API with flask and python as a development platform, i'm following.

TwiML TwiML < Stream>

TwiML TwiML <Stream>

现在,我拥有服务器端点来接收JSON消息,最后我可以解析出其中的字节.但是就像API所说的那样,如果在我们的案例TwiML Verb中没有继续执行的指令,它将被连接并断开连接.最明显的动词似乎是< Dial> 动词.

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.

此处是引荐 https://stackoverflow.com/a/36315684/6215280

现在,我们的主要目标是仅从调用方接收字节并将其发送回处理后的数据.但是在这里,由于呼叫被断开,所以我只能打给其他人以保持TwiML Bin的运行.

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.

我一直在寻找API,还没有找到使< Stream> 保持循环的任何方法.没有< Dial> ,有人B可以接收和发送字节吗?

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.

@philnash提供任何帮助

Any help would be appreciated @philnash

谢谢

推荐答案

Twilio Media Streams github存储库中,如果您不想进行拨号或会议,则使用TwiML暂停动词来实现此目的.

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>

这篇关于TwiML&lt; Stream&gt;不会持续流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆