2015-12-13 30 views
1

我通過Twilio發送語音留言,並指定所有狀態的回撥URL,但我不認爲它實際上是因爲我無法找出回撥文件應該是什麼樣子而被調用的。回調文件尋找什麼?它是否被髮送進去?我的「callbackfilename」代碼是什麼樣的?我無法在任何地方找到該信息。感謝Twilio statusCallback文件是什麼樣的?

這些都是我的PARAMS:

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"; 

回答

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其中記錄了請求,以便您可以輕鬆地對其進行檢查。

讓我知道這是否有幫助。