whatsapp应用拥有比较优秀的VOIP功能,主要采用SRTP实现安全的语音通话功能。支持语音,视频通话。使用自有协议实现信令传输。下面简要分析一下主要流程
1、语音呼出:主要确定可能音频参数,传输端对端的加密因子
<call to="6285601013863@s.whatsapp.net" id="DAF0CFF791C14F478AA650E5D2777521">
<offer call-creator="6285763694005.0:0@s.whatsapp.net" call-id="7BE703846B1D4DE5A2AFA5E4711207D2">
<audio rate="8000" enc="opus">
</audio>
<audio rate="16000" enc="opus">
</audio>
<net medium="3">
</net>
<capability ver="1">
【6】0104f70bce1a
</capability>
<enc v="2" type="pkmsg">
【182】3308f505122105264054c9b456af057c9c65cb4ab84b1bd5b4e26da402c915e7c3bc3b20edb84b1a21055c0e3ce541ae3fbfa730eb505bc862fc6b76c6cd75f8408f01788bc42fcf446d2262330a21055b00fb3cc9fa547bc4c5e8cff2f6e253c57508670daa202356d13bd6653c13521000180022303e41c5b2f1b97a147fbd05aa0c8ab9404b8fdea26172771dc29a9b92780704c1c4b45fe7c55e7b742f2042d317a03155efd3e3a1e6e2726b28a4fecab0023000
</enc>
<encopt keygen="2">
</encopt>
</offer>
</call>
2、中继上报:下发可能的中继服务分期节点。
<call to='6283821499733@s.whatsapp.net' id='7D573F69F341D96724F2846CC442978B'><relaylatency call-creator='6283835112426.0:0@s.whatsapp.net' call-id='B128928C127B7C18621DA21E1D34B2B4'><te latency='33554913'>nfDZPg2W</te></relaylatency></call>
3、中继确认:确认最优的中继服务器节点。
<call to='6283821499733@s.whatsapp.net' id='FBFAD9F697C19491F35B2F3D4061B9AC'><transport call-creator='6283835112426.0:0@s.whatsapp.net' call-id='B128928C127B7C18621DA21E1D34B2B4'><te priority='2'>GhoaAp6v</te><te priority='1'>Z9PmMs9d</te><net medium='2'/></transport></call>
4、语音接听:应答方允许接受通话
<call from='6283821499733@s.whatsapp.net' version='2.22.24.21' platform='smba' id='D83E431E98754EBA913A852A7AF0EB87' t='1669869127'><accept call-creator='6283835112426@s.whatsapp.net' call-id='B128928C127B7C18621DA21E1D34B2B4'><audio rate='16000' enc='opus'/><te priority='2'>GhoaL7S3</te><te priority='1'>ZyuigLpv</te><net medium='2'/><encopt keygen='2'/></accept></call>
5、SRTP流传输:从前面的传输过程中,确定SRTP的秘钥,加密音频数据
6、语音中断:通过结束时,终止双方的通话
<call from='6283821499733@s.whatsapp.net' id='FC2C7B9E44CA0D5A6E42291C4DD17BBE' t='1669869131'><terminate duration='4097' audio_duration='4097' call-creator='6283835112426@s.whatsapp.net' call-id='B128928C127B7C18621DA21E1D34B2B4'/></call>