]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix some things on the console and start implementing the transfer.
authorJoao Mesquita <jmesquita@freeswitch.org>
Thu, 15 Apr 2010 02:54:59 +0000 (23:54 -0300)
committerJoao Mesquita <jmesquita@freeswitch.org>
Thu, 15 Apr 2010 02:54:59 +0000 (23:54 -0300)
fscomm/call.cpp
fscomm/call.h
fscomm/debugtools/consolewindow.cpp
fscomm/mainwindow.cpp
fscomm/mainwindow.h

index 80dc316fb3b4c297694080f8ec7ba2e4e2f9ee1a..0dce6a83cd17f22295ae25d6283cc2ca08b30126 100644 (file)
@@ -112,3 +112,9 @@ QTime Call::getCurrentStateTime()
     int now = QDateTime::fromTime_t(time).secsTo(QDateTime::currentDateTime());
     return QTime::fromString(QString::number(now), "s");
 }
+
+/*bool Call::transfer()
+{
+
+    g_FSHost.sendCmd("uuid_bridge", "")
+}*/
index 81f712a6799697e0ab668e83a3749c356bf307fe..d2626f35af4d07ec2c6546a650e840386525f8ad 100644 (file)
@@ -38,7 +38,8 @@ typedef enum {
     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 @@ public:
     void setAnsweredEpoch(qulonglong time) { _answeredEpoch = time/1000000; }
     QTime getCurrentStateTime();
 
+    /*bool transfer();*/
+
 private:
     QSharedPointer<Channel> _channel; /* This should be our portaudio channel */
     QSharedPointer<Channel> _otherLegChannel;
index aa3b4faa424efc39f50cac6b78bc99b0454e3481..25fab26df99554bdbad02ce121fbb8ccdbd6bb8b 100644 (file)
@@ -105,9 +105,23 @@ void ConsoleWindow::cmdSendClicked()
 
     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();
 }
 
index 0cfb076f3ea5b03393160ae15033e1a8d1f8c895..50dca81beee47e887bbc8decf0b99875a4c54018 100644 (file)
@@ -101,6 +101,7 @@ MainWindow::MainWindow(QWidget *parent) :
     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::callTableDoubleClick(QTableWidgetItem *item)
 
 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()) {
index 3b87da18ed34461d75a84cb058197a2a2bbce3c7..32c4466d201bd0e6995cdc2be04bdc3db56f31f9 100644 (file)
@@ -77,6 +77,7 @@ private slots:
     void callFailed(QSharedPointer<Call>);
     void recordCall(bool);
     void holdCall(bool);
+    /*void transferCall();*/
     void setDefaultAccount();
     void accountAdd(QSharedPointer<Account>);
     void accountDel(QSharedPointer<Account>);