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
|
<HTML>
<HEAD>
<TITLE>class MGCPMessage</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 MGCPMessage</h1>
</TD>
<TD valign="top" align="right" colspan="1">An MGCP command or response. <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>::MGCPMessage</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__RefObject.html">TelEngine::RefObject</A> <small>[public ]</small></TD></TR>
<TR><TH><A HREF="full-list-TelEngine__MGCPMessage.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> <b><A HREF="#ref2">MGCPMessage</A></b> (MGCPEngine* engine, const char* name, const char* ep, const char* ver = "MGCP 1.0")
</LI>
<LI> <b><A HREF="#ref3">MGCPMessage</A></b> (MGCPTransaction* trans, unsigned int code, const char* comment = 0)
</LI>
<LI>virtual <b><A HREF="#ref4">~MGCPMessage</A></b> ()
</LI>
<LI>inline bool <b><A HREF="#ref5">valid</A></b> () const
</LI>
<LI>inline const String& <b><A HREF="#ref6">name</A></b> () const
</LI>
<LI>inline int <b><A HREF="#ref7">code</A></b> () const
</LI>
<LI>inline const String& <b><A HREF="#ref8">version</A></b> () const
</LI>
<LI>inline const String& <b><A HREF="#ref9">comment</A></b> () const
</LI>
<LI>inline bool <b><A HREF="#ref10">isCommand</A></b> () const
</LI>
<LI>inline bool <b><A HREF="#ref11">isResponse</A></b> () const
</LI>
<LI>inline bool <b><A HREF="#ref12">isAck</A></b> () const
</LI>
<LI>inline unsigned int <b><A HREF="#ref13">transactionId</A></b> () const
</LI>
<LI>inline const String& <b><A HREF="#ref14">endpointId</A></b> () const
</LI>
<LI>void <b><A HREF="#ref15">toString</A></b> (String& dest) const
</LI>
</ul><h4>Public Static Methods</h4><ul><LI>static bool <b><A HREF="#ref16">parse</A></b> (MGCPEngine* engine, ObjList& dest,
const unsigned char* buffer, unsigned int len,
const char* sdpType = "application/sdp")
</LI>
</ul><h4>Public Members</h4><ul><LI>NamedList <b><A HREF="#ref17">params</A></b></LI>
<LI>ObjList <b><A HREF="#ref18">sdp</A></b></LI>
</ul><h4>Protected Methods</h4><ul><LI> <b><A HREF="#ref19">MGCPMessage</A></b> (MGCPEngine* engine, const char* name, int code,
unsigned int transId, const char* epId, const char* ver)
</LI>
</ul><HR><H2><A NAME="longdesc">Detailed Description</A></H2><p>
This class holds an MGCP message, either command or response, along with
its parameters. The
</p>
<A NAME="MGCPMessage"></A><A NAME="ref2"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>MGCPMessage</strong> (MGCPEngine* engine, const char* name, const char* ep, const char* ver = "MGCP 1.0")
<br></td><td align="right"><h3><strong>MGCPMessage</strong></h3></td></tr></table><p></p><p>
Constructor. Construct an outgoing command message.
A transaction id will be requested from the endpoint's engine.
The message will be invalidated if failed to get a transaction id or the
command name is unknown
</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 sending this message
</TD></TR>
<TR><TD align="left" valign="top"><i>name</i></TD><TD align="left" valign="top">Command name
</TD></TR>
<TR><TD align="left" valign="top"><i>ep</i></TD><TD align="left" valign="top">The id of the endpoint issuing this command
</TD></TR>
<TR><TD align="left" valign="top"><i>ver</i></TD><TD align="left" valign="top">The protocol version to use
</TD></TR>
</TABLE></P>
<A NAME="MGCPMessage"></A><A NAME="ref3"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>MGCPMessage</strong> (MGCPTransaction* trans, unsigned int code, const char* comment = 0)
<br></td><td align="right"><h3><strong>MGCPMessage</strong></h3></td></tr></table><p></p><p>
Constructor. Construct an outgoing response message
The message will be invalidated if failed to get a transaction id or the
code is greater then 999
</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 respond
</TD></TR>
<TR><TD align="left" valign="top"><i>code</i></TD><TD align="left" valign="top">The response code ranging from 0 to 999
</TD></TR>
<TR><TD align="left" valign="top"><i>comment</i></TD><TD align="left" valign="top">Optional response comment
</TD></TR>
</TABLE></P>
<A NAME="~MGCPMessage"></A><A NAME="ref4"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>~MGCPMessage</strong> ()
<br></td><td align="right"><h3><strong>~MGCPMessage</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p>
Destructor
</p>
<A NAME="valid"></A><A NAME="ref5"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline bool <strong>valid</strong> ()
<br></td><td align="right"><h3><strong>valid</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Check if this is a valid message
</p>
<p><b>Returns</b>: True if this is a valid message
</p>
<A NAME="name"></A><A NAME="ref6"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline const String& <strong>name</strong> ()
<br></td><td align="right"><h3><strong>name</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the command name or response code text representation of this message
</p>
<p><b>Returns</b>: The command name or response text representation of this message
</p>
<A NAME="code"></A><A NAME="ref7"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline int <strong>code</strong> ()
<br></td><td align="right"><h3><strong>code</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the response code if this is a response message
</p>
<p><b>Returns</b>: The response code contained in this message
</p>
<A NAME="version"></A><A NAME="ref8"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline const String& <strong>version</strong> ()
<br></td><td align="right"><h3><strong>version</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the protocol version of a command message
</p>
<p><b>Returns</b>: The protocol version of this message
</p>
<A NAME="comment"></A><A NAME="ref9"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline const String& <strong>comment</strong> ()
<br></td><td align="right"><h3><strong>comment</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the comment from a response message
</p>
<p><b>Returns</b>: The comment of this message
</p>
<A NAME="isCommand"></A><A NAME="ref10"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline bool <strong>isCommand</strong> ()
<br></td><td align="right"><h3><strong>isCommand</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Check if this is a command (code is a negative value)
</p>
<p><b>Returns</b>: True if this message is a command
</p>
<A NAME="isResponse"></A><A NAME="ref11"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline bool <strong>isResponse</strong> ()
<br></td><td align="right"><h3><strong>isResponse</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Check if this is a response message (code is greater then or equal to 100)
</p>
<p><b>Returns</b>: True if this message is a response
</p>
<A NAME="isAck"></A><A NAME="ref12"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline bool <strong>isAck</strong> ()
<br></td><td align="right"><h3><strong>isAck</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Check if this message is a response ACK (code is between 0 and 99, including the margins)
</p>
<p><b>Returns</b>: True if this message is a response ACK
</p>
<A NAME="transactionId"></A><A NAME="ref13"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline unsigned int <strong>transactionId</strong> ()
<br></td><td align="right"><h3><strong>transactionId</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the message's transaction id
</p>
<p><b>Returns</b>: The message's transaction id
</p>
<A NAME="endpointId"></A><A NAME="ref14"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline const String& <strong>endpointId</strong> ()
<br></td><td align="right"><h3><strong>endpointId</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the message's endpoint id if this is a command
</p>
<p><b>Returns</b>: The message's endpoint id if this is a command
</p>
<A NAME="toString"></A><A NAME="ref15"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void <strong>toString</strong> (String& dest)
<br></td><td align="right"><h3><strong>toString</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Convert this message to a string representation to be sent to the remote
endpoint or printed to output
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>dest</i></TD><TD align="left" valign="top">Destination string
</TD></TR>
</TABLE></P>
<p>Reimplemented from <A HREF="TelEngine__GenObject.html#toString">GenObject</A>.</p>
<A NAME="parse"></A><A NAME="ref16"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <strong>parse</strong> (MGCPEngine* engine, ObjList& dest,
const unsigned char* buffer, unsigned int len,
const char* sdpType = "application/sdp")
<br></td><td align="right"><h3><strong>parse</strong></h3></td></tr></table><p> <small>[static]</small></p><p>
Parse a received buffer according to RFC 3435. Command and protocol names are converted to upper case.
The enpoint id is converted to lower case. Message parameter names are converted to lower case if
the engine's flag is set. Message parameter values and SDP(s) are stored unchanged
</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 receiving engine
</TD></TR>
<TR><TD align="left" valign="top"><i>dest</i></TD><TD align="left" valign="top">The list of received messages
</TD></TR>
<TR><TD align="left" valign="top"><i>buffer</i></TD><TD align="left" valign="top">The buffer to parse
</TD></TR>
<TR><TD align="left" valign="top"><i>len</i></TD><TD align="left" valign="top">The buffer length
</TD></TR>
<TR><TD align="left" valign="top"><i>sdpType</i></TD><TD align="left" valign="top">The MIME SDP content type if the message contains any SDP body
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: False on failure, true on success. If failed, the destination
list may contain a response message to be sent
</p>
<A NAME="params"></A><A NAME="ref17"></A><table width="100%"><tr bgcolor="#eeeeee"><td>NamedList <strong>params</strong>
</td><td align="right"><h3><strong>params</strong></h3></td></tr></table><p></p><A NAME="sdp"></A><A NAME="ref18"></A><table width="100%"><tr bgcolor="#eeeeee"><td>ObjList <strong>sdp</strong>
</td><td align="right"><h3><strong>sdp</strong></h3></td></tr></table><p></p><A NAME="MGCPMessage"></A><A NAME="ref19"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>MGCPMessage</strong> (MGCPEngine* engine, const char* name, int code,
unsigned int transId, const char* epId, const char* ver)
<br></td><td align="right"><h3><strong>MGCPMessage</strong></h3></td></tr></table><p> <small>[protected]</small></p><p>
Constructor. Used by the parser to construct an incoming 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 receiving this message
</TD></TR>
<TR><TD align="left" valign="top"><i>name</i></TD><TD align="left" valign="top">Command name or response comment
</TD></TR>
<TR><TD align="left" valign="top"><i>code</i></TD><TD align="left" valign="top">The response code in the range 0 to 999 or -1 if the received
message is a command
</TD></TR>
<TR><TD align="left" valign="top"><i>transId</i></TD><TD align="left" valign="top">The id of the transaction owning this message
</TD></TR>
<TR><TD align="left" valign="top"><i>epId</i></TD><TD align="left" valign="top">The id of the endpoint issuing this command
</TD></TR>
<TR><TD align="left" valign="top"><i>ver</i></TD><TD align="left" valign="top">The protocol version
</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>
|