2016-01-20 217 views
0

我正在瀏覽器瀏覽器呼叫,成功呼叫建立後,呼叫自動斷開。接收器沒有獲得執行的傳入功能。誰能幫我嗎?Twilio呼叫自動斷開

Twilio.Device.setup(token, { debug : true}); 

Twilio.Device.ready(function (device) { 
    console.log("Client '' is ready"); 
    //! Ready 
}); 

Twilio.Device.error(function (error) { 
    console.log("Error: " + error.message); 

}); 

Twilio.Device.connect(function (conn) { 
    console.log("Successfully established call"); 
}); 

Twilio.Device.disconnect(function (conn) { 
    console.log("From:" + conn.parameters.From); 
    console.log("To:" + conn.parameters.To); 
    console.log("Call ended"); 

}); 

Twilio.Device.incoming(function (conn) { 
    console.log("Incoming connection from " + conn.parameters.From); 
     // accept the incoming connection and start two-way audio 

     conn.accept(); 

}); 

function call(id) { 
    console.log('calling started! to ' + id); 
    callto = id; 
    params = {"client": id}; 
    Twilio.Device.connect(params); 

} 

我正在使用套接字來連接呼叫者!當第二個用戶進入場景時,發送者向接收者發出呼叫。傳入功能在接收端不起作用。

控制檯登錄:

[Device] Setting up PStream 
twilio.min.js (line 58) 
[WSTransport] Opening socket 
twilio.min.js (line 58) 
[WSTransport] attempting to connect 
twilio.min.js (line 58) 
[Device] Registering to eventStream with url: wss://matrix.twilio.com/2012-02-09/?AccessToken=eyJ&feature=publishPresence 
twilio.min.js (line 58) 
[Matrix] Attempting to connect to wss://matrix.twilio.com/2012-02-09/?AccessToken=eyJ&feature=publishPresence... 
twilio.min.js (line 58) 

[WSTransport] Socket opened 
twilio.min.js (line 58) 
[PStream] Setting token and publishing listen 
twilio.min.js (line 58) 
[Matrix] Socket opened... sending ready signal 
twilio.min.js (line 58) 
[Device] Stream is ready 
twilio.min.js (line 58) 
Client '' is ready 
test (line 3718) 
FIREBASE WARNING: 
calling to user 12232343 
test (line 3749) 
[Twilio.PeerConnection] signalingState is "have-local-offer" 
twilio.min.js (line 58) 
[Twilio.PeerConnection] signalingState is "stable" 
twilio.min.js (line 58) 
Successfully established call 
test (line 3728) 
[Twilio.PeerConnection] iceConnectionState is "checking" 
twilio.min.js (line 58) 
[Twilio.PeerConnection] iceConnectionState is "connected" 
twilio.min.js (line 58) 
[Connection] Received HANGUP from gateway 
twilio.min.js (line 58) 
[Connection] Disconnecting... 
twilio.min.js (line 58) 
[Twilio.PeerConnection] iceConnectionState is "closed" 
twilio.min.js (line 58) 
[Twilio.PeerConnection] signalingState is "closed" 
twilio.min.js (line 58) 
From:undefined 
test (line 3733) 
To:undefined 
test (line 3734) 
Call ended 
test (line 3735) 
calling started! to 12122323 
test (line 3749) 
[Twilio.PeerConnection] signalingState is "have-local-offer" 
twilio.min.js (line 58) 
[Twilio.PeerConnection] signalingState is "stable" 
twilio.min.js (line 58) 
Successfully established call 
test (line 3728) 
[Twilio.PeerConnection] iceConnectionState is "checking" 
twilio.min.js (line 58) 
[Twilio.PeerConnection] iceConnectionState is "connected" 
twilio.min.js (line 58) 
[Connection] Received HANGUP from gateway 
twilio.min.js (line 58) 
[Connection] Disconnecting... 
twilio.min.js (line 58) 
[Twilio.PeerConnection] iceConnectionState is "closed" 
twilio.min.js (line 58) 
[Twilio.PeerConnection] signalingState is "closed" 
twilio.min.js (line 58) 
From:undefined 
test (line 3733) 
To:undefined 
test (line 3734) 
Call ended 

在客戶端的另一面:

The value "0.6;" for key "initial-scale" was truncated to its numeric prefix. 
    test:5 The value "0.5;" for key "minimum-scale" was truncated to its numeric prefix. 
    test:5 The key "maximum-scale:0.7;" is not recognized and ignored. 
    test:5 Error parsing a meta element's content: ';' is not a valid key-value pair separator. Please use ',' instead. 
    test:1845 Client '' is ready 
    firebase.js:36 FIREBASE WARNING: 
+0

您能否以這種方式從調用中共享控制檯日誌?謝謝! – philnash

+0

@philnash我添加了twilio的控制檯 –

+0

Thanks @Rahul。那裏的調用結束表明,連接關閉了From和To的未定義參數,這很奇怪。你有來自通話另一端的控制檯日誌嗎? – philnash

回答

2

固定!由於該網站是安全的,通過瀏覽器製作了一個新的TwiML應用程序,新的請求URL爲receivemake calls。感謝@philnash幫助我解決問題