File: TelEngine__MGCPEngine.html

package info (click to toggle)
yate 2.2.0-1~dfsg-1.1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 17,496 kB
  • ctags: 21,687
  • sloc: cpp: 126,248; ansic: 11,462; sh: 3,573; php: 3,229; python: 2,014; makefile: 1,504; perl: 465; awk: 8
file content (449 lines) | stat: -rw-r--r-- 27,757 bytes parent folder | download
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
<HTML>
<HEAD>
<TITLE>class MGCPEngine</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 MGCPEngine</h1>
		</TD>
		<TD valign="top" align="right" colspan="1">An MGCP engine. <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>::MGCPEngine</code></TD></TR>
<TR><TH>Definition</TH><TD><code>#include &lt;<A HREF="libs___ymgcp___yatemgcp_h.html">libs/ymgcp/yatemgcp.h</A>&gt;</code></TD></TR>
<TR><TH>Inherits</TH><TD><A HREF="TelEngine__DebugEnabler.html">TelEngine::DebugEnabler</A> <small>[public ]</small>, <A HREF="TelEngine__Mutex.html">TelEngine::Mutex</A> <small>[public ]</small></TD></TR>
<TR><TH><A HREF="full-list-TelEngine__MGCPEngine.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 Methods</h4><ul><LI>&nbsp;<b><A HREF="#ref3">MGCPEngine</A></b> (bool gateway, const char* name = 0, const NamedList* params = 0) 
</LI>
<LI>virtual  &nbsp;<b><A HREF="#ref4">~MGCPEngine</A></b> () 
</LI>
<LI>inline bool &nbsp;<b><A HREF="#ref5">gateway</A></b> ()  const
</LI>
<LI>inline const SocketAddr& &nbsp;<b><A HREF="#ref6">address</A></b> ()  const
</LI>
<LI>inline unsigned int &nbsp;<b><A HREF="#ref7">maxRecvPacket</A></b> ()  const
</LI>
<LI>inline bool &nbsp;<b><A HREF="#ref8">allowUnkCmd</A></b> ()  const
</LI>
<LI>inline unsigned int &nbsp;<b><A HREF="#ref9">retransInterval</A></b> ()  const
</LI>
<LI>inline unsigned int &nbsp;<b><A HREF="#ref10">retransCount</A></b> ()  const
</LI>
<LI>inline <A HREF="#u_int64_t">u_int64_t</A> &nbsp;<b><A HREF="#ref11">extraTime</A></b> ()  const
</LI>
<LI>inline bool &nbsp;<b><A HREF="#ref12">parseParamToLower</A></b> ()  const
</LI>
<LI>inline bool &nbsp;<b><A HREF="#ref13">provisional</A></b> ()  const
</LI>
<LI>inline bool &nbsp;<b><A HREF="#ref14">ackRequest</A></b> ()  const
</LI>
<LI>inline void &nbsp;<b><A HREF="#ref15">ackRequest</A></b> (bool request) 
</LI>
<LI>virtual  void &nbsp;<b><A HREF="#ref16">initialize</A></b> (const NamedList& params) 
</LI>
<LI>inline bool &nbsp;<b><A HREF="#ref17">knownCommand</A></b> (const char* cmd) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref18">addCommand</A></b> (const char* cmd) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref19">attach</A></b> (MGCPEndpoint* ep) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref20">detach</A></b> (MGCPEndpoint* ep, bool del = false, bool delTrans = false) 
</LI>
<LI>MGCPEndpoint* &nbsp;<b><A HREF="#ref21">findEp</A></b> (MGCPEndpoint* ep) 
</LI>
<LI>MGCPEndpoint* &nbsp;<b><A HREF="#ref22">findEp</A></b> (const String& epId) 
</LI>
<LI>MGCPTransaction* &nbsp;<b><A HREF="#ref23">findTrans</A></b> (unsigned int id, bool outgoing) 
</LI>
<LI>unsigned int &nbsp;<b><A HREF="#ref24">getNextId</A></b> () 
</LI>
<LI>MGCPTransaction* &nbsp;<b><A HREF="#ref25">sendCommand</A></b> (MGCPMessage* cmd, const SocketAddr& address) 
</LI>
<LI>bool &nbsp;<b><A HREF="#ref26">receive</A></b> (unsigned char* buffer, SocketAddr& addr) 
</LI>
<LI>bool &nbsp;<b><A HREF="#ref27">process</A></b> (<A HREF="#u_int64_t">u_int64_t</A> time = Time()) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref28">runReceive</A></b> () 
</LI>
<LI>void &nbsp;<b><A HREF="#ref29">runProcess</A></b> () 
</LI>
<LI>MGCPEvent* &nbsp;<b><A HREF="#ref30">getEvent</A></b> (<A HREF="#u_int64_t">u_int64_t</A> time = Time()) 
</LI>
<LI>virtual  bool &nbsp;<b><A HREF="#ref31">processEvent</A></b> (MGCPEvent* event) 
</LI>
<LI>virtual  bool &nbsp;<b><A HREF="#ref32">processEvent</A></b> (MGCPTransaction* trans, MGCPMessage* msg, void* data) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref33">returnEvent</A></b> (MGCPEvent* event) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref34">cleanup</A></b> (bool gracefully = true, const char* text = "Shutdown") 
</LI>
</ul><h4>Public Static Methods</h4><ul><LI>static  inline int &nbsp;<b><A HREF="#ref35">defaultPort</A></b> (bool gateway) 
</LI>
</ul><h4>Public Members</h4><ul><LI>static TokenDict <b><A HREF="#ref36">mgcp_commands[]</A></b></LI>
<LI>static TokenDict <b><A HREF="#ref37">mgcp_responses[]</A></b></LI>
<LI>static TokenDict <b><A HREF="#ref38">mgcp_reasons[]</A></b></LI>
</ul><h4>Protected Methods</h4><ul><LI>bool &nbsp;<b><A HREF="#ref39">sendData</A></b> (const String& msg, const SocketAddr& address) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref40">appendTrans</A></b> (MGCPTransaction* trans) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref41">removeTrans</A></b> (MGCPTransaction* trans, bool del) 
</LI>
</ul><h4>Protected Members</h4><ul><LI>ObjList <b><A HREF="#ref42">m_endpoints</A></b></LI>
<LI>ObjList <b><A HREF="#ref43">m_transactions</A></b></LI>
</ul><HR><H2><A NAME="longdesc">Detailed Description</A></H2><p>
 The engine may keep gateway endpoints or call agents
 Keep the transaction list and manage it (create/delete/modify/timeout...)
 Keep a list with the endpoints it services
 Generate transaction numbers (IDs)
 Parse received messages, validate and send them to the appropriate transaction
 Send MGCP messages to remote addresses
</p>
<A NAME="MGCPEngine"></A><A NAME="ref3"></A><table width="100%"><tr bgcolor="#eeeeee"><td>&nbsp;<strong>MGCPEngine</strong> (bool gateway, const char* name = 0, const NamedList* params = 0)
<br></td><td align="right"><h3><strong>MGCPEngine</strong></h3></td></tr></table><p></p><p>
 Constructor. Construct the engine and, optionally, initialize it
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>gateway</i></TD><TD align="left" valign="top">Engine's mode: true if this engine is an MGCP Gateway,
  false if it's a collection of Call Agents
</TD></TR>
<TR><TD align="left" valign="top"><i>name</i></TD><TD align="left" valign="top">Optional debug name for this engine
</TD></TR>
<TR><TD align="left" valign="top"><i>params</i></TD><TD align="left" valign="top">Optional parameters used to initialize this engine
     </TD></TR>
</TABLE></P>
<A NAME="~MGCPEngine"></A><A NAME="ref4"></A><table width="100%"><tr bgcolor="#eeeeee"><td> &nbsp;<strong>~MGCPEngine</strong> ()
<br></td><td align="right"><h3><strong>~MGCPEngine</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p>
 Destructor. Clear all lists
     </p>
<A NAME="gateway"></A><A NAME="ref5"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline bool &nbsp;<strong>gateway</strong> ()
<br></td><td align="right"><h3><strong>gateway</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
 Check if this engine is an MGCP Gateway or a collection of Call Agents
</p>
<p><b>Returns</b>: True if this engine is an MGCP Gateway, false if it's a
  collection of Call Agents
     </p>
<A NAME="address"></A><A NAME="ref6"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline const SocketAddr& &nbsp;<strong>address</strong> ()
<br></td><td align="right"><h3><strong>address</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
 Get the IP address used by this engine to receive data
</p>
<p><b>Returns</b>: The IP address used by this engine to receive data
     </p>
<A NAME="maxRecvPacket"></A><A NAME="ref7"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline unsigned int &nbsp;<strong>maxRecvPacket</strong> ()
<br></td><td align="right"><h3><strong>maxRecvPacket</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
 Get the maximum length or received packets. This is the size of the buffer used by
  this engine to read data from the socket
</p>
<p><b>Returns</b>: The maximum length or received packets
     </p>
<A NAME="allowUnkCmd"></A><A NAME="ref8"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline bool &nbsp;<strong>allowUnkCmd</strong> ()
<br></td><td align="right"><h3><strong>allowUnkCmd</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
 Check if this engine is allowed to send/accept unknown commands
</p>
<p><b>Returns</b>: True if this engine is allowed to send/accept unknown commands
     </p>
<A NAME="retransInterval"></A><A NAME="ref9"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline unsigned int &nbsp;<strong>retransInterval</strong> ()
<br></td><td align="right"><h3><strong>retransInterval</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
 Get the message retransmission interval
</p>
<p><b>Returns</b>: The message retransmission interval
     </p>
<A NAME="retransCount"></A><A NAME="ref10"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline unsigned int &nbsp;<strong>retransCount</strong> ()
<br></td><td align="right"><h3><strong>retransCount</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
 Get the maximum number of retransmissions for a message
</p>
<p><b>Returns</b>: The maximum number of retransmissions for a message
     </p>
<A NAME="extraTime"></A><A NAME="ref11"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline <A HREF="#u_int64_t">u_int64_t</A> &nbsp;<strong>extraTime</strong> ()
<br></td><td align="right"><h3><strong>extraTime</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
 Get the time to live after the transaction terminated gracefully
</p>
<p><b>Returns</b>: The time to live after the transaction terminated gracefully
     </p>
<A NAME="parseParamToLower"></A><A NAME="ref12"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline bool &nbsp;<strong>parseParamToLower</strong> ()
<br></td><td align="right"><h3><strong>parseParamToLower</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
 Check if the parser should convert received messages' parameters to lower case
</p>
<p><b>Returns</b>: True if the parser should convert received messages' parameters to lower case
     </p>
<A NAME="provisional"></A><A NAME="ref13"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline bool &nbsp;<strong>provisional</strong> ()
<br></td><td align="right"><h3><strong>provisional</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
 Check if incoming transactions would send provisional responses
</p>
<p><b>Returns</b>: True if incoming transactions would send provisional responses
     </p>
<A NAME="ackRequest"></A><A NAME="ref14"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline bool &nbsp;<strong>ackRequest</strong> ()
<br></td><td align="right"><h3><strong>ackRequest</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
 Get the remote ACK request flag
</p>
<p><b>Returns</b>: True if remote will be requested to send an ACK
     </p>
<A NAME="ackRequest"></A><A NAME="ref15"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline void &nbsp;<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 to not request from remote to send an ACK
     </TD></TR>
</TABLE></P>
<A NAME="initialize"></A><A NAME="ref16"></A><table width="100%"><tr bgcolor="#eeeeee"><td> void &nbsp;<strong>initialize</strong> (const NamedList& params)
<br></td><td align="right"><h3><strong>initialize</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p>
 Initialize this engine
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>params</i></TD><TD align="left" valign="top">Engine's parameters
     </TD></TR>
</TABLE></P>
<A NAME="knownCommand"></A><A NAME="ref17"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline bool &nbsp;<strong>knownCommand</strong> (const char* cmd)
<br></td><td align="right"><h3><strong>knownCommand</strong></h3></td></tr></table><p></p><p>
 Check if a command is known by this engine
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>cmd</i></TD><TD align="left" valign="top">The command name to check
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: True if the given command is known by this engine
     </p>
<A NAME="addCommand"></A><A NAME="ref18"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>addCommand</strong> (const char* cmd)
<br></td><td align="right"><h3><strong>addCommand</strong></h3></td></tr></table><p></p><p>
 Add a command to the list of known commands
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>cmd</i></TD><TD align="left" valign="top">The command name to add
     </TD></TR>
</TABLE></P>
<A NAME="attach"></A><A NAME="ref19"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>attach</strong> (MGCPEndpoint* ep)
<br></td><td align="right"><h3><strong>attach</strong></h3></td></tr></table><p></p><p>
 Append an endpoint to this engine if not already done
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>ep</i></TD><TD align="left" valign="top">The endpoint to append
     </TD></TR>
</TABLE></P>
<A NAME="detach"></A><A NAME="ref20"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>detach</strong> (MGCPEndpoint* ep, bool del = false, bool delTrans = false)
<br></td><td align="right"><h3><strong>detach</strong></h3></td></tr></table><p></p><p>
 Remove an endpoint from this engine and, optionally, remove all its transactions
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>ep</i></TD><TD align="left" valign="top">The endpoint to remove
</TD></TR>
<TR><TD align="left" valign="top"><i>del</i></TD><TD align="left" valign="top">True to delete it, false to just remove it from the list
</TD></TR>
<TR><TD align="left" valign="top"><i>delTrans</i></TD><TD align="left" valign="top">True to remove all its transactions.
  Forced to true if the endpoint is deleted
     </TD></TR>
</TABLE></P>
<A NAME="findEp"></A><A NAME="ref21"></A><table width="100%"><tr bgcolor="#eeeeee"><td>MGCPEndpoint* &nbsp;<strong>findEp</strong> (MGCPEndpoint* ep)
<br></td><td align="right"><h3><strong>findEp</strong></h3></td></tr></table><p></p><p>
 Find an endpoint by its pointer
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>ep</i></TD><TD align="left" valign="top">The endpoint to find
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: MGCPEndpoint pointer or 0 if not found
     </p>
<A NAME="findEp"></A><A NAME="ref22"></A><table width="100%"><tr bgcolor="#eeeeee"><td>MGCPEndpoint* &nbsp;<strong>findEp</strong> (const String& epId)
<br></td><td align="right"><h3><strong>findEp</strong></h3></td></tr></table><p></p><p>
 Find an endpoint by its id
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>epId</i></TD><TD align="left" valign="top">The endpoint's id to find
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: MGCPEndpoint pointer or 0 if not found
     </p>
<A NAME="findTrans"></A><A NAME="ref23"></A><table width="100%"><tr bgcolor="#eeeeee"><td>MGCPTransaction* &nbsp;<strong>findTrans</strong> (unsigned int id, bool outgoing)
<br></td><td align="right"><h3><strong>findTrans</strong></h3></td></tr></table><p></p><p>
 Find a transaction by its id
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>id</i></TD><TD align="left" valign="top">The id of the transaction to find
</TD></TR>
<TR><TD align="left" valign="top"><i>outgoing</i></TD><TD align="left" valign="top">The transaction direction. True for outgoing, false for incoming
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: MGCPTransaction pointer or 0 if not found
     </p>
<A NAME="getNextId"></A><A NAME="ref24"></A><table width="100%"><tr bgcolor="#eeeeee"><td>unsigned int &nbsp;<strong>getNextId</strong> ()
<br></td><td align="right"><h3><strong>getNextId</strong></h3></td></tr></table><p></p><p>
 Generate a new id for an outgoing transaction
</p>
<p><b>Returns</b>: An id for an outgoing transaction
     </p>
<A NAME="sendCommand"></A><A NAME="ref25"></A><table width="100%"><tr bgcolor="#eeeeee"><td>MGCPTransaction* &nbsp;<strong>sendCommand</strong> (MGCPMessage* cmd, const SocketAddr& address)
<br></td><td align="right"><h3><strong>sendCommand</strong></h3></td></tr></table><p></p><p>
 Send a command message. Create a transaction for it.
 The method will fail if the message is not a valid one or isn't a valid command
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>cmd</i></TD><TD align="left" valign="top">The message containig the command
</TD></TR>
<TR><TD align="left" valign="top"><i>address</i></TD><TD align="left" valign="top">The destination IP address
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: MGCPTransaction pointer or 0 if failed to create a transaction
     </p>
<A NAME="receive"></A><A NAME="ref26"></A><table width="100%"><tr bgcolor="#eeeeee"><td>bool &nbsp;<strong>receive</strong> (unsigned char* buffer, SocketAddr& addr)
<br></td><td align="right"><h3><strong>receive</strong></h3></td></tr></table><p></p><p>
 Read data from the socket. Parse and process the received message
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>buffer</i></TD><TD align="left" valign="top">Buffer used for read operation. The buffer must be large enough
  to keep the maximum packet length returned by <A HREF="TelEngine__MGCPEngine.html#maxRecvPacket">maxRecvPacket</A>()
</TD></TR>
<TR><TD align="left" valign="top"><i>addr</i></TD><TD align="left" valign="top">The sender's address if received any data
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: True if received any data (a message was successfully parsed)
     </p>
<A NAME="process"></A><A NAME="ref27"></A><table width="100%"><tr bgcolor="#eeeeee"><td>bool &nbsp;<strong>process</strong> (<A HREF="#u_int64_t">u_int64_t</A> time = Time())
<br></td><td align="right"><h3><strong>process</strong></h3></td></tr></table><p></p><p>
 Try to get an event from a transaction.
 If the event contains an unknown command and this engine is not allowed
  to process such commands, calls the <A HREF="TelEngine__MGCPEngine.html#returnEvent">returnEvent</A>() method, otherwise,
  calls the <A HREF="TelEngine__MGCPEngine.html#processEvent">processEvent</A>() method
</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>: True if an event was processed
     </p>
<A NAME="runReceive"></A><A NAME="ref28"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>runReceive</strong> ()
<br></td><td align="right"><h3><strong>runReceive</strong></h3></td></tr></table><p></p><p>
 Repeatedly calls <A HREF="TelEngine__MGCPEngine.html#receive">receive</A>() until the calling thread terminates
     </p>
<A NAME="runProcess"></A><A NAME="ref29"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>runProcess</strong> ()
<br></td><td align="right"><h3><strong>runProcess</strong></h3></td></tr></table><p></p><p>
 Repeatedly calls <A HREF="TelEngine__MGCPEngine.html#process">process</A>() until the calling thread terminates
     </p>
<A NAME="getEvent"></A><A NAME="ref30"></A><table width="100%"><tr bgcolor="#eeeeee"><td>MGCPEvent* &nbsp;<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>
 Try to get an event from a transaction
</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="processEvent"></A><A NAME="ref31"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool &nbsp;<strong>processEvent</strong> (MGCPEvent* event)
<br></td><td align="right"><h3><strong>processEvent</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p>
 Process an event generated by a transaction. Descendants must override this
  method if they want to process events. By default it calls the version
  of processEvent that accepts separate parameters of event
</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 event to process
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: True if the event was processed. If the event carry a received
  command and it's not processed the transaction will receive an 'unknown command' response
     </p>
<A NAME="processEvent"></A><A NAME="ref32"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool &nbsp;<strong>processEvent</strong> (MGCPTransaction* trans, MGCPMessage* msg, void* data)
<br></td><td align="right"><h3><strong>processEvent</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p>
 Process an event generated by a transaction. Descendants must override this
  method if they want to process events
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>trans</i></TD><TD align="left" valign="top">Pointer to the transaction that generated the event
</TD></TR>
<TR><TD align="left" valign="top"><i>msg</i></TD><TD align="left" valign="top">MGCP message of the event, may be NULL
</TD></TR>
<TR><TD align="left" valign="top"><i>data</i></TD><TD align="left" valign="top">User data that is stored in transaction, may be NULL
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: True if the event was processed. If the event carry a received
  command and it's not processed the transaction will receive an 'unknown command' response
     </p>
<A NAME="returnEvent"></A><A NAME="ref33"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>returnEvent</strong> (MGCPEvent* event)
<br></td><td align="right"><h3><strong>returnEvent</strong></h3></td></tr></table><p></p><p>
 Returns an unprocessed event to this engine to be deleted.
 Incoming transactions will be responded. Unknown commands will receive a
  504 Unknown Command response, the others will receive a 507 Unsupported Functionality one
</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 event to return
     </TD></TR>
</TABLE></P>
<A NAME="cleanup"></A><A NAME="ref34"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>cleanup</strong> (bool gracefully = true, const char* text = "Shutdown")
<br></td><td align="right"><h3><strong>cleanup</strong></h3></td></tr></table><p></p><p>
 Terminate all transactions. Cancel all private threads if any and
  wait for them to terminate
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>gracefully</i></TD><TD align="left" valign="top">If true, all incoming transaction will be responded and private
  threads will be gently cancelled. If false, all transactions will be deleted and
  threads will be cancelled the hard way
</TD></TR>
<TR><TD align="left" valign="top"><i>text</i></TD><TD align="left" valign="top">Optional text to be sent with the response code of the incoming
  transactions on gracefully cleanup
     </TD></TR>
</TABLE></P>
<A NAME="defaultPort"></A><A NAME="ref35"></A><table width="100%"><tr bgcolor="#eeeeee"><td> inline int &nbsp;<strong>defaultPort</strong> (bool gateway)
<br></td><td align="right"><h3><strong>defaultPort</strong></h3></td></tr></table><p> <small>[static]</small></p><p>
 Get the default port defined by the protocol
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>gateway</i></TD><TD align="left" valign="top">True to get the default Gateway port,
  false to get the default port for the Call Agent
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: The default port defined by the protocol
     </p>
<A NAME="mgcp_commands[]"></A><A NAME="ref36"></A><table width="100%"><tr bgcolor="#eeeeee"><td>static TokenDict  <strong>mgcp_commands[]</strong>
</td><td align="right"><h3><strong>mgcp_commands[]</strong></h3></td></tr></table><p></p><A NAME="mgcp_responses[]"></A><A NAME="ref37"></A><table width="100%"><tr bgcolor="#eeeeee"><td>static TokenDict  <strong>mgcp_responses[]</strong>
</td><td align="right"><h3><strong>mgcp_responses[]</strong></h3></td></tr></table><p></p><A NAME="mgcp_reasons[]"></A><A NAME="ref38"></A><table width="100%"><tr bgcolor="#eeeeee"><td>static TokenDict  <strong>mgcp_reasons[]</strong>
</td><td align="right"><h3><strong>mgcp_reasons[]</strong></h3></td></tr></table><p></p><A NAME="sendData"></A><A NAME="ref39"></A><table width="100%"><tr bgcolor="#eeeeee"><td>bool &nbsp;<strong>sendData</strong> (const String& msg, const SocketAddr& address)
<br></td><td align="right"><h3><strong>sendData</strong></h3></td></tr></table><p> <small>[protected]</small></p><p>
 Send a string buffer through the socket
</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 buffer to send
</TD></TR>
<TR><TD align="left" valign="top"><i>address</i></TD><TD align="left" valign="top">The destination IP address
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: False if the operation failed
     </p>
<A NAME="appendTrans"></A><A NAME="ref40"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>appendTrans</strong> (MGCPTransaction* trans)
<br></td><td align="right"><h3><strong>appendTrans</strong></h3></td></tr></table><p> <small>[protected]</small></p><p>
 Append a transaction to the list
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>trans</i></TD><TD align="left" valign="top">The transaction to append
     </TD></TR>
</TABLE></P>
<A NAME="removeTrans"></A><A NAME="ref41"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>removeTrans</strong> (MGCPTransaction* trans, bool del)
<br></td><td align="right"><h3><strong>removeTrans</strong></h3></td></tr></table><p> <small>[protected]</small></p><p>
 Remove a transaction from the list
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>trans</i></TD><TD align="left" valign="top">The transaction to remove
</TD></TR>
<TR><TD align="left" valign="top"><i>del</i></TD><TD align="left" valign="top">True to delete it, false to just remove it from list
     </TD></TR>
</TABLE></P>
<A NAME="m_endpoints"></A><A NAME="ref42"></A><table width="100%"><tr bgcolor="#eeeeee"><td>ObjList  <strong>m_endpoints</strong>
</td><td align="right"><h3><strong>m_endpoints</strong></h3></td></tr></table><p> <small>[protected]</small></p><A NAME="m_transactions"></A><A NAME="ref43"></A><table width="100%"><tr bgcolor="#eeeeee"><td>ObjList  <strong>m_transactions</strong>
</td><td align="right"><h3><strong>m_transactions</strong></h3></td></tr></table><p> <small>[protected]</small></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>