<!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][14234] </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=14234">14234</a></dd>
<dt>Author</dt> <dd>jmesquita</dd>
<dt>Date</dt> <dd>2009-07-13 22:42:55 -0500 (Mon, 13 Jul 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>We are now on the right track after anthm and Math got me on the right path.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunkcontribjmesquitafsguifsguipro">freeswitch/trunk/contrib/jmesquita/fsgui/fsgui.pro</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>freeswitch/trunk/contrib/jmesquita/fsgui/resources/</li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguiresourcesfs_guiui">freeswitch/trunk/contrib/jmesquita/fsgui/resources/fs_gui.ui</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguiresourcesserver_managerui">freeswitch/trunk/contrib/jmesquita/fsgui/resources/server_manager.ui</a></li>
<li>freeswitch/trunk/contrib/jmesquita/fsgui/src/</li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcesl_connectioncpp">freeswitch/trunk/contrib/jmesquita/fsgui/src/esl_connection.cpp</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcfs_guicpp">freeswitch/trunk/contrib/jmesquita/fsgui/src/fs_gui.cpp</a></li>
<li>freeswitch/trunk/contrib/jmesquita/fsgui/src/include/</li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcincludeesl_connectionh">freeswitch/trunk/contrib/jmesquita/fsgui/src/include/esl_connection.h</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcincludefs_guih">freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcincludeserver_managerh">freeswitch/trunk/contrib/jmesquita/fsgui/src/include/server_manager.h</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcmaincpp">freeswitch/trunk/contrib/jmesquita/fsgui/src/main.cpp</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcserver_managercpp">freeswitch/trunk/contrib/jmesquita/fsgui/src/server_manager.cpp</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#freeswitchtrunkcontribjmesquitafsguiesl_connectioncpp">freeswitch/trunk/contrib/jmesquita/fsgui/esl_connection.cpp</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguiesl_connectionh">freeswitch/trunk/contrib/jmesquita/fsgui/esl_connection.h</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguifs_guicpp">freeswitch/trunk/contrib/jmesquita/fsgui/fs_gui.cpp</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguifs_guih">freeswitch/trunk/contrib/jmesquita/fsgui/fs_gui.h</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguifs_guiui">freeswitch/trunk/contrib/jmesquita/fsgui/fs_gui.ui</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguimaincpp">freeswitch/trunk/contrib/jmesquita/fsgui/main.cpp</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguiserver_managercpp">freeswitch/trunk/contrib/jmesquita/fsgui/server_manager.cpp</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguiserver_managerh">freeswitch/trunk/contrib/jmesquita/fsgui/server_manager.h</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguiserver_managerui">freeswitch/trunk/contrib/jmesquita/fsgui/server_manager.ui</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkcontribjmesquitafsguiesl_connectioncpp"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/contrib/jmesquita/fsgui/esl_connection.cpp</h4></div>
<a id="freeswitchtrunkcontribjmesquitafsguiesl_connectionh"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/contrib/jmesquita/fsgui/esl_connection.h</h4></div>
<a id="freeswitchtrunkcontribjmesquitafsguifs_guicpp"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/contrib/jmesquita/fsgui/fs_gui.cpp</h4></div>
<a id="freeswitchtrunkcontribjmesquitafsguifs_guih"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/contrib/jmesquita/fsgui/fs_gui.h</h4></div>
<a id="freeswitchtrunkcontribjmesquitafsguifs_guiui"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/contrib/jmesquita/fsgui/fs_gui.ui</h4></div>
<a id="freeswitchtrunkcontribjmesquitafsguifsguipro"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/fsgui.pro (14233 => 14234)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/fsgui.pro        2009-07-14 02:00:00 UTC (rev 14233)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/fsgui.pro        2009-07-14 03:42:55 UTC (rev 14234)
</span><span class="lines">@@ -1,17 +1,27 @@
</span><del>-# -------------------------------------------------
-# Project created by QtCreator 2009-01-18T13:57:52
-# -------------------------------------------------
</del><ins>+
+DESTDIR = ./bin/
+message(The project will be installed in $$DESTDIR)
</ins><span class="cx"> TARGET = fs_gui
</span><span class="cx"> TEMPLATE = app
</span><del>-SOURCES += main.cpp \
- fs_gui.cpp \
- server_manager.cpp \
- esl_connection.cpp
-INCLUDEPATH += ../../../libs/esl/src/include
-HEADERS += fs_gui.h \
- server_manager.h \
- esl_connection.h
-FORMS += fs_gui.ui \
- server_manager.ui
</del><ins>+
+MOC_DIR = ./build/
+OBJECTS_DIR = ./build/
+UI_DIR = ./build/
+
+SOURCES += ./src/main.cpp \
+ ./src/fs_gui.cpp \
+ ./src/server_manager.cpp \
+ ./src/esl_connection.cpp
+
+INCLUDEPATH += ../../../libs/esl/src/include \
+ ./src/include
+
+HEADERS += ./src/include/fs_gui.h \
+ ./src/include/server_manager.h \
+ ./src/include/esl_connection.h
+
+FORMS += ./resources/fs_gui.ui \
+ ./resources/server_manager.ui
+
</ins><span class="cx"> LIBS += -L../../../libs/esl \
</span><span class="cx"> -lesl
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguimaincpp"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/contrib/jmesquita/fsgui/main.cpp</h4></div>
<a id="freeswitchtrunkcontribjmesquitafsguiresourcesfs_guiui"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/jmesquita/fsgui/resources/fs_gui.ui (0 => 14234)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/resources/fs_gui.ui         (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/resources/fs_gui.ui        2009-07-14 03:42:55 UTC (rev 14234)
</span><span class="lines">@@ -0,0 +1,126 @@
</span><ins>+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Cfsgui</class>
+ <widget class="QMainWindow" name="Cfsgui">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>400</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>FSGui - The console for humans</string>
+ </property>
+ <widget class="QWidget" name="centralWidget">
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0" colspan="2">
+ <widget class="QTextEdit" name="textConsole">
+ <property name="undoRedoEnabled">
+ <bool>false</bool>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ <property name="textInteractionFlags">
+ <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLineEdit" name="lineCmd">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QPushButton" name="btnSend">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Send</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menuBar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>26</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menuFile">
+ <property name="title">
+ <string>&amp;File</string>
+ </property>
+ <addaction name="actionConnect"/>
+ <addaction name="actionDisconnect"/>
+ <addaction name="separator"/>
+ <addaction name="actionQuit"/>
+ </widget>
+ <widget class="QMenu" name="menuHelp">
+ <property name="title">
+ <string>&amp;Help</string>
+ </property>
+ <addaction name="actionAbout"/>
+ </widget>
+ <addaction name="menuFile"/>
+ <addaction name="menuHelp"/>
+ </widget>
+ <widget class="QStatusBar" name="statusBar">
+ <property name="sizeGripEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <action name="actionQuit">
+ <property name="text">
+ <string>&amp;Quit</string>
+ </property>
+ </action>
+ <action name="actionAbout">
+ <property name="text">
+ <string>&amp;About</string>
+ </property>
+ </action>
+ <action name="actionConnect">
+ <property name="text">
+ <string>&amp;Connect</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+C</string>
+ </property>
+ </action>
+ <action name="actionDisconnect">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Disconnect</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+D</string>
+ </property>
+ </action>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <tabstops>
+ <tabstop>lineCmd</tabstop>
+ <tabstop>textConsole</tabstop>
+ <tabstop>btnSend</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
</ins></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguiresourcesserver_managerui"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/jmesquita/fsgui/resources/server_manager.ui (0 => 14234)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/resources/server_manager.ui         (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/resources/server_manager.ui        2009-07-14 03:42:55 UTC (rev 14234)
</span><span class="lines">@@ -0,0 +1,142 @@
</span><ins>+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>CserverManager</class>
+ <widget class="QDialog" name="CserverManager">
+ <property name="windowModality">
+ <enum>Qt::NonModal</enum>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>516</width>
+ <height>249</height>
+ </rect>
+ </property>
+ <property name="focusPolicy">
+ <enum>Qt::NoFocus</enum>
+ </property>
+ <property name="windowTitle">
+ <string>Server Manager</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QTreeView" name="treeView"/>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>Server Settings</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Host</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="host">
+ <property name="text">
+ <string>localhost</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Password</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="pass">
+ <property name="text">
+ <string>ClueCon</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Port</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLineEdit" name="port">
+ <property name="text">
+ <string>8021</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QPushButton" name="pushButton">
+ <property name="text">
+ <string>Save</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QPushButton" name="pushButton_2">
+ <property name="text">
+ <string>Delete</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>CserverManager</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>CserverManager</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
</ins></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguiserver_managercpp"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/contrib/jmesquita/fsgui/server_manager.cpp</h4></div>
<a id="freeswitchtrunkcontribjmesquitafsguiserver_managerh"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/contrib/jmesquita/fsgui/server_manager.h</h4></div>
<a id="freeswitchtrunkcontribjmesquitafsguiserver_managerui"></a>
<div class="delfile"><h4>Deleted: freeswitch/trunk/contrib/jmesquita/fsgui/server_manager.ui</h4></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcesl_connectioncpp"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/jmesquita/fsgui/src/esl_connection.cpp (0 => 14234)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/esl_connection.cpp         (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/esl_connection.cpp        2009-07-14 03:42:55 UTC (rev 14234)
</span><span class="lines">@@ -0,0 +1,498 @@
</span><ins>+/*
+ * Copyright (c) 2007, Anthony Minessale II
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of the original author; nor the names of any contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Contributor(s):
+ *
+ * Joao Mesquita <jmesquita (at) gmail.com>
+ *
+ */
+
+#include <QtGui>
+#include <esl.h>
+#include <esl_connection.h>
+
+#define connection_construct_common() memset(&handle, 0, sizeof(handle)); last_event_obj = NULL
+#define event_construct_common() event = NULL; serialized_string = NULL; mine = 0; hp = NULL
+
+void eslSetLogLevel(int level)
+{
+ esl_global_set_default_logger(level);
+}
+
+ESLconnection::ESLconnection(const char *host, const char *port, const char *password)
+ : _host(new QString(host)), _port(new QString(port)), _pass(new QString(password))
+{
+ connection_construct_common();
+}
+
+ESLconnection::~ESLconnection()
+{
+ if (handle.connected) {
+ esl_disconnect(&handle);
+ }
+
+}
+
+int ESLconnection::disconnect()
+{
+ if (handle.connected) {
+ return esl_disconnect(&handle);
+ }
+
+ return 0;
+}
+
+void ESLconnection::doConnect()
+{
+ int x_port = _port->toInt();
+
+ esl_global_set_default_logger(7);
+
+ if (esl_connect(&handle, _host->toAscii(), x_port, _pass->toAscii()) == ESL_SUCCESS)
+ {
+ sendRecv("log 7");
+ emit gotConnected();
+ start();
+ }
+ else
+ {
+ emit connectionFailed(QString(handle.err));
+ qDebug() << handle.err;
+ }
+}
+
+int ESLconnection::connected()
+{
+ return handle.connected;
+}
+
+int ESLconnection::send(const char *cmd)
+{
+ return esl_send(&handle, cmd);
+}
+
+ESLevent *ESLconnection::sendRecv(const char *cmd)
+{
+ if (esl_send_recv(&handle, cmd) == ESL_SUCCESS) {
+ esl_event_t *event;
+ esl_event_dup(&event, handle.last_sr_event);
+ return new ESLevent(event, 1);
+ }
+
+ return NULL;
+}
+
+ESLevent *ESLconnection::api(const char *cmd, const char *arg)
+{
+ size_t len;
+ char *cmd_buf;
+
+ if (!cmd) {
+ return NULL;
+ }
+
+ len = strlen(cmd) + (arg ? strlen(arg) : 0) + 10;
+
+ cmd_buf = (char *) malloc(len + 1);
+ assert(cmd_buf);
+
+ snprintf(cmd_buf, len, "api %s %s", cmd, arg ? arg : "");
+ *(cmd_buf + (len)) = '\0';
+
+
+ if (esl_send_recv(&handle, cmd_buf) == ESL_SUCCESS) {
+ esl_event_t *event;
+ esl_event_dup(&event, handle.last_sr_event);
+ return new ESLevent(event, 1);
+ }
+
+ free(cmd_buf);
+
+ return NULL;
+}
+
+ESLevent *ESLconnection::bgapi(const char *cmd, const char *arg)
+{
+ size_t len;
+ char *cmd_buf;
+
+ if (!cmd) {
+ return NULL;
+ }
+
+ len = strlen(cmd) + (arg ? strlen(arg) : 0) + 10;
+
+ cmd_buf = (char *) malloc(len + 1);
+ assert(cmd_buf);
+
+ snprintf(cmd_buf, len, "bgapi %s %s", cmd, arg ? arg : "");
+ *(cmd_buf + (len)) = '\0';
+
+ if (esl_send_recv(&handle, cmd_buf) == ESL_SUCCESS) {
+ esl_event_t *event;
+ esl_event_dup(&event, handle.last_sr_event);
+ return new ESLevent(event, 1);
+ }
+
+ free(cmd_buf);
+
+ return NULL;
+}
+
+ESLevent *ESLconnection::getInfo()
+{
+ if (handle.connected && handle.info_event) {
+ esl_event_t *event;
+ esl_event_dup(&event, handle.info_event);
+ return new ESLevent(event, 1);
+ }
+
+ return NULL;
+}
+
+int ESLconnection::setAsyncExecute(const char *val)
+{
+ if (val) {
+ handle.async_execute = esl_true(val);
+ }
+ return handle.async_execute;
+}
+
+int ESLconnection::setEventLock(const char *val)
+{
+ if (val) {
+ handle.event_lock = esl_true(val);
+ }
+ return handle.event_lock;
+}
+
+int ESLconnection::execute(const char *app, const char *arg, const char *uuid)
+{
+ return esl_execute(&handle, app, arg, uuid);
+}
+
+
+int ESLconnection::executeAsync(const char *app, const char *arg, const char *uuid)
+{
+ int async = handle.async_execute;
+ int r;
+
+ handle.async_execute = 1;
+ r = esl_execute(&handle, app, arg, uuid);
+ handle.async_execute = async;
+
+ return r;
+}
+
+int ESLconnection::sendEvent(ESLevent *send_me)
+{
+ return esl_sendevent(&handle, send_me->event);
+}
+
+ESLevent *ESLconnection::recvEvent()
+{
+ if (last_event_obj) {
+ delete last_event_obj;
+ }
+
+ if (esl_recv_event(&handle, 1, NULL) == ESL_SUCCESS) {
+ esl_event_t *e = handle.last_ievent ? handle.last_ievent : handle.last_event;
+ if (e) {
+ esl_event_t *event;
+ esl_event_dup(&event, e);
+ last_event_obj = new ESLevent(event, 1);
+ return last_event_obj;
+ }
+ }
+
+ last_event_obj = new ESLevent("server_disconnected");
+
+ return last_event_obj;
+}
+
+ESLevent *ESLconnection::recvEventTimed(int ms)
+{
+ if (last_event_obj) {
+ delete last_event_obj;
+ last_event_obj = NULL;
+ }
+
+ if (esl_recv_event_timed(&handle, ms, 1, NULL) == ESL_SUCCESS) {
+ esl_event_t *e = handle.last_ievent ? handle.last_ievent : handle.last_event;
+ if (e) {
+ esl_event_t *event;
+ esl_event_dup(&event, e);
+ last_event_obj = new ESLevent(event, 1);
+ return last_event_obj;
+ }
+ }
+
+ return NULL;
+}
+
+ESLevent *ESLconnection::filter(const char *header, const char *value)
+{
+ esl_status_t status = esl_filter(&handle, header, value);
+
+ if (status == ESL_SUCCESS && handle.last_sr_event) {
+ esl_event_t *event;
+ esl_event_dup(&event, handle.last_sr_event);
+ return new ESLevent(event, 1);
+ }
+
+ return NULL;
+
+}
+
+int ESLconnection::events(const char *etype, const char *value)
+{
+ esl_event_type_t type_id = ESL_EVENT_TYPE_PLAIN;
+
+ if (!strcmp(etype, "xml")) {
+ type_id = ESL_EVENT_TYPE_XML;
+ }
+
+ return esl_events(&handle, type_id, value);
+}
+
+void ESLconnection::run(void)
+{
+ forever
+ {
+ if (!connected())
+ {
+ emit gotDisconnected();
+ qDebug() << handle.err;
+ break;
+ }
+ else
+ {
+ ESLevent * event = recvEventTimed(10);
+ if (event)
+ {
+ ESLevent * e = new ESLevent(event);
+ emit gotEvent(e);
+ }
+ }
+ }
+
+}
+
+// ESLevent
+///////////////////////////////////////////////////////////////////////
+
+ESLevent::ESLevent(const char *type, const char *subclass_name)
+{
+ esl_event_types_t event_id;
+
+ event_construct_common();
+
+ if (esl_name_event(type, &event_id) != ESL_SUCCESS) {
+ event_id = ESL_EVENT_MESSAGE;
+ }
+
+ if (!esl_strlen_zero(subclass_name) && event_id != ESL_EVENT_CUSTOM) {
+ esl_log(ESL_LOG_WARNING, "Changing event type to custom because you specified a subclass name!\n");
+ event_id = ESL_EVENT_CUSTOM;
+ }
+
+ if (esl_event_create_subclass(&event, event_id, subclass_name) != ESL_SUCCESS) {
+ esl_log(ESL_LOG_ERROR, "Failed to create event!\n");
+ event = NULL;
+ }
+
+ serialized_string = NULL;
+ mine = 1;
+}
+
+ESLevent::ESLevent(esl_event_t *wrap_me, int free_me)
+{
+ event_construct_common();
+ event = wrap_me;
+ mine = free_me;
+ serialized_string = NULL;
+}
+
+
+ESLevent::ESLevent(ESLevent *me)
+{
+ /* workaround for silly php thing */
+ event = me->event;
+ mine = me->mine;
+ serialized_string = NULL;
+ me->event = NULL;
+ me->mine = 0;
+ esl_safe_free(me->serialized_string);
+}
+
+ESLevent::~ESLevent()
+{
+
+ if (serialized_string) {
+ free(serialized_string);
+ }
+
+ if (event && mine) {
+ esl_event_destroy(&event);
+ }
+}
+
+const char *ESLevent::nextHeader(void)
+{
+ const char *name = NULL;
+
+ if (hp) {
+ name = hp->name;
+ hp = hp->next;
+ }
+
+ return name;
+}
+
+const char *ESLevent::firstHeader(void)
+{
+ if (event) {
+ hp = event->headers;
+ }
+
+ return nextHeader();
+}
+
+const char *ESLevent::serialize(const char *format)
+{
+ this_check("");
+
+ esl_safe_free(serialized_string);
+
+ if (!event) {
+ return "";
+ }
+
+ if (esl_event_serialize(event, &serialized_string, ESL_TRUE) == ESL_SUCCESS) {
+ return serialized_string;
+ }
+
+ return "";
+
+}
+
+bool ESLevent::setPriority(esl_priority_t priority)
+{
+ this_check(false);
+
+ if (event) {
+ esl_event_set_priority(event, priority);
+ return true;
+ } else {
+ esl_log(ESL_LOG_ERROR, "Trying to setPriority an event that does not exist!\n");
+ }
+ return false;
+}
+
+const char *ESLevent::getHeader(const char *header_name)
+{
+ this_check("");
+
+ if (event) {
+ return esl_event_get_header(event, header_name);
+ } else {
+ esl_log(ESL_LOG_ERROR, "Trying to getHeader an event that does not exist!\n");
+ }
+ return NULL;
+}
+
+bool ESLevent::addHeader(const char *header_name, const char *value)
+{
+ this_check(false);
+
+ if (event) {
+ return esl_event_add_header_string(event, ESL_STACK_BOTTOM, header_name, value) == ESL_SUCCESS ? true : false;
+ } else {
+ esl_log(ESL_LOG_ERROR, "Trying to addHeader an event that does not exist!\n");
+ }
+
+ return false;
+}
+
+bool ESLevent::delHeader(const char *header_name)
+{
+ this_check(false);
+
+ if (event) {
+ return esl_event_del_header(event, header_name) == ESL_SUCCESS ? true : false;
+ } else {
+ esl_log(ESL_LOG_ERROR, "Trying to delHeader an event that does not exist!\n");
+ }
+
+ return false;
+}
+
+
+bool ESLevent::addBody(const char *value)
+{
+ this_check(false);
+
+ if (event) {
+ return esl_event_add_body(event, "%s", value) == ESL_SUCCESS ? true : false;
+ } else {
+ esl_log(ESL_LOG_ERROR, "Trying to addBody an event that does not exist!\n");
+ }
+
+ return false;
+}
+
+char *ESLevent::getBody(void)
+{
+
+ this_check((char *)"");
+
+ if (event) {
+ return esl_event_get_body(event);
+ } else {
+ esl_log(ESL_LOG_ERROR, "Trying to getBody an event that does not exist!\n");
+ }
+
+ return NULL;
+}
+
+const char *ESLevent::getType(void)
+{
+ this_check("");
+
+ if (event) {
+ return esl_event_name(event->event_id);
+ } else {
+ esl_log(ESL_LOG_ERROR, "Trying to getType an event that does not exist!\n");
+ }
+
+ return (char *) "invalid";
+}
</ins></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcfs_guicpp"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/jmesquita/fsgui/src/fs_gui.cpp (0 => 14234)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/fs_gui.cpp         (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/fs_gui.cpp        2009-07-14 03:42:55 UTC (rev 14234)
</span><span class="lines">@@ -0,0 +1,176 @@
</span><ins>+/*
+ * Copyright (c) 2007, Anthony Minessale II
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of the original author; nor the names of any contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Contributor(s):
+ *
+ * Joao Mesquita <jmesquita (at) gmail.com>
+ *
+ */
+
+#include "fs_gui.h"
+#include "ui_fs_gui.h"
+#include "esl_connection.h"
+
+Cfsgui::Cfsgui(QWidget *parent) :
+ QMainWindow(parent),
+ m_ui(new Ui::Cfsgui),
+ serverDialog(new CserverManager)
+{
+ m_ui->setupUi(this);
+
+ // Set the default status bar message
+ m_ui->statusBar->showMessage(tr("Ready"));
+
+ connect(m_ui->actionConnect, SIGNAL(triggered()),
+ serverDialog, SLOT(show()));
+ connect(serverDialog, SIGNAL(doConnect(QString,QString,QString)),
+ this, SLOT(newConnectionFromDialog(QString,QString,QString)));
+ connect(m_ui->lineCmd, SIGNAL(textChanged(QString)),
+ this, SLOT(typedCommand()));
+ connect(m_ui->btnSend, SIGNAL(clicked()),
+ this, SLOT(sendCommand()));
+}
+
+Cfsgui::~Cfsgui()
+{
+ delete m_ui;
+ delete serverDialog;
+}
+
+void Cfsgui::appendConsoleText(const QString text)
+{
+ m_ui->textConsole->append(text);
+}
+
+void Cfsgui::getDisconnectedSlot()
+{
+ eslConnection->disconnect();
+}
+
+void Cfsgui::typedCommand()
+{
+ m_ui->btnSend->setDisabled(m_ui->lineCmd->text().isEmpty());
+}
+
+void Cfsgui::sendCommand()
+{
+ QString cmd = m_ui->lineCmd->text();
+ //eslConnection->sendCmd(cmd);
+ m_ui->lineCmd->clear();
+}
+
+void Cfsgui::gotConnectedSlot()
+{
+ qDebug() << "We got connected.";
+ m_ui->statusBar->showMessage("Connected");
+ appendConsoleText("Conneted!");
+ m_ui->actionConnect->setDisabled(true);
+ m_ui->actionDisconnect->setEnabled(true);
+ m_ui->lineCmd->setEnabled(true);
+ m_ui->lineCmd->setFocus();
+}
+void Cfsgui::gotDisconnectedSlot()
+{
+ m_ui->statusBar->showMessage("Disconnected");
+ appendConsoleText("Disconnected!");
+ m_ui->actionConnect->setEnabled(true);
+ m_ui->actionDisconnect->setDisabled(true);
+ m_ui->lineCmd->setDisabled(true);
+ delete eslConnection;
+}
+
+void Cfsgui::connectionFailedSlot(QString msg)
+{
+ qDebug() << msg;
+ m_ui->statusBar->showMessage("Connection Failed: "+msg);
+ appendConsoleText("Connection Failed: "+msg);
+ m_ui->actionConnect->setEnabled(true);
+ m_ui->actionDisconnect->setDisabled(true);
+ m_ui->lineCmd->setDisabled(true);
+}
+
+void Cfsgui::gotEventSlot(ESLevent * event)
+{
+ if (event->getBody())
+ {
+ QString text = event->getBody();
+
+ if (text.endsWith("\r\n"))
+ text.chop(2);
+ if (text.endsWith("\n"))
+ text.chop(1);
+
+ appendConsoleText(text);
+ }
+ delete event;
+}
+
+void Cfsgui::changeEvent(QEvent *e)
+{
+ QMainWindow::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ m_ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
+
+void Cfsgui::closeEvent(QCloseEvent *e)
+{
+ /* TODO: We have to stop threads and do cleanup */
+ e->accept();
+}
+
+void Cfsgui::newConnectionFromDialog(QString host, QString pass, QString port)
+{
+ m_ui->statusBar->showMessage("Connecting...");
+ eslConnection = new ESLconnection(host.toAscii(),
+ port.toAscii(),
+ pass.toAscii());
+ /* Connect signals from eslConnection */
+ connect(eslConnection, SIGNAL(gotConnected(void)),
+ this, SLOT(gotConnectedSlot(void)));
+ connect(eslConnection, SIGNAL(gotDisconnected(void)),
+ this, SLOT(gotDisconnectedSlot(void)));
+ connect(eslConnection, SIGNAL(connectionFailed(QString)),
+ this, SLOT(connectionFailedSlot(QString)));
+ connect(eslConnection, SIGNAL(gotEvent(ESLevent*)),
+ this, SLOT(gotEventSlot(ESLevent*)));
+
+ /* Connect the disconnect menu */
+ connect(m_ui->actionDisconnect, SIGNAL(triggered()),
+ this, SLOT(getDisconnectedSlot()));
+
+ eslConnection->doConnect();
+}
</ins></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcincludeesl_connectionh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/jmesquita/fsgui/src/include/esl_connection.h (0 => 14234)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/include/esl_connection.h         (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/include/esl_connection.h        2009-07-14 03:42:55 UTC (rev 14234)
</span><span class="lines">@@ -0,0 +1,120 @@
</span><ins>+/*
+ * Copyright (c) 2007, Anthony Minessale II
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of the original author; nor the names of any contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Contributor(s):
+ *
+ * Joao Mesquita <jmesquita (at) gmail.com>
+ *
+ */
+
+#ifndef _ESL_CONNECTION_H_
+#define _ESL_CONNECTION_H_
+#include <QThread>
+#include <esl.h>
+
+/*#ifdef __cplusplus
+extern "C" {
+#endif*/
+
+#define this_check(x) do { if (!this) { esl_log(ESL_LOG_ERROR, "object is not initalized\n"); return x;}} while(0)
+#define this_check_void() do { if (!this) { esl_log(ESL_LOG_ERROR, "object is not initalized\n"); return;}} while(0)
+
+
+class ESLevent {
+ private:
+        esl_event_header_t *hp;
+ public:
+        esl_event_t *event;
+        char *serialized_string;
+        int mine;
+
+        ESLevent(const char *type, const char *subclass_name = NULL);
+        ESLevent(esl_event_t *wrap_me, int free_me = 0);
+        ESLevent(ESLevent *me);
+        virtual ~ESLevent();
+        const char *serialize(const char *format = NULL);
+        bool setPriority(esl_priority_t priority = ESL_PRIORITY_NORMAL);
+        const char *getHeader(const char *header_name);
+        char *getBody(void);
+        const char *getType(void);
+        bool addBody(const char *value);
+        bool addHeader(const char *header_name, const char *value);
+        bool delHeader(const char *header_name);
+        const char *firstHeader(void);
+        const char *nextHeader(void);
+};
+
+class ESLconnection : public QThread
+{
+ Q_OBJECT
+ private:
+ esl_handle_t handle;
+ ESLevent *last_event_obj;
+ QString *_host;
+ QString *_port;
+ QString *_pass;
+ public:
+ ESLconnection(const char *host, const char *port, const char *password);
+ virtual ~ESLconnection();
+ int connected();
+ void doConnect();
+ ESLevent *getInfo();
+ int send(const char *cmd);
+ ESLevent *sendRecv(const char *cmd);
+ ESLevent *api(const char *cmd, const char *arg = NULL);
+ ESLevent *bgapi(const char *cmd, const char *arg = NULL);
+ int sendEvent(ESLevent *send_me);
+ ESLevent *recvEvent();
+ ESLevent *recvEventTimed(int ms);
+ ESLevent *filter(const char *header, const char *value);
+ int events(const char *etype, const char *value);
+ int execute(const char *app, const char *arg = NULL, const char *uuid = NULL);
+ int executeAsync(const char *app, const char *arg = NULL, const char *uuid = NULL);
+ int setAsyncExecute(const char *val);
+ int setEventLock(const char *val);
+ int disconnect(void);
+ signals:
+ void gotConnected(void);
+ void gotDisconnected(void);
+ void connectionFailed(QString);
+ void gotEvent(ESLevent*);
+protected:
+ void run();
+};
+
+void eslSetLogLevel(int level);
+
+/*#ifdef __cplusplus
+}
+#endif*/
+
+#endif
</ins></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcincludefs_guih"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h (0 => 14234)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h         (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h        2009-07-14 03:42:55 UTC (rev 14234)
</span><span class="lines">@@ -0,0 +1,81 @@
</span><ins>+/*
+ * Copyright (c) 2007, Anthony Minessale II
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of the original author; nor the names of any contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Contributor(s):
+ *
+ * Joao Mesquita <jmesquita (at) gmail.com>
+ *
+ */
+
+#ifndef FS_GUI_H
+#define FS_GUI_H
+
+#include <QtGui>
+#include "server_manager.h"
+
+namespace Ui {
+ class Cfsgui;
+}
+
+/* Forward declarations */
+class ESLevent;
+class ESLconnection;
+
+class Cfsgui : public QMainWindow {
+ Q_OBJECT
+ Q_DISABLE_COPY(Cfsgui)
+public:
+ explicit Cfsgui (QWidget *parent = 0);
+ virtual ~Cfsgui();
+
+protected:
+ virtual void changeEvent(QEvent *e);
+ void closeEvent(QCloseEvent *e);
+ void appendConsoleText(const QString);
+
+private slots:
+ void newConnectionFromDialog(QString,QString,QString);
+ void gotConnectedSlot();
+ void gotDisconnectedSlot();
+ void connectionFailedSlot(QString);
+ void gotEventSlot(ESLevent *);
+ void getDisconnectedSlot();
+ void typedCommand();
+ void sendCommand();
+
+private:
+ Ui::Cfsgui *m_ui;
+ CserverManager *serverDialog;
+ ESLconnection *eslConnection;
+};
+
+#endif // FS_GUI_H
</ins></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcincludeserver_managerh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/jmesquita/fsgui/src/include/server_manager.h (0 => 14234)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/include/server_manager.h         (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/include/server_manager.h        2009-07-14 03:42:55 UTC (rev 14234)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+/*
+ * Copyright (c) 2007, Anthony Minessale II
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of the original author; nor the names of any contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Contributor(s):
+ *
+ * Joao Mesquita <jmesquita (at) gmail.com>
+ *
+ */
+
+#ifndef SERVER_MANAGER_H
+#define SERVER_MANAGER_H
+
+#include <QtGui/QDialog>
+
+namespace Ui {
+ class CserverManager;
+}
+
+class CserverManager : public QDialog {
+ Q_OBJECT
+ Q_DISABLE_COPY(CserverManager)
+public:
+ explicit CserverManager(QWidget *parent = 0);
+ virtual ~CserverManager();
+signals:
+ void doConnect(QString, QString, QString);
+protected:
+ virtual void changeEvent(QEvent *e);
+private slots:
+ void newConnection();
+private:
+ Ui::CserverManager *m_ui;
+};
+
+#endif // SERVER_MANAGER_H
</ins></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcmaincpp"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/jmesquita/fsgui/src/main.cpp (0 => 14234)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/main.cpp         (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/main.cpp        2009-07-14 03:42:55 UTC (rev 14234)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+/*
+ * Copyright (c) 2007, Anthony Minessale II
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of the original author; nor the names of any contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Contributor(s):
+ *
+ * Joao Mesquita <jmesquita (at) gmail.com>
+ *
+ */
+
+#include <QtGui/QApplication>
+#include "fs_gui.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ Cfsgui w;
+ w.show();
+ return a.exec();
+}
</ins></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcserver_managercpp"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/contrib/jmesquita/fsgui/src/server_manager.cpp (0 => 14234)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/server_manager.cpp         (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/server_manager.cpp        2009-07-14 03:42:55 UTC (rev 14234)
</span><span class="lines">@@ -0,0 +1,74 @@
</span><ins>+/*
+ * Copyright (c) 2007, Anthony Minessale II
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of the original author; nor the names of any contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Contributor(s):
+ *
+ * Joao Mesquita <jmesquita (at) gmail.com>
+ *
+ */
+
+#include "server_manager.h"
+#include "ui_server_manager.h"
+
+CserverManager::CserverManager(QWidget *parent) :
+ QDialog(parent),
+ m_ui(new Ui::CserverManager)
+{
+ m_ui->setupUi(this);
+ connect(this, SIGNAL(accepted()),
+ this, SLOT(newConnection()));
+}
+
+CserverManager::~CserverManager()
+{
+ delete m_ui;
+}
+
+void CserverManager::changeEvent(QEvent *e)
+{
+ QDialog::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ m_ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
+
+void CserverManager::newConnection()
+{
+ //TODO: Sanity checking needed.
+ emit doConnect(m_ui->host->text(),
+ m_ui->pass->text(),
+ m_ui->port->text());
+}
</ins></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>