Revision
17298
Author
jmesquita
Date
2010-04-14 21:54:59 -0500 (Wed, 14 Apr 2010)

Log Message

Fix some things on the console and start implementing the transfer.

Modified Paths

Diff

Modified: freeswitch/trunk/fscomm/call.cpp (17297 => 17298)


--- freeswitch/trunk/fscomm/call.cpp	2010-04-15 01:36:41 UTC (rev 17297)
+++ freeswitch/trunk/fscomm/call.cpp	2010-04-15 02:54:59 UTC (rev 17298)
@@ -112,3 +112,9 @@
     int now = QDateTime::fromTime_t(time).secsTo(QDateTime::currentDateTime());
     return QTime::fromString(QString::number(now), "s");
 }
+
+/*bool Call::transfer()
+{
+
+    g_FSHost.sendCmd("uuid_bridge", "")
+}*/

Modified: freeswitch/trunk/fscomm/call.h (17297 => 17298)


--- freeswitch/trunk/fscomm/call.h	2010-04-15 01:36:41 UTC (rev 17297)
+++ freeswitch/trunk/fscomm/call.h	2010-04-15 02:54:59 UTC (rev 17298)
@@ -38,7 +38,8 @@
     FSCOMM_CALL_STATE_RINGING = 0,
     FSCOMM_CALL_STATE_TRYING  = 1,
     FSCOMM_CALL_STATE_ANSWERED = 2,
-    FSCOMM_CALL_STATE_FAILED = 3
+    FSCOMM_CALL_STATE_FAILED = 3,
+    FSCOMM_CALL_STATE_TRANSFER = 4
 } fscomm_call_state_t;
 
 typedef enum {
@@ -76,6 +77,8 @@
     void setAnsweredEpoch(qulonglong time) { _answeredEpoch = time/1000000; }
     QTime getCurrentStateTime();
 
+    /*bool transfer();*/
+
 private:
     QSharedPointer<Channel> _channel; /* This should be our portaudio channel */
     QSharedPointer<Channel> _otherLegChannel;

Modified: freeswitch/trunk/fscomm/debugtools/consolewindow.cpp (17297 => 17298)


--- freeswitch/trunk/fscomm/debugtools/consolewindow.cpp	2010-04-15 01:36:41 UTC (rev 17297)
+++ freeswitch/trunk/fscomm/debugtools/consolewindow.cpp	2010-04-15 02:54:59 UTC (rev 17298)
@@ -105,9 +105,23 @@
 
     QString res;
     g_FSHost.sendCmd(cmd.toAscii().data(), args.toAscii().data(), &res);
-    QStandardItem *item = new QStandardItem(res);
-    item->setData(SWITCH_LOG_CONSOLE, ConsoleModel::LogLevelRole);
-    addNewConsoleItem(item);
+    if (!res.isEmpty())
+    {
+         /* Remove \r\n */
+        QStringList textList = res.split(QRegExp("(\r+)"), QString::SkipEmptyParts);
+        QString final_str;
+        for (int line = 0; line<textList.size(); line++)
+        {
+            final_str += textList[line];
+        }
+        QStringList lines = final_str.split(QRegExp("(\n+)"), QString::SkipEmptyParts);
+        for (int line = 0; line < lines.size(); ++line)
+        {
+            QStandardItem *item = new QStandardItem(lines[line]);
+            item->setData(SWITCH_LOG_CONSOLE, ConsoleModel::LogLevelRole);
+            addNewConsoleItem(item);
+        }
+    }
     ui->lineCmd->clear();
 }
 

Modified: freeswitch/trunk/fscomm/mainwindow.cpp (17297 => 17298)


--- freeswitch/trunk/fscomm/mainwindow.cpp	2010-04-15 01:36:41 UTC (rev 17297)
+++ freeswitch/trunk/fscomm/mainwindow.cpp	2010-04-15 02:54:59 UTC (rev 17298)
@@ -101,6 +101,7 @@
     connect(ui->hangupBtn, SIGNAL(clicked()), this, SLOT(paHangup()));
     connect(ui->recoredCallBtn, SIGNAL(toggled(bool)), SLOT(recordCall(bool)));
     connect(ui->btnHold, SIGNAL(toggled(bool)), this, SLOT(holdCall(bool)));
+    /*connect(ui->btnTransfer, SIGNAL(clicked()), this, SLOT(transferCall()));*/
     connect(ui->tableCalls, SIGNAL(itemDoubleClicked(QTableWidgetItem*)), this, SLOT(callTableDoubleClick(QTableWidgetItem*)));
     connect(ui->action_Preferences, SIGNAL(triggered()), this, SLOT(prefTriggered()));
     connect(ui->action_Exit, SIGNAL(triggered()), this, SLOT(close()));
@@ -280,9 +281,9 @@
 
 void MainWindow::makeCall()
 {
-    bool ok;
+    bool ok = true;
     QString dialstring = QInputDialog::getText(this, tr("Make new call"),
-                                         tr("Number to dial:"), QLineEdit::Normal, NULL,&ok);
+                                               tr("Number to dial:"), QLineEdit::Normal, NULL,&ok);
 
     QSharedPointer<Account> acc = g_FSHost.getCurrentDefaultAccount();
     if (!acc.isNull()) {

Modified: freeswitch/trunk/fscomm/mainwindow.h (17297 => 17298)


--- freeswitch/trunk/fscomm/mainwindow.h	2010-04-15 01:36:41 UTC (rev 17297)
+++ freeswitch/trunk/fscomm/mainwindow.h	2010-04-15 02:54:59 UTC (rev 17298)
@@ -77,6 +77,7 @@
     void callFailed(QSharedPointer<Call>);
     void recordCall(bool);
     void holdCall(bool);
+    /*void transferCall();*/
     void setDefaultAccount();
     void accountAdd(QSharedPointer<Account>);
     void accountDel(QSharedPointer<Account>);