我使用twilio client
使&接受來自瀏覽器的調用。但是,當我運行接受頁面,我得到一個JavaScript錯誤的瀏覽器 -Twilio客戶端在接受客戶端調用時出錯
Uncaught Twilio.Exception: 401: Unable to determine account.
@行 - twilio.js:2683
下面是從我這就是控制代碼顯示接受呼叫時被執行頁/視圖 -
def prepare_accept_call
# create the twilio capability object
capability = Twilio::Util::Capability.new TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN
# guessing this is not needed for accepting calls, but added to see if it fixes my issue and it doesnt :(
capability.allow_client_outgoing TWILIO_APP_SID
capability.allow_client_incoming "some-client-identifier"
# use this token for client JS - Twilio.Device.setup("#{@token}");
@token = capability.generate
end
注 - :我能夠成功地顯示出呼叫頁面,沒有JavaScript錯誤 - 當我點擊呼叫按鈕我得到的閃光燈話筒允許彈出窗口。沒有401.所以猜測我的鑰匙,令牌等都可以。
任何想法可能發生在這裏?
你在哪裏指定你的賬戶ID和令牌生成令牌? –
就在這裏 - Twilio :: Util :: Capability.new TWILIO_ACCOUNT_SID,TWILIO_AUTH_TOKEN – kapso
你確定TWILIO_APP_SID是否正確? – CaseySoftware