Twilio statusCallback文件是什么样的?

时间:2015-12-13 19:45:15

标签: twilio

我正在通过Twilio发送语音消息并指定所有状态的回调网址,但我认为它实际上没有被调用,因为我无法找到回调文件看起来应该是什么样的。回调文件的用途是什么?是发送的表单吗?我的“callbackfilename”代码是什么样的?我无法在任何地方找到这些信息。感谢

这些是我的参数:

 params["StatusCallback"]= "http://XXXX.com/events/callbackfilename";
 params["StatusCallbackMethod"]="POST";
 params["StatusCallbackEvent"]="initiated"; 
 params["StatusCallbackEvent"]="ringing";
 params["StatusCallbackEvent"]="answered"; 
 params["StatusCallbackEvent"]="completed"; 
 params["IfMachine"] = "Continue";

1 个答案:

答案 0 :(得分:0)

Twilio开发者传道者在这里。

StatusCallback与传入呼叫的​​TwiML请求非常相似。它以表单编码数据(application/x-www-form-urlencoded)的形式发送,并包含所有the regular parameters sent in an incoming call request

您还获得bunch of bonus parameters, listed here。您也可以在下面看到这些参数:

CallStatus          A descriptive status for the call. The value is one of queued, initiated, ringing, in-progress, busy, failed, or no-answer. See the CallStatus section for more details.
CallDuration        The duration in seconds of the just-completed call. Only present in the completed event.
RecordingUrl        The URL of the phone call's recorded audio. This parameter is included only if Record=true is set on the REST API request and does not include recordings from <Dial> or <Record>. RecordingUrl is only present in the completed event.
RecordingSid        The unique ID of the Recording from this call. RecordingSid is only present in the completed event.
RecordingDuration   The duration of the recorded audio (in seconds). RecordingDuration is only present in the completed event.
Timestamp           The timestamp when the event was fired, given as UTC in RFC 2822 format.
CallbackSource      A string that describes the source of the webhook. This is provided to help disambiguate why the webhook was made. On Status Callbacks, this value is always call-progress-events.
SequenceNumber      The order in which the events were fired, starting from 0. Although events are fired in order, they are made as separate HTTP requests and there is no guarantee they will arrive in the same order.

如果您想检查这些参数以及它们是否已被发送,您可以设置类似RequestBin的内容来记录请求,以便您可以轻松地检查它们。

如果有帮助,请告诉我。