欢迎来到天天文库
浏览记录
ID:9532945
大小:56.50 KB
页数:24页
时间:2018-05-03
《java实现sip一个例子》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、java实现SIP一个例子(如果你贴子有附件,请一定按照下面模板发贴,否则贴子会被立刻删除,谢谢合作!)【资料名称】:【作者】:【语言】:【页数】:【格式】:【发表时间】:【摘要或目录】:(请根据需要,保留上面的相应选项)packagecom.voip.sipphone;importgov.nist.javax.sip.address.SipUri;importgov.nist.javax.sip.header.CSeq;importgov.nist.javax.sip.header.Contact;importgov.nist.javax.sip.header.ContentLengt
2、h;importgov.nist.javax.sip.header.ContentType;importgov.nist.javax.sip.header.From;importgov.nist.javax.sip.header.Via;importjava.text.ParseException;importjava.util.ArrayList;importjava.util.Hashtable;importjava.util.List;importjava.util.Properties;importjava.util.Timer;importjavax.sip.*;importj
3、avax.sip.address.Address;importjavax.sip.address.AddressFactory;importjavax.sip.address.URI;importjavax.sip.header.CallIdHeader;importjavax.sip.header.ContactHeader;importjavax.sip.header.ExpiresHeader;importjavax.sip.header.FromHeader;importjavax.sip.header.Header;importjavax.sip.header.HeaderFa
4、ctory;importjavax.sip.header.MaxForwardsHeader;importjavax.sip.header.RecordRouteHeader;importjavax.sip.header.ToHeader;importjavax.sip.header.ViaHeader;importjavax.sip.message.MessageFactory;importjavax.sip.message.Request;importjavax.sip.message.Response;publicclassSipPhoneimplementsSipListener
5、{publicvoidprocessDialogTerminated(DialogTerminatedEventarg0){ //TODOAuto-generatedmethodstub System.out.println("processDialogTerminated"+arg0.toString());}publicvoidprocessIOException(IOExceptionEventarg0){ //TODOAuto-generatedmethodstub System.out.println("processIOException"+arg0.toString
6、());}/** *保存当前注册的用户 */privatestaticHashtablecurrUser=newHashtable();/** *@authorsoftware *注册定时器 */classTimerTaskextendsTimer{ /** *defaultconstructor */ publicTimerTask() { } /** * 如果定时任务到,则删除该用户的注册信息 */ publicvoidrun() { }}/** *服务器侦听IP地址 */privateStringipAddr="
7、192.168.0.20";/** *服务器侦听端口 */privateintport=5060;/** *处理register请求 *@paramrequest请求消息 */privatevoidprocessRegister(Requestrequest,RequestEventrequestEvent){ if(null==request) { System.out.println("processInvite
此文档下载收益归作者所有