smackx jingle语音通话实例
来源:互联网 发布:如何建立网络共享 编辑:程序博客网 时间:2024/05/16 19:43
关于jingle ,资料网上少之又少,官方提供的Demo无法运行(原因:问声明客户端支持Jingle,所以服务端返回501异常)。
这个问题困然我几天,然后在Ignite Realtime看到一篇可以很好工作的JIngle示例:
public static void main(String[] args) throws Exception { // enable Jingle service JingleManager.setJingleServiceEnabled(); // user1 connect to a XMPP Server XMPPConnection x1 = new XMPPConnection("localhost"); x1.connect(); x1.login("user1", "user1"); // Create a JingleManager using a BasicTransportManager List<JingleMediaManager> mediaManagers1 = new ArrayList<JingleMediaManager>(); mediaManagers1.add(new JmfMediaManager(new BasicTransportManager())); final JingleManager jm1 = new JingleManager(x1, mediaManagers1); // Listen for incoming calls jm1.addJingleSessionRequestListener(new JingleSessionRequestListener() { public void sessionRequested(JingleSessionRequest request) { try { // Accept the call JingleSession session = request.accept(); // Start the call session.startIncoming(); } catch (XMPPException e) { e.printStackTrace(); } } }); // user2 connect to a XMPP Server XMPPConnection x0 = new XMPPConnection("localhost"); x0.connect(); x0.login("user2", "user2"); // Create a JingleManager using a BasicTransportManager List<JingleMediaManager> mediaManagers0 = new ArrayList<JingleMediaManager>(); mediaManagers0.add(new JmfMediaManager(new BasicTransportManager())); final JingleManager jm0 = new JingleManager(x0, mediaManagers0); // Create a new Jingle Call with a full JID JingleSession js0 = jm0 .createOutgoingJingleSession("user1@localhost/Smack"); // Start the call js0.startOutgoing(); Thread.sleep(30000); js0.terminate(); Thread.sleep(3000); }
For the JMFMediaManager to work you have to add the jmf.jar and maybe some OS dependent libraries to the classpath. These can be found in the svn repository /smack/jingle/extensions/build/lib转自:http://community.igniterealtime.org/thread/37786
- smackx jingle语音通话实例
- 语音通话技术浅析
- 安卓语音通话
- 调试3G模块语音通话
- Android P2P语音通话实现
- iOS语音通话(语音对讲)
- iOS语音通话(语音对讲)
- 终于搞定mSn的语音通话
- 用yate2实现软VoIP语音通话
- 对语音通话占用带宽的理解
- 语音通话-sip电话(一)
- 语音通话 切换扬声器和听筒
- 语音通话中talkspurt的介绍
- 云之讯语音通话Demo
- 网络电话语音通话的android实现
- 运用腾讯云实现QQ语音通话
- Android Sipdroid 语音通话项目简单使用
- jingle bells
- 2012年图灵奖获得者及他们的主要贡献
- How to call Matlab function in C++
- 我的DIY Android之旅--Android2.3源码初识
- 分享下.NET程序读取二代身份证(附源码
- Windows7下硬盘安装Mac OS X Lion(狮子)10.7正式版
- smackx jingle语音通话实例
- 理解面向对象
- 复选框勾选全部实现方法
- JavaScript验证大全
- div和table 用作布局的 区别
- 动态规划考智商 智商是硬伤
- 继续二维指针
- android monkeyRunner 自动化测试
- OpenCV笔记1:显示一幅图片(一)