<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][14538] </title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=14538">14538</a></dd>
<dt>Author</dt> <dd>mrene</dd>
<dt>Date</dt> <dd>2009-08-16 16:08:58 -0500 (Sun, 16 Aug 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Doxygen comments to esl, thanks jmesquita</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunklibseslsrcincludeeslh">freeswitch/trunk/libs/esl/src/include/esl.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunklibseslsrcincludeeslh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/libs/esl/src/include/esl.h (14537 => 14538)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/esl/src/include/esl.h        2009-08-16 19:01:35 UTC (rev 14537)
+++ freeswitch/trunk/libs/esl/src/include/esl.h        2009-08-16 21:08:58 UTC (rev 14538)
</span><span class="lines">@@ -256,28 +256,43 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;esl_threadmutex.h&gt;
</span><span class="cx"> 
</span><ins>+/*! \brief A handle that will hold the socket information and
+           different events received. */
</ins><span class="cx"> typedef struct {
</span><span class="cx">         struct sockaddr_in sockaddr;
</span><span class="cx">         struct hostent hostent;
</span><span class="cx">         char hostbuf[256];
</span><span class="cx">         esl_socket_t sock;
</span><ins>+        /*! In case of socket error, this will hold the error description as reported by the OS */
</ins><span class="cx">         char err[256];
</span><ins>+        /*! The error number reported by the OS */
</ins><span class="cx">         int errnum;
</span><ins>+        /*! The inner contents received by the socket. Used only internally. */
</ins><span class="cx">         char header_buf[4196];
</span><ins>+        /*! Last command reply */
</ins><span class="cx">         char last_reply[1024];
</span><ins>+        /*! Las command reply when called with esl_send_recv */
</ins><span class="cx">         char last_sr_reply[1024];
</span><ins>+        /*! Last event received. Only populated when **save_event is NULL */
</ins><span class="cx">         esl_event_t *last_event;
</span><ins>+        /*! Last event received when called by esl_send_recv */
</ins><span class="cx">         esl_event_t *last_sr_event;
</span><ins>+        /*! This will hold already processed events queued by esl_recv_event */
</ins><span class="cx">         esl_event_t *race_event;
</span><ins>+        /*! Events that have content-type == text/plain and a body */
</ins><span class="cx">         esl_event_t *last_ievent;
</span><ins>+        /*! For outbound socket. Will hold reply information when connect\n\n is sent */
</ins><span class="cx">         esl_event_t *info_event;
</span><ins>+        /*! Socket is connected or not */
</ins><span class="cx">         int connected;
</span><span class="cx">         struct sockaddr_in addr;
</span><ins>+        /*! Internal mutex */
</ins><span class="cx">         esl_mutex_t *mutex;
</span><span class="cx">         int async_execute;
</span><span class="cx">         int event_lock;
</span><span class="cx"> } esl_handle_t;
</span><span class="cx"> 
</span><ins>+/*! \brief Used internally for truth test */
</ins><span class="cx"> typedef enum {
</span><span class="cx">         ESL_TRUE = 1,
</span><span class="cx">         ESL_FALSE = 0
</span><span class="lines">@@ -312,7 +327,9 @@
</span><span class="cx"> 
</span><span class="cx"> ESL_DECLARE_DATA extern esl_logger_t esl_log;
</span><span class="cx"> 
</span><ins>+/*! Sets the logger for libesl. Default is the null_logger */
</ins><span class="cx"> ESL_DECLARE(void) esl_global_set_logger(esl_logger_t logger);
</span><ins>+/*! Sets the default log level for libesl */
</ins><span class="cx"> ESL_DECLARE(void) esl_global_set_default_logger(int level);
</span><span class="cx"> 
</span><span class="cx"> #include &quot;esl_event.h&quot;
</span><span class="lines">@@ -328,19 +345,88 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> typedef void (*esl_listen_callback_t)(esl_socket_t server_sock, esl_socket_t client_sock, struct sockaddr_in *addr);
</span><del>-
</del><ins>+/*!
+    \brief Attach a handle to an established socket connection
+    \param handle Handle to be attached
+    \param socket Socket to which the handle will be attached
+    \param addr Structure that will contain the connection descritption (look up your os info)
+*/
</ins><span class="cx"> ESL_DECLARE(esl_status_t) esl_attach_handle(esl_handle_t *handle, esl_socket_t socket, struct sockaddr_in *addr);
</span><ins>+/*!
+    \brief Will bind to host and callback when event is received. Used for outbound socket.
+    \param host Host to bind to
+    \param port Port to bind to
+    \param callback Callback that will be called upon data received
+*/
</ins><span class="cx"> ESL_DECLARE(esl_status_t) esl_listen(const char *host, esl_port_t port, esl_listen_callback_t callback);
</span><ins>+/*!
+    \brief Executes application with sendmsg to a specific UUID. Used for outbound socket.
+    \param handle Handle that the msg will be sent
+    \param app Application to execute
+    \param arg Application arguments
+    \param uuid Target UUID for the application
+*/
</ins><span class="cx"> ESL_DECLARE(esl_status_t) esl_execute(esl_handle_t *handle, const char *app, const char *arg, const char *uuid);
</span><ins>+/*!
+    \brief Send an event
+    \param handle Handle to which the event should be sent
+    \param event Event to be sent
+*/
</ins><span class="cx"> ESL_DECLARE(esl_status_t) esl_sendevent(esl_handle_t *handle, esl_event_t *event);
</span><span class="cx"> 
</span><ins>+/*!
+    \brief Connect a handle to a host/port with a specific password. This will also authenticate against the server
+    \param handle Handle to connect
+    \param host Host to be connected
+    \param port Port to be connected
+    \param password FreeSWITCH server password
+*/
</ins><span class="cx"> ESL_DECLARE(esl_status_t) esl_connect(esl_handle_t *handle, const char *host, esl_port_t port, const char *password);
</span><ins>+/*!
+    \brief Disconnect a handle
+    \param handle Handle to be disconnected
+*/
</ins><span class="cx"> ESL_DECLARE(esl_status_t) esl_disconnect(esl_handle_t *handle);
</span><ins>+/*!
+    \brief Send a raw command using specific handle
+    \param handle Handle to send the command to
+    \param cmd Command to send
+*/
</ins><span class="cx"> ESL_DECLARE(esl_status_t) esl_send(esl_handle_t *handle, const char *cmd);
</span><ins>+/*!
+    \brief Poll the handle's socket until an event is received or a connection error occurs 
+    \param handle Handle to poll
+    \param check_q If set to 1, will check the handle queue (handle-&gt;race_event) and return the last event from it
+    \param[out] save_event If this is not NULL, will return the event received
+*/
</ins><span class="cx"> ESL_DECLARE(esl_status_t) esl_recv_event(esl_handle_t *handle, int check_q, esl_event_t **save_event);
</span><ins>+/*!
+    \brief Poll the handle's socket until an event is received, a connection error occurs or ms expires
+    \param handle Handle to poll
+    \param ms Maximum time to poll
+    \param check_q If set to 1, will check the handle queue (handle-&gt;race_event) and return the last event from it
+    \param[out] save_event If this is not NULL, will return the event received
+*/
</ins><span class="cx"> ESL_DECLARE(esl_status_t) esl_recv_event_timed(esl_handle_t *handle, uint32_t ms, int check_q, esl_event_t **save_event);
</span><ins>+/*!
+    \brief This will send a command and place its response event on handle-&gt;last_sr_event and handle-&gt;last_sr_reply
+    \param handle Handle to be used
+    \param cmd Raw command to send 
+*/
</ins><span class="cx"> ESL_DECLARE(esl_status_t) esl_send_recv(esl_handle_t *handle, const char *cmd);
</span><ins>+/*!
+    \brief Applies a filter to received events
+    \param handle Handle to apply the filter to
+    \param header Header that the filter will be based on
+    \param value The value of the header to filter
+*/
</ins><span class="cx"> ESL_DECLARE(esl_status_t) esl_filter(esl_handle_t *handle, const char *header, const char *value);
</span><ins>+/*!
+    \brief Will subscribe to events on the server
+    \param handle Handle to which we will subscribe to events
+    \param etype Event type to subscribe
+    \param value Which event to subscribe to 
+*/
</ins><span class="cx"> ESL_DECLARE(esl_status_t) esl_events(esl_handle_t *handle, esl_event_type_t etype, const char *value);
</span><span class="cx"> 
</span><span class="cx"> #define esl_recv(_h) esl_recv_event(_h, 0, NULL)
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>