Yate开源软件Jabberclient模块实现注册openfire过程分析
Using jabber client in server modeLoad jabber client moduleSince jabberclient is a client module, not loaded when Yate is running in server mode, you must explicitly load it.To do that set in ya
Using jabber client in server mode
Load jabber client module
Since jabberclient is a client module, not loaded when Yate is running in server mode, you must explicitly load it.
To do that set in yate.conf:
[postload] ${modulepath}/client/jabberclient${modsuffix}=yes
Account setup
Set jabber account in accfile.conf:
[MyJabberAccount] enabled=yes protocol=jabber username=myusername domain=mydomain ;这里与openfire上的Server Name必须一致
server=127.0.0.1 ;openfire运行主机的IP,这里是在本机运行
password=mypassword
下面是在禁止使用TLS和压缩选项的情况下(即不加载openssl.yate和zlibcompress.yate模块),使用JabberClient模块注册openfire的过程。其中XMPP user是外部使用JabberClient模块服务的模块。
XMPP注册过程
<c2s/test_jabber:INFO> Sending to'localhost.localdomain' [01338298]
-----
<?xml version="1.0"encoding="utf-8"?>
<stream:stream xmlns:stream="http://etherx.jabber.org/streams"xmlns="jabber:client" from="mcu01@localhost.localdomain"to="localhost.localdomain" version="1.0"xml:lang="en">
-----
<c2s/test_jabber:INFO> Receiving from'localhost.localdomain' [01338298]
-----
<?xml version="1.0"encoding="UTF-8"?>
-----
<c2s/test_jabber:INFO> Receiving from'localhost.localdomain' [01338298]
-----
<stream:streamxmlns:stream="http://etherx.jabber.org/streams"xmlns="jabber:client" from="localhost.localdomain"id="de8d2941" xml:lang="en" version="1.0">
-----
<jbclientengine:INFO> Processingevent (0133C660,Start)
<c2s/test_jabber:INFO> Receiving from'localhost.localdomain' [01338298]
-----
<stream:features>
<starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
<mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
<mechanism>DIGEST-MD5</mechanism>
<mechanism>PLAIN</mechanism>
<mechanism>ANONYMOUS</mechanism>
<mechanism>CRAM-MD5</mechanism>
</mechanisms>
<compressionxmlns="http://jabber.org/features/compress">
<method>zlib</method>
</compression>
<auth xmlns="http://jabber.org/features/iq-auth"/>
<registerxmlns="http://jabber.org/features/iq-register"/>
</stream:features>
-----
<STUB>XMPPFeature::fromStreamFeature() Unhandled mechanism 'ANONYMOUS'
<STUB>XMPPFeature::fromStreamFeature() Unhandled mechanism 'CRAM-MD5'
<c2s/test_jabber:INFO> Sending to'localhost.localdomain' [01338298]
-----
<authxmlns="urn:ietf:params:xml:ns:xmpp-sasl"mechanism="DIGEST-MD5"/>
-----
<c2s/test_jabber:INFO> Receiving from'localhost.localdomain' [01338298]
-----
<challengexmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09ImxvY2FsaG9zdC5sb2NhbGRvbWFpbiIsbm9uY2U9Ii9CbTFGUFFyNW1MbXdPRVlmUUU2ekpYN3Mx
SHBtSW9WRWZ4SDM1OWwiLHFvcD0iYXV0aCIsY2hhcnNldD11dGYtOCxhbGdvcml0aG09bWQ1LXNlc3M=</challenge>
-----
<c2s/test_jabber:INFO> Sending to'localhost.localdomain' [01338298]
-----
<responsexmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9Im1jdTAxIixyZWFsbT0ibG9jYWxob3N0LmxvY2FsZG9tYWluIixub25jZT0iL0JtMUZQUXI1b
Uxtd09FWWZRRTZ6Slg3czFIcG1Jb1ZFZnhIMzU5bCIsY25vbmNlPSI2NTMzNDgyYzdjYjhjYzg5ZGVlMGQ0OGVkMTM3N2NjNCIsbmM9IjAwMDAwMDAxIixxb3A9ImF1dGgiLGRpZ
2VzdC11cmk9InhtcHAvbG9jYWxob3N0LmxvY2FsZG9tYWluIixyZXNwb25zZT01ZjBiODE2ZGIwNjk4OWNiZjE1MGVhNWIxNTI5NzM2ZixjaGFyc2V0PSJ1dGYtOCI=</response>
-----
<c2s/test_jabber:INFO> Receiving from'localhost.localdomain' [01338298]
-----
<successxmlns="urn:ietf:params:xml:ns:xmpp-sasl">cnNwYXV0aD0xZDM5MDUwMDAzMmRiZTg2OGNmYzQyMDI5ZWFhZDRjZQ==</success>
-----
<c2s/test_jabber:INFO> Sending to'localhost.localdomain' [01338298]
-----
<?xml version="1.0"encoding="utf-8"?>
<stream:streamxmlns:stream="http://etherx.jabber.org/streams"xmlns="jabber:client" from="mcu01@localhost.localdomain"to="localhost.localdomain" version="1.0"xml:lang="en">
-----
<c2s/test_jabber:INFO> Receiving from'localhost.localdomain' [01338298]
-----
<?xml version="1.0"encoding="UTF-8"?>
-----
<c2s/test_jabber:INFO> Receiving from'localhost.localdomain' [01338298]
-----
<stream:streamxmlns:stream="http://etherx.jabber.org/streams"xmlns="jabber:client" from="localhost.localdomain"id="de8d2941" xml:lang
="en" version="1.0">
-----
<jbclientengine:INFO> Processingevent (01341B70,Start)
<c2s/test_jabber:INFO> Receiving from'localhost.localdomain' [01338298]
-----
<stream:features>
<compression xmlns="http://jabber.org/features/compress">
<method>zlib</method>
</compression>
<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/>
<session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>
</stream:features>
-----
<c2s/test_jabber:INFO> Sending to'localhost.localdomain' [01338298]
-----
<iq type="set"id="bind_1">
<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/>
</iq>
-----
<c2s/test_jabber:INFO> Receiving from'localhost.localdomain' [01338298]
-----
<iq type="result"id="bind_1" to="localhost.localdomain/de8d2941">
<bindxmlns="urn:ietf:params:xml:ns:xmpp-bind">
<jid>mcu01@localhost.localdomain/de8d2941</jid>
</bind>
</iq>
-----
<c2s/test_jabber:INFO> Sending to'localhost.localdomain' [01338298]
-----
<iq type="set"id="sess_1">
<session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>
</iq>
-----
<c2s/test_jabber:INFO> Receiving from'localhost.localdomain' [01338298]
-----
<iq type="result"id="sess_1" to="mcu01@localhost.localdomain/de8d2941"/>
-----
<jbclientengine:INFO> Processingevent (01341B70,Running)
<c2s/test_jabber:INFO> Sending to'localhost.localdomain' [01338298]
-----
<iq type="get"id="roster-query">
<query xmlns="jabber:iq:roster"/>
</iq>
-----
<c2s/test_jabber:INFO> Sending to'localhost.localdomain' [01338298]
-----
<presence>
<priority>20</priority>
<status/>
<c xmlns="http://jabber.org/protocol/caps"node="http://yate.null.ro/yate/client/caps" ver="1.0"ext="voice-v1 pmuc-v1"/>
<c xmlns="http://jabber.org/protocol/caps"node="http://yate.null.ro/yate/client/caps" hash="sha-1"ver="lmx2tY/vPVjFXPCKk/wo2OBY18Q="/>
</presence>
-----
<c2s/test_jabber:INFO> Receiving from'localhost.localdomain' [01338298]
-----
<iq type="result"id="roster-query"to="mcu01@localhost.localdomain/de8d2941">
<query xmlns="jabber:iq:roster"/>
</iq>
-----
<jbclientengine:INFO>Processing event (01341B70,Iq)
http://www.agilevideo.net 所有
更多推荐
所有评论(0)