<!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][16111] </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=16111">16111</a></dd>
<dt>Author</dt> <dd>jmesquita</dd>
<dt>Date</dt> <dd>2009-12-31 16:58:14 -0600 (Thu, 31 Dec 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>Initial work to support multiple lines. Took away the dial for a minute. Sorry about that.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunkcontribjmesquitaFSPhoneFSPhonepro">freeswitch/trunk/contrib/jmesquita/FSPhone/FSPhone.pro</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitaFSPhonecallcpp">freeswitch/trunk/contrib/jmesquita/FSPhone/call.cpp</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitaFSPhonecallh">freeswitch/trunk/contrib/jmesquita/FSPhone/call.h</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitaFSPhonefshostcpp">freeswitch/trunk/contrib/jmesquita/FSPhone/fshost.cpp</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitaFSPhonefshosth">freeswitch/trunk/contrib/jmesquita/FSPhone/fshost.h</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitaFSPhonemainwindowcpp">freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.cpp</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitaFSPhonemainwindowh">freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.h</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitaFSPhonemainwindowui">freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.ui</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkcontribjmesquitaFSPhoneFSPhonepro"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/FSPhone.pro (16110 => 16111)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/FSPhone/FSPhone.pro        2009-12-31 20:08:57 UTC (rev 16110)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/FSPhone.pro        2009-12-31 22:58:14 UTC (rev 16111)
</span><span class="lines">@@ -25,9 +25,9 @@
</span><span class="cx">
</span><span class="cx"> SOURCES += main.cpp \
</span><span class="cx"> mainwindow.cpp \
</span><del>- fshost.cpp
- #call.cpp
</del><ins>+ fshost.cpp \
+ call.cpp
</ins><span class="cx"> HEADERS += mainwindow.h \
</span><del>- fshost.h
- #call.h
</del><ins>+ fshost.h \
+ call.h
</ins><span class="cx"> FORMS += mainwindow.ui
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitaFSPhonecallcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/call.cpp (16110 => 16111)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/FSPhone/call.cpp        2009-12-31 20:08:57 UTC (rev 16110)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/call.cpp        2009-12-31 22:58:14 UTC (rev 16111)
</span><span class="lines">@@ -1,8 +1,14 @@
</span><span class="cx"> #include "call.h"
</span><span class="cx">
</span><del>-Call::Call(int call_id, QString cid_name, QString cid_number) :
</del><ins>+Call::Call()
+{
+}
+
+Call::Call(int call_id, QString cid_name, QString cid_number, fsphone_call_direction_t direction, QString uuid) :
</ins><span class="cx"> _call_id(call_id),
</span><span class="cx"> _cid_name(cid_name),
</span><del>- _cid_number(cid_number)
</del><ins>+ _cid_number(cid_number),
+ _direction(direction),
+ _uuid (uuid)
</ins><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitaFSPhonecallh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/call.h (16110 => 16111)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/FSPhone/call.h        2009-12-31 20:08:57 UTC (rev 16110)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/call.h        2009-12-31 22:58:14 UTC (rev 16111)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> #ifndef CALL_H
</span><span class="cx"> #define CALL_H
</span><span class="cx">
</span><ins>+#include <QtCore>
</ins><span class="cx"> #include <QString>
</span><span class="cx"> #include <fshost.h>
</span><span class="cx">
</span><span class="lines">@@ -12,13 +13,21 @@
</span><span class="cx"> class Call
</span><span class="cx"> {
</span><span class="cx"> public:
</span><del>- Call(int call_id, QString cid_name, QString cid_number);
</del><ins>+ Call(void);
+ Call(int call_id, QString cid_name, QString cid_number, fsphone_call_direction_t direction, QString uuid);
+ QString getCidName(void) { return _cid_name; }
+ QString getCidNumber(void) { return _cid_number; }
+ int getCallID(void) { return _call_id; }
+ QString getUUID(void) { return _uuid; }
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> int _call_id;
</span><span class="cx"> QString _cid_name;
</span><span class="cx"> QString _cid_number;
</span><span class="cx"> fsphone_call_direction_t _direction;
</span><ins>+ QString _uuid;
</ins><span class="cx"> };
</span><span class="cx">
</span><ins>+Q_DECLARE_METATYPE(Call)
+
</ins><span class="cx"> #endif // CALL_H
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitaFSPhonefshostcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/fshost.cpp (16110 => 16111)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/FSPhone/fshost.cpp        2009-12-31 20:08:57 UTC (rev 16110)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/fshost.cpp        2009-12-31 22:58:14 UTC (rev 16111)
</span><span class="lines">@@ -1,4 +1,6 @@
</span><ins>+#include <QtGui>
</ins><span class="cx"> #include "fshost.h"
</span><ins>+#include "call.h"
</ins><span class="cx">
</span><span class="cx"> /* Declare it globally */
</span><span class="cx"> FSHost g_FSHost;
</span><span class="lines">@@ -10,6 +12,9 @@
</span><span class="cx"> printf("Initializing globals...\n");
</span><span class="cx"> switch_core_setrlimits();
</span><span class="cx"> switch_core_set_globals();
</span><ins>+
+ qRegisterMetaType<Call>("Call");
+
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void FSHost::run(void)
</span><span class="lines">@@ -58,7 +63,12 @@
</span><span class="cx"> {
</span><span class="cx"> if (strcmp(event->subclass_name, "portaudio::ringing") == 0)
</span><span class="cx"> {
</span><del>- emit ringing(switch_event_get_header_nil(event, "call_id"), switch_event_get_header_nil(event, "Caller-Caller-ID-Number"), switch_event_get_header_nil(event, "Caller-Caller-ID-Name"));
</del><ins>+ Call *call = new Call(atoi(switch_event_get_header_nil(event, "call_id")),
+ switch_event_get_header_nil(event, "Caller-Caller-ID-Name"),
+ switch_event_get_header_nil(event, "Caller-Caller-ID-Number"),
+ FSPHONE_CALL_DIRECTION_INBOUND,
+ switch_event_get_header_nil(event, "Unique-ID"));
+ emit ringing(call);
</ins><span class="cx"> }
</span><span class="cx"> else
</span><span class="cx"> {
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitaFSPhonefshosth"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/fshost.h (16110 => 16111)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/FSPhone/fshost.h        2009-12-31 20:08:57 UTC (rev 16110)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/fshost.h        2009-12-31 22:58:14 UTC (rev 16111)
</span><span class="lines">@@ -4,6 +4,8 @@
</span><span class="cx"> #include <QThread>
</span><span class="cx"> #include <switch.h>
</span><span class="cx">
</span><ins>+class Call;
+
</ins><span class="cx"> class FSHost : public QThread
</span><span class="cx"> {
</span><span class="cx"> Q_OBJECT
</span><span class="lines">@@ -17,7 +19,7 @@
</span><span class="cx">
</span><span class="cx"> signals:
</span><span class="cx"> void ready(void);
</span><del>- void ringing(QString uuid, QString caller_id_name, QString caller_id_name);
</del><ins>+ void ringing(Call *call);
</ins><span class="cx">
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitaFSPhonemainwindowcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.cpp (16110 => 16111)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.cpp        2009-12-31 20:08:57 UTC (rev 16110)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.cpp        2009-12-31 22:58:14 UTC (rev 16111)
</span><span class="lines">@@ -8,11 +8,9 @@
</span><span class="cx"> ui->setupUi(this);
</span><span class="cx">
</span><span class="cx"> connect(&g_FSHost, SIGNAL(ready()),this, SLOT(fshostReady()));
</span><del>- connect(&g_FSHost, SIGNAL(ringing(QString,QString,QString)), this, SLOT(ringing(QString,QString,QString)));
</del><ins>+ connect(&g_FSHost, SIGNAL(ringing(Call *)), this, SLOT(ringing(Call *)));
</ins><span class="cx"> connect(ui->answerBtn, SIGNAL(clicked()), this, SLOT(paAnswer()));
</span><del>- connect(ui->callBtn, SIGNAL(clicked()), this, SLOT(paCall()));
</del><span class="cx"> connect(ui->hangupBtn, SIGNAL(clicked()), this, SLOT(paHangup()));
</span><del>- connect(ui->paDevlistBtn, SIGNAL(clicked()), this, SLOT(paDevlist()));
</del><span class="cx">
</span><span class="cx"> g_FSHost.start();
</span><span class="cx"> }
</span><span class="lines">@@ -28,22 +26,10 @@
</span><span class="cx"> void MainWindow::fshostReady()
</span><span class="cx"> {
</span><span class="cx"> ui->statusBar->showMessage("Ready", 0);
</span><del>- ui->paDevlistBtn->setEnabled(true);
</del><span class="cx"> ui->textEdit->setEnabled(true);
</span><del>- ui->callBtn->setEnabled(true);
- ui->textEdit->setText("Click to dial number...");
</del><ins>+ ui->textEdit->setText("Click on line to dial number...");
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void MainWindow::paDevlist()
-{
- QString result;
- if (g_FSHost.sendCmd("pa", "devlist as xml", &result) == SWITCH_STATUS_FALSE) {
- ui->textEdit->setText("Error sending that command");
- }
-
- ui->textEdit->setText(result);
-}
-
</del><span class="cx"> void MainWindow::paAnswer()
</span><span class="cx"> {
</span><span class="cx"> QString result;
</span><span class="lines">@@ -51,11 +37,9 @@
</span><span class="cx"> ui->textEdit->setText("Error sending that command");
</span><span class="cx"> }
</span><span class="cx">
</span><del>- ui->textEdit->setReadOnly(true);
</del><span class="cx"> ui->textEdit->setText("Talking...");
</span><span class="cx"> ui->hangupBtn->setEnabled(true);
</span><span class="cx"> ui->answerBtn->setEnabled(false);
</span><del>- ui->callBtn->setEnabled(false);
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MainWindow::paCall()
</span><span class="lines">@@ -81,13 +65,18 @@
</span><span class="cx"> ui->textEdit->setText("Click to dial number...");
</span><span class="cx"> ui->statusBar->showMessage("Call hungup", 10);
</span><span class="cx"> ui->hangupBtn->setEnabled(false);
</span><del>- ui->textEdit->setReadOnly(false);
- ui->callBtn->setEnabled(true);
</del><span class="cx"> }
</span><span class="cx">
</span><del>-void MainWindow::ringing(QString uuid, QString caller_id_number, QString caller_id_name)
</del><ins>+void MainWindow::ringing(Call *call)
</ins><span class="cx"> {
</span><del>- ui->textEdit->setText(QString("Number: %1\nName: %3").arg(caller_id_number, caller_id_name));
</del><ins>+ if (_lines.contains(call->getUUID()))
+ {
+ delete call;
+ }
+ else
+ {
+ ui->textEdit->setText(QString("Number: %1\nName: %3").arg(call->getCidNumber(), call->getCidName()));
+ }
</ins><span class="cx"> ui->answerBtn->setEnabled(true);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitaFSPhonemainwindowh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.h (16110 => 16111)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.h        2009-12-31 20:08:57 UTC (rev 16110)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.h        2009-12-31 22:58:14 UTC (rev 16111)
</span><span class="lines">@@ -34,8 +34,10 @@
</span><span class="cx"> #define MAINWINDOW_H
</span><span class="cx">
</span><span class="cx"> #include <QMainWindow>
</span><ins>+#include <QPushButton>
</ins><span class="cx"> #include <switch.h>
</span><span class="cx"> #include <fshost.h>
</span><ins>+#include <call.h>
</ins><span class="cx">
</span><span class="cx"> namespace Ui {
</span><span class="cx"> class MainWindow;
</span><span class="lines">@@ -52,14 +54,14 @@
</span><span class="cx">
</span><span class="cx"> private slots:
</span><span class="cx"> void fshostReady();
</span><del>- void paDevlist();
</del><span class="cx"> void paAnswer();
</span><span class="cx"> void paCall();
</span><span class="cx"> void paHangup();
</span><del>- void ringing(QString, QString, QString);
</del><ins>+ void ringing(Call *);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> Ui::MainWindow *ui;
</span><ins>+ QHash<QString, Call *> _lines;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> #endif // MAINWINDOW_H
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitaFSPhonemainwindowui"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.ui (16110 => 16111)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.ui        2009-12-31 20:08:57 UTC (rev 16110)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.ui        2009-12-31 22:58:14 UTC (rev 16111)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> <x>0</x>
</span><span class="cx"> <y>0</y>
</span><span class="cx"> <width>287</width>
</span><del>- <height>471</height>
</del><ins>+ <height>438</height>
</ins><span class="cx"> </rect>
</span><span class="cx"> </property>
</span><span class="cx"> <property name="windowTitle">
</span><span class="lines">@@ -21,23 +21,13 @@
</span><span class="cx"> <bool>false</bool>
</span><span class="cx"> </property>
</span><span class="cx"> <property name="readOnly">
</span><del>- <bool>false</bool>
</del><ins>+ <bool>true</bool>
</ins><span class="cx"> </property>
</span><span class="cx"> </widget>
</span><span class="cx"> </item>
</span><span class="cx"> <item>
</span><del>- <widget class="QPushButton" name="callBtn">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Call</string>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
</del><ins>+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
</ins><span class="cx"> <widget class="QPushButton" name="answerBtn">
</span><span class="cx"> <property name="enabled">
</span><span class="cx"> <bool>false</bool>
</span><span class="lines">@@ -47,17 +37,7 @@
</span><span class="cx"> </property>
</span><span class="cx"> </widget>
</span><span class="cx"> </item>
</span><del>- <item>
- <widget class="QPushButton" name="paDevlistBtn">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>pa devlist</string>
- </property>
- </widget>
- </item>
- <item>
</del><ins>+ <item row="0" column="1">
</ins><span class="cx"> <widget class="QPushButton" name="hangupBtn">
</span><span class="cx"> <property name="enabled">
</span><span class="cx"> <bool>false</bool>
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>