节目通信流程

备注:
1001:节目id
9001:用户id
9001@im.lanmei.fm/Spark 2.6.3:用户jid
conference.im.lanmei.fm:节目绑定域(固定)


1、获取节目详情
c req:


<iq id="NyPcU-43" from="9001@im.lanmei.fm/Spark 2.6.3" to="1001@conference.im.lanmei.fm" type="get">
<query xmlns="http://jabber.org/protocol/disco#info">
</query>
</iq>


s res:
<iq type="result" id="NyPcU-43" from="1001@conference.im.lanmei.fm" to="9001@im.lanmei.fm/Spark 2.6.3">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity category="conference" name="聊天室1" type="text"/>
<feature var="http://jabber.org/protocol/muc"/>
<feature var="muc_public"/>
<feature var="muc_open"/>
<feature var="muc_unmoderated"/>
<feature var="muc_semianonymous"/>
<feature var="muc_unsecured"/>
<feature var="muc_persistent"/>
<feature var="http://jabber.org/protocol/disco#info"/>
<x xmlns="jabber:x:data" type="result">
<field var="FORM_TYPE" type="hidden">
<value>http://jabber.org/protocol/muc#roominfo</value>
</field>
<field var="muc#roominfo_description" label="描述">
<value>aaa</value>
</field>
<field var="muc#roominfo_subject" label="主题">
<value>聊天室1_开放的会议室</value>
</field>
<field var="muc#roominfo_occupants" label="占有者人数">
<value>0</value>
</field>
<field var="x-muc#roominfo_creationdate" label="创建日期">
<value>20130101T09:12:33</value>
</field>
</x>
</query>
</iq>


2、进入节目
c req:
<presence id="NyPcU-45" from="9001@im.lanmei.fm/Spark 2.6.3" to="1001@conference.im.lanmei.fm/9001">
<x xmlns="http://jabber.org/protocol/muc"></x>
</presence>


s res:
<presence id="NyPcU-45" to="9001@im.lanmei.fm/Spark 2.6.3" from="1001@conference.im.lanmei.fm/9001">
<x xmlns="http://jabber.org/protocol/muc#user">
<item affiliation="none" role="participant"/>
</x>
</presence>
备注:role
case 0: return moderator;//主持
case 1: return participant;//与会者
case 2: return visitor;
case 4: return guest;//嘉宾


s res:
<message type="groupchat" from="1001@conference.im.lanmei.fm" to="9001@im.lanmei.fm/Spark 2.6.3">
<subject>聊天室1_开放的会议室</subject>
<delay xmlns="urn:xmpp:delay" stamp="2013-01-14T08:43:52.571Z" from="1001@conference.im.lanmei.fm"/>
<x xmlns="jabber:x:delay" stamp="20130114T08:43:52" from="1001@conference.im.lanmei.fm"/>
</message>


s res:
<message id="NyPcU-38" to="9001@im.lanmei.fm/Spark 2.6.3" type="groupchat" from="1001@conference.im.lanmei.fm/9001">
<body>sfsdf</body>
<x xmlns="jabber:x:event">
<offline/>
<delivered/>
<displayed/>
<composing/>
</x>
<delay xmlns="urn:xmpp:delay" stamp="2013-01-14T08:56:20.171Z" from="1001@conference.im.lanmei.fm/9001"/>
<x xmlns="jabber:x:delay" stamp="20130114T08:56:20" from="1001@conference.im.lanmei.fm/9001"/>
</message>


3、节目中群聊发信息
c req:
<message id="NyPcU-46" to="1001@conference.im.lanmei.fm" type="groupchat">
<body>test123</body>
<x xmlns="jabber:x:event">
<offline/>
<delivered/>
<displayed/>
<composing/>
</x>
</message>


s res:
<message id="NyPcU-46" to="9001@im.lanmei.fm/Spark 2.6.3" type="groupchat" from="1001@conference.im.lanmei.fm/9001">
<body>test123</body>
<x xmlns="jabber:x:event">
<offline/>
<delivered/>
<displayed/>
<composing/>
</x>
</message>


4、退去节目
c req:
<presence id="99QBw-34" to="1001@conference.im.lanmei.fm/9001" type="unavailable"></presence>
s res:
<presence id="99QBw-34" to="9001@im.lanmei.fm/Spark 2.6.3" from="1001@conference.im.lanmei.fm/9001" type="unavailable">
<x xmlns="http://jabber.org/protocol/muc#user">
<item affiliation="none" role="none"/>
</x>
</presence>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值