2017-06-03 1 views
1

QuickbloxのWeb RTCをテストするための簡単なアプリケーションを作成しようとしています。ここでQuickblox Javascript SDK - Web RTC経由のビデオコールは常に拒否されます

は、それが何であるかです:

  1. 私は私がクエリパラメータ(localhostの?:3001 /ユーザー= XYZ)に渡したユーザーによっては、以前の
  2. を作成した2人のQuickbloxユーザーを持って、アプリケーションは適切なユーザーの資格情報を使用してログインします(私は2人のユーザーしかいないことを覚えておいてください)。他のユーザーを対戦相手として扱います。
  3. "Call"ボタンをクリックしてセッションを開始します。ここで

ログインするためのコードです:ここで

function makeCall() { 
     console.log('[APP EVENT]', 'Calling the current session'); 

     var mediaParams = { 
     audio: false, 
     video: { 
      deviceId: undefined 
     }, 
     options: { 
      muted: true, 
      mirror: true 
     }, 
     elemId: 'localVideo' 
     }; 
     setViewState('calling'); 

     if (urlParams['user'] == 1) { 
     var calleesIds = [user2Parameters.userId]; 
     } else { 
     var calleesIds = [user1Parameters.userId]; 
     } 
     var sessionType = QB.webrtc.CallType.VIDEO; // AUDIO is also possible 
     console.log('calleesIds::', calleesIds); 
     session = QB.webrtc.createNewSession(calleesIds, sessionType); 
     console.log('Session is', session); 
     session.getUserMedia(mediaParams, function(err, stream) { 
     if (err || !stream.getVideoTracks().length) { 
      console.error('Failed to get video tracks', err); 
      session.stop({}); 
      setViewState('error'); 
     } else { 
      session.call({}, function(error) { 
      if(error) { 
       console.warn('session.call', error.detail); 
      } else { 
       console.log('Called successfully.'); 
      } 
      }); 
     } 
     }); 
    } 

はログです::

[AuthProxy] createSession Object {application_id: "46121", auth_key: "grNjnNAOUDwtC3b", nonce: 1834, timestamp: 1496471781, signature: "c79ba456143ef8dc117516c6c27878e045f1aa26"} 
    quickblox.min.js:55221 [ServiceProxy] Request: POST Object {data: undefined} 
    quickblox.min.js:55221 [ServiceProxy] Response: Object {data: "{"session":{"application_id":46121,"created_at":"2…-06-03T06:36:22Z","user_id":0,"_id":"161537831"}}"} 
    quickblox.min.js:55221 [AuthProxy] login Object {userId: 27183475, login: "USERNAME", password: "PASSWORD"} 
    quickblox.min.js:55221 [ServiceProxy] Request: POST Object {data: undefined} 
    quickblox.min.js:55221 [ServiceProxy] Response: Object {data: "{"user":{"id":27183475,"owner_id":54682,"full_name…ter_digits_id":null,"user_tags":"secret-123456"}}"} 
    quickblox.min.js:55221 [UsersProxy] update 27183475 Object {full_name: "User#2", tag_list: "secret-123456"} 
    quickblox.min.js:55221 [ServiceProxy] Request: PUT Object {data: undefined} 
    quickblox.min.js:55221 [ServiceProxy] Response: Object {data: "{"user":{"id":27183475,"owner_id":54682,"full_name…ter_digits_id":null,"user_tags":"secret-123456"}}"} 
    quickblox.min.js:55221 [ChatProxy] connect Object {jid: "[email protected]", password: "PASSWORD"} 
    quickblox.min.js:55221 [ChatProxy] Status.CONNECTING 
    quickblox.min.js:55221 [ChatProxy] Chat Protocol - WebSocket 
    quickblox.min.js:55221 [QBChat] SENT: <open xmlns=​"urn:​ietf:​params:​xml:​ns:​xmpp-framing" to=​"chat.quickblox.com" version=​"1.0">​</open>​ 
    quickblox.min.js:55221 [QBChat] RECV: <open xmlns=​"urn:​ietf:​params:​xml:​ns:​xmpp-framing" from=​"chat.quickblox.com" id=​"c4f15c35-e9f0-4d12-9430-a327dd72e217" version=​"1.0" xml:lang=​"en">​</open>​ 
    quickblox.min.js:55221 [QBChat] RECV: <stream:features xmlns:stream=​"http:​/​/​etherx.jabber.org/​streams">​…​</stream:features>​ 
    quickblox.min.js:55221 [QBChat] SENT: <auth xmlns=​"urn:​ietf:​params:​xml:​ns:​xmpp-sasl" mechanism=​"PLAIN">​…​</auth>​ 
    quickblox.min.js:55221 [QBChat] RECV: <success xmlns=​"urn:​ietf:​params:​xml:​ns:​xmpp-sasl">​</success>​ 
    quickblox.min.js:55221 [QBChat] SENT: <open xmlns=​"urn:​ietf:​params:​xml:​ns:​xmpp-framing" to=​"chat.quickblox.com" version=​"1.0">​</open>​ 
    quickblox.min.js:55221 [QBChat] RECV: <open xmlns=​"urn:​ietf:​params:​xml:​ns:​xmpp-framing" from=​"chat.quickblox.com" id=​"c4f15c35-e9f0-4d12-9430-a327dd72e217" version=​"1.0" xml:lang=​"en">​</open>​ 
    quickblox.min.js:55221 [QBChat] RECV: <stream:features xmlns:stream=​"http:​/​/​etherx.jabber.org/​streams">​…​</stream:features>​ 
    quickblox.min.js:55221 [QBChat] SENT: <iq type=​"set" id=​"_bind_auth_2" xmlns=​"jabber:​client">​…​</iq>​ 
    quickblox.min.js:55221 [QBChat] RECV: <iq xmlns=​"jabber:​client" to=​"[email protected]/​1571722472-quickblox-2693571" type=​"result" id=​"_bind_auth_2">​…​</iq>​ 
    quickblox.min.js:55221 [QBChat] SENT: <iq type=​"set" id=​"_session_auth_2" xmlns=​"jabber:​client">​…​</iq>​ 
    quickblox.min.js:55221 [QBChat] RECV: <iq xmlns=​"jabber:​client" to=​"[email protected]/​1571722472-quickblox-2693571" type=​"result" id=​"_session_auth_2">​</iq>​ 
    quickblox.min.js:55221 [ChatProxy] Status.CONNECTED at 16:36:27 
    quickblox.min.js:55221 [QBChat] SENT: <iq type=​"set" from=​"[email protected]/​1571722472-quickblox-2693571" id=​"87836bf7-f1d7-4605-8e86-3298160dd5bb:​enableCarbons" xmlns=​"jabber:​client">​…​</iq>​ 
    quickblox.min.js:55221 [QBChat] SENT: <presence xmlns=​"jabber:​client">​</presence>​ 
    quickblox.min.js:55221 [QBChat] SENT: <iq type=​"get" from=​"[email protected]/​1571722472-quickblox-2693571" id=​"9c926c20-a437-4a5a-879d-a44616fc8d86:​getRoster" xmlns=​"jabber:​client">​…​</iq>​ 
    quickblox.min.js:55221 [QBChat] RECV: <iq xmlns=​"jabber:​client" to=​"[email protected]/​1571722472-quickblox-2693571" type=​"result" id=​"87836bf7-f1d7-4605-8e86-3298160dd5bb:​enableCarbons">​</iq>​ 
    quickblox.min.js:55221 [QBChat] RECV: <iq xmlns=​"jabber:​client" to=​"[email protected]/​1571722472-quickblox-2693571" type=​"result" id=​"9c926c20-a437-4a5a-879d-a44616fc8d86:​getRoster">​…​</iq>​ 
    app.js:56 Connected to chat. 
    quickblox.min.js:55221 [UsersProxy] get Object {tags: Array(1), per_page: 100} 
    quickblox.min.js:55221 [ServiceProxy] Request: GET Object {data: undefined} 
    quickblox.min.js:55221 [QBChat] RECV: <presence xmlns=​"jabber:​client" to=​"[email protected]" from=​"[email protected]/​1571722472-quickblox-2691871">​</presence>​ 
    quickblox.min.js:55221 [QBChat] RECV: <presence xmlns=​"jabber:​client" to=​"[email protected]" from=​"[email protected]/​1571722472-quickblox-2693360">​</presence>​ 
    quickblox.min.js:55221 [QBChat] RECV: <presence xmlns=​"jabber:​client" to=​"[email protected]" from=​"[email protected]/​1571722472-quickblox-2693571">​</presence>​ 
    quickblox.min.js:55221 [ServiceProxy] Response: Object {data: "{"current_page":1,"per_page":100,"total_entries":2…r_digits_id":null,"user_tags":"secret-123456"}}]}"} 
    app.js:166 [APP EVENT] Calling the current session 
    app.js:187 calleesIds:: [26345193] 
    app.js:189 Session is n {ID: "01b6e562-e1b2-445d-a5fc-4fcf4683d98c", state: 1, initiatorID: 27183475, opponentsIDs: Array(1), callType: 1…} 
    quickblox.min.js:52658 [QBWebRTC]: Call, extension: {} 
    quickblox.min.js:52658 [QBWebRTC]: _createPeer, iceServers: {"iceServers":[{"url":"stun:stun.l.google.com:19302","urls":"stun:stun.l.google.com:19302"},{"url":"stun:turn.quickblox.com","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"stun:turn.quickblox.com"},{"url":"turn:turn.quickblox.com:3478?transport=udp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turn.quickblox.com:3478?transport=udp"},{"url":"turn:turn.quickblox.com:3478?transport=tcp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turn.quickblox.com:3478?transport=tcp"},{"url":"turn:turnsingapor.quickblox.com:3478?transport=udp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turnsingapor.quickblox.com:3478?transport=udp"},{"url":"turn:turnsingapore.quickblox.com:3478?transport=tcp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turnsingapore.quickblox.com:3478?transport=tcp"},{"url":"turn:turnireland.quickblox.com:3478?transport=udp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turnireland.quickblox.com:3478?transport=udp"},{"url":"turn:turnireland.quickblox.com:3478?transport=tcp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turnireland.quickblox.com:3478?transport=tcp"}]} 
    quickblox.min.js:52658 [QBWebRTC]: RTCPeerConnection init. userID: 26345193, sessionID: 01b6e562-e1b2-445d-a5fc-4fcf4683d98c, type: offer 
    quickblox.min.js:52763 _callInternal 
    app.js:200 Called successfully. 
    quickblox.min.js:52658 [QBWebRTC]: getAndSetLocalSessionDescription success 
    quickblox.min.js:52658 [QBWebRTC]: _startDialingTimer, dialingTimeInterval: 5000 
    quickblox.min.js:52658 [QBWebRTC]: _dialingCallback, answerTimeInterval: 0 
    quickblox.min.js:55221 [QBChat] SENT: <message to=​"[email protected]" type=​"headline" id=​"593258f4858e5a6ec7000000" xmlns=​"jabber:​client">​…​</message>​ 
    quickblox.min.js:55221 [QBChat] RECV: <message xmlns="jabber:client" to="[email protected]" id="593258f53446726f40000025" from="[email protected]/1571722472-quickblox-2691870" type="headline"><extraParams xmlns="jabber:client"><callType>1</callType><callerID>27183475</callerID><opponentsIDs><opponentID>26345193</opponentID></opponentsIDs><sessionID>01b6e562-e1b2-445d-a5fc-4fcf4683d98c</sessionID><moduleIdentifier>WebRTCVideoChat</moduleIdentifier><signalType>reject</signalType><platform>web</platform></extraParams></message> 
    quickblox.min.js:52658 [QBWebRTC]: onReject. UserID:27183475. SessionID: 01b6e562-e1b2-445d-a5fc-4fcf4683d98c 
    app.js:81 onRejectCallListener. The other person rejected the call. 
    quickblox.min.js:52664 [QBWebRTC]: Ignore 'OnReject', there is no information about peer connection by some reason. 
    traceError @ quickblox.min.js:52664 
    n.processOnReject @ quickblox.min.js:52849 
    n._onRejectListener @ quickblox.min.js:52621 
    _onMessage @ quickblox.min.js:52999 
    _onSystemMessageListener @ quickblox.min.js:51072 
    run @ quickblox.min.js:37985 
    (anonymous) @ quickblox.min.js:38206 
    forEachChild @ quickblox.min.js:37758 
    _dataRecv @ quickblox.min.js:38201 
    _onMessage @ quickblox.min.js:38823 
    quickblox.min.js:52658 [QBWebRTC]: All peer connections closed: false 
    quickblox.min.js:55221 [QBChat] RECV: <message xmlns=​"jabber:​client" to=​"[email protected]" id=​"593258f5b2eadf50f700002a" from=​"[email protected]/​1571722472-quickblox-2691871" type=​"headline">​…​</message>​ 
    quickblox.min.js:52658 [QBWebRTC]: onReject. UserID:27183475. SessionID: 01b6e562-e1b2-445d-a5fc-4fcf4683d98c 
    app.js:81 onRejectCallListener. The other person rejected the call. 
    quickblox.min.js:52664 [QBWebRTC]: Ignore 'OnReject', there is no information about peer connection by some reason. 
    traceError @ quickblox.min.js:52664 
    n.processOnReject @ quickblox.min.js:52849 
    n._onRejectListener @ quickblox.min.js:52621 
    _onMessage @ quickblox.min.js:52999 
    _onSystemMessageListener @ quickblox.min.js:51072 
    run @ quickblox.min.js:37985 
    (anonymous) @ quickblox.min.js:38206 
    forEachChild @ quickblox.min.js:37758 
    _dataRecv @ quickblox.min.js:38201 
    _onMessage @ quickblox.min.js:38823 
    quickblox.min.js:52658 [QBWebRTC]: All peer connections closed: false 
    quickblox.min.js:55221 [QBChat] RECV: <message xmlns=​"jabber:​client" to=​"[email protected]" id=​"593258f53446726f40000025" from=​"[email protected]/​1571722472-quickblox-2691870" type=​"headline">​…​</message>​ 
    quickblox.min.js:52658 [QBWebRTC]: onReject. UserID:26345193. SessionID: 01b6e562-e1b2-445d-a5fc-4fcf4683d98c 
    app.js:81 onRejectCallListener. The other person rejected the call. 
    quickblox.min.js:52658 [QBWebRTC]: _clearDialingTimer 
    quickblox.min.js:52658 [QBWebRTC]: All peer connections closed: true 
    app.js:105 onSessionCloseListener: n {ID: "01b6e562-e1b2-445d-a5fc-4fcf4683d98c", state: 2, initiatorID: 27183475, opponentsIDs: Array(1), callType: 1…} 
    quickblox.min.js:52658 [QBWebRTC]: onIceConnectionStateCallback: closed 
    app.js:109 All states Object {UNDEFINED: 0, CONNECTING: 1, CONNECTED: 2, FAILED: 3, DISCONNECTED: 4…} 
    app.js:110 Connection state is # 5 
私はボタンを "コール" をクリックすると、ここで

function connectToChat(callback) { 
     setViewState('initializing'); 
     QB.createSession(function(err, res) { 
      if (err) { 
      return console.error('connectToChat', err); 
      } else { 
      var userParameters 
      if (urlParams['user'] == 1) { 
       userParameters = user1Parameters; 
      } else { 
       userParameters = user2Parameters; 
      } 
      $('#my_id').html(userParameters.userId); 
      QB.login(userParameters, function(err, user) { 
       if (err) { 
       return console.error('QB.login', err); 
       } else { 
       var userName = urlParams['user'] == 1 ? 'User#1' : 'User#2'; 
       QB.users.update(userParameters.userId, { 
        'full_name': userName, 
        'tag_list': ROOM_TAG, 
       }, function(updateError, updateUser) { 
        $('#current-user').html('Logged in as : ' + userParameters.userId + ' - ' + userName); 
        if(updateError) { 
         console.error('APP [update user] Error:', updateError); 
        } else { 
         QB.chat.connect({ 
         jid: QB.chat.helpers.getUserJid(userParameters.userId, APP_ID), 
         password: userParameters.password, 
         }, callback); 
        } 
       }); 
       } 
      }); 
      } 
     }) 
     } 

コードです

ご覧のとおり、Quickbloxは次の行があるため、呼び出しを管理します。app.js:200 Cal成功した

相手側がコールを受信して​​、このコードは、その端に実行されます。ここでは

QB.webrtc.onCallListener = function(receivingSession, extension) { 
     console.log('onCallListener. Someone else is calling me.'); 
     setViewState('receiving-call'); 
    }; 

は、他の側からのログです:あなたが見ることができるように

onCallListener. Someone else is calling me. 
    quickblox.min.js:52658 [QBWebRTC]: _createPeer, iceServers: {"iceServers":[{"url":"stun:stun.l.google.com:19302","urls":"stun:stun.l.google.com:19302"},{"url":"stun:turn.quickblox.com","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"stun:turn.quickblox.com"},{"url":"turn:turn.quickblox.com:3478?transport=udp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turn.quickblox.com:3478?transport=udp"},{"url":"turn:turn.quickblox.com:3478?transport=tcp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turn.quickblox.com:3478?transport=tcp"},{"url":"turn:turnsingapor.quickblox.com:3478?transport=udp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turnsingapor.quickblox.com:3478?transport=udp"},{"url":"turn:turnsingapore.quickblox.com:3478?transport=tcp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turnsingapore.quickblox.com:3478?transport=tcp"},{"url":"turn:turnireland.quickblox.com:3478?transport=udp","user 
    name":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turnireland.quickblox.com:3478?transport=udp"},{"url":"turn:turnireland.quickblox.com:3478?transport=tcp","username":"quickblox","credential":"baccb97ba2d92d71e26eb9886da5f1e0","urls":"turn:turnireland.quickblox.com:3478?transport=tcp"}]} 
    quickblox.min.js:52658 [QBWebRTC]: RTCPeerConnection init. userID: 27183475, sessionID: c7bc18fc-746f-445b-b631-40e1cfa6ca85, type: answer 
    quickblox.min.js:52658 [QBWebRTC]: _startAnswerTimer 
    quickblox.min.js:55219 [QBChat] RECV: <message xmlns=​"jabber:​client" to=​"[email protected]/​1571722472-quickblox-2693645" from=​"[email protected]" type=​"headline" id=​"5932598f3446726f40000026">​<sent xmlns=​"urn:​xmpp:​carbons:​2">​<forwarded xmlns=​"urn:​xmpp:​forward:​0">​<message xmlns=​"jabber:​client" to=​"[email protected]" id=​"5932598f3446726f40000026" from=​"[email protected]/​1571722472-quickblox-2691870" type=​"headline">​<extraParams xmlns=​"jabber:​client">​<callType>​1​</callType>​<callerID>​27183475​</callerID>​<opponentsIDs>​<opponentID>​26345193​</opponentID>​</opponentsIDs>​<sessionID>​c7bc18fc-746f-445b-b631-40e1cfa6ca85​</sessionID>​<moduleIdentifier>​WebRTCVideoChat​</moduleIdentifier>​<signalType>​reject​</signalType>​<platform>​web​</platform>​</extraParams>​</message>​</forwarded>​</sent>​</message>​ 
    quickblox.min.js:52658 [QBWebRTC]: onReject. UserID:26345193. SessionID: c7bc18fc-746f-445b-b631-40e1cfa6ca85 
    app.js:80 onRejectCallListener. The other person rejected the call. 
    quickblox.min.js:52664 [QBWebRTC]: Ignore 'OnReject', there is no information about peer connection by some reason 

、コールをほぼ直ちに拒否メッセージが続きます。

私はこれを数日間把握しようとしていますが、解決策はまだ見つかりませんでした。

私はgithubのサンプルのwebrtcアプリケーションも見てきましたが、私のコードにどこに問題があるのか​​を特定していません。

+0

あなたは解決策を見つけましたか? –

答えて

0

ローカル(同じPC)にビデオ通話を練習している場合、これが動作しない場合があります@krunal、 は、私はそれは文句を言わない私がコールを受け入れることができ、同じ問題を持っていた、

quickbloxは、正確なエラーを与えますコンソール、

[QBWRTC] Can't accept the call, there is no information about peer connection by some reason 

は、二つの異なるPCでそれを試して、呼び出し、 は、このことができます願っています。

+0

ありがとうございました。お返事ありがとうございました。 –

関連する問題