lukeweber / webrtc-jingle-client

Webrtc audio + jingle protocol brought to IOS and Android.
https://groups.google.com/forum/?fromgroups#!forum/webrtc-jingle
BSD 3-Clause "New" or "Revised" License
334 stars 137 forks source link

Mismatched call initialisation on iOS and Android #118

Open modohash opened 10 years ago

modohash commented 10 years ago

Hi,

First of all, thanks for the project, it's great work.

I'm working on a project and we've integrated the iOS voip library. We're now trying to get an android version up and running. We've run into a small issue. Calls can be made from iOS to iOS and from iOS to android, but outgoing calls from android don't seem to be working. The message to initiate a call from iOS looks like:

 <iq to="<jid>/voice" type="set" id="20">
   <jingle xmlns="urn:xmpp:jingle:1" action="session-initiate" sid="8587747108303529835" initiator="">
     <content name="audio" creator="initiator">
       <description xmlns="urn:xmpp:jingle:apps:rtp:1" media="audio" ssrc="3046155857">
         <payload-type id="103" name="ISAC" clockrate="16000"/>
         <payload-type id="105" name="CN" clockrate="16000"/>
         <payload-type id="126" name="telephone-event" clockrate="8000"/>
         <rtcp-mux/>
         <rtp-hdrext uri="urn:ietf:params:rtp-hdrext:ssrc-audio-level" id="1"/>
       </description>
       <transport xmlns="http://www.google.com/transport/p2p"/>
     </content>
   </jingle>
 </iq>

This works great. On android the message looks like:

<iq to="<jid>/42610935441390825380324119" type="set" id="17">
  <jingle xmlns="urn:xmpp:jingle:1" action="session-initiate" sid="8165965449859209516" initiator="<jid>/voice">
    <content name="audio" creator="initiator">
      <description xmlns="urn:xmpp:jingle:apps:rtp:1" media="audio" ssrc="1238193034">
        <payload-type id="103" name="ISAC" clockrate="16000"/>
        <payload-type id="105" name="CN" clockrate="16000"/>
        <payload-type id="126" name="telephone-event" clockrate="8000"/>
        <encryption>
          <crypto tag="0" crypto-suite="AES_CM_128_HMAC_SHA1_32" key-params="inline:qOTM0MWD30G5yAqMQUul20pONJnH+Qjun3XiEMzA"/>
          <crypto tag="1" crypto-suite="AES_CM_128_HMAC_SHA1_80" key-params="inline:Vsf90jJYGzoloyyLJBL7jjFzAzYGdZXocdNEfFnM"/>
         </encryption>
         <rtcp-mux/>
         <rtp-hdrext uri="urn:ietf:params:rtp-hdrext:ssrc-audio-level" id="1"/>
       </description>
       <transport xmlns="http://www.google.com/transport/p2p"/>
     </content>
   </jingle>
   <session xmlns="http://www.google.com/session" type="initiate" id="8165965449859209516" initiator="<jid>/voice">
     <description xmlns="http://www.google.com/session/phone">
       <payload-type xmlns="http://www.google.com/session/phone" id="103" name="ISAC" clockrate="16000"/>
       <payload-type xmlns="http://www.google.com/session/phone" id="105" name="CN" clockrate="16000"/>
       <payload-type xmlns="http://www.google.com/session/phone" id="126" name="telephone-event" clockrate="8000"/>
       <src-id xmlns="http://www.google.com/session/phone">
         1238193034
       </src-id>
       <rtp:encryption xmlns:rtp="urn:xmpp:jingle:apps:rtp:1">
         <rtp:crypto tag="0" crypto-suite="AES_CM_128_HMAC_SHA1_32" key-params="inline:qOTM0MWD30G5yAqMQUul20pONJnH+Qjun3XiEMzA"/>
         <rtp:crypto tag="1" crypto-suite="AES_CM_128_HMAC_SHA1_80" key-params="inline:Vsf90jJYGzoloyyLJBL7jjFzAzYGdZXocdNEfFnM"/>
         <usage/>
       </rtp:encryption>
     </description>
   </session>
 </iq>

This seems to be ignored by the server. Is it something to do with srtp being enabled on android or something? If so, how can I disable it? Or is it to do with a protocol mismatch? Jingle vs. Gingle or something.

Any help appreciated.

Chris

chathudan commented 10 years ago

SRTP not working on iOS see issues/64 , did you try android to android ?

modohash commented 10 years ago

Android to android doesn't work either, it seems that the ejabberd server that we're using for XMPP is ignoring the request to set up a voice call from android devices due to the message not being in the same format as the iOS client. I can see the initial message coming in to the server but after that there is no output/error. The actual error message I'm seeing on the android side is:

01-28 12:40:46.338: I/libjingle(28753): ClientSignalingThread::OnSessionError ERROR_ACK_TIME - no ack response to signaling, client not available 01-28 12:40:46.338: I/libjingle(28753): Session:17964329291882738664 Old state:STATE_SENTINITIATE New state:STATE_SENTTERMINATE Type:urn:xmpp:jingle:apps:rtp:1 Transport:http://www.google.com/transport/p2p 01-28 12:40:46.338: I/libjingle(28753): ClientSignalingThread::OnMessage: MSG_CALL_ERROR 01-28 12:40:46.348: E/CallManagerImpl(28753): call error ------------------, callid -113750439error 6 01-28 12:40:46.348: I/libjingle(28753): ClientSignalingThread::OnSessionState STATE_SENTTERMINATE - sent terminate (any time / either side)

Do you know how to force the android client to initiate the call in the same manner as the iOS devices?

TangTieuLinh commented 10 years ago

Hi chris-mccabe1988, I am doing voice chat application with webrtc-jingle-client. I have the same problem with you. Have you solved the problem yet ? Can you help me ? Thank you in advance.

chathudan commented 10 years ago

Are the two devices on two different networks ?

TangTieuLinh commented 10 years ago

No, aren't. I tested two devices on same network and i login with account is not Gmail account. When i login with Gmail account, I can call from android to android devices. But I login with account is not Gmail, I only call from IOS to IOS devices. And the error message from logcat on android device is same to you.