用户名: 密码: 验证码:
基于Android终端的小型VoIP系统设计与实现
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
VoIP是一种利用IP网络来传输话音的业务,它在为用户提供高质量通话服务的同时还能大大降低用户的通话成本。随着2010年初我国工信部宣布解除对手机Wi-Fi入网的限制,带宽将不再是阻碍移动终端发展的问题,VoIP也以其低廉的价格越来越多的受到用户的青睐。然而近两年来,智能手机平台发展的势头迅猛,由于其性能强劲,可以支持更多更复杂的多媒体业务,这就导致传统的,以单一话音业务为主的VoIP业务已经不再能满足用户的需求,用户更希望能享受到一些高级的业务如视频通话,视频短信所带来的乐趣。因此,基于多领域业务的融合已成为目前VoIP发展的一个重要趋势。
     出于上述考虑,本文设计并实现了一个小型的VoIP系统。该系统支持位于不同内网用户的P2P语音通话、视频通话及收发视频短信的功能。系统实现主要分为三大部分,即协议的制定,服务器的设计和移动终端功能模块的开发。本文选用Android作为移动终端的操作系统,原因是Android是目前智能手机操作系统中功能最强大,开放性最好的系统,使开发人员可以灵活的根据自己的需求而开发特定的功能。在协议方面,本文采用会话初始协议(SIP)作为呼叫信令,负责建立端到端的通话。在媒体流的传输方面,本文选用H.264作为视频编解码标准,并选用实时传输协议(RTP)负责媒体数据的传输。在防火墙的穿透问题上,本文采用STUN协议(RFC 5389)配合UDP打洞的方法完成NAT的穿透。在服务器的设计方面,本文充分考虑到实际应用中的情况,采用Windows下效率最高的完成端口(ICOP)作为服务器内核来处理大量的并发请求,同时综合使用了BOOST库,设计模式等技术来优化服务器的设计。
     本文首先对系统结构、用到的工具以及系统设涉及的基本知识做了简单的介绍。然后针对系统中重要环节的实现做了深入的分析并给出了实现方法,这些环节包括,高效的UDP服务器设计方法,NAT的穿透方法以及Android下H.264视频传输的方法。最后本文给出了各个功能模块的实现过程,并展示了实验结果。本文对于在Android系统上开发VoIP业务有一定的借鉴作用。
VoIP is a new kind of telecommunication technique which uses IP network to transmit the voice signal. One of Its many advantages is that it can greately reduce the cost of communication without undermining the quality of services. In year 2010, China has removed the network access limits through Wi-Fi. Which means the bandwidth is no longer the problem for mobile phone. Thus, VoIP businesses become more and more attractive to people. However, in these two years, the share of smart phone in market has growed up very quickly, which results in a phenomenon that the traditional VoIP business, especially the voice business, can no longer meet the requirements of people. Therefore, the integration of multi-domain business is becoming a new trend in the development of VoIP business.
     With such an opinion in mind, this paper design and implement a small VoIP system. This system can provide both voice and video calling services. Besides, it can also provide IM services by allowing users to send video based message. The implemention of this system is divided into three parts which are protocol, server and client. This paper chooses Android as the client OS for a very simple reason that is Android is open to everyone, anyone can use it for its own purpose. In the realm of protocol, this paper choose to use SIP as the main session control protocol. To wrap media data, this paper uses RTP because it is widely used in media streaming. Refering to the STUN protocol, this paper implement a unique method to solve the NAT traversal problem. In video codec, H.264 is chosen. To realize the video message preview, RTSP protocol is implemented on the IM server. Since in the real case, there might be hundreds of thousand clients try to connect to the server at the same time, the design of socket I/O model becomes much more important. To solve this case, this paper implements the IOCP mechanism to core layer of the server and uses lots of other techniques to optimize server's architechture, such as BOOST library, design patterns, etc.
     This paper first briefly introduces the architechture of the system and some knowledge background related to the system. Then focuses on three important issues and discusses them in detail. These issuals are method to realize a high performance UDP server, NAT traversal technique and video transmitting based on H.264. At last, this paper presents the realization of each model and demonstrate the experiment results. This paper can be a reference to those who want to develop VoIP business on Android.
引文
[1]百度互联网事业部.移动互联网发展趋势报告[EB/OL].百度在线网络技术(北京)有限公司.2011,7.
    [2]宙震洲.五大移动应用前景石好[J].世界电信.2011,1(2):18-21.
    [3]刘章詟,舒华英,董舒翼.三网融合后运营商应对国际放音业务竞争的策略研究[C].Proceedings of 2011 National Teaching Seminar on Cryptography and Information Security,中国广东珠海,2011.
    [4]杨丰盛Android技术内幕(系统卷)[M].北京:机械工业出版社,2011.
    [5]邓凡平.深入理解Android(卷1)[M].北京:机械工业出版社,2011.
    [6]ROSENBERG J, SCHULZRINNE H, et al. SIP:Session Initiat ion Protocol [S]. IETF RFC 3261, 2002.
    [7]HANDLEY M, et al. SDP:Session Description Protocol [S]. IETF RFC 4566,2011.
    [8]SCHULZRINNE H, et al. Real Time Streaming Protocol 2. 0(RTSP) [S]. IETF RFC 2326,2011.
    [9]SCHULZRINNE H, CASNER S, FREDERICK R, et al. RTP:A Transport Protocol for Real-Time Applications [S].IETF RFC 3550,2003.
    [10]PRZYGIENDA. T, et al. Reserved Type, Length and Value (TLV) Codepoints in Intermediate System to Intermediate System [S]. IETF RFC 3359,2002.
    [11]余兆明,查日勇,等.图像编码标准H.264技术[M].北京:人民邮电出版社,2006.
    [12]沈兰荪,卓力.小波编码与网络视频传输[M].北京:科学出版社,2005.
    [13]毕厚杰.新一代视频压缩编码标准[M].北京:人民邮电出版社,2005.
    [14]S. WENGER, et al. RTP Payload Format for H.264 Video [S]. IETF RFC 3984,2005.
    [15]RICHTER J, NASARRE C.Windows核心编程(第五版)[M].北京:清华大学出版社,2008.
    [16]程远忠,杜平安.Winsock中的I/0模型探讨[J].计算机工程.2001,27(1):178-180.
    [17]肖舸0 bug:C/C++商用工程之道[M].北京:电子工业出版社,2010.
    [18]BOOST. http://www.boost.org/.
    [19]罗剑锋.BOOST程序库完全开发指南[M].北京:电子工业出版社,2010.
    [20]GAMMA E, et al.设计模式[M].北京:机械工业出版社,2010.
    [21]SRISURESH. P, et al. Traditional IP Network Address Translator(Traditional NAT) [S]. IETF RFC 3022,2001.
    [22]JENNINGS. C, et al. Network Address Translation(NAT) Behavioral Requirements for Unicast UDP [S]. IETF RFC 4787,2007.
    [23]张春红,裘晓峰,等.P2P技术全面解析[M].北京:人民邮电出版社,2010.
    [24]ROSENBERG J, et al. STUN-Simple Traversal of User Datagram Protocol (UDP) Through Network Address Translators (NATs) [S]. IETF RFC 3489,2003.
    [25]ROSENBERG J, et al. Session Traversal Utilities for NAT (STUN) [S]. IETF RFC 5389, 2008.
    [26]SRISURESH. P, et al. State of Peer-to-Peer (P2P) Communication across Network Address Translators (NATs) [S]. IETF RFC 5128,2008.
    [27]MACDONALD. D, et al. NAT Behavior Discovery Using Session Traversal Utilities for NAT (STUN) [S]. IETF RFC 5780.2008.
    [28]BOULTON.C, et al. NAT Traversal Practices for Client-Server SIP [S]. IETF RFC 6314, 2011.
    [29]MAHY. R, et al. Traversal Using Relays around NAT (TURN):Relay Extensions to Session traversal Utilities for NAT (STUN) [S]. IETF RFC 5766,2010.
    [30]ROSENBERG J, et al. Interactive Connectivity Establishment (ICE):A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols [S]. IETF RFC 5245,2010.
    [31]Ying-Dar Lin, Chien-Chao Tseng, et al. How NAT-Compatible Are VoIP Applications? [J]. IEEE Communications Magazine.2010.12,48(12):58-65.
    [32]柯元旦.Android内核剖析[M].北京:电子工业出版社,2011.
    [33]国际标准化组织.Information technology Coding of audio visual objects Part 12:ISO base media file format. ISO IEC 14496-12 [S].2004.
    [34]HORSTMANN C, CORNELL G. Core Java Volume 1:Fundemantals[M].北京:机械工业出版社,2009.

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700