Skip to content
yuanxiaohua edited this page Nov 23, 2017 · 1 revision

消息交互

VALUE DESCRIPTION
canceled was canceled via the REST API before it was answered.
completed The called party answered the call and was connected to the caller.
answered The called party answered the call and was connected to the caller, returned when dialing a conference.
busy Twilio received a busy signal when trying to connect to the called party.
failed was unable to route to the given phone number. This is frequently caused by dialing a properly formatted but non-existent phone number.
no-answer The called party did not pick up before the timeout period passed.

基本交互模型

呼入

sequenceDiagram
平台->>应用: HTTP Req(呼入通知&TwiML请求)
应用->>平台: HTTP Res(TwiML)
平台->>应用: HTTP Req(事件通知&TwiML请求)
应用->>平台: HTTP Res(TwiML)

当分配给应用的号码上有呼叫或短信进入时,平台将会通过号码上设置的URL,请求初始的TwiML文档;然后执行TwiML文档中的相关命令,比如录音,向主叫放音,提示主叫按键输入等等。

TwiML与HTML类似。一次只有一个TwiML文档被呈现给主叫,但是多个文档可以被“链”起来构建复杂的IVR应用。

你可以通过门户网站或REST API来配置接受Twilio请求的URLs和HTTP方法。

平台通过HTTP(GET或POST)向应用请求TwiML文档。我们将此称为TwiML请求。

初始为TwiML请求是在平台中静态配置的(通过门户控制台),在收到呼叫后,平台就会向应用发送TwiML请求。

在账户里创建一个Twilio Application能使你更容易的配置这些URLs。不用将URLs直接赋予电话号码的,而是将它们赋予一个应用,然后将应用与号码关联


Clone this wiki locally