<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>Yate: yatejabber.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.7.1 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> </ul> </div> <h1>yatejabber.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00024"></a>00024 <span class="preprocessor">#ifndef __YATEJABBER_H</span> <a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define __YATEJABBER_H</span> <a name="l00026"></a>00026 <span class="preprocessor"></span> <a name="l00027"></a>00027 <span class="preprocessor">#include <xmpputils.h></span> <a name="l00028"></a>00028 <span class="preprocessor">#include <xmlparser.h></span> <a name="l00029"></a>00029 <a name="l00033"></a>00033 <span class="keyword">namespace </span>TelEngine { <a name="l00034"></a>00034 <a name="l00035"></a>00035 <span class="keyword">class </span>JBEvent; <span class="comment">// A Jabber event</span> <a name="l00036"></a>00036 <span class="keyword">class </span>JBStream; <span class="comment">// A Jabber stream</span> <a name="l00037"></a>00037 <span class="keyword">class </span>JBComponentStream; <span class="comment">// A Jabber Component stream</span> <a name="l00038"></a>00038 <span class="keyword">class </span>JBClientStream; <span class="comment">// A Jabber client to server stream</span> <a name="l00039"></a>00039 <span class="keyword">class </span>JBThread; <span class="comment">// Base class for private threads</span> <a name="l00040"></a>00040 <span class="keyword">class </span>JBThreadList; <span class="comment">// A list of threads</span> <a name="l00041"></a>00041 <span class="keyword">class </span>JBEngine; <span class="comment">// A Jabber engine</span> <a name="l00042"></a>00042 <span class="keyword">class </span>JBService; <span class="comment">// A Jabber service</span> <a name="l00043"></a>00043 <span class="keyword">class </span>JBPresence; <span class="comment">// A Jabber presence service</span> <a name="l00044"></a>00044 <span class="keyword">class </span>JIDResource; <span class="comment">// A JID resource</span> <a name="l00045"></a>00045 <span class="keyword">class </span>JIDResourceList; <span class="comment">// Resource list</span> <a name="l00046"></a>00046 <span class="keyword">class </span>XMPPUser; <span class="comment">// An XMPP user (JID, resources, capabilities etc)</span> <a name="l00047"></a>00047 <span class="keyword">class </span>XMPPUserRoster; <span class="comment">// An XMPP user's roster</span> <a name="l00048"></a>00048 <a name="l00054"></a><a class="code" href="classTelEngine_1_1JBEvent.html">00054</a> <span class="keyword">class </span>YJINGLE_API <a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a> : <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1RefObject.html">RefObject</a> <a name="l00055"></a>00055 { <a name="l00056"></a>00056 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>; <a name="l00057"></a>00057 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTelEngine_1_1JBClientStream.html" title="A Jabber client to server stream.">JBClientStream</a>; <a name="l00058"></a>00058 <span class="keyword">public</span>: <a name="l00062"></a><a class="code" href="classTelEngine_1_1JBEvent.html#1d1cfd8ffb84e947f82999c682b666a7">00062</a> <span class="keyword">enum</span> <a class="code" href="classTelEngine_1_1JBEvent.html#1d1cfd8ffb84e947f82999c682b666a7">Type</a> { <a name="l00063"></a>00063 <span class="comment">// Stream events</span> <a name="l00064"></a>00064 Terminated = 1, <span class="comment">// Stream terminated. Try to connect</span> <a name="l00065"></a>00065 Destroy = 2, <span class="comment">// Stream is destroying</span> <a name="l00066"></a>00066 Running = 3, <span class="comment">// Stream is running (stable state: can send/recv stanzas)</span> <a name="l00067"></a>00067 <span class="comment">// Result events</span> <a name="l00068"></a>00068 WriteFail = 10, <span class="comment">// Write failed. m_element is the element, m_id is the id set by the sender</span> <a name="l00069"></a>00069 <span class="comment">// Stanza events: m_element is always valid</span> <a name="l00070"></a>00070 Presence = 20, <span class="comment">// m_element is a 'presence' stanza</span> <a name="l00071"></a>00071 <a class="code" href="classTelEngine_1_1Message.html" title="A message container class.">Message</a> = 30, <span class="comment">// m_element is a 'message' stanza</span> <a name="l00072"></a>00072 Iq = 50, <span class="comment">// m_element is an 'iq' set/get, m_child is it's first child</span> <a name="l00073"></a>00073 IqError = 51, <span class="comment">// m_element is an 'iq' error, m_child is the 'iq' child if any</span> <a name="l00074"></a>00074 IqResult = 52, <span class="comment">// m_element is an 'iq' result, m_child is it's first child if any</span> <a name="l00075"></a>00075 <span class="comment">// Disco: m_child is a 'query' element qualified by DiscoInfo/DiscoItems namespaces</span> <a name="l00076"></a>00076 IqDiscoInfoGet = 60, <a name="l00077"></a>00077 IqDiscoInfoSet = 61, <a name="l00078"></a>00078 IqDiscoInfoRes = 62, <a name="l00079"></a>00079 IqDiscoInfoErr = 63, <a name="l00080"></a>00080 IqDiscoItemsGet = 64, <a name="l00081"></a>00081 IqDiscoItemsSet = 65, <a name="l00082"></a>00082 IqDiscoItemsRes = 66, <a name="l00083"></a>00083 IqDiscoItemsErr = 67, <a name="l00084"></a>00084 <span class="comment">// Command: m_child is a 'command' element qualified by Command namespace</span> <a name="l00085"></a>00085 IqCommandGet = 70, <a name="l00086"></a>00086 IqCommandSet = 71, <a name="l00087"></a>00087 IqCommandRes = 72, <a name="l00088"></a>00088 IqCommandErr = 73, <a name="l00089"></a>00089 <span class="comment">// Jingle: m_child is a 'jingle' element qualified by Jingle namespace</span> <a name="l00090"></a>00090 IqJingleGet = 80, <a name="l00091"></a>00091 IqJingleSet = 81, <a name="l00092"></a>00092 IqJingleRes = 82, <a name="l00093"></a>00093 IqJingleErr = 83, <a name="l00094"></a>00094 <span class="comment">// Roster: m_child is a 'query' element qualified by Roster namespace</span> <a name="l00095"></a>00095 IqRosterSet = 91, <a name="l00096"></a>00096 IqRosterRes = 92, <a name="l00097"></a>00097 IqRosterErr = 93, <a name="l00098"></a>00098 <span class="comment">// Roster update (set or result) received by client streams: m_child is a 'query' element</span> <a name="l00099"></a>00099 <span class="comment">// qualified by Roster namespace</span> <a name="l00100"></a>00100 IqClientRosterUpdate = 150, <a name="l00101"></a>00101 <span class="comment">// Invalid</span> <a name="l00102"></a>00102 Unhandled = 200, <span class="comment">// m_element is an unhandled element</span> <a name="l00103"></a>00103 Invalid = 500, <span class="comment">// m_element is 0</span> <a name="l00104"></a>00104 }; <a name="l00105"></a>00105 <a name="l00113"></a>00113 <a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>(Type type, <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* stream, <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* element, <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* child = 0); <a name="l00114"></a>00114 <a name="l00122"></a>00122 <a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>(Type type, <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* stream, <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* element, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& senderID); <a name="l00123"></a>00123 <a name="l00127"></a>00127 <span class="keyword">virtual</span> ~<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>(); <a name="l00128"></a>00128 <a name="l00133"></a><a class="code" href="classTelEngine_1_1JBEvent.html#4609e33962a63a3b71f17de25e8745aa">00133</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> type()<span class="keyword"> const</span> <a name="l00134"></a>00134 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_type; } <a name="l00135"></a>00135 <a name="l00140"></a><a class="code" href="classTelEngine_1_1JBEvent.html#862958aa3c2b9bf36903f1f0f2e81c54">00140</a> <span class="keyword">inline</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* name()<span class="keyword"> const</span> <a name="l00141"></a>00141 <span class="keyword"> </span>{ <span class="keywordflow">return</span> <a class="code" href="namespaceTelEngine.html#4668c9172c6ae5f59f5782ecc6e05516">lookup</a>(type()); } <a name="l00142"></a>00142 <a name="l00147"></a><a class="code" href="classTelEngine_1_1JBEvent.html#d9fddf58fa498927c432cd2487a9e747">00147</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& stanzaType()<span class="keyword"> const</span> <a name="l00148"></a>00148 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_stanzaType; } <a name="l00149"></a>00149 <a name="l00154"></a><a class="code" href="classTelEngine_1_1JBEvent.html#21da8ed95c87e04ceb056d7f841dd9ac">00154</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& from()<span class="keyword"> const</span> <a name="l00155"></a>00155 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_from; } <a name="l00156"></a>00156 <a name="l00161"></a><a class="code" href="classTelEngine_1_1JBEvent.html#a27cccae2304ba7236c0b15a6115ff38">00161</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& to()<span class="keyword"> const</span> <a name="l00162"></a>00162 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_to; } <a name="l00163"></a>00163 <a name="l00169"></a><a class="code" href="classTelEngine_1_1JBEvent.html#e537a056a2d8316444575696aa701bbd">00169</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& id()<span class="keyword"> const</span> <a name="l00170"></a>00170 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_id; } <a name="l00171"></a>00171 <a name="l00176"></a><a class="code" href="classTelEngine_1_1JBEvent.html#b9dd7ce5697473f1226828da52353f6b">00176</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& text()<span class="keyword"> const</span> <a name="l00177"></a>00177 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_text; } <a name="l00178"></a>00178 <a name="l00183"></a><a class="code" href="classTelEngine_1_1JBEvent.html#30f9c9311f4c60a58c2f7c757e83988f">00183</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* stream()<span class="keyword"> const</span> <a name="l00184"></a>00184 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_stream; } <a name="l00185"></a>00185 <a name="l00190"></a><a class="code" href="classTelEngine_1_1JBEvent.html#097b09ca0cd260fcdb0f05c34473847c">00190</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* element()<span class="keyword"> const</span> <a name="l00191"></a>00191 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_element; } <a name="l00192"></a>00192 <a name="l00197"></a><a class="code" href="classTelEngine_1_1JBEvent.html#734f74399c0cb9d990d0c2d6a1a18774">00197</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* child()<span class="keyword"> const</span> <a name="l00198"></a>00198 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_child; } <a name="l00199"></a>00199 <a name="l00206"></a><a class="code" href="classTelEngine_1_1JBEvent.html#c350003d0b805df6915d1f753ce07138">00206</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* <a class="code" href="classTelEngine_1_1JBEvent.html#c350003d0b805df6915d1f753ce07138">releaseXML</a>(<span class="keywordtype">bool</span> del = <span class="keyword">false</span>) { <a name="l00207"></a>00207 <a class="code" href="namespaceTelEngine.html#9cc4a4249317f5c7eb006842cf233672">TelEngine::destruct</a>(m_child); <a name="l00208"></a>00208 <span class="keywordflow">if</span> (del) { <a name="l00209"></a>00209 <a class="code" href="namespaceTelEngine.html#9cc4a4249317f5c7eb006842cf233672">TelEngine::destruct</a>(m_element); <a name="l00210"></a>00210 <span class="keywordflow">return</span> 0; <a name="l00211"></a>00211 } <a name="l00212"></a>00212 <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* tmp = m_element; <a name="l00213"></a>00213 m_element = 0; <a name="l00214"></a>00214 <span class="keywordflow">return</span> tmp; <a name="l00215"></a>00215 } <a name="l00216"></a>00216 <a name="l00220"></a>00220 <span class="keywordtype">void</span> releaseStream(); <a name="l00221"></a>00221 <a name="l00230"></a>00230 <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* createError(<a class="code" href="classTelEngine_1_1XMPPError.html#b0df38968e4f03a3f1f6d6df0f31f45a">XMPPError::ErrorType</a> type, <a class="code" href="classTelEngine_1_1XMPPError.html#1d1cfd8ffb84e947f82999c682b666a7">XMPPError::Type</a> error, <span class="keyword">const</span> <span class="keywordtype">char</span>* text = 0); <a name="l00231"></a>00231 <a name="l00236"></a><a class="code" href="classTelEngine_1_1JBEvent.html#e2e9c8e1d04cf6494cba55c97111c0ac">00236</a> <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="namespaceTelEngine.html#4668c9172c6ae5f59f5782ecc6e05516">lookup</a>(<span class="keywordtype">int</span> type) <a name="l00237"></a>00237 { <span class="keywordflow">return</span> <a class="code" href="namespaceTelEngine.html#4668c9172c6ae5f59f5782ecc6e05516">TelEngine::lookup</a>(type,s_type); } <a name="l00238"></a>00238 <a name="l00239"></a>00239 <span class="keyword">private</span>: <a name="l00240"></a>00240 <span class="keyword">static</span> <a class="code" href="structTelEngine_1_1TokenDict.html">TokenDict</a> s_type[]; <span class="comment">// Event names</span> <a name="l00241"></a>00241 <a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>() {} <span class="comment">// Don't use it!</span> <a name="l00242"></a>00242 <span class="keywordtype">bool</span> init(JBStream* stream, XMLElement* element); <a name="l00243"></a>00243 <a name="l00244"></a>00244 Type m_type; <span class="comment">// Type of this event</span> <a name="l00245"></a>00245 JBStream* m_stream; <span class="comment">// The stream that generated this event</span> <a name="l00246"></a>00246 <span class="keywordtype">bool</span> m_link; <span class="comment">// Stream link state</span> <a name="l00247"></a>00247 XMLElement* m_element; <span class="comment">// Received XML element, if any</span> <a name="l00248"></a>00248 XMLElement* m_child; <span class="comment">// The first child element for 'iq' elements</span> <a name="l00249"></a>00249 String m_stanzaType; <span class="comment">// Stanza's 'type' attribute</span> <a name="l00250"></a>00250 JabberID m_from; <span class="comment">// Stanza's 'from' attribute</span> <a name="l00251"></a>00251 JabberID m_to; <span class="comment">// Stanza's 'to' attribute</span> <a name="l00252"></a>00252 String m_id; <span class="comment">// Sender's id for Write... events</span> <a name="l00253"></a>00253 <span class="comment">// 'id' attribute if the received stanza has one</span> <a name="l00254"></a>00254 String m_text; <span class="comment">// The stanza's text or termination reason for</span> <a name="l00255"></a>00255 <span class="comment">// Terminated/Destroy events</span> <a name="l00256"></a>00256 }; <a name="l00257"></a>00257 <a name="l00262"></a><a class="code" href="classTelEngine_1_1JBSocket.html">00262</a> <span class="keyword">class </span>YJINGLE_API <a class="code" href="classTelEngine_1_1JBSocket.html" title="A Jabber streams&#39;s socket.">JBSocket</a> <a name="l00263"></a>00263 { <a name="l00264"></a>00264 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>; <a name="l00265"></a>00265 <span class="keyword">public</span>: <a name="l00273"></a>00273 <a class="code" href="classTelEngine_1_1JBSocket.html" title="A Jabber streams&#39;s socket.">JBSocket</a>(<a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>* engine, <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* stream, <a name="l00274"></a>00274 <span class="keyword">const</span> <span class="keywordtype">char</span>* address, <span class="keywordtype">int</span> port); <a name="l00275"></a>00275 <a name="l00279"></a><a class="code" href="classTelEngine_1_1JBSocket.html#e4a043ca4cd19dfce8c37e8beca00cec">00279</a> <span class="keyword">inline</span> ~<a class="code" href="classTelEngine_1_1JBSocket.html" title="A Jabber streams&#39;s socket.">JBSocket</a>() <a name="l00280"></a>00280 { terminate(); } <a name="l00281"></a>00281 <a name="l00286"></a><a class="code" href="classTelEngine_1_1JBSocket.html#8d985300b138b6c5556ab17ed4df3b38">00286</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> valid()<span class="keyword"> const</span> <a name="l00287"></a>00287 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_socket && m_socket->valid(); } <a name="l00288"></a>00288 <a name="l00293"></a><a class="code" href="classTelEngine_1_1JBSocket.html#37daa045dcf7a1b182cda22f09ae61a4">00293</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1SocketAddr.html" title="A socket address holder.">SocketAddr</a>& addr()<span class="keyword"> const</span> <a name="l00294"></a>00294 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_address; } <a name="l00295"></a>00295 <a name="l00300"></a><a class="code" href="classTelEngine_1_1JBSocket.html#190258a12474f26b4d1a321ca52e0e7b">00300</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& error()<span class="keyword"> const</span> <a name="l00301"></a>00301 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_error; } <a name="l00302"></a>00302 <a name="l00311"></a>00311 <span class="keywordtype">bool</span> connect(<span class="keywordtype">bool</span>& terminated, <span class="keyword">const</span> <span class="keywordtype">char</span>* newAddr, <span class="keywordtype">int</span> newPort = 0); <a name="l00312"></a>00312 <a name="l00317"></a>00317 <span class="keywordtype">void</span> terminate(<span class="keywordtype">bool</span> shutdown = <span class="keyword">false</span>); <a name="l00318"></a>00318 <a name="l00326"></a>00326 <span class="keywordtype">bool</span> recv(<span class="keywordtype">char</span>* buffer, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>& len); <a name="l00327"></a>00327 <a name="l00334"></a>00334 <span class="keywordtype">bool</span> send(<span class="keyword">const</span> <span class="keywordtype">char</span>* buffer, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>& len); <a name="l00335"></a>00335 <a name="l00336"></a>00336 <span class="keyword">private</span>: <a name="l00337"></a>00337 <a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>* m_engine; <span class="comment">// The Jabber engine</span> <a name="l00338"></a>00338 <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* m_stream; <span class="comment">// Stream owning this socket</span> <a name="l00339"></a>00339 <a class="code" href="classTelEngine_1_1Socket.html" title="A generic socket class.">Socket</a>* m_socket; <span class="comment">// The socket</span> <a name="l00340"></a>00340 <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a> m_remoteDomain; <span class="comment">// Remote domain used to resolve before connecting</span> <a name="l00341"></a>00341 <a class="code" href="classTelEngine_1_1SocketAddr.html" title="A socket address holder.">SocketAddr</a> m_address; <span class="comment">// Remote address</span> <a name="l00342"></a>00342 <a class="code" href="classTelEngine_1_1Mutex.html" title="Mutex support.">Mutex</a> m_streamMutex; <span class="comment">// Lock stream</span> <a name="l00343"></a>00343 <a class="code" href="classTelEngine_1_1Mutex.html" title="Mutex support.">Mutex</a> m_receiveMutex; <span class="comment">// Lock receive</span> <a name="l00344"></a>00344 <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a> m_error; <span class="comment">// Keep error string from send/receive/connect</span> <a name="l00345"></a>00345 }; <a name="l00346"></a>00346 <a name="l00352"></a><a class="code" href="classTelEngine_1_1JBStream.html">00352</a> <span class="keyword">class </span>YJINGLE_API <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a> : <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1RefObject.html">RefObject</a> <a name="l00353"></a>00353 { <a name="l00354"></a>00354 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>; <a name="l00355"></a>00355 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>; <a name="l00356"></a>00356 <span class="keyword">public</span>: <a name="l00360"></a><a class="code" href="classTelEngine_1_1JBStream.html#5d74787dedbc4e11c1ab15bf487e61f8">00360</a> <span class="keyword">enum</span> <a class="code" href="classTelEngine_1_1JBStream.html#5d74787dedbc4e11c1ab15bf487e61f8">State</a> { <a name="l00361"></a>00361 Idle = 0, <span class="comment">// Stream is waiting to be connected or destroyed</span> <a name="l00362"></a>00362 Connecting = 1, <span class="comment">// Stream is waiting for the socket to connect</span> <a name="l00363"></a>00363 Started = 2, <span class="comment">// Stream start tag sent</span> <a name="l00364"></a>00364 Securing = 3, <span class="comment">// Stream is currently negotiating the TLS</span> <a name="l00365"></a>00365 Auth = 4, <span class="comment">// Stream is currently authenticating</span> <a name="l00366"></a>00366 Running = 5, <span class="comment">// Established. Allow XML stanzas to pass over the stream</span> <a name="l00367"></a>00367 Destroy = 6, <span class="comment">// Stream is destroying. No more traffic allowed</span> <a name="l00368"></a>00368 }; <a name="l00369"></a>00369 <a name="l00373"></a><a class="code" href="classTelEngine_1_1JBStream.html#2c3e4bb40f36b262a5214e2da2bca9c5">00373</a> <span class="keyword">enum</span> <a class="code" href="classTelEngine_1_1JBStream.html#2c3e4bb40f36b262a5214e2da2bca9c5">Error</a> { <a name="l00374"></a>00374 ErrorNone = 0, <span class="comment">// No error (stanza enqueued/sent)</span> <a name="l00375"></a>00375 ErrorContext, <span class="comment">// Invalid stream context (state) or parameters</span> <a name="l00376"></a>00376 ErrorPending, <span class="comment">// The operation is pending in the stream's queue</span> <a name="l00377"></a>00377 ErrorNoSocket, <span class="comment">// Unrecoverable socket error. The stream will be terminated</span> <a name="l00378"></a>00378 }; <a name="l00379"></a>00379 <a name="l00383"></a><a class="code" href="classTelEngine_1_1JBStream.html#a705cf7e79a21c2352b00ffe20cd295f">00383</a> <span class="keyword">enum</span> <a class="code" href="classTelEngine_1_1JBStream.html#a705cf7e79a21c2352b00ffe20cd295f">Flags</a> { <a name="l00384"></a>00384 AutoRestart = 0x0001, <span class="comment">// Auto restart stream when down</span> <a name="l00385"></a>00385 AllowPlainAuth = 0x0002, <span class="comment">// Allow plain password authentication</span> <a name="l00386"></a>00386 <span class="comment">// If not allowed and this is the only method</span> <a name="l00387"></a>00387 <span class="comment">// offered by server the stream will be terminated</span> <a name="l00388"></a>00388 NoVersion1 = 0x0004, <span class="comment">// Don't support RFC 3920 TLS/SASL ...</span> <a name="l00389"></a>00389 UseTls = 0x0008, <span class="comment">// Use TLS if offered. Internally set if the remote server</span> <a name="l00390"></a>00390 <span class="comment">// always require encryption</span> <a name="l00391"></a>00391 UseSasl = 0x0010, <span class="comment">// Use SASL as authentication mechanism (RFC 3920)</span> <a name="l00392"></a>00392 <span class="comment">// If not set, the deprecated XEP-0078 will be used for authentication</span> <a name="l00393"></a>00393 StreamSecured = 0x0100, <span class="comment">// Stream already secured</span> <a name="l00394"></a>00394 StreamAuthenticated = 0x0200, <span class="comment">// Stream already authenticated</span> <a name="l00395"></a>00395 NoRemoteVersion1 = 0x0400, <span class="comment">// Remote doesn't support RFC 3920 TLS/SASL ...</span> <a name="l00396"></a>00396 }; <a name="l00397"></a>00397 <a name="l00402"></a>00402 <span class="keyword">virtual</span> ~<a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>(); <a name="l00403"></a>00403 <a name="l00408"></a><a class="code" href="classTelEngine_1_1JBStream.html#4609e33962a63a3b71f17de25e8745aa">00408</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> type()<span class="keyword"> const</span> <a name="l00409"></a>00409 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_type; } <a name="l00410"></a>00410 <a name="l00415"></a><a class="code" href="classTelEngine_1_1JBStream.html#3804c9648e6d1325751536cca350f2bf">00415</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JBStream.html#5d74787dedbc4e11c1ab15bf487e61f8">State</a> state()<span class="keyword"> const</span> <a name="l00416"></a>00416 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_state; } <a name="l00417"></a>00417 <a name="l00422"></a><a class="code" href="classTelEngine_1_1JBStream.html#bf0a85f6a7ff9ab42c7f7d86b1bc0da8">00422</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> outgoing()<span class="keyword"> const</span> <a name="l00423"></a>00423 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_outgoing; } <a name="l00424"></a>00424 <a name="l00429"></a><a class="code" href="classTelEngine_1_1JBStream.html#b31e7357671cfe484e3c3ed3cd6258e4">00429</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& name()<span class="keyword"> const</span> <a name="l00430"></a>00430 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_name; } <a name="l00431"></a>00431 <a name="l00436"></a><a class="code" href="classTelEngine_1_1JBStream.html#e537a056a2d8316444575696aa701bbd">00436</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& id()<span class="keyword"> const</span> <a name="l00437"></a>00437 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_id; } <a name="l00438"></a>00438 <a name="l00443"></a><a class="code" href="classTelEngine_1_1JBStream.html#59017748ae989e92f5b818fb60cbe699">00443</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>* engine()<span class="keyword"> const</span> <a name="l00444"></a>00444 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_engine; } <a name="l00445"></a>00445 <a name="l00450"></a><a class="code" href="classTelEngine_1_1JBStream.html#6d69311c97f52f35724133a03e922036">00450</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& local()<span class="keyword"> const</span> <a name="l00451"></a>00451 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_local; } <a name="l00452"></a>00452 <a name="l00457"></a><a class="code" href="classTelEngine_1_1JBStream.html#53352bbc3dbce3d00e4f1d34c4bdeb33">00457</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& remote()<span class="keyword"> const</span> <a name="l00458"></a>00458 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_remote; } <a name="l00459"></a>00459 <a name="l00464"></a><a class="code" href="classTelEngine_1_1JBStream.html#37daa045dcf7a1b182cda22f09ae61a4">00464</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1SocketAddr.html" title="A socket address holder.">SocketAddr</a>& addr()<span class="keyword"> const</span> <a name="l00465"></a>00465 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_socket.addr(); } <a name="l00466"></a>00466 <a name="l00472"></a><a class="code" href="classTelEngine_1_1JBStream.html#1b5e2d8e3d68180be05b6fac508e2751">00472</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> flag(<span class="keywordtype">int</span> mask)<span class="keyword"> const</span> <a name="l00473"></a>00473 <span class="keyword"> </span>{ <span class="keywordflow">return</span> 0 != (m_flags & mask); } <a name="l00474"></a>00474 <a name="l00479"></a><a class="code" href="classTelEngine_1_1JBStream.html#cf8fac719409fab9ff61ae22faaa62a2">00479</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1Mutex.html" title="Mutex support.">Mutex</a>* streamMutex() <a name="l00480"></a>00480 { <span class="keywordflow">return</span> &m_socket.m_streamMutex; } <a name="l00481"></a>00481 <a name="l00486"></a>00486 <span class="keywordtype">void</span> connect(); <a name="l00487"></a>00487 <a name="l00494"></a>00494 <span class="keywordtype">bool</span> receive(); <a name="l00495"></a>00495 <a name="l00503"></a>00503 <span class="keyword">virtual</span> Error sendStanza(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* stanza, <span class="keyword">const</span> <span class="keywordtype">char</span>* senderId = 0); <a name="l00504"></a>00504 <a name="l00513"></a>00513 <a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* getEvent(u_int64_t time); <a name="l00514"></a>00514 <a name="l00526"></a>00526 <span class="keywordtype">void</span> terminate(<span class="keywordtype">bool</span> destroy, <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* recvStanza, <a class="code" href="classTelEngine_1_1XMPPError.html#1d1cfd8ffb84e947f82999c682b666a7">XMPPError::Type</a> error, <span class="keyword">const</span> <span class="keywordtype">char</span>* reason, <a name="l00527"></a>00527 <span class="keywordtype">bool</span> send, <span class="keywordtype">bool</span> <span class="keyword">final</span> = <span class="keyword">false</span>); <a name="l00528"></a>00528 <a name="l00535"></a><a class="code" href="classTelEngine_1_1JBStream.html#3f014376dd3fe9993e745b910ed9483a">00535</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classTelEngine_1_1JBStream.html#3f014376dd3fe9993e745b910ed9483a">removePending</a>(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& <span class="keywordtype">id</span>, <span class="keywordtype">bool</span> notify = <span class="keyword">false</span>) { <a name="l00536"></a>00536 <a class="code" href="classTelEngine_1_1Lock.html" title="Ephemeral mutex locking object.">Lock</a> lock(m_socket.m_streamMutex); <a name="l00537"></a>00537 removePending(notify,&<span class="keywordtype">id</span>,<span class="keyword">false</span>); <a name="l00538"></a>00538 } <a name="l00539"></a>00539 <a name="l00544"></a><a class="code" href="classTelEngine_1_1JBStream.html#4a7bd56fb99593ace9379ed699f2719c">00544</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& toString()<span class="keyword"> const</span> <a name="l00545"></a>00545 <span class="keyword"> </span>{ <span class="keywordflow">return</span> name(); } <a name="l00546"></a>00546 <a name="l00551"></a>00551 <span class="keyword">virtual</span> <span class="keywordtype">void</span>* getObject(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& name) <span class="keyword">const</span>; <a name="l00552"></a>00552 <a name="l00558"></a>00558 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* lookupState(<span class="keywordtype">int</span> state); <a name="l00559"></a>00559 <a name="l00563"></a><a class="code" href="classTelEngine_1_1JBStream.html#b4e84f1adfb74728e7388aab96bb82f3">00563</a> <span class="keyword">static</span> <a class="code" href="structTelEngine_1_1TokenDict.html">TokenDict</a> s_flagName[]; <a name="l00564"></a>00564 <a name="l00565"></a>00565 <span class="keyword">protected</span>: <a name="l00569"></a><a class="code" href="classTelEngine_1_1JBStream.html#0fae335f68530ec36ed416609375f46a">00569</a> <span class="keyword">enum</span> <a class="code" href="classTelEngine_1_1JBStream.html#0fae335f68530ec36ed416609375f46a">WaitState</a> { <span class="comment">// Main state Wait</span> <a name="l00570"></a>00570 WaitIdle, <span class="comment">// Idle nothing</span> <a name="l00571"></a>00571 WaitStart, <span class="comment">// Started stream start response</span> <a name="l00572"></a>00572 WaitFeatures, <span class="comment">// Started stream features</span> <a name="l00573"></a>00573 WaitBindRsp, <span class="comment">// Started wait for bind response</span> <a name="l00574"></a>00574 WaitTlsRsp, <span class="comment">// Started: wait response to starttls</span> <a name="l00575"></a>00575 WaitChallenge, <span class="comment">// Auth iq auth query with auth data sent, wait response</span> <a name="l00576"></a>00576 WaitResponse, <span class="comment">// Auth iq auth query sent, wait response</span> <a name="l00577"></a>00577 WaitAborted, <span class="comment">// Auth abort sent, wait confirmation to terminate stream</span> <a name="l00578"></a>00578 }; <a name="l00579"></a>00579 <a name="l00588"></a>00588 <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>(<a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>* engine, <span class="keywordtype">int</span> type, <a class="code" href="classTelEngine_1_1XMPPServerInfo.html" title="Server info class.">XMPPServerInfo</a>& info, <a name="l00589"></a>00589 <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& localJid, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& remoteJid); <a name="l00590"></a>00590 <a name="l00594"></a><a class="code" href="classTelEngine_1_1JBStream.html#2f0ae63bd21de99a5e1b71e49bf7e655">00594</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>() <a name="l00595"></a>00595 : m_socket(0,0,0,0) <a name="l00596"></a>00596 {} <a name="l00597"></a>00597 <a name="l00601"></a>00601 <span class="keyword">virtual</span> <span class="keywordtype">void</span> destroyed(); <a name="l00602"></a>00602 <a name="l00611"></a>00611 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> checkDestination(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* xml, <span class="keywordtype">bool</span>& respond); <a name="l00612"></a>00612 <a name="l00617"></a>00617 <span class="keyword">virtual</span> <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* getStreamStart(); <a name="l00618"></a>00618 <a name="l00623"></a>00623 <span class="keyword">virtual</span> <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* getAuthStart(); <a name="l00624"></a>00624 <a name="l00629"></a>00629 <span class="keyword">virtual</span> <span class="keywordtype">void</span> processRunning(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* xml); <a name="l00630"></a>00630 <a name="l00635"></a>00635 <span class="keyword">virtual</span> <span class="keywordtype">void</span> processAuth(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* xml); <a name="l00636"></a>00636 <a name="l00642"></a>00642 <span class="keyword">virtual</span> <span class="keywordtype">void</span> processSecuring(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* xml); <a name="l00643"></a>00643 <a name="l00648"></a>00648 <span class="keyword">virtual</span> <span class="keywordtype">void</span> processStarted(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* xml); <a name="l00649"></a>00649 <a name="l00653"></a><a class="code" href="classTelEngine_1_1JBStream.html#26b27be8f0822275eb0c24bfca8adb27">00653</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> streamRunning() <a name="l00654"></a>00654 {} <a name="l00655"></a>00655 <a name="l00663"></a>00663 <a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* getIqEvent(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* xml, <span class="keywordtype">int</span> iqType, <a class="code" href="classTelEngine_1_1XMPPError.html#1d1cfd8ffb84e947f82999c682b666a7">XMPPError::Type</a>& error); <a name="l00664"></a>00664 <a name="l00669"></a>00669 <span class="keywordtype">bool</span> sendStreamStart(); <a name="l00670"></a>00670 <a name="l00677"></a>00677 <span class="keywordtype">bool</span> sendStreamXML(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* e, State newState); <a name="l00678"></a>00678 <a name="l00685"></a>00685 <span class="keywordtype">void</span> invalidStreamXML(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* xml, <a class="code" href="classTelEngine_1_1XMPPError.html#1d1cfd8ffb84e947f82999c682b666a7">XMPPError::Type</a> error, <span class="keyword">const</span> <span class="keywordtype">char</span>* reason); <a name="l00686"></a>00686 <a name="l00691"></a>00691 <span class="keywordtype">void</span> errorStreamXML(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* xml); <a name="l00692"></a>00692 <a name="l00698"></a>00698 <span class="keywordtype">void</span> dropXML(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* xml, <span class="keywordtype">bool</span> unexpected = <span class="keyword">true</span>); <a name="l00699"></a>00699 <a name="l00704"></a>00704 <span class="keywordtype">void</span> changeState(State newState); <a name="l00705"></a>00705 <a name="l00713"></a>00713 <span class="keywordtype">bool</span> getStreamFeatures(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* features); <a name="l00714"></a>00714 <a name="l00719"></a>00719 <span class="keywordtype">bool</span> startTls(); <a name="l00720"></a>00720 <a name="l00726"></a>00726 <span class="keywordtype">bool</span> startAuth(); <a name="l00727"></a>00727 <a name="l00735"></a>00735 <span class="keywordtype">bool</span> sendAuthResponse(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* challenge = 0); <a name="l00736"></a>00736 <a name="l00744"></a>00744 <span class="keywordtype">void</span> buildSaslResponse(<a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& response, <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>* realm = 0, <a name="l00745"></a>00745 <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>* nonce = 0); <a name="l00746"></a>00746 <a name="l00751"></a>00751 <span class="keywordtype">void</span> setClientAuthMechanism(); <a name="l00752"></a>00752 <a name="l00759"></a>00759 <span class="keywordtype">void</span> buildDigestMD5Sasl(<a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& dest, <span class="keywordtype">bool</span> authenticate = <span class="keyword">true</span>); <a name="l00760"></a>00760 <a name="l00765"></a>00765 <span class="keywordtype">void</span> setRecvCount(<span class="keywordtype">int</span> value); <a name="l00766"></a>00766 <a name="l00772"></a>00772 <span class="keywordtype">bool</span> startIdleTimer(u_int64_t time = <a class="code" href="classTelEngine_1_1Time.html#fedf91537e85e72f09da0a8ffc598e53">Time::msecNow</a>()); <a name="l00773"></a>00773 <a name="l00778"></a><a class="code" href="classTelEngine_1_1JBStream.html#7cdf23fa6629049d3beaf3c24c9025ed">00778</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* <a class="code" href="classTelEngine_1_1JBStream.html#7cdf23fa6629049d3beaf3c24c9025ed">lastEvent</a>() { <a name="l00779"></a>00779 <a class="code" href="classTelEngine_1_1ObjList.html" title="An object list class.">ObjList</a>* o = m_events.last(); <a name="l00780"></a>00780 <span class="keywordflow">return</span> o ? <span class="keyword">static_cast<</span><a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>*<span class="keyword">></span>(o-><a class="code" href="classTelEngine_1_1ObjList.html#b59374b052f2beba1b97ad046326e9f2">get</a>()) : 0; <a name="l00781"></a>00781 } <a name="l00782"></a>00782 <a name="l00786"></a><a class="code" href="classTelEngine_1_1JBStream.html#bcf1cd8e42c8d2c130ff1d20e3083fb8">00786</a> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a> m_name; <a name="l00787"></a>00787 <a name="l00791"></a><a class="code" href="classTelEngine_1_1JBStream.html#e83497974c7f7c20068de5b0afc9a343">00791</a> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a> m_password; <a name="l00792"></a>00792 <a name="l00796"></a><a class="code" href="classTelEngine_1_1JBStream.html#9f08ef25bb406fb5e5fce8bf9bfedbfe">00796</a> <a class="code" href="classTelEngine_1_1JIDFeatureList.html" title="JID feature list.">JIDFeatureList</a> m_localFeatures; <a name="l00797"></a>00797 <a name="l00801"></a><a class="code" href="classTelEngine_1_1JBStream.html#f37d04720d93411f21b1f07344ea7671">00801</a> <a class="code" href="classTelEngine_1_1JIDFeatureList.html" title="JID feature list.">JIDFeatureList</a> m_remoteFeatures; <a name="l00802"></a>00802 <a name="l00806"></a><a class="code" href="classTelEngine_1_1JBStream.html#cf88a9269a6bde0e77d6d64102d824ad">00806</a> <span class="keywordtype">int</span> m_flags; <a name="l00807"></a>00807 <a name="l00811"></a><a class="code" href="classTelEngine_1_1JBStream.html#a39befd76b9c3dc89d1a275d9bc893d7">00811</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_challengeCount; <a name="l00812"></a>00812 <a name="l00816"></a><a class="code" href="classTelEngine_1_1JBStream.html#697e1f2b341314ad19ff303ebd2d39d8">00816</a> <a class="code" href="classTelEngine_1_1JBStream.html#0fae335f68530ec36ed416609375f46a">WaitState</a> m_waitState; <a name="l00817"></a>00817 <a name="l00821"></a><a class="code" href="classTelEngine_1_1JBStream.html#463e66ede248013fecb61d075e47cb0a">00821</a> <a class="code" href="classTelEngine_1_1JIDFeatureSasl.html#003177e1998c999a0ee3b28fb7c5db4c">JIDFeatureSasl::Mechanism</a> m_authMech; <a name="l00822"></a>00822 <a name="l00826"></a><a class="code" href="classTelEngine_1_1JBStream.html#f03492039835c9a69c91e9c2517a56aa">00826</a> <a class="code" href="classTelEngine_1_1ObjList.html" title="An object list class.">ObjList</a> m_events; <a name="l00827"></a>00827 <a name="l00828"></a>00828 <span class="keyword">private</span>: <a name="l00829"></a>00829 <span class="comment">// Event termination notification</span> <a name="l00830"></a>00830 <span class="comment">// @param event The notifier. Ignored if it's not m_lastEvent</span> <a name="l00831"></a>00831 <span class="keywordtype">void</span> eventTerminated(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event); <a name="l00832"></a>00832 <span class="comment">// Try sending pending stream element if any</span> <a name="l00833"></a>00833 <span class="comment">// Try to send the first element in pending outgoing stanzas list</span> <a name="l00834"></a>00834 <span class="comment">// If ErrorNoSocket is returned, stream termination was initiated</span> <a name="l00835"></a>00835 <a class="code" href="classTelEngine_1_1JBStream.html#2c3e4bb40f36b262a5214e2da2bca9c5">Error</a> sendPending(); <a name="l00836"></a>00836 <span class="comment">// Remove pending elements with id if id is not 0</span> <a name="l00837"></a>00837 <span class="comment">// Remove all elements without id if id is 0</span> <a name="l00838"></a>00838 <span class="comment">// Set force to true to remove the first element even if partially sent</span> <a name="l00839"></a>00839 <span class="keywordtype">void</span> removePending(<span class="keywordtype">bool</span> notify, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>* <span class="keywordtype">id</span>, <span class="keywordtype">bool</span> force); <a name="l00840"></a>00840 <span class="comment">// Called when a setup state was completed</span> <a name="l00841"></a>00841 <span class="comment">// Set/reset some stream flags and data</span> <a name="l00842"></a>00842 <span class="keywordtype">void</span> resetStream(); <a name="l00843"></a>00843 <a name="l00844"></a>00844 <span class="keywordtype">int</span> m_type; <span class="comment">// Stream type</span> <a name="l00845"></a>00845 <a class="code" href="classTelEngine_1_1JBStream.html#5d74787dedbc4e11c1ab15bf487e61f8">State</a> m_state; <span class="comment">// Stream state</span> <a name="l00846"></a>00846 <span class="keywordtype">bool</span> m_outgoing; <span class="comment">// Stream direction</span> <a name="l00847"></a>00847 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_restart; <span class="comment">// Remaining restart attempts</span> <a name="l00848"></a>00848 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_restartMax; <span class="comment">// Max restart attempts</span> <a name="l00849"></a>00849 u_int64_t m_timeToFillRestart; <span class="comment">// Next time to increase the restart counter</span> <a name="l00850"></a>00850 u_int64_t m_setupTimeout; <span class="comment">// Stream setup timeout (interval allowed between Idle and Running states)</span> <a name="l00851"></a>00851 u_int64_t m_idleTimeout; <span class="comment">// Connection idle in state Running (send keep alive packet)</span> <a name="l00852"></a>00852 <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a> m_id; <span class="comment">// Stream id</span> <a name="l00853"></a>00853 <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a> m_local; <span class="comment">// Local peer's jid</span> <a name="l00854"></a>00854 <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a> m_remote; <span class="comment">// Remote peer's jid</span> <a name="l00855"></a>00855 <a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>* m_engine; <span class="comment">// The owner of this stream</span> <a name="l00856"></a>00856 <a class="code" href="classTelEngine_1_1JBSocket.html" title="A Jabber streams&#39;s socket.">JBSocket</a> m_socket; <span class="comment">// The socket used by this stream</span> <a name="l00857"></a>00857 <a class="code" href="classTelEngine_1_1XMLParser.html" title="An XML parser.">XMLParser</a> m_parser; <span class="comment">// XML parser</span> <a name="l00858"></a>00858 <a class="code" href="classTelEngine_1_1ObjList.html" title="An object list class.">ObjList</a> m_outXML; <span class="comment">// Outgoing XML elements</span> <a name="l00859"></a>00859 <a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* m_lastEvent; <span class="comment">// Last generated event</span> <a name="l00860"></a>00860 <a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* m_terminateEvent; <span class="comment">// Destroy/Terminate event</span> <a name="l00861"></a>00861 <a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* m_startEvent; <span class="comment">// Running event</span> <a name="l00862"></a>00862 <span class="keywordtype">int</span> m_recvCount; <span class="comment">// The number of bytes to read: -1: all, 0: nothing 1: 1 byte</span> <a name="l00863"></a>00863 <a class="code" href="classTelEngine_1_1XMLElementOut.html" title="An outgoing XML element.">XMLElementOut</a>* m_streamXML; <span class="comment">// Pending (incomplete) stream element</span> <a name="l00864"></a>00864 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_declarationSent; <span class="comment">// The number of declaration bytes sent</span> <a name="l00865"></a>00865 <span class="comment">// Auth data</span> <a name="l00866"></a>00866 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_nonceCount; <span class="comment">// Nonce count</span> <a name="l00867"></a>00867 <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a> m_nc; <span class="comment">// Nonce count string</span> <a name="l00868"></a>00868 <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a> m_nonce; <span class="comment">// Server nonce</span> <a name="l00869"></a>00869 <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a> m_cnonce; <span class="comment">// Client nonce</span> <a name="l00870"></a>00870 <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a> m_realm; <span class="comment">// Client realm</span> <a name="l00871"></a>00871 }; <a name="l00872"></a>00872 <a name="l00877"></a><a class="code" href="classTelEngine_1_1JBComponentStream.html">00877</a> <span class="keyword">class </span>YJINGLE_API <a class="code" href="classTelEngine_1_1JBComponentStream.html" title="A Jabber Component stream.">JBComponentStream</a> : <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a> <a name="l00878"></a>00878 { <a name="l00879"></a>00879 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>; <a name="l00880"></a>00880 <span class="keyword">public</span>: <a name="l00884"></a><a class="code" href="classTelEngine_1_1JBComponentStream.html#cad19d5b413bcc10a441be47594e86bc">00884</a> <span class="keyword">virtual</span> ~<a class="code" href="classTelEngine_1_1JBComponentStream.html" title="A Jabber Component stream.">JBComponentStream</a>() <a name="l00885"></a>00885 {} <a name="l00886"></a>00886 <a name="l00887"></a>00887 <span class="keyword">protected</span>: <a name="l00895"></a>00895 <a class="code" href="classTelEngine_1_1JBComponentStream.html" title="A Jabber Component stream.">JBComponentStream</a>(<a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>* engine, <a class="code" href="classTelEngine_1_1XMPPServerInfo.html" title="Server info class.">XMPPServerInfo</a>& info, <a name="l00896"></a>00896 <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& localJid, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& remoteJid); <a name="l00897"></a>00897 <a name="l00902"></a>00902 <span class="keyword">virtual</span> <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* getStreamStart(); <a name="l00903"></a>00903 <a name="l00908"></a>00908 <span class="keyword">virtual</span> <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* getAuthStart(); <a name="l00909"></a>00909 <a name="l00914"></a>00914 <span class="keyword">virtual</span> <span class="keywordtype">void</span> processAuth(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* xml); <a name="l00915"></a>00915 <a name="l00920"></a>00920 <span class="keyword">virtual</span> <span class="keywordtype">void</span> processStarted(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* xml); <a name="l00921"></a>00921 <a name="l00922"></a>00922 <span class="keyword">private</span>: <a name="l00923"></a>00923 <span class="comment">// Default constructor is private to avoid unwanted use</span> <a name="l00924"></a>00924 <a class="code" href="classTelEngine_1_1JBComponentStream.html" title="A Jabber Component stream.">JBComponentStream</a>() {} <a name="l00925"></a>00925 }; <a name="l00926"></a>00926 <a name="l00931"></a><a class="code" href="classTelEngine_1_1JBClientStream.html">00931</a> <span class="keyword">class </span>YJINGLE_API <a class="code" href="classTelEngine_1_1JBClientStream.html" title="A Jabber client to server stream.">JBClientStream</a> : <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a> <a name="l00932"></a>00932 { <a name="l00933"></a>00933 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>; <a name="l00934"></a>00934 <span class="keyword">public</span>: <a name="l00938"></a>00938 <span class="keyword">virtual</span> ~<a class="code" href="classTelEngine_1_1JBClientStream.html" title="A Jabber client to server stream.">JBClientStream</a>(); <a name="l00939"></a>00939 <a name="l00944"></a><a class="code" href="classTelEngine_1_1JBClientStream.html#2bd974d7c72f3fcaf298ab626234ad22">00944</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1XMPPUserRoster.html" title="The roster of a local user.">XMPPUserRoster</a>* roster() <a name="l00945"></a>00945 { <span class="keywordflow">return</span> m_roster; } <a name="l00946"></a>00946 <a name="l00951"></a><a class="code" href="classTelEngine_1_1JBClientStream.html#eca1e7829f73b83025df5d1bb14a74ad">00951</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JIDResource.html" title="A JID resource.">JIDResource</a>* getResource() <a name="l00952"></a>00952 { <span class="keywordflow">return</span> m_resource; } <a name="l00953"></a>00953 <a name="l00959"></a>00959 <a class="code" href="classTelEngine_1_1XMPPUser.html" title="An XMPP remote user.">XMPPUser</a>* getRemote(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& jid); <a name="l00960"></a>00960 <a name="l00967"></a>00967 <span class="keyword">virtual</span> Error sendStanza(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* stanza, <span class="keyword">const</span> <span class="keywordtype">char</span>* senderId = 0); <a name="l00968"></a>00968 <a name="l00969"></a>00969 <span class="keyword">protected</span>: <a name="l00977"></a>00977 <a class="code" href="classTelEngine_1_1JBClientStream.html" title="A Jabber client to server stream.">JBClientStream</a>(<a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>* engine, <a class="code" href="classTelEngine_1_1XMPPServerInfo.html" title="Server info class.">XMPPServerInfo</a>& info, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& jid, <a name="l00978"></a>00978 <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1NamedList.html" title="A named string container class.">NamedList</a>& params); <a name="l00979"></a>00979 <a name="l00992"></a>00992 <a class="code" href="classTelEngine_1_1JBClientStream.html" title="A Jabber client to server stream.">JBClientStream</a>(<a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>* engine, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& jid, <a name="l00993"></a>00993 <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& password, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1SocketAddr.html" title="A socket address holder.">SocketAddr</a>& address, <a name="l00994"></a>00994 <span class="keywordtype">bool</span> autoRestart, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> maxRestart, u_int64_t incRestartInterval, <a name="l00995"></a>00995 <span class="keywordtype">bool</span> allowPlainAuth = <span class="keyword">false</span>, <span class="keywordtype">bool</span> outgoing = <span class="keyword">true</span>); <a name="l00996"></a>00996 <a name="l01000"></a>01000 <span class="keyword">virtual</span> <span class="keywordtype">void</span> streamRunning(); <a name="l01001"></a>01001 <a name="l01006"></a>01006 <span class="keyword">virtual</span> <span class="keywordtype">void</span> processRunning(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* xml); <a name="l01007"></a>01007 <a name="l01015"></a>01015 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> checkDestination(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* xml, <span class="keywordtype">bool</span>& respond); <a name="l01016"></a>01016 <a name="l01017"></a>01017 <span class="keyword">private</span>: <a name="l01018"></a>01018 <span class="comment">// Default constructor is private to avoid unwanted use</span> <a name="l01019"></a>01019 <a class="code" href="classTelEngine_1_1JBClientStream.html" title="A Jabber client to server stream.">JBClientStream</a>() {} <a name="l01020"></a>01020 <a name="l01021"></a>01021 XMPPUserRoster* m_roster; <span class="comment">// Client's roster</span> <a name="l01022"></a>01022 JIDResource* m_resource; <span class="comment">// Client's resource</span> <a name="l01023"></a>01023 String m_rosterReqId; <span class="comment">// Roster request id</span> <a name="l01024"></a>01024 }; <a name="l01025"></a>01025 <a name="l01026"></a>01026 <a name="l01031"></a><a class="code" href="classTelEngine_1_1JBThread.html">01031</a> <span class="keyword">class </span>YJINGLE_API <a class="code" href="classTelEngine_1_1JBThread.html" title="A Jabber thread that can be added to a list of threads.">JBThread</a> : <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1GenObject.html">GenObject</a> <a name="l01032"></a>01032 { <a name="l01033"></a>01033 <span class="keyword">public</span>: <a name="l01037"></a><a class="code" href="classTelEngine_1_1JBThread.html#1d1cfd8ffb84e947f82999c682b666a7">01037</a> <span class="keyword">enum</span> <a class="code" href="classTelEngine_1_1JBThread.html#1d1cfd8ffb84e947f82999c682b666a7">Type</a> { <a name="l01038"></a>01038 StreamConnect, <span class="comment">// Asynchronously connect a stream's socket</span> <a name="l01039"></a>01039 EngineReceive, <span class="comment">// Read all streams sockets</span> <a name="l01040"></a>01040 EngineProcess, <span class="comment">// Get events from sockets and send them to</span> <a name="l01041"></a>01041 <span class="comment">// registered services</span> <a name="l01042"></a>01042 Presence, <span class="comment">// Presence service processor</span> <a name="l01043"></a>01043 Jingle, <span class="comment">// Jingle service processor</span> <a name="l01044"></a>01044 <a class="code" href="classTelEngine_1_1Message.html" title="A message container class.">Message</a> <span class="comment">// Message service processor</span> <a name="l01045"></a>01045 }; <a name="l01046"></a>01046 <a name="l01050"></a>01050 <span class="keyword">virtual</span> ~<a class="code" href="classTelEngine_1_1JBThread.html" title="A Jabber thread that can be added to a list of threads.">JBThread</a>(); <a name="l01051"></a>01051 <a name="l01056"></a><a class="code" href="classTelEngine_1_1JBThread.html#fbd0fa31db28593e9669c3c56711c0a7">01056</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JBThread.html#1d1cfd8ffb84e947f82999c682b666a7">Type</a> type()<span class="keyword"> const</span> <a name="l01057"></a>01057 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_type; } <a name="l01058"></a>01058 <a name="l01064"></a>01064 <span class="keyword">virtual</span> <span class="keywordtype">void</span> cancelThread(<span class="keywordtype">bool</span> hard = <span class="keyword">false</span>) = 0; <a name="l01065"></a>01065 <a name="l01075"></a>01075 <span class="keyword">static</span> <span class="keywordtype">bool</span> start(Type type, <a class="code" href="classTelEngine_1_1JBThreadList.html" title="A list of private threads.">JBThreadList</a>* list, <span class="keywordtype">void</span>* client, <span class="keywordtype">int</span> sleep, <span class="keywordtype">int</span> prio); <a name="l01076"></a>01076 <a name="l01077"></a>01077 <span class="keyword">protected</span>: <a name="l01085"></a>01085 <a class="code" href="classTelEngine_1_1JBThread.html" title="A Jabber thread that can be added to a list of threads.">JBThread</a>(Type type, <a class="code" href="classTelEngine_1_1JBThreadList.html" title="A list of private threads.">JBThreadList</a>* owner, <span class="keywordtype">void</span>* client, <span class="keywordtype">int</span> sleep = 2); <a name="l01086"></a>01086 <a name="l01090"></a>01090 <span class="keywordtype">void</span> runClient(); <a name="l01091"></a>01091 <a name="l01096"></a><a class="code" href="classTelEngine_1_1JBThread.html#9e0674277712e407202cb84e135e74df">01096</a> <span class="keyword">inline</span> <span class="keywordtype">void</span>* client() <a name="l01097"></a>01097 { <span class="keywordflow">return</span> m_client; } <a name="l01098"></a>01098 <a name="l01099"></a>01099 <span class="keyword">private</span>: <a name="l01100"></a>01100 Type m_type; <span class="comment">// Thread type</span> <a name="l01101"></a>01101 <a class="code" href="classTelEngine_1_1JBThreadList.html" title="A list of private threads.">JBThreadList</a>* m_owner; <span class="comment">// List owning this thread</span> <a name="l01102"></a>01102 <span class="keywordtype">void</span>* m_client; <span class="comment">// The client to process</span> <a name="l01103"></a>01103 <span class="keywordtype">int</span> m_sleep; <span class="comment">// Time to sleep if there is nothing to do</span> <a name="l01104"></a>01104 }; <a name="l01105"></a>01105 <a name="l01106"></a>01106 <a name="l01111"></a><a class="code" href="classTelEngine_1_1JBThreadList.html">01111</a> <span class="keyword">class </span>YJINGLE_API <a class="code" href="classTelEngine_1_1JBThreadList.html" title="A list of private threads.">JBThreadList</a> <a name="l01112"></a>01112 { <a name="l01113"></a>01113 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTelEngine_1_1JBThread.html" title="A Jabber thread that can be added to a list of threads.">JBThread</a>; <a name="l01114"></a>01114 <span class="keyword">public</span>: <a name="l01119"></a><a class="code" href="classTelEngine_1_1JBThreadList.html#acc39ead51a3dfc232fbcc28dd65f4cf">01119</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1DebugEnabler.html" title="A holder for a debug level.">DebugEnabler</a>* owner()<span class="keyword"> const</span> <a name="l01120"></a>01120 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_owner; } <a name="l01121"></a>01121 <a name="l01128"></a>01128 <span class="keywordtype">void</span> cancelThreads(<span class="keywordtype">bool</span> wait = <span class="keyword">true</span>, <span class="keywordtype">bool</span> hard = <span class="keyword">false</span>); <a name="l01129"></a>01129 <a name="l01130"></a>01130 <span class="keyword">protected</span>: <a name="l01135"></a><a class="code" href="classTelEngine_1_1JBThreadList.html#c3af94502767797ae7197fd95adf5157">01135</a> <a class="code" href="classTelEngine_1_1JBThreadList.html" title="A list of private threads.">JBThreadList</a>(<a class="code" href="classTelEngine_1_1DebugEnabler.html" title="A holder for a debug level.">DebugEnabler</a>* owner = 0) <a name="l01136"></a>01136 : m_owner(owner), m_mutex(true), m_cancelling(false) <a name="l01137"></a>01137 { m_threads.setDelete(<span class="keyword">false</span>); } <a name="l01138"></a>01138 <a name="l01143"></a><a class="code" href="classTelEngine_1_1JBThreadList.html#51e309e04f1bb2b773ad9cd9466351be">01143</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> setOwner(<a class="code" href="classTelEngine_1_1DebugEnabler.html" title="A holder for a debug level.">DebugEnabler</a>* dbg) <a name="l01144"></a>01144 { m_owner = dbg; } <a name="l01145"></a>01145 <a name="l01146"></a>01146 <span class="keyword">private</span>: <a name="l01147"></a>01147 <a class="code" href="classTelEngine_1_1DebugEnabler.html" title="A holder for a debug level.">DebugEnabler</a>* m_owner; <span class="comment">// The owner of this list</span> <a name="l01148"></a>01148 <a class="code" href="classTelEngine_1_1Mutex.html" title="Mutex support.">Mutex</a> m_mutex; <span class="comment">// Lock list operations</span> <a name="l01149"></a>01149 <a class="code" href="classTelEngine_1_1ObjList.html" title="An object list class.">ObjList</a> m_threads; <span class="comment">// Private threads list</span> <a name="l01150"></a>01150 <span class="keywordtype">bool</span> m_cancelling; <span class="comment">// Cancelling threads operation in progress</span> <a name="l01151"></a>01151 }; <a name="l01152"></a>01152 <a name="l01153"></a>01153 <a name="l01158"></a><a class="code" href="classTelEngine_1_1JBEngine.html">01158</a> <span class="keyword">class </span>YJINGLE_API <a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a> : <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1DebugEnabler.html" title="A holder for a debug level.">DebugEnabler</a>, <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1Mutex.html" title="Mutex support.">Mutex</a>, <a name="l01159"></a>01159 <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1GenObject.html">GenObject</a>, <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1JBThreadList.html" title="A list of private threads.">JBThreadList</a> <a name="l01160"></a>01160 { <a name="l01161"></a>01161 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>; <a name="l01162"></a>01162 <span class="keyword">public</span>: <a name="l01166"></a><a class="code" href="classTelEngine_1_1JBEngine.html#ac39b55be6469395f55ff0292ad8184c">01166</a> <span class="keyword">enum</span> <a class="code" href="classTelEngine_1_1JBEngine.html#ac39b55be6469395f55ff0292ad8184c">Protocol</a> { <a name="l01167"></a>01167 Component = 1, <span class="comment">// Use Jabber Component protocol</span> <a name="l01168"></a>01168 <a class="code" href="classTelEngine_1_1Client.html" title="Thread that runs the User Interface.">Client</a> = 2, <span class="comment">// Use client streams</span> <a name="l01169"></a>01169 }; <a name="l01170"></a>01170 <a name="l01174"></a><a class="code" href="classTelEngine_1_1JBEngine.html#5b06c272042eb9a41fa774ec00171c0f">01174</a> <span class="keyword">enum</span> <a class="code" href="classTelEngine_1_1JBEngine.html#5b06c272042eb9a41fa774ec00171c0f">Service</a> { <a name="l01175"></a>01175 ServiceJingle = 0, <span class="comment">// Receive Jingle events</span> <a name="l01176"></a>01176 ServiceIq = 1, <span class="comment">// Receive generic Iq events</span> <a name="l01177"></a>01177 ServiceMessage = 2, <span class="comment">// Receive Message events</span> <a name="l01178"></a>01178 ServicePresence = 3, <span class="comment">// Receive Presence events</span> <a name="l01179"></a>01179 ServiceCommand = 4, <span class="comment">// Receive Command events</span> <a name="l01180"></a>01180 ServiceDisco = 5, <span class="comment">// Receive Disco events</span> <a name="l01181"></a>01181 ServiceStream = 6, <span class="comment">// Receive stream Terminated or Destroy events</span> <a name="l01182"></a>01182 ServiceWriteFail = 7, <span class="comment">// Receive WriteFail events</span> <a name="l01183"></a>01183 ServiceRoster = 8, <span class="comment">// Receive roster events</span> <a name="l01184"></a>01184 ServiceCount = 9 <a name="l01185"></a>01185 }; <a name="l01186"></a>01186 <a name="l01191"></a>01191 <a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>(Protocol proto); <a name="l01192"></a>01192 <a name="l01196"></a>01196 <span class="keyword">virtual</span> ~<a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>(); <a name="l01197"></a>01197 <a name="l01202"></a><a class="code" href="classTelEngine_1_1JBEngine.html#892a53d0ff150377ce8ff6f4fa5b3370">01202</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JBEngine.html#ac39b55be6469395f55ff0292ad8184c">Protocol</a> protocol()<span class="keyword"> const</span> <a name="l01203"></a>01203 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_protocol; } <a name="l01204"></a>01204 <a name="l01209"></a><a class="code" href="classTelEngine_1_1JBEngine.html#4ca1a9610a129754f96cec4c0465ae7f">01209</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& componentServer()<span class="keyword"> const</span> <a name="l01210"></a>01210 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_componentDomain; } <a name="l01211"></a>01211 <a name="l01216"></a><a class="code" href="classTelEngine_1_1JBEngine.html#1ce8a139871d81eea7522fe417302698">01216</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> setAlternateDomain(<span class="keyword">const</span> <span class="keywordtype">char</span>* domain = 0) <a name="l01217"></a>01217 { m_alternateDomain = domain; } <a name="l01218"></a>01218 <a name="l01223"></a><a class="code" href="classTelEngine_1_1JBEngine.html#5b626c020d22d0b4fdf24eba7a7a4561">01223</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& getAlternateDomain()<span class="keyword"> const</span> <a name="l01224"></a>01224 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_alternateDomain; } <a name="l01225"></a>01225 <a name="l01230"></a><a class="code" href="classTelEngine_1_1JBEngine.html#8edc2dd8faf4d78e95a2562ce6b481af">01230</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& defaultResource()<span class="keyword"> const</span> <a name="l01231"></a>01231 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_defaultResource; } <a name="l01232"></a>01232 <a name="l01237"></a><a class="code" href="classTelEngine_1_1JBEngine.html#0b1c871dc0071b5e6889e3c7fa62f1c7">01237</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1ObjList.html" title="An object list class.">ObjList</a>& streams()<span class="keyword"> const</span> <a name="l01238"></a>01238 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_streams; } <a name="l01239"></a>01239 <a name="l01243"></a>01243 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="namespaceTelEngine.html#9cc4a4249317f5c7eb006842cf233672">destruct</a>(); <a name="l01244"></a>01244 <a name="l01249"></a>01249 <span class="keyword">virtual</span> <span class="keywordtype">void</span> initialize(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1NamedList.html" title="A named string container class.">NamedList</a>& params); <a name="l01250"></a>01250 <a name="l01254"></a>01254 <span class="keywordtype">void</span> cleanup(); <a name="l01255"></a>01255 <a name="l01262"></a>01262 <span class="keywordtype">void</span> setComponentServer(<span class="keyword">const</span> <span class="keywordtype">char</span>* domain); <a name="l01263"></a>01263 <a name="l01269"></a>01269 <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* findStream(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& name); <a name="l01270"></a>01270 <a name="l01281"></a>01281 <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* getStream(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>* jid = 0, <span class="keywordtype">bool</span> create = <span class="keyword">true</span>); <a name="l01282"></a>01282 <a name="l01289"></a>01289 <span class="keywordtype">bool</span> getStream(<a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>*& stream, <span class="keywordtype">bool</span>& release); <a name="l01290"></a>01290 <a name="l01296"></a>01296 <a class="code" href="classTelEngine_1_1JBClientStream.html" title="A Jabber client to server stream.">JBClientStream</a>* createClientStream(<a class="code" href="classTelEngine_1_1NamedList.html" title="A named string container class.">NamedList</a>& params); <a name="l01297"></a>01297 <a name="l01303"></a>01303 <span class="keywordtype">bool</span> receive(); <a name="l01304"></a>01304 <a name="l01311"></a>01311 <span class="keywordtype">bool</span> process(u_int64_t time); <a name="l01312"></a>01312 <a name="l01318"></a>01318 <span class="keywordtype">bool</span> checkDupId(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* stream); <a name="l01319"></a>01319 <a name="l01326"></a>01326 <span class="keywordtype">bool</span> checkComponentFrom(<a class="code" href="classTelEngine_1_1JBComponentStream.html" title="A Jabber Component stream.">JBComponentStream</a>* stream, <span class="keyword">const</span> <span class="keywordtype">char</span>* from); <a name="l01327"></a>01327 <a name="l01332"></a>01332 <span class="keyword">virtual</span> <span class="keywordtype">void</span> connect(<a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* stream); <a name="l01333"></a>01333 <a name="l01338"></a><a class="code" href="classTelEngine_1_1JBEngine.html#8b00783f72e7cd9a1ceb96f23572d0bc">01338</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> exiting()<span class="keyword"> const</span> <a name="l01339"></a>01339 <span class="keyword"> </span>{ <span class="keywordflow">return</span> <span class="keyword">false</span>; } <a name="l01340"></a>01340 <a name="l01346"></a>01346 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> encryptStream(<a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* stream); <a name="l01347"></a>01347 <a name="l01353"></a>01353 <span class="keywordtype">void</span> appendServer(<a class="code" href="classTelEngine_1_1XMPPServerInfo.html" title="Server info class.">XMPPServerInfo</a>* server, <span class="keywordtype">bool</span> open); <a name="l01354"></a>01354 <a name="l01364"></a>01364 <span class="keywordtype">bool</span> getServerIdentity(<a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& destination, <span class="keywordtype">bool</span> full, <span class="keyword">const</span> <span class="keywordtype">char</span>* token = 0, <a name="l01365"></a>01365 <span class="keywordtype">bool</span> domain = <span class="keyword">true</span>); <a name="l01366"></a>01366 <a name="l01374"></a>01374 <a class="code" href="classTelEngine_1_1XMPPServerInfo.html" title="Server info class.">XMPPServerInfo</a>* findServerInfo(<span class="keyword">const</span> <span class="keywordtype">char</span>* token, <span class="keywordtype">bool</span> domain); <a name="l01375"></a>01375 <a name="l01384"></a>01384 <span class="keywordtype">void</span> attachService(<a class="code" href="classTelEngine_1_1JBService.html" title="A Jabber service.">JBService</a>* service, Service type, <span class="keywordtype">int</span> prio = -1); <a name="l01385"></a>01385 <a name="l01391"></a>01391 <span class="keywordtype">void</span> detachService(<a class="code" href="classTelEngine_1_1JBService.html" title="A Jabber service.">JBService</a>* service); <a name="l01392"></a>01392 <a name="l01399"></a>01399 <span class="keywordtype">void</span> printXml(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>& xml, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* stream, <span class="keywordtype">bool</span> send) <span class="keyword">const</span>; <a name="l01400"></a>01400 <a name="l01405"></a><a class="code" href="classTelEngine_1_1JBEngine.html#5bef94a97c415b3d98d2dc046fafdce1">01405</a> <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* lookupProto(<span class="keywordtype">int</span> proto, <span class="keyword">const</span> <span class="keywordtype">char</span>* def = 0) <a name="l01406"></a>01406 { <span class="keywordflow">return</span> <a class="code" href="namespaceTelEngine.html#4668c9172c6ae5f59f5782ecc6e05516">lookup</a>(proto,s_protoName,def); } <a name="l01407"></a>01407 <a name="l01412"></a><a class="code" href="classTelEngine_1_1JBEngine.html#7a3c7e7dc7c991c341feaf027eb44714">01412</a> <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">int</span> lookupProto(<span class="keyword">const</span> <span class="keywordtype">char</span>* proto, <span class="keywordtype">int</span> def = 0) <a name="l01413"></a>01413 { <span class="keywordflow">return</span> <a class="code" href="namespaceTelEngine.html#4668c9172c6ae5f59f5782ecc6e05516">lookup</a>(proto,s_protoName,def); } <a name="l01414"></a>01414 <a name="l01415"></a>01415 <span class="keyword">private</span>: <a name="l01416"></a>01416 <span class="comment">// Process a Disco... events</span> <a name="l01417"></a>01417 <span class="keywordtype">bool</span> processDisco(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event); <a name="l01418"></a>01418 <span class="comment">// Process a Command events</span> <a name="l01419"></a>01419 <span class="keywordtype">bool</span> processCommand(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event); <a name="l01420"></a>01420 <span class="comment">// Pass events to services</span> <a name="l01421"></a>01421 <span class="keywordtype">bool</span> received(Service service, <a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event); <a name="l01422"></a>01422 <span class="keyword">static</span> <a class="code" href="structTelEngine_1_1TokenDict.html">TokenDict</a> s_protoName[]; <span class="comment">// Protocol names</span> <a name="l01423"></a>01423 <a name="l01424"></a>01424 Protocol m_protocol; <span class="comment">// The protocol to use</span> <a name="l01425"></a>01425 u_int32_t m_restartUpdateInterval; <span class="comment">// Update interval for restart counter of all streams</span> <a name="l01426"></a>01426 u_int32_t m_restartCount; <span class="comment">// The default restart counter value</span> <a name="l01427"></a>01427 u_int64_t m_streamSetupInterval; <span class="comment">// Timeout for stream setup</span> <a name="l01428"></a>01428 u_int64_t m_streamIdleInterval; <span class="comment">// Timeout for stream idle (nothing sent/received in Running state)</span> <a name="l01429"></a>01429 <span class="keywordtype">int</span> m_printXml; <span class="comment">// Print XML data to output</span> <a name="l01430"></a>01430 <a class="code" href="classTelEngine_1_1ObjList.html" title="An object list class.">ObjList</a> m_streams; <span class="comment">// Streams belonging to this engine</span> <a name="l01431"></a>01431 <a class="code" href="classTelEngine_1_1JIDIdentity.html" title="A JID identity.">JIDIdentity</a>* m_identity; <span class="comment">// Engine's identity</span> <a name="l01432"></a>01432 <a class="code" href="classTelEngine_1_1JIDFeatureList.html" title="JID feature list.">JIDFeatureList</a> m_features; <span class="comment">// Engine's features</span> <a name="l01433"></a>01433 <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a> m_componentDomain; <span class="comment">// Default server domain name</span> <a name="l01434"></a>01434 <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a> m_componentAddr; <span class="comment">// Default server address</span> <a name="l01435"></a>01435 <span class="keywordtype">int</span> m_componentCheckFrom; <span class="comment">// The behaviour when checking the 'from' attribute for a component stream</span> <a name="l01436"></a>01436 <span class="comment">// 0: no check 1: local identity 2: remote identity</span> <a name="l01437"></a>01437 <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a> m_alternateDomain; <span class="comment">// Alternate acceptable domain</span> <a name="l01438"></a>01438 <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a> m_defaultResource; <span class="comment">// Default name for missing resources</span> <a name="l01439"></a>01439 <a class="code" href="classTelEngine_1_1Mutex.html" title="Mutex support.">Mutex</a> m_serverMutex; <span class="comment">// Lock server info list</span> <a name="l01440"></a>01440 <a class="code" href="classTelEngine_1_1ObjList.html" title="An object list class.">ObjList</a> m_server; <span class="comment">// Server info list</span> <a name="l01441"></a>01441 <a class="code" href="classTelEngine_1_1Mutex.html" title="Mutex support.">Mutex</a> m_servicesMutex; <span class="comment">// Lock service list</span> <a name="l01442"></a>01442 <a class="code" href="classTelEngine_1_1ObjList.html" title="An object list class.">ObjList</a> m_services[ServiceCount]; <span class="comment">// Services list</span> <a name="l01443"></a>01443 <span class="keywordtype">bool</span> m_initialized; <span class="comment">// True if already initialized</span> <a name="l01444"></a>01444 }; <a name="l01445"></a>01445 <a name="l01446"></a>01446 <a name="l01452"></a><a class="code" href="classTelEngine_1_1JBService.html">01452</a> <span class="keyword">class </span>YJINGLE_API <a class="code" href="classTelEngine_1_1JBService.html" title="A Jabber service.">JBService</a> : <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1DebugEnabler.html" title="A holder for a debug level.">DebugEnabler</a>, <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1Mutex.html" title="Mutex support.">Mutex</a>, <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1GenObject.html">GenObject</a> <a name="l01453"></a>01453 { <a name="l01454"></a>01454 <span class="keyword">public</span>: <a name="l01462"></a>01462 <a class="code" href="classTelEngine_1_1JBService.html" title="A Jabber service.">JBService</a>(<a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>* engine, <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1NamedList.html" title="A named string container class.">NamedList</a>* params, <span class="keywordtype">int</span> prio); <a name="l01463"></a>01463 <a name="l01467"></a>01467 <span class="keyword">virtual</span> ~<a class="code" href="classTelEngine_1_1JBService.html" title="A Jabber service.">JBService</a>(); <a name="l01468"></a>01468 <a name="l01473"></a><a class="code" href="classTelEngine_1_1JBService.html#5a8b605296e58ff76f7e068ac4ebc16f">01473</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>* engine() <a name="l01474"></a>01474 { <span class="keywordflow">return</span> m_engine; } <a name="l01475"></a>01475 <a name="l01480"></a><a class="code" href="classTelEngine_1_1JBService.html#abe11693b6d1400438282e81388587d9">01480</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> priority()<span class="keyword"> const</span> <a name="l01481"></a>01481 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_priority; } <a name="l01482"></a>01482 <a name="l01491"></a>01491 <span class="keywordtype">bool</span> received(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event); <a name="l01492"></a>01492 <a name="l01497"></a><a class="code" href="classTelEngine_1_1JBService.html#c391e1e7a016b4064486b5994fc1fed7">01497</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> initialize(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1NamedList.html" title="A named string container class.">NamedList</a>& params) <a name="l01498"></a>01498 {} <a name="l01499"></a>01499 <a name="l01503"></a>01503 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="namespaceTelEngine.html#9cc4a4249317f5c7eb006842cf233672">destruct</a>(); <a name="l01504"></a>01504 <a name="l01505"></a>01505 <span class="keyword">protected</span>: <a name="l01514"></a>01514 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> accept(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event, <span class="keywordtype">bool</span>& processed, <span class="keywordtype">bool</span>& insert); <a name="l01515"></a>01515 <a name="l01520"></a>01520 <a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* deque(); <a name="l01521"></a>01521 <a name="l01525"></a><a class="code" href="classTelEngine_1_1JBService.html#31bc0bda51596df392f3558367778451">01525</a> <span class="keywordtype">bool</span> m_initialized; <a name="l01526"></a>01526 <a name="l01527"></a>01527 <span class="keyword">private</span>: <a name="l01528"></a>01528 <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JBService.html" title="A Jabber service.">JBService</a>() {} <span class="comment">// Don't use it !</span> <a name="l01529"></a>01529 <a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>* m_engine; <span class="comment">// The Jabber Component engine</span> <a name="l01530"></a>01530 <span class="keywordtype">int</span> m_priority; <span class="comment">// Service priority</span> <a name="l01531"></a>01531 <a class="code" href="classTelEngine_1_1ObjList.html" title="An object list class.">ObjList</a> m_events; <span class="comment">// Events received from engine</span> <a name="l01532"></a>01532 }; <a name="l01533"></a>01533 <a name="l01534"></a>01534 <a name="l01539"></a><a class="code" href="classTelEngine_1_1JBMessage.html">01539</a> <span class="keyword">class </span>YJINGLE_API <a class="code" href="classTelEngine_1_1JBMessage.html" title="A Jabber message service.">JBMessage</a> : <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1JBService.html" title="A Jabber service.">JBService</a>, <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1JBThreadList.html" title="A list of private threads.">JBThreadList</a> <a name="l01540"></a>01540 { <a name="l01541"></a>01541 <span class="keyword">public</span>: <a name="l01545"></a><a class="code" href="classTelEngine_1_1JBMessage.html#2ea0bb09adcce7f655e8f8ee8d30561b">01545</a> <span class="keyword">enum</span> <a class="code" href="classTelEngine_1_1JBMessage.html#2ea0bb09adcce7f655e8f8ee8d30561b">MsgType</a> { <a name="l01546"></a>01546 Chat, <span class="comment">// chat</span> <a name="l01547"></a>01547 GroupChat, <span class="comment">// groupchat</span> <a name="l01548"></a>01548 HeadLine, <span class="comment">// headline</span> <a name="l01549"></a>01549 Normal, <span class="comment">// normal</span> <a name="l01550"></a>01550 Error, <span class="comment">// error</span> <a name="l01551"></a>01551 None, <a name="l01552"></a>01552 }; <a name="l01553"></a>01553 <a name="l01560"></a><a class="code" href="classTelEngine_1_1JBMessage.html#c3c10ed9002c8c7bd02f3c9aed3cc019">01560</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JBMessage.html" title="A Jabber message service.">JBMessage</a>(<a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>* engine, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1NamedList.html" title="A named string container class.">NamedList</a>* params, <span class="keywordtype">int</span> prio = 0) <a name="l01561"></a>01561 : <a class="code" href="classTelEngine_1_1JBService.html" title="A Jabber service.">JBService</a>(engine,<span class="stringliteral">"jbmsgrecv"</span>,params,prio), m_syncProcess(true) <a name="l01562"></a>01562 { <a class="code" href="classTelEngine_1_1JBThreadList.html#51e309e04f1bb2b773ad9cd9466351be">JBThreadList::setOwner</a>(<span class="keyword">this</span>); } <a name="l01563"></a>01563 <a name="l01567"></a><a class="code" href="classTelEngine_1_1JBMessage.html#d8bec1f689f893e40a11f7212c374143">01567</a> <span class="keyword">virtual</span> ~<a class="code" href="classTelEngine_1_1JBMessage.html" title="A Jabber message service.">JBMessage</a>() <a name="l01568"></a>01568 { cancelThreads(); } <a name="l01569"></a>01569 <a name="l01574"></a>01574 <span class="keyword">virtual</span> <span class="keywordtype">void</span> initialize(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1NamedList.html" title="A named string container class.">NamedList</a>& params); <a name="l01575"></a>01575 <a name="l01580"></a><a class="code" href="classTelEngine_1_1JBMessage.html#c9e7d1066fd09869137479a8442d28b3">01580</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* getMessage() <a name="l01581"></a>01581 { <span class="keywordflow">return</span> deque(); } <a name="l01582"></a>01582 <a name="l01588"></a>01588 <span class="keyword">virtual</span> <span class="keywordtype">void</span> processMessage(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event); <a name="l01589"></a>01589 <a name="l01599"></a>01599 <span class="keyword">static</span> <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* createMessage(MsgType type, <span class="keyword">const</span> <span class="keywordtype">char</span>* from, <a name="l01600"></a>01600 <span class="keyword">const</span> <span class="keywordtype">char</span>* to, <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keywordtype">id</span>, <span class="keyword">const</span> <span class="keywordtype">char</span>* message); <a name="l01601"></a>01601 <a name="l01607"></a><a class="code" href="classTelEngine_1_1JBMessage.html#f149efda34c8fb01c22b186f72783030">01607</a> <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JBMessage.html#2ea0bb09adcce7f655e8f8ee8d30561b">MsgType</a> msgType(<span class="keyword">const</span> <span class="keywordtype">char</span>* text) <a name="l01608"></a>01608 { <span class="keywordflow">return</span> (<a class="code" href="classTelEngine_1_1JBMessage.html#2ea0bb09adcce7f655e8f8ee8d30561b">MsgType</a>)<a class="code" href="namespaceTelEngine.html#4668c9172c6ae5f59f5782ecc6e05516">lookup</a>(text,s_msg,None); } <a name="l01609"></a>01609 <a name="l01615"></a><a class="code" href="classTelEngine_1_1JBMessage.html#5300c440a8974025a3df6d6684890924">01615</a> <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* msgText(<a class="code" href="classTelEngine_1_1JBMessage.html#2ea0bb09adcce7f655e8f8ee8d30561b">MsgType</a> msg) <a name="l01616"></a>01616 { <span class="keywordflow">return</span> <a class="code" href="namespaceTelEngine.html#4668c9172c6ae5f59f5782ecc6e05516">lookup</a>(msg,s_msg,0); } <a name="l01617"></a>01617 <a name="l01621"></a><a class="code" href="classTelEngine_1_1JBMessage.html#5b48dd9cca4a273a60961848daf8377d">01621</a> <span class="keyword">static</span> <a class="code" href="structTelEngine_1_1TokenDict.html">TokenDict</a> s_msg[]; <a name="l01622"></a>01622 <a name="l01623"></a>01623 <span class="keyword">protected</span>: <a name="l01631"></a>01631 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> accept(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event, <span class="keywordtype">bool</span>& processed, <span class="keywordtype">bool</span>& insert); <a name="l01632"></a>01632 <a name="l01633"></a>01633 <span class="keyword">private</span>: <a name="l01634"></a>01634 <span class="keywordtype">bool</span> m_syncProcess; <span class="comment">// Process messages on accept</span> <a name="l01635"></a>01635 }; <a name="l01636"></a>01636 <a name="l01637"></a>01637 <a name="l01643"></a><a class="code" href="classTelEngine_1_1JBPresence.html">01643</a> <span class="keyword">class </span>YJINGLE_API <a class="code" href="classTelEngine_1_1JBPresence.html" title="A Jabber presence service.">JBPresence</a> : <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1JBService.html" title="A Jabber service.">JBService</a>, <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1JBThreadList.html" title="A list of private threads.">JBThreadList</a> <a name="l01644"></a>01644 { <a name="l01645"></a>01645 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTelEngine_1_1XMPPUserRoster.html" title="The roster of a local user.">XMPPUserRoster</a>; <a name="l01646"></a>01646 <span class="keyword">public</span>: <a name="l01650"></a><a class="code" href="classTelEngine_1_1JBPresence.html#c25d041dbdb54de3fe3b492859d0575c">01650</a> <span class="keyword">enum</span> <a class="code" href="classTelEngine_1_1JBPresence.html#c25d041dbdb54de3fe3b492859d0575c">Presence</a> { <a name="l01651"></a>01651 Error = 0, <span class="comment">// error</span> <a name="l01652"></a>01652 Probe = 1, <span class="comment">// probe</span> <a name="l01653"></a>01653 Subscribe = 2, <span class="comment">// subscribe request</span> <a name="l01654"></a>01654 Subscribed = 3, <span class="comment">// subscribe accepted</span> <a name="l01655"></a>01655 Unavailable = 4, <span class="comment">// unavailable</span> <a name="l01656"></a>01656 Unsubscribe = 5, <span class="comment">// unsubscribe request</span> <a name="l01657"></a>01657 Unsubscribed = 6, <span class="comment">// unsubscribe accepted</span> <a name="l01658"></a>01658 None = 7, <a name="l01659"></a>01659 }; <a name="l01660"></a>01660 <a name="l01667"></a>01667 <a class="code" href="classTelEngine_1_1JBPresence.html" title="A Jabber presence service.">JBPresence</a>(<a class="code" href="classTelEngine_1_1JBEngine.html" title="A Jabber engine.">JBEngine</a>* engine, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1NamedList.html" title="A named string container class.">NamedList</a>* params, <span class="keywordtype">int</span> prio = 0); <a name="l01668"></a>01668 <a name="l01672"></a>01672 <span class="keyword">virtual</span> ~<a class="code" href="classTelEngine_1_1JBPresence.html" title="A Jabber presence service.">JBPresence</a>(); <a name="l01673"></a>01673 <a name="l01678"></a><a class="code" href="classTelEngine_1_1JBPresence.html#f92392a03f476eca96dc47c39f4d0407">01678</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1XMPPDirVal.html" title="Direction flags.">XMPPDirVal</a> autoSubscribe()<span class="keyword"> const</span> <a name="l01679"></a>01679 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_autoSubscribe; } <a name="l01680"></a>01680 <a name="l01685"></a><a class="code" href="classTelEngine_1_1JBPresence.html#30593acdb8584716c1a59a3a4510a562">01685</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> delUnavailable()<span class="keyword"> const</span> <a name="l01686"></a>01686 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_delUnavailable; } <a name="l01687"></a>01687 <a name="l01692"></a><a class="code" href="classTelEngine_1_1JBPresence.html#02888ac8e073c36ceea20bb3e9dab2bb">01692</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1XMPPDirVal.html" title="Direction flags.">XMPPDirVal</a> addOnSubscribe()<span class="keyword"> const</span> <a name="l01693"></a>01693 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_addOnSubscribe; } <a name="l01694"></a>01694 <a name="l01699"></a><a class="code" href="classTelEngine_1_1JBPresence.html#9e1f1c20ecf90203c844aa21687a3ef9">01699</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1XMPPDirVal.html" title="Direction flags.">XMPPDirVal</a> addOnProbe()<span class="keyword"> const</span> <a name="l01700"></a>01700 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_addOnProbe; } <a name="l01701"></a>01701 <a name="l01706"></a><a class="code" href="classTelEngine_1_1JBPresence.html#28eaf697ed84866bba7605d49f89f95b">01706</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1XMPPDirVal.html" title="Direction flags.">XMPPDirVal</a> addOnPresence()<span class="keyword"> const</span> <a name="l01707"></a>01707 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_addOnPresence; } <a name="l01708"></a>01708 <a name="l01713"></a><a class="code" href="classTelEngine_1_1JBPresence.html#62d95b50b3a7fc61be81900875ece6e3">01713</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> autoRoster()<span class="keyword"> const</span> <a name="l01714"></a>01714 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_autoRoster; } <a name="l01715"></a>01715 <a name="l01720"></a><a class="code" href="classTelEngine_1_1JBPresence.html#81d8403390567a39af9ae095849c7fd5">01720</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> ignoreNonRoster()<span class="keyword"> const</span> <a name="l01721"></a>01721 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_ignoreNonRoster; } <a name="l01722"></a>01722 <a name="l01727"></a><a class="code" href="classTelEngine_1_1JBPresence.html#56494b758a4be1017b702e28a8b48cdd">01727</a> <span class="keyword">inline</span> u_int32_t probeInterval() <a name="l01728"></a>01728 { <span class="keywordflow">return</span> m_probeInterval; } <a name="l01729"></a>01729 <a name="l01734"></a><a class="code" href="classTelEngine_1_1JBPresence.html#9a1f01d8186322d918f490ff564ee485">01734</a> <span class="keyword">inline</span> u_int32_t expireInterval() <a name="l01735"></a>01735 { <span class="keywordflow">return</span> m_expireInterval; } <a name="l01736"></a>01736 <a name="l01741"></a>01741 <span class="keyword">virtual</span> <span class="keywordtype">void</span> initialize(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1NamedList.html" title="A named string container class.">NamedList</a>& params); <a name="l01742"></a>01742 <a name="l01748"></a>01748 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> process(); <a name="l01749"></a>01749 <a name="l01755"></a>01755 <span class="keyword">virtual</span> <span class="keywordtype">void</span> checkTimeout(u_int64_t time); <a name="l01756"></a>01756 <a name="l01761"></a>01761 <span class="keyword">virtual</span> <span class="keywordtype">void</span> processDisco(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event); <a name="l01762"></a>01762 <a name="l01767"></a>01767 <span class="keyword">virtual</span> <span class="keywordtype">void</span> processError(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event); <a name="l01768"></a>01768 <a name="l01773"></a>01773 <span class="keyword">virtual</span> <span class="keywordtype">void</span> processProbe(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event); <a name="l01774"></a>01774 <a name="l01780"></a>01780 <span class="keyword">virtual</span> <span class="keywordtype">void</span> processSubscribe(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event, Presence presence); <a name="l01781"></a>01781 <a name="l01786"></a>01786 <span class="keyword">virtual</span> <span class="keywordtype">void</span> processUnavailable(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event); <a name="l01787"></a>01787 <a name="l01792"></a>01792 <span class="keyword">virtual</span> <span class="keywordtype">void</span> processPresence(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event); <a name="l01793"></a>01793 <a name="l01799"></a>01799 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> notifyProbe(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event); <a name="l01800"></a>01800 <a name="l01807"></a>01807 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> notifySubscribe(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event, Presence presence); <a name="l01808"></a>01808 <a name="l01814"></a>01814 <span class="keyword">virtual</span> <span class="keywordtype">void</span> notifySubscribe(<a class="code" href="classTelEngine_1_1XMPPUser.html" title="An XMPP remote user.">XMPPUser</a>* user, Presence presence); <a name="l01815"></a>01815 <a name="l01823"></a>01823 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> notifyPresence(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event, <span class="keywordtype">bool</span> available); <a name="l01824"></a>01824 <a name="l01830"></a>01830 <span class="keyword">virtual</span> <span class="keywordtype">void</span> notifyPresence(<a class="code" href="classTelEngine_1_1XMPPUser.html" title="An XMPP remote user.">XMPPUser</a>* user, <a class="code" href="classTelEngine_1_1JIDResource.html" title="A JID resource.">JIDResource</a>* resource); <a name="l01831"></a>01831 <a name="l01837"></a>01837 <span class="keyword">virtual</span> <span class="keywordtype">void</span> notifyNewUser(<a class="code" href="classTelEngine_1_1XMPPUser.html" title="An XMPP remote user.">XMPPUser</a>* user); <a name="l01838"></a>01838 <a name="l01847"></a>01847 <a class="code" href="classTelEngine_1_1XMPPUserRoster.html" title="The roster of a local user.">XMPPUserRoster</a>* getRoster(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& jid, <span class="keywordtype">bool</span> <span class="keyword">add</span>, <span class="keywordtype">bool</span>* added); <a name="l01848"></a>01848 <a name="l01860"></a>01860 <a class="code" href="classTelEngine_1_1XMPPUser.html" title="An XMPP remote user.">XMPPUser</a>* getRemoteUser(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& local, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& remote, <a name="l01861"></a>01861 <span class="keywordtype">bool</span> addLocal, <span class="keywordtype">bool</span>* addedLocal, <span class="keywordtype">bool</span> addRemote, <span class="keywordtype">bool</span>* addedRemote); <a name="l01862"></a>01862 <a name="l01869"></a>01869 <span class="keywordtype">void</span> removeRemoteUser(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& local, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& remote); <a name="l01870"></a>01870 <a name="l01876"></a>01876 <span class="keywordtype">bool</span> validDomain(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& domain); <a name="l01877"></a>01877 <a name="l01886"></a>01886 <span class="keywordtype">bool</span> sendStanza(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* element, <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* stream); <a name="l01887"></a>01887 <a name="l01899"></a>01899 <span class="keywordtype">bool</span> sendError(<a class="code" href="classTelEngine_1_1XMPPError.html#1d1cfd8ffb84e947f82999c682b666a7">XMPPError::Type</a> type, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& from, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& to, <a name="l01900"></a>01900 <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* element, <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* stream = 0, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>* <span class="keywordtype">id</span> = 0); <a name="l01901"></a>01901 <a name="l01909"></a>01909 <span class="keyword">static</span> <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* createPresence(<span class="keyword">const</span> <span class="keywordtype">char</span>* from, <a name="l01910"></a>01910 <span class="keyword">const</span> <span class="keywordtype">char</span>* to, Presence type = None); <a name="l01911"></a>01911 <a name="l01920"></a>01920 <span class="keyword">static</span> <span class="keywordtype">bool</span> decodeError(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* element, <a name="l01921"></a>01921 <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& code, <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& type, <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& error); <a name="l01922"></a>01922 <a name="l01928"></a><a class="code" href="classTelEngine_1_1JBPresence.html#a615b5a1d31387a2500a78b7e4e658e4">01928</a> <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JBPresence.html#c25d041dbdb54de3fe3b492859d0575c">Presence</a> presenceType(<span class="keyword">const</span> <span class="keywordtype">char</span>* text) <a name="l01929"></a>01929 { <span class="keywordflow">return</span> (<a class="code" href="classTelEngine_1_1JBPresence.html#c25d041dbdb54de3fe3b492859d0575c">Presence</a>)<a class="code" href="namespaceTelEngine.html#4668c9172c6ae5f59f5782ecc6e05516">lookup</a>(text,s_presence,None); } <a name="l01930"></a>01930 <a name="l01936"></a><a class="code" href="classTelEngine_1_1JBPresence.html#2fe197cd8f6468e33359e0aeb4cee17c">01936</a> <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* presenceText(<a class="code" href="classTelEngine_1_1JBPresence.html#c25d041dbdb54de3fe3b492859d0575c">Presence</a> presence) <a name="l01937"></a>01937 { <span class="keywordflow">return</span> <a class="code" href="namespaceTelEngine.html#4668c9172c6ae5f59f5782ecc6e05516">lookup</a>(presence,s_presence,0); } <a name="l01938"></a>01938 <a name="l01942"></a>01942 <span class="keywordtype">void</span> cleanup(); <a name="l01943"></a>01943 <a name="l01944"></a>01944 <span class="keyword">protected</span>: <a name="l01952"></a>01952 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> accept(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event, <span class="keywordtype">bool</span>& processed, <span class="keywordtype">bool</span>& insert); <a name="l01953"></a>01953 <a name="l01954"></a>01954 <span class="keyword">static</span> <a class="code" href="structTelEngine_1_1TokenDict.html">TokenDict</a> s_presence[]; <span class="comment">// Keep the types of 'presence'</span> <a name="l01955"></a>01955 <a class="code" href="classTelEngine_1_1XMPPDirVal.html" title="Direction flags.">XMPPDirVal</a> m_autoSubscribe; <span class="comment">// Auto subscribe state</span> <a name="l01956"></a>01956 <span class="keywordtype">bool</span> m_delUnavailable; <span class="comment">// Delete unavailable user or resource</span> <a name="l01957"></a>01957 <span class="keywordtype">bool</span> m_autoRoster; <span class="comment">// True if this service make an automatically roster management</span> <a name="l01958"></a>01958 <span class="keywordtype">bool</span> m_ignoreNonRoster; <span class="comment">// Ignore all elements whose destination is not in roster</span> <a name="l01959"></a>01959 <a class="code" href="classTelEngine_1_1XMPPDirVal.html" title="Direction flags.">XMPPDirVal</a> m_addOnSubscribe; <span class="comment">// Add new user on subscribe request</span> <a name="l01960"></a>01960 <a class="code" href="classTelEngine_1_1XMPPDirVal.html" title="Direction flags.">XMPPDirVal</a> m_addOnProbe; <span class="comment">// Add new user on probe request</span> <a name="l01961"></a>01961 <a class="code" href="classTelEngine_1_1XMPPDirVal.html" title="Direction flags.">XMPPDirVal</a> m_addOnPresence; <span class="comment">// Add new user on presence</span> <a name="l01962"></a>01962 <span class="keywordtype">bool</span> m_autoProbe; <span class="comment">// Automatically respond to probe requests</span> <a name="l01963"></a>01963 u_int32_t m_probeInterval; <span class="comment">// Interval to probe a remote user</span> <a name="l01964"></a>01964 u_int32_t m_expireInterval; <span class="comment">// Expire interval after probe</span> <a name="l01965"></a>01965 <a class="code" href="classTelEngine_1_1ObjList.html" title="An object list class.">ObjList</a> m_rosters; <span class="comment">// The rosters</span> <a name="l01966"></a>01966 <a class="code" href="classTelEngine_1_1JIDIdentity.html" title="A JID identity.">JIDIdentity</a>* m_defIdentity; <span class="comment">// Default identity</span> <a name="l01967"></a>01967 <a class="code" href="classTelEngine_1_1JIDFeatureList.html" title="JID feature list.">JIDFeatureList</a> m_defFeatures; <span class="comment">// Default features</span> <a name="l01968"></a>01968 <a name="l01969"></a>01969 <span class="keyword">private</span>: <a name="l01970"></a>01970 <span class="comment">// Wrapper for getRemoteUser() used when receiving presence</span> <a name="l01971"></a>01971 <span class="comment">// Show a debug message if not found</span> <a name="l01972"></a>01972 <a class="code" href="classTelEngine_1_1XMPPUser.html" title="An XMPP remote user.">XMPPUser</a>* recvGetRemoteUser(<span class="keyword">const</span> <span class="keywordtype">char</span>* type, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& local, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& remote, <a name="l01973"></a>01973 <span class="keywordtype">bool</span> addLocal = <span class="keyword">false</span>, <span class="keywordtype">bool</span>* addedLocal = 0, <a name="l01974"></a>01974 <span class="keywordtype">bool</span> addRemote = <span class="keyword">false</span>, <span class="keywordtype">bool</span>* addedRemote = 0); <a name="l01975"></a>01975 <span class="keywordtype">void</span> addRoster(<a class="code" href="classTelEngine_1_1XMPPUserRoster.html" title="The roster of a local user.">XMPPUserRoster</a>* ur); <a name="l01976"></a>01976 <span class="keywordtype">void</span> removeRoster(<a class="code" href="classTelEngine_1_1XMPPUserRoster.html" title="The roster of a local user.">XMPPUserRoster</a>* ur); <a name="l01977"></a>01977 }; <a name="l01978"></a>01978 <a name="l01979"></a>01979 <a name="l01984"></a><a class="code" href="classTelEngine_1_1JIDResource.html">01984</a> <span class="keyword">class </span>YJINGLE_API <a class="code" href="classTelEngine_1_1JIDResource.html" title="A JID resource.">JIDResource</a> : <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1RefObject.html">RefObject</a> <a name="l01985"></a>01985 { <a name="l01986"></a>01986 <span class="keyword">public</span>: <a name="l01990"></a><a class="code" href="classTelEngine_1_1JIDResource.html#4171335401279aad7e5a463349c093c6">01990</a> <span class="keyword">enum</span> <a class="code" href="classTelEngine_1_1JIDResource.html#4171335401279aad7e5a463349c093c6">Capability</a> { <a name="l01991"></a>01991 CapChat = 1, <span class="comment">// Chat capability</span> <a name="l01992"></a>01992 CapAudio = 2, <span class="comment">// Jingle capability</span> <a name="l01993"></a>01993 }; <a name="l01994"></a>01994 <a name="l01998"></a><a class="code" href="classTelEngine_1_1JIDResource.html#c25d041dbdb54de3fe3b492859d0575c">01998</a> <span class="keyword">enum</span> <a class="code" href="classTelEngine_1_1JIDResource.html#c25d041dbdb54de3fe3b492859d0575c">Presence</a> { <a name="l01999"></a>01999 Unknown = 0, <span class="comment">// unknown</span> <a name="l02000"></a>02000 Available = 1, <span class="comment">// available</span> <a name="l02001"></a>02001 Unavailable = 2, <span class="comment">// unavailable</span> <a name="l02002"></a>02002 }; <a name="l02003"></a>02003 <a name="l02007"></a><a class="code" href="classTelEngine_1_1JIDResource.html#85eaa9605d18cf563353eb999e9c87f4">02007</a> <span class="keyword">enum</span> <a class="code" href="classTelEngine_1_1JIDResource.html#85eaa9605d18cf563353eb999e9c87f4">Show</a> { <a name="l02008"></a>02008 ShowAway, <span class="comment">// away : Temporarily away</span> <a name="l02009"></a>02009 ShowChat, <span class="comment">// chat : Actively interested in chatting</span> <a name="l02010"></a>02010 ShowDND, <span class="comment">// dnd : Busy</span> <a name="l02011"></a>02011 ShowXA, <span class="comment">// xa : Extended away</span> <a name="l02012"></a>02012 ShowNone, <span class="comment">// : Missing or no text</span> <a name="l02013"></a>02013 }; <a name="l02014"></a>02014 <a name="l02021"></a><a class="code" href="classTelEngine_1_1JIDResource.html#cf6eea256c169a6797b17b3453ac1d36">02021</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JIDResource.html" title="A JID resource.">JIDResource</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* name, <a class="code" href="classTelEngine_1_1JIDResource.html#c25d041dbdb54de3fe3b492859d0575c">Presence</a> presence = Unknown, <a name="l02022"></a>02022 u_int32_t capability = CapChat) <a name="l02023"></a>02023 : m_name(name), m_presence(presence), <a name="l02024"></a>02024 m_capability(capability), m_show(ShowNone) <a name="l02025"></a>02025 {} <a name="l02026"></a>02026 <a name="l02030"></a><a class="code" href="classTelEngine_1_1JIDResource.html#2596d4bd1f769e1e2b2742ead924f6b1">02030</a> <span class="keyword">inline</span> <span class="keyword">virtual</span> ~<a class="code" href="classTelEngine_1_1JIDResource.html" title="A JID resource.">JIDResource</a>() <a name="l02031"></a>02031 {} <a name="l02032"></a>02032 <a name="l02037"></a><a class="code" href="classTelEngine_1_1JIDResource.html#b31e7357671cfe484e3c3ed3cd6258e4">02037</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& name()<span class="keyword"> const</span> <a name="l02038"></a>02038 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_name; } <a name="l02039"></a>02039 <a name="l02044"></a><a class="code" href="classTelEngine_1_1JIDResource.html#b3a256e7d9fad73fa57de7c1fedf51c5">02044</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> setName(<span class="keyword">const</span> <span class="keywordtype">char</span>* name) <a name="l02045"></a>02045 { m_name = name; } <a name="l02046"></a>02046 <a name="l02051"></a><a class="code" href="classTelEngine_1_1JIDResource.html#3de3482044ca3dd847eb6645be666fe4">02051</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JIDResource.html#c25d041dbdb54de3fe3b492859d0575c">Presence</a> presence()<span class="keyword"> const</span> <a name="l02052"></a>02052 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_presence; } <a name="l02053"></a>02053 <a name="l02058"></a><a class="code" href="classTelEngine_1_1JIDResource.html#ac2d2aa5d9e827da9069f035cb8c3a3f">02058</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> available()<span class="keyword"> const</span> <a name="l02059"></a>02059 <span class="keyword"> </span>{ <span class="keywordflow">return</span> (m_presence == Available); } <a name="l02060"></a>02060 <a name="l02065"></a><a class="code" href="classTelEngine_1_1JIDResource.html#271cc8303713bfc0e2d67c377546d3a9">02065</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JIDResource.html#85eaa9605d18cf563353eb999e9c87f4">Show</a> show()<span class="keyword"> const</span> <a name="l02066"></a>02066 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_show; } <a name="l02067"></a>02067 <a name="l02072"></a><a class="code" href="classTelEngine_1_1JIDResource.html#6fddb831a062b8dc3b2aa2a42afff1ec">02072</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> show(<a class="code" href="classTelEngine_1_1JIDResource.html#85eaa9605d18cf563353eb999e9c87f4">Show</a> s) <a name="l02073"></a>02073 { m_show = s; } <a name="l02074"></a>02074 <a name="l02079"></a><a class="code" href="classTelEngine_1_1JIDResource.html#89af19d58d2d27ed45e9881623867169">02079</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& status()<span class="keyword"> const</span> <a name="l02080"></a>02080 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_status; } <a name="l02081"></a>02081 <a name="l02086"></a><a class="code" href="classTelEngine_1_1JIDResource.html#1845e04afd9572f460849fe0c822dbc0">02086</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> status(<span class="keyword">const</span> <span class="keywordtype">char</span>* s) <a name="l02087"></a>02087 { m_status = s; } <a name="l02088"></a>02088 <a name="l02093"></a><a class="code" href="classTelEngine_1_1JIDResource.html#291dd0df0e334d12117829052ff43746">02093</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1ObjList.html" title="An object list class.">ObjList</a>* infoXml() <a name="l02094"></a>02094 { <span class="keywordflow">return</span> &m_info; } <a name="l02095"></a>02095 <a name="l02101"></a>02101 <span class="keywordtype">bool</span> setPresence(<span class="keywordtype">bool</span> value); <a name="l02102"></a>02102 <a name="l02108"></a><a class="code" href="classTelEngine_1_1JIDResource.html#2ecbfa06022b9c52d770d49ffef14a7d">02108</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> hasCap(<a class="code" href="classTelEngine_1_1JIDResource.html#4171335401279aad7e5a463349c093c6">Capability</a> capability)<span class="keyword"> const</span> <a name="l02109"></a>02109 <span class="keyword"> </span>{ <span class="keywordflow">return</span> (m_capability & capability) != 0; } <a name="l02110"></a>02110 <a name="l02116"></a>02116 <span class="keywordtype">bool</span> fromXML(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* element); <a name="l02117"></a>02117 <a name="l02123"></a>02123 <span class="keywordtype">void</span> addTo(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* element, <span class="keywordtype">bool</span> addInfo = <span class="keyword">true</span>); <a name="l02124"></a>02124 <a name="l02130"></a>02130 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* getShow(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* element); <a name="l02131"></a>02131 <a name="l02137"></a>02137 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* getStatus(<a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* element); <a name="l02138"></a>02138 <a name="l02144"></a><a class="code" href="classTelEngine_1_1JIDResource.html#2db842bdf5748da3b5ff9b7ee820d859">02144</a> <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JIDResource.html#85eaa9605d18cf563353eb999e9c87f4">Show</a> showType(<span class="keyword">const</span> <span class="keywordtype">char</span>* text) <a name="l02145"></a>02145 { <span class="keywordflow">return</span> (<a class="code" href="classTelEngine_1_1JIDResource.html#85eaa9605d18cf563353eb999e9c87f4">Show</a>)<a class="code" href="namespaceTelEngine.html#4668c9172c6ae5f59f5782ecc6e05516">lookup</a>(text,s_show,ShowNone); } <a name="l02146"></a>02146 <a name="l02152"></a><a class="code" href="classTelEngine_1_1JIDResource.html#8db71c91e5edd47a343eabcbc6c32ffe">02152</a> <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* showText(<a class="code" href="classTelEngine_1_1JIDResource.html#85eaa9605d18cf563353eb999e9c87f4">Show</a> show) <a name="l02153"></a>02153 { <span class="keywordflow">return</span> <a class="code" href="namespaceTelEngine.html#4668c9172c6ae5f59f5782ecc6e05516">lookup</a>(show,s_show,0); } <a name="l02154"></a>02154 <a name="l02155"></a>02155 <span class="keyword">protected</span>: <a name="l02156"></a>02156 <span class="keyword">static</span> <a class="code" href="structTelEngine_1_1TokenDict.html">TokenDict</a> s_show[]; <span class="comment">// Show texts</span> <a name="l02157"></a>02157 <a name="l02158"></a>02158 <span class="keyword">private</span>: <a name="l02159"></a>02159 <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a> m_name; <span class="comment">// Resource name</span> <a name="l02160"></a>02160 Presence m_presence; <span class="comment">// Resorce presence</span> <a name="l02161"></a>02161 u_int32_t m_capability; <span class="comment">// Resource capabilities</span> <a name="l02162"></a>02162 Show m_show; <span class="comment">// Show attribute</span> <a name="l02163"></a>02163 <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a> m_status; <span class="comment">// Status attribute</span> <a name="l02164"></a>02164 <a class="code" href="classTelEngine_1_1ObjList.html" title="An object list class.">ObjList</a> m_info; <span class="comment">// XML elements containing additional info about this resource</span> <a name="l02165"></a>02165 }; <a name="l02166"></a>02166 <a name="l02167"></a>02167 <a name="l02172"></a><a class="code" href="classTelEngine_1_1JIDResourceList.html">02172</a> <span class="keyword">class </span>YJINGLE_API <a class="code" href="classTelEngine_1_1JIDResourceList.html" title="A resource list.">JIDResourceList</a> : <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1Mutex.html" title="Mutex support.">Mutex</a> <a name="l02173"></a>02173 { <a name="l02174"></a>02174 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTelEngine_1_1XMPPUser.html" title="An XMPP remote user.">XMPPUser</a>; <a name="l02175"></a>02175 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTelEngine_1_1JBPresence.html" title="A Jabber presence service.">JBPresence</a>; <a name="l02176"></a>02176 <span class="keyword">public</span>: <a name="l02180"></a><a class="code" href="classTelEngine_1_1JIDResourceList.html#05d8f12a70b90cbeefe2107a2ea3b03f">02180</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JIDResourceList.html" title="A resource list.">JIDResourceList</a>() <a name="l02181"></a>02181 : <a class="code" href="classTelEngine_1_1Mutex.html" title="Mutex support.">Mutex</a>(true) <a name="l02182"></a>02182 {} <a name="l02183"></a>02183 <a name="l02190"></a>02190 <span class="keywordtype">bool</span> <span class="keyword">add</span>(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& name); <a name="l02191"></a>02191 <a name="l02198"></a>02198 <span class="keywordtype">bool</span> <span class="keyword">add</span>(<a class="code" href="classTelEngine_1_1JIDResource.html" title="A JID resource.">JIDResource</a>* resource); <a name="l02199"></a>02199 <a name="l02205"></a><a class="code" href="classTelEngine_1_1JIDResourceList.html#87d1c55d53a834dac4ab3008fcfdb64f">02205</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <span class="keyword">remove</span>(<a class="code" href="classTelEngine_1_1JIDResource.html" title="A JID resource.">JIDResource</a>* resource, <span class="keywordtype">bool</span> del = <span class="keyword">true</span>) <a name="l02206"></a>02206 { <a class="code" href="classTelEngine_1_1Lock.html" title="Ephemeral mutex locking object.">Lock</a> lock(<span class="keyword">this</span>); m_resources.remove(resource,del); } <a name="l02207"></a>02207 <a name="l02211"></a><a class="code" href="classTelEngine_1_1JIDResourceList.html#c8bb3912a3ce86b15842e79d0b421204">02211</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> clear() <a name="l02212"></a>02212 { <a class="code" href="classTelEngine_1_1Lock.html" title="Ephemeral mutex locking object.">Lock</a> lock(<span class="keyword">this</span>); m_resources.clear(); } <a name="l02213"></a>02213 <a name="l02219"></a>02219 <a class="code" href="classTelEngine_1_1JIDResource.html" title="A JID resource.">JIDResource</a>* <span class="keyword">get</span>(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& name); <a name="l02220"></a>02220 <a name="l02225"></a><a class="code" href="classTelEngine_1_1JIDResourceList.html#370e6d06415cc77efd8c6f11983cb339">02225</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JIDResource.html" title="A JID resource.">JIDResource</a>* <a class="code" href="classTelEngine_1_1JIDResourceList.html#370e6d06415cc77efd8c6f11983cb339">getFirst</a>() { <a name="l02226"></a>02226 <a class="code" href="classTelEngine_1_1Lock.html" title="Ephemeral mutex locking object.">Lock</a> lock(<span class="keyword">this</span>); <a name="l02227"></a>02227 <a class="code" href="classTelEngine_1_1ObjList.html" title="An object list class.">ObjList</a>* obj = m_resources.skipNull(); <a name="l02228"></a>02228 <span class="keywordflow">return</span> obj ? <span class="keyword">static_cast<</span><a class="code" href="classTelEngine_1_1JIDResource.html" title="A JID resource.">JIDResource</a>*<span class="keyword">></span>(obj-><a class="code" href="classTelEngine_1_1ObjList.html#b59374b052f2beba1b97ad046326e9f2">get</a>()) : 0; <a name="l02229"></a>02229 } <a name="l02230"></a>02230 <a name="l02236"></a>02236 <a class="code" href="classTelEngine_1_1JIDResource.html" title="A JID resource.">JIDResource</a>* getAudio(<span class="keywordtype">bool</span> availableOnly = <span class="keyword">true</span>); <a name="l02237"></a>02237 <a name="l02238"></a>02238 <span class="keyword">private</span>: <a name="l02239"></a>02239 <a class="code" href="classTelEngine_1_1ObjList.html" title="An object list class.">ObjList</a> m_resources; <span class="comment">// The resources list</span> <a name="l02240"></a>02240 }; <a name="l02241"></a>02241 <a name="l02242"></a>02242 <a name="l02247"></a><a class="code" href="classTelEngine_1_1XMPPUser.html">02247</a> <span class="keyword">class </span>YJINGLE_API <a class="code" href="classTelEngine_1_1XMPPUser.html" title="An XMPP remote user.">XMPPUser</a> : <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1RefObject.html">RefObject</a>, <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1Mutex.html" title="Mutex support.">Mutex</a> <a name="l02248"></a>02248 { <a name="l02249"></a>02249 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTelEngine_1_1XMPPUserRoster.html" title="The roster of a local user.">XMPPUserRoster</a>; <a name="l02250"></a>02250 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTelEngine_1_1JBPresence.html" title="A Jabber presence service.">JBPresence</a>; <a name="l02251"></a>02251 <span class="keyword">public</span>: <a name="l02261"></a>02261 <a class="code" href="classTelEngine_1_1XMPPUser.html" title="An XMPP remote user.">XMPPUser</a>(<a class="code" href="classTelEngine_1_1XMPPUserRoster.html" title="The roster of a local user.">XMPPUserRoster</a>* local, <span class="keyword">const</span> <span class="keywordtype">char</span>* node, <span class="keyword">const</span> <span class="keywordtype">char</span>* domain, <a name="l02262"></a>02262 <a class="code" href="classTelEngine_1_1XMPPDirVal.html" title="Direction flags.">XMPPDirVal</a> sub, <span class="keywordtype">bool</span> subTo = <span class="keyword">true</span>, <span class="keywordtype">bool</span> sendProbe = <span class="keyword">true</span>); <a name="l02263"></a>02263 <a name="l02268"></a>02268 <span class="keyword">virtual</span> ~<a class="code" href="classTelEngine_1_1XMPPUser.html" title="An XMPP remote user.">XMPPUser</a>(); <a name="l02269"></a>02269 <a name="l02274"></a><a class="code" href="classTelEngine_1_1XMPPUser.html#92124d50d5cabbd5c051f851a0eaf04b">02274</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& jid()<span class="keyword"> const</span> <a name="l02275"></a>02275 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_jid; } <a name="l02276"></a>02276 <a name="l02281"></a><a class="code" href="classTelEngine_1_1XMPPUser.html#ed483e4ce7185ce0e623605aa5534f14">02281</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1XMPPUserRoster.html" title="The roster of a local user.">XMPPUserRoster</a>* local()<span class="keyword"> const</span> <a name="l02282"></a>02282 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_local; } <a name="l02283"></a>02283 <a name="l02288"></a><a class="code" href="classTelEngine_1_1XMPPUser.html#0d6b34c9d336915a692177f635336452">02288</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1XMPPDirVal.html" title="Direction flags.">XMPPDirVal</a>& subscription() <a name="l02289"></a>02289 { <span class="keywordflow">return</span> m_subscription; } <a name="l02290"></a>02290 <a name="l02295"></a><a class="code" href="classTelEngine_1_1XMPPUser.html#ae007ed93c86ec0d845d745db3ba1fd1">02295</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JIDResourceList.html" title="A resource list.">JIDResourceList</a>& localRes() <a name="l02296"></a>02296 { <span class="keywordflow">return</span> m_localRes; } <a name="l02297"></a>02297 <a name="l02302"></a><a class="code" href="classTelEngine_1_1XMPPUser.html#c0be73f38f60a2951e0482827abaffbe">02302</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JIDResourceList.html" title="A resource list.">JIDResourceList</a>& remoteRes() <a name="l02303"></a>02303 { <span class="keywordflow">return</span> m_remoteRes; } <a name="l02304"></a>02304 <a name="l02313"></a>02313 <span class="keywordtype">bool</span> addLocalRes(<a class="code" href="classTelEngine_1_1JIDResource.html" title="A JID resource.">JIDResource</a>* resource, <span class="keywordtype">bool</span> send = <span class="keyword">true</span>); <a name="l02314"></a>02314 <a name="l02321"></a>02321 <span class="keywordtype">void</span> removeLocalRes(<a class="code" href="classTelEngine_1_1JIDResource.html" title="A JID resource.">JIDResource</a>* resource); <a name="l02322"></a>02322 <a name="l02328"></a>02328 <span class="keywordtype">void</span> clearLocalRes(); <a name="l02329"></a>02329 <a name="l02335"></a>02335 <span class="keywordtype">bool</span> addRemoteRes(<a class="code" href="classTelEngine_1_1JIDResource.html" title="A JID resource.">JIDResource</a>* resource); <a name="l02336"></a>02336 <a name="l02341"></a>02341 <span class="keywordtype">void</span> removeRemoteRes(<a class="code" href="classTelEngine_1_1JIDResource.html" title="A JID resource.">JIDResource</a>* resource); <a name="l02342"></a>02342 <a name="l02349"></a><a class="code" href="classTelEngine_1_1XMPPUser.html#b6d61c7ee93d7d7fd5b3f9341c30eb1c">02349</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JIDResource.html" title="A JID resource.">JIDResource</a>* <a class="code" href="classTelEngine_1_1XMPPUser.html#b6d61c7ee93d7d7fd5b3f9341c30eb1c">getAudio</a>(<span class="keywordtype">bool</span> local, <span class="keywordtype">bool</span> availableOnly = <span class="keyword">true</span>) { <a name="l02350"></a>02350 <span class="keywordflow">return</span> local ? m_localRes.getAudio(availableOnly) : <a name="l02351"></a>02351 m_remoteRes.getAudio(availableOnly); <a name="l02352"></a>02352 } <a name="l02353"></a>02353 <a name="l02359"></a>02359 <span class="keywordtype">void</span> processError(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event); <a name="l02360"></a>02360 <a name="l02367"></a>02367 <span class="keywordtype">void</span> processProbe(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>* resName = 0); <a name="l02368"></a>02368 <a name="l02376"></a>02376 <span class="keywordtype">bool</span> processPresence(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event, <span class="keywordtype">bool</span> available); <a name="l02377"></a>02377 <a name="l02384"></a>02384 <span class="keywordtype">void</span> processSubscribe(<a class="code" href="classTelEngine_1_1JBEvent.html" title="A Jabber stream event.">JBEvent</a>* event, <a class="code" href="classTelEngine_1_1JBPresence.html#c25d041dbdb54de3fe3b492859d0575c">JBPresence::Presence</a> type); <a name="l02385"></a>02385 <a name="l02393"></a>02393 <span class="keywordtype">bool</span> probe(<a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* stream, u_int64_t time = <a class="code" href="classTelEngine_1_1Time.html#fedf91537e85e72f09da0a8ffc598e53">Time::msecNow</a>()); <a name="l02394"></a>02394 <a name="l02402"></a>02402 <span class="keywordtype">bool</span> sendSubscribe(<a class="code" href="classTelEngine_1_1JBPresence.html#c25d041dbdb54de3fe3b492859d0575c">JBPresence::Presence</a> type, <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* stream); <a name="l02403"></a>02403 <a name="l02410"></a>02410 <span class="keywordtype">bool</span> sendUnavailable(<a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* stream); <a name="l02411"></a>02411 <a name="l02420"></a>02420 <span class="keywordtype">bool</span> sendPresence(<a class="code" href="classTelEngine_1_1JIDResource.html" title="A JID resource.">JIDResource</a>* resource, <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* stream = 0, <span class="keywordtype">bool</span> force = <span class="keyword">false</span>); <a name="l02421"></a>02421 <a name="l02428"></a>02428 <span class="keywordtype">bool</span> timeout(u_int64_t time); <a name="l02429"></a>02429 <a name="l02439"></a>02439 <span class="keywordtype">void</span> notifyResource(<span class="keywordtype">bool</span> remote, <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1String.html" title="A C-style string handling class.">String</a>& name, <a name="l02440"></a>02440 <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* stream = 0, <span class="keywordtype">bool</span> force = <span class="keyword">false</span>); <a name="l02441"></a>02441 <a name="l02450"></a>02450 <span class="keywordtype">void</span> notifyResources(<span class="keywordtype">bool</span> remote, <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* stream = 0, <span class="keywordtype">bool</span> force = <span class="keyword">false</span>); <a name="l02451"></a>02451 <a name="l02452"></a>02452 <span class="keyword">protected</span>: <a name="l02459"></a>02459 <span class="keywordtype">void</span> updateSubscription(<span class="keywordtype">bool</span> from, <span class="keywordtype">bool</span> value, <a class="code" href="classTelEngine_1_1JBStream.html" title="A Jabber stream.">JBStream</a>* stream); <a name="l02460"></a>02460 <a name="l02466"></a>02466 <span class="keywordtype">void</span> updateTimeout(<span class="keywordtype">bool</span> from, u_int64_t time = <a class="code" href="classTelEngine_1_1Time.html#fedf91537e85e72f09da0a8ffc598e53">Time::msecNow</a>()); <a name="l02467"></a>02467 <a name="l02468"></a>02468 <span class="keyword">private</span>: <a name="l02469"></a>02469 <a class="code" href="classTelEngine_1_1XMPPUserRoster.html" title="The roster of a local user.">XMPPUserRoster</a>* m_local; <span class="comment">// Local user</span> <a name="l02470"></a>02470 <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a> m_jid; <span class="comment">// User's JID</span> <a name="l02471"></a>02471 <a class="code" href="classTelEngine_1_1XMPPDirVal.html" title="Direction flags.">XMPPDirVal</a> m_subscription; <span class="comment">// Subscription state</span> <a name="l02472"></a>02472 <a class="code" href="classTelEngine_1_1JIDResourceList.html" title="A resource list.">JIDResourceList</a> m_localRes; <span class="comment">// Local user's resources</span> <a name="l02473"></a>02473 <a class="code" href="classTelEngine_1_1JIDResourceList.html" title="A resource list.">JIDResourceList</a> m_remoteRes; <span class="comment">// Remote user's resources</span> <a name="l02474"></a>02474 u_int64_t m_nextProbe; <span class="comment">// Time to probe</span> <a name="l02475"></a>02475 u_int64_t m_expire; <span class="comment">// Expire time</span> <a name="l02476"></a>02476 }; <a name="l02477"></a>02477 <a name="l02482"></a><a class="code" href="classTelEngine_1_1XMPPUserRoster.html">02482</a> <span class="keyword">class </span>YJINGLE_API <a class="code" href="classTelEngine_1_1XMPPUserRoster.html" title="The roster of a local user.">XMPPUserRoster</a> : <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1RefObject.html">RefObject</a>, <span class="keyword">public</span> <a class="code" href="classTelEngine_1_1Mutex.html" title="Mutex support.">Mutex</a> <a name="l02483"></a>02483 { <a name="l02484"></a>02484 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTelEngine_1_1JBPresence.html" title="A Jabber presence service.">JBPresence</a>; <a name="l02485"></a>02485 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTelEngine_1_1JBClientStream.html" title="A Jabber client to server stream.">JBClientStream</a>; <a name="l02486"></a>02486 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTelEngine_1_1XMPPUser.html" title="An XMPP remote user.">XMPPUser</a>; <a name="l02487"></a>02487 <span class="keyword">public</span>: <a name="l02492"></a>02492 <span class="keyword">virtual</span> ~<a class="code" href="classTelEngine_1_1XMPPUserRoster.html" title="The roster of a local user.">XMPPUserRoster</a>(); <a name="l02493"></a>02493 <a name="l02498"></a><a class="code" href="classTelEngine_1_1XMPPUserRoster.html#92124d50d5cabbd5c051f851a0eaf04b">02498</a> <span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& jid()<span class="keyword"> const</span> <a name="l02499"></a>02499 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_jid; } <a name="l02500"></a>02500 <a name="l02505"></a><a class="code" href="classTelEngine_1_1XMPPUserRoster.html#dbd98645010e87b417fba284ca0c39b6">02505</a> <a class="code" href="classTelEngine_1_1JBPresence.html" title="A Jabber presence service.">JBPresence</a>* engine() <a name="l02506"></a>02506 { <span class="keywordflow">return</span> m_engine; } <a name="l02507"></a>02507 <a name="l02512"></a><a class="code" href="classTelEngine_1_1XMPPUserRoster.html#4a1633bea62c9a6b4255fee6fb307825">02512</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1JIDResourceList.html" title="A resource list.">JIDResourceList</a>& resources() <a name="l02513"></a>02513 { <span class="keywordflow">return</span> m_resources; } <a name="l02514"></a>02514 <a name="l02523"></a>02523 <a class="code" href="classTelEngine_1_1XMPPUser.html" title="An XMPP remote user.">XMPPUser</a>* getUser(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& jid, <span class="keywordtype">bool</span> <span class="keyword">add</span> = <span class="keyword">false</span>, <span class="keywordtype">bool</span>* added = 0); <a name="l02524"></a>02524 <a name="l02531"></a>02531 <span class="keywordtype">bool</span> removeUser(<span class="keyword">const</span> <a class="code" href="classTelEngine_1_1JabberID.html" title="A Jabber ID.">JabberID</a>& remote); <a name="l02532"></a>02532 <a name="l02536"></a><a class="code" href="classTelEngine_1_1XMPPUserRoster.html#4b66d5e31b5dc18b314c8a68163263bd">02536</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classTelEngine_1_1XMPPUserRoster.html#4b66d5e31b5dc18b314c8a68163263bd">cleanup</a>() { <a name="l02537"></a>02537 <a class="code" href="classTelEngine_1_1Lock.html" title="Ephemeral mutex locking object.">Lock</a> lock(<span class="keyword">this</span>); <a name="l02538"></a>02538 m_remote.clear(); <a name="l02539"></a>02539 } <a name="l02540"></a>02540 <a name="l02547"></a>02547 <span class="keywordtype">bool</span> timeout(u_int64_t time); <a name="l02548"></a>02548 <a name="l02556"></a><a class="code" href="classTelEngine_1_1XMPPUserRoster.html#8da2441e1991f5ceb8d846f88ece62d4">02556</a> <span class="keyword">inline</span> <a class="code" href="classTelEngine_1_1XMLElement.html" title="An XML element.">XMLElement</a>* createDiscoInfoResult(<span class="keyword">const</span> <span class="keywordtype">char</span>* from, <span class="keyword">const</span> <span class="keywordtype">char</span>* to, <a name="l02557"></a>02557 <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keywordtype">id</span>) <a name="l02558"></a>02558 { <span class="keywordflow">return</span> <a class="code" href="classTelEngine_1_1XMPPUtils.html#d2196e2a0ced3a3359d874470b9928c5">XMPPUtils::createDiscoInfoRes</a>(from,to,<span class="keywordtype">id</span>,&m_features,m_identity); } <a name="l02559"></a>02559 <a name="l02560"></a>02560 <span class="keyword">protected</span>: <a name="l02568"></a>02568 <a class="code" href="classTelEngine_1_1XMPPUserRoster.html" title="The roster of a local user.">XMPPUserRoster</a>(<a class="code" href="classTelEngine_1_1JBPresence.html" title="A Jabber presence service.">JBPresence</a>* engine, <span class="keyword">const</span> <span class="keywordtype">char</span>* node, <span class="keyword">const</span> <span class="keywordtype">char</span>* domain, <a name="l02569"></a>02569 <a class="code" href="classTelEngine_1_1JBEngine.html#ac39b55be6469395f55ff0292ad8184c">JBEngine::Protocol</a> proto = JBEngine::Component); <a name="l02570"></a>02570 <a name="l02571"></a>02571 <span class="keyword">private</span>: <a name="l02572"></a>02572 <span class="keyword">inline</span> <span class="keywordtype">void</span> addUser(<a class="code" href="classTelEngine_1_1XMPPUser.html" title="An XMPP remote user.">XMPPUser</a>* u) { <a name="l02573"></a>02573 <a class="code" href="classTelEngine_1_1Lock.html" title="Ephemeral mutex locking object.">Lock</a> lock(<span class="keyword">this</span>); <a name="l02574"></a>02574 m_remote.append(u); <a name="l02575"></a>02575 } <a name="l02576"></a>02576 <span class="keywordtype">void</span> removeUser(XMPPUser* u) { <a name="l02577"></a>02577 Lock lock(<span class="keyword">this</span>); <a name="l02578"></a>02578 m_remote.remove(u,<span class="keyword">false</span>); <a name="l02579"></a>02579 } <a name="l02580"></a>02580 <a name="l02581"></a>02581 JabberID m_jid; <span class="comment">// User's bare JID</span> <a name="l02582"></a>02582 JIDFeatureList m_features; <span class="comment">// Local user's resources</span> <a name="l02583"></a>02583 JIDIdentity* m_identity; <span class="comment">// JID's identity</span> <a name="l02584"></a>02584 ObjList m_remote; <span class="comment">// Remote users</span> <a name="l02585"></a>02585 JIDResourceList m_resources; <span class="comment">// Available resources of the user</span> <a name="l02586"></a>02586 JBPresence* m_engine; <span class="comment">// Presence engine</span> <a name="l02587"></a>02587 }; <a name="l02588"></a>02588 <a name="l02589"></a>02589 }; <a name="l02590"></a>02590 <a name="l02591"></a>02591 <span class="preprocessor">#endif </span><span class="comment">/* __YATEJABBER_H */</span> <a name="l02592"></a>02592 <a name="l02593"></a>02593 <span class="comment">/* vi: set ts=8 sw=4 sts=4 noet: */</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Sun Dec 7 21:36:10 2008 for Yate by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.7.1 </small></address> </body> </html>