1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342
|
<HTML>
<HEAD>
<TITLE>class MGCPTransaction</TITLE>
<META NAME="Generator" CONTENT="KDOC ">
</HEAD>
<BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff">
<TABLE WIDTH="100%" BORDER="0">
<TR>
<TD>
<TABLE BORDER="0">
<TR><TD valign="top" align="left" cellspacing="10">
<h1>class MGCPTransaction</h1>
</TD>
<TD valign="top" align="right" colspan="1">An MGCP transaction. <small><A HREF="#longdesc">More...</A></small></TD></TR>
</TABLE>
<HR>
<TABLE BORDER="0">
<TR><TH>Full name</TH><TD><code><A HREF="TelEngine.html">TelEngine</A>::MGCPTransaction</code></TD></TR>
<TR><TH>Definition</TH><TD><code>#include <<A HREF="libs___ymgcp___yatemgcp_h.html">libs/ymgcp/yatemgcp.h</A>></code></TD></TR>
<TR><TH>Inherits</TH><TD><A HREF="TelEngine__Mutex.html">TelEngine::Mutex</A> <small>[public ]</small>, <A HREF="TelEngine__RefObject.html">TelEngine::RefObject</A> <small>[public ]</small></TD></TR>
<TR><TH><A HREF="full-list-TelEngine__MGCPTransaction.html">List of all Methods</A></TH></TR>
</TABLE>
</TD>
<TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR>
<TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR>
<TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR>
<TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR>
<TR><TD><small><A HREF="index.html">Index</A></small></TD></TR>
</TABLE></TD></TR></TABLE>
<h4>Public Types</h4><ul><LI>enum <A HREF="#ref3">State</A> { Invalid = 0,
Initiated = 1,
Trying = 2,
Responded = 3,
Ack = 4,
Destroying = 5,
}
</LI>
</ul><h4>Public Methods</h4><ul><LI> <b><A HREF="#ref4">MGCPTransaction</A></b> (MGCPEngine* engine, MGCPMessage* msg, bool outgoing,
const SocketAddr& address)
</LI>
<LI>virtual <b><A HREF="#ref5">~MGCPTransaction</A></b> ()
</LI>
<LI>inline State <b><A HREF="#ref6">state</A></b> () const
</LI>
<LI>inline unsigned int <b><A HREF="#ref7">id</A></b> () const
</LI>
<LI>inline bool <b><A HREF="#ref8">outgoing</A></b> () const
</LI>
<LI>inline const String& <b><A HREF="#ref9">ep</A></b> () const
</LI>
<LI>const SocketAddr& <b><A HREF="#ref10">addr</A></b> () const
</LI>
<LI>inline MGCPEngine* <b><A HREF="#ref11">engine</A></b> ()
</LI>
<LI>inline const MGCPMessage* <b><A HREF="#ref12">initial</A></b> () const
</LI>
<LI>inline const MGCPMessage* <b><A HREF="#ref13">msgProvisional</A></b> () const
</LI>
<LI>inline const MGCPMessage* <b><A HREF="#ref14">msgResponse</A></b> () const
</LI>
<LI>inline const MGCPMessage* <b><A HREF="#ref15">msgAck</A></b> () const
</LI>
<LI>inline bool <b><A HREF="#ref16">timeout</A></b> () const
</LI>
<LI>inline void <b><A HREF="#ref17">ackRequest</A></b> (bool request)
</LI>
<LI>inline void* <b><A HREF="#ref18">userData</A></b> () const
</LI>
<LI>inline void <b><A HREF="#ref19">userData</A></b> (void* data)
</LI>
<LI>MGCPEvent* <b><A HREF="#ref20">getEvent</A></b> (<A HREF="#u_int64_t">u_int64_t</A> time = Time())
</LI>
<LI>bool <b><A HREF="#ref21">sendProvisional</A></b> (int code = 100, const char* comment = 0)
</LI>
<LI>inline bool <b><A HREF="#ref22">setResponse</A></b> (int code, const char* comment = 0)
</LI>
<LI>bool <b><A HREF="#ref23">setResponse</A></b> (int code, const NamedList* params, MimeSdpBody* sdp1 = 0,
MimeSdpBody* sdp2 = 0)
</LI>
<LI>bool <b><A HREF="#ref24">setResponse</A></b> (MGCPMessage* msg)
</LI>
</ul><h4>Protected Methods</h4><ul><LI>virtual void <b><A HREF="#ref25">destroyed</A></b> ()
</LI>
<LI>void <b><A HREF="#ref26">processMessage</A></b> (MGCPMessage* msg)
</LI>
<LI>MGCPEvent* <b><A HREF="#ref27">checkTimeout</A></b> (<A HREF="#u_int64_t">u_int64_t</A> time)
</LI>
<LI>void <b><A HREF="#ref28">eventTerminated</A></b> (MGCPEvent* event)
</LI>
<LI>void <b><A HREF="#ref29">changeState</A></b> (State newState)
</LI>
<LI>void <b><A HREF="#ref30">setProvisional</A></b> (int code = 100)
</LI>
<LI>void <b><A HREF="#ref31">send</A></b> (MGCPMessage* msg)
</LI>
</ul><HR><H2><A NAME="longdesc">Detailed Description</A></H2><p>
This class implements an MGCP transaction
</p>
<A NAME="State"></A><A NAME="ref3"></A><table width="100%"><tr bgcolor="#eeeeee"><td>enum <strong>State</strong> { Invalid = 0,
Initiated = 1,
Trying = 2,
Responded = 3,
Ack = 4,
Destroying = 5,
}
</td><td align="right"><h3><strong>State</strong></h3></td></tr></table><p></p><p>
Transaction state enumeration
</p>
<A NAME="MGCPTransaction"></A><A NAME="ref4"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>MGCPTransaction</strong> (MGCPEngine* engine, MGCPMessage* msg, bool outgoing,
const SocketAddr& address)
<br></td><td align="right"><h3><strong>MGCPTransaction</strong></h3></td></tr></table><p></p><p>
Constructor. Construct a transaction from its first message
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>engine</i></TD><TD align="left" valign="top">The engine owning this transaction
</TD></TR>
<TR><TD align="left" valign="top"><i>msg</i></TD><TD align="left" valign="top">The command creating this transaction
</TD></TR>
<TR><TD align="left" valign="top"><i>outgoing</i></TD><TD align="left" valign="top">The direction of this transaction
</TD></TR>
<TR><TD align="left" valign="top"><i>address</i></TD><TD align="left" valign="top">Remote enpoint's address
</TD></TR>
</TABLE></P>
<A NAME="~MGCPTransaction"></A><A NAME="ref5"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>~MGCPTransaction</strong> ()
<br></td><td align="right"><h3><strong>~MGCPTransaction</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p>
Destructor
</p>
<A NAME="state"></A><A NAME="ref6"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline State <strong>state</strong> ()
<br></td><td align="right"><h3><strong>state</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the current transaction's state
</p>
<p><b>Returns</b>: The transaction state as enumeration
</p>
<A NAME="id"></A><A NAME="ref7"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline unsigned int <strong>id</strong> ()
<br></td><td align="right"><h3><strong>id</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the id of this transaction
</p>
<p><b>Returns</b>: The id of this transaction
</p>
<A NAME="outgoing"></A><A NAME="ref8"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline bool <strong>outgoing</strong> ()
<br></td><td align="right"><h3><strong>outgoing</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the direction of this transaction
</p>
<p><b>Returns</b>: True if this is an outgoing transaction
</p>
<A NAME="ep"></A><A NAME="ref9"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline const String& <strong>ep</strong> ()
<br></td><td align="right"><h3><strong>ep</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the id of the endpoint owning this transaction
</p>
<p><b>Returns</b>: The id of the endpoint owning this transaction
</p>
<A NAME="addr"></A><A NAME="ref10"></A><table width="100%"><tr bgcolor="#eeeeee"><td>const SocketAddr& <strong>addr</strong> ()
<br></td><td align="right"><h3><strong>addr</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the remote endpoint's IP address
</p>
<p><b>Returns</b>: The remote endpoint's IP address
</p>
<A NAME="engine"></A><A NAME="ref11"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline MGCPEngine* <strong>engine</strong> ()
<br></td><td align="right"><h3><strong>engine</strong></h3></td></tr></table><p></p><p>
Get the engine owning this transaction
</p>
<p><b>Returns</b>: The engine owning this transaction
</p>
<A NAME="initial"></A><A NAME="ref12"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline const MGCPMessage* <strong>initial</strong> ()
<br></td><td align="right"><h3><strong>initial</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the initial command message sent or received by this transaction
</p>
<p><b>Returns</b>: The transaction's initial message
</p>
<A NAME="msgProvisional"></A><A NAME="ref13"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline const MGCPMessage* <strong>msgProvisional</strong> ()
<br></td><td align="right"><h3><strong>msgProvisional</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the provisional response message sent or received by this transaction
</p>
<p><b>Returns</b>: The transaction's provisional response message
</p>
<A NAME="msgResponse"></A><A NAME="ref14"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline const MGCPMessage* <strong>msgResponse</strong> ()
<br></td><td align="right"><h3><strong>msgResponse</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the final response message sent or received by this transaction
</p>
<p><b>Returns</b>: The transaction's final response message
</p>
<A NAME="msgAck"></A><A NAME="ref15"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline const MGCPMessage* <strong>msgAck</strong> ()
<br></td><td align="right"><h3><strong>msgAck</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the response aknowledgement message sent or received by this transaction
</p>
<p><b>Returns</b>: The transaction's response aknowledgement message
</p>
<A NAME="timeout"></A><A NAME="ref16"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline bool <strong>timeout</strong> ()
<br></td><td align="right"><h3><strong>timeout</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Check if this transaction timed out
</p>
<p><b>Returns</b>: True if this transaction timed out
</p>
<A NAME="ackRequest"></A><A NAME="ref17"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline void <strong>ackRequest</strong> (bool request)
<br></td><td align="right"><h3><strong>ackRequest</strong></h3></td></tr></table><p></p><p>
Set the remote ACK request flag
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>request</i></TD><TD align="left" valign="top">False if remote is not required to send an ACK
</TD></TR>
</TABLE></P>
<A NAME="userData"></A><A NAME="ref18"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline void* <strong>userData</strong> ()
<br></td><td align="right"><h3><strong>userData</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the private user data of this transaction
</p>
<p><b>Returns</b>: The private user data of this transaction
</p>
<A NAME="userData"></A><A NAME="ref19"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline void <strong>userData</strong> (void* data)
<br></td><td align="right"><h3><strong>userData</strong></h3></td></tr></table><p></p><p>
Set the private user data of this transaction
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>data</i></TD><TD align="left" valign="top">The new private user data of this transaction
</TD></TR>
</TABLE></P>
<A NAME="getEvent"></A><A NAME="ref20"></A><table width="100%"><tr bgcolor="#eeeeee"><td>MGCPEvent* <strong>getEvent</strong> (<A HREF="#u_int64_t">u_int64_t</A> time = Time())
<br></td><td align="right"><h3><strong>getEvent</strong></h3></td></tr></table><p></p><p>
Get an event from this transaction. Check timeouts
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>time</i></TD><TD align="left" valign="top">Current time in microseconds
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: MGCPEvent pointer or 0 if none
</p>
<A NAME="sendProvisional"></A><A NAME="ref21"></A><table width="100%"><tr bgcolor="#eeeeee"><td>bool <strong>sendProvisional</strong> (int code = 100, const char* comment = 0)
<br></td><td align="right"><h3><strong>sendProvisional</strong></h3></td></tr></table><p></p><p>
Explicitely transmits a provisional code
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>code</i></TD><TD align="left" valign="top">Provisional response code to send, must be in range 100-199
</TD></TR>
<TR><TD align="left" valign="top"><i>comment</i></TD><TD align="left" valign="top">Optional response comment text
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: True if the provisional response was sent
</p>
<A NAME="setResponse"></A><A NAME="ref22"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline bool <strong>setResponse</strong> (int code, const char* comment = 0)
<br></td><td align="right"><h3><strong>setResponse</strong></h3></td></tr></table><p></p><p>
Creates and transmits a final response (code must at least 200) message if
this is an incoming transaction
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>code</i></TD><TD align="left" valign="top">Response code to send
</TD></TR>
<TR><TD align="left" valign="top"><i>comment</i></TD><TD align="left" valign="top">Optional response comment text
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: True if the message was queued for transmission
</p>
<A NAME="setResponse"></A><A NAME="ref23"></A><table width="100%"><tr bgcolor="#eeeeee"><td>bool <strong>setResponse</strong> (int code, const NamedList* params, MimeSdpBody* sdp1 = 0,
MimeSdpBody* sdp2 = 0)
<br></td><td align="right"><h3><strong>setResponse</strong></h3></td></tr></table><p></p><p>
Creates and transmits a final response (code must at least 200) message if
this is an incoming transaction.
The SDP(s) will be consumed (appended to the message or destroyed)
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>code</i></TD><TD align="left" valign="top">Response code to send
</TD></TR>
<TR><TD align="left" valign="top"><i>params</i></TD><TD align="left" valign="top">Parameters to set in response, name will be set as comment
</TD></TR>
<TR><TD align="left" valign="top"><i>sdp1</i></TD><TD align="left" valign="top">Optional SDP to be added to the response
</TD></TR>
<TR><TD align="left" valign="top"><i>sdp2</i></TD><TD align="left" valign="top">Optional second SDP to be added to the response if the first one is not 0
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: True if the message was queued for transmission
</p>
<A NAME="setResponse"></A><A NAME="ref24"></A><table width="100%"><tr bgcolor="#eeeeee"><td>bool <strong>setResponse</strong> (MGCPMessage* msg)
<br></td><td align="right"><h3><strong>setResponse</strong></h3></td></tr></table><p></p><p>
Transmits a final response (code must at least 200)
message if this is an incoming transaction
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>msg</i></TD><TD align="left" valign="top">The message to transmit
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: True if the message was queued for transmission
</p>
<A NAME="destroyed"></A><A NAME="ref25"></A><table width="100%"><tr bgcolor="#eeeeee"><td> void <strong>destroyed</strong> ()
<br></td><td align="right"><h3><strong>destroyed</strong></h3></td></tr></table><p> <small>[protected virtual]</small></p><p>
Gracefully terminate this transaction. Release memory
</p>
<p>Reimplemented from <A HREF="TelEngine__RefObject.html#destroyed">RefObject</A>.</p>
<A NAME="processMessage"></A><A NAME="ref26"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void <strong>processMessage</strong> (MGCPMessage* msg)
<br></td><td align="right"><h3><strong>processMessage</strong></h3></td></tr></table><p> <small>[protected]</small></p><p>
Consume (process) a received message, other then the initiating one
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>msg</i></TD><TD align="left" valign="top">The received message
</TD></TR>
</TABLE></P>
<A NAME="checkTimeout"></A><A NAME="ref27"></A><table width="100%"><tr bgcolor="#eeeeee"><td>MGCPEvent* <strong>checkTimeout</strong> (<A HREF="#u_int64_t">u_int64_t</A> time)
<br></td><td align="right"><h3><strong>checkTimeout</strong></h3></td></tr></table><p> <small>[protected]</small></p><p>
Check timeouts. Manage retransmissions
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>time</i></TD><TD align="left" valign="top">Current time in milliseconds
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: MGCPEvent pointer if timeout
</p>
<A NAME="eventTerminated"></A><A NAME="ref28"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void <strong>eventTerminated</strong> (MGCPEvent* event)
<br></td><td align="right"><h3><strong>eventTerminated</strong></h3></td></tr></table><p> <small>[protected]</small></p><p>
Event termination notification
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>event</i></TD><TD align="left" valign="top">The notifier
</TD></TR>
</TABLE></P>
<A NAME="changeState"></A><A NAME="ref29"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void <strong>changeState</strong> (State newState)
<br></td><td align="right"><h3><strong>changeState</strong></h3></td></tr></table><p> <small>[protected]</small></p><p>
Change transaction's state if the new state is a valid one
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>newState</i></TD><TD align="left" valign="top">The new state of this transaction
</TD></TR>
</TABLE></P>
<A NAME="setProvisional"></A><A NAME="ref30"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void <strong>setProvisional</strong> (int code = 100)
<br></td><td align="right"><h3><strong>setProvisional</strong></h3></td></tr></table><p> <small>[protected]</small></p><p>
Set and send the provisional response (codes between 100 and 199)
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>code</i></TD><TD align="left" valign="top">The response code
</TD></TR>
</TABLE></P>
<A NAME="send"></A><A NAME="ref31"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void <strong>send</strong> (MGCPMessage* msg)
<br></td><td align="right"><h3><strong>send</strong></h3></td></tr></table><p> <small>[protected]</small></p><p>
(Re)send one the initial, provisional or final response. Change transaction's state
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>msg</i></TD><TD align="left" valign="top">The message to send
</TD></TR>
</TABLE></P>
<HR>
<table>
<tr><td><small>Generated by: paulc on bussard on Mon Mar 8 12:18:15 2010, using kdoc 2.0a54.</small></td></tr>
</table>
</BODY>
</HTML>
|