<!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][16350] </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=16350">16350</a></dd>
<dt>Author</dt> <dd>jmesquita</dd>
<dt>Date</dt> <dd>2010-01-17 22:21:46 -0600 (Sun, 17 Jan 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fix DTMF for outbound calls, default settings on startup and dialplan correctly set. We must be ready to go and really test this thing.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunkfscommfshostcpp">freeswitch/trunk/fscomm/fshost.cpp</a></li>
<li><a href="#freeswitchtrunkfscommmainwindowcpp">freeswitch/trunk/fscomm/mainwindow.cpp</a></li>
<li><a href="#freeswitchtrunkfscommmainwindowui">freeswitch/trunk/fscomm/mainwindow.ui</a></li>
<li><a href="#freeswitchtrunkfscommmod_qsettingsmod_qsettingscpp">freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.cpp</a></li>
<li><a href="#freeswitchtrunkfscommmod_qsettingsmod_qsettingsh">freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.h</a></li>
<li><a href="#freeswitchtrunkfscommpreferencesprefaccountscpp">freeswitch/trunk/fscomm/preferences/prefaccounts.cpp</a></li>
<li><a href="#freeswitchtrunkfscommpreferencesprefaccountsh">freeswitch/trunk/fscomm/preferences/prefaccounts.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkfscommfshostcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/fshost.cpp (16349 => 16350)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/fshost.cpp        2010-01-18 02:43:48 UTC (rev 16349)
+++ freeswitch/trunk/fscomm/fshost.cpp        2010-01-18 04:21:46 UTC (rev 16350)
</span><span class="lines">@@ -237,6 +237,7 @@
</span><span class="cx"> {
</span><span class="cx"> case SWITCH_EVENT_CHANNEL_ANSWER:
</span><span class="cx"> {
</span><ins>+ /* When do we get here? */
</ins><span class="cx"> emit answered(call);
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="lines">@@ -254,7 +255,11 @@
</span><span class="cx"> call.data()->setState(FSCOMM_CALL_STATE_RINGING);
</span><span class="cx"> emit ringing(call);
</span><span class="cx"> }
</span><del>- //printEventHeaders(event);
</del><ins>+ else if (QString(switch_event_get_header_nil(event, "Answer-State")) == "answered")
+ {
+ call.data()->setState(FSCOMM_CALL_STATE_ANSWERED);
+ emit answered(call);
+ }
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchtrunkfscommmainwindowcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/mainwindow.cpp (16349 => 16350)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/mainwindow.cpp        2010-01-18 02:43:48 UTC (rev 16349)
+++ freeswitch/trunk/fscomm/mainwindow.cpp        2010-01-18 04:21:46 UTC (rev 16350)
</span><span class="lines">@@ -300,6 +300,8 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><ins>+ ui->recoredCallBtn->setEnabled(true);
+ ui->recoredCallBtn->setChecked(false);
</ins><span class="cx"> ui->dtmf0Btn->setEnabled(true);
</span><span class="cx"> ui->dtmf1Btn->setEnabled(true);
</span><span class="cx"> ui->dtmf2Btn->setEnabled(true);
</span><span class="lines">@@ -334,6 +336,8 @@
</span><span class="cx"> call.data()->getCause()));
</span><span class="cx"> call.data()->setActive(false);
</span><span class="cx"> /* TODO: Will cause problems if 2 calls are received at the same time */
</span><ins>+ ui->recoredCallBtn->setEnabled(false);
+ ui->recoredCallBtn->setChecked(false);
</ins><span class="cx"> ui->answerBtn->setEnabled(false);
</span><span class="cx"> ui->hangupBtn->setEnabled(false);
</span><span class="cx"> ui->dtmf0Btn->setEnabled(false);
</span><span class="lines">@@ -369,6 +373,8 @@
</span><span class="cx"> call.data()->setActive(false);
</span><span class="cx"> ui->textEdit->setText(tr("Call with %1 (%2) hungup.").arg(call.data()->getCidName(), call.data()->getCidNumber()));
</span><span class="cx"> /* TODO: Will cause problems if 2 calls are received at the same time */
</span><ins>+ ui->recoredCallBtn->setEnabled(false);
+ ui->recoredCallBtn->setChecked(false);
</ins><span class="cx"> ui->answerBtn->setEnabled(false);
</span><span class="cx"> ui->hangupBtn->setEnabled(false);
</span><span class="cx"> ui->dtmf0Btn->setEnabled(false);
</span></span></pre></div>
<a id="freeswitchtrunkfscommmainwindowui"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/mainwindow.ui (16349 => 16350)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/mainwindow.ui        2010-01-18 02:43:48 UTC (rev 16349)
+++ freeswitch/trunk/fscomm/mainwindow.ui        2010-01-18 04:21:46 UTC (rev 16350)
</span><span class="lines">@@ -41,6 +41,9 @@
</span><span class="cx"> </item>
</span><span class="cx"> <item>
</span><span class="cx"> <widget class="QPushButton" name="recoredCallBtn">
</span><ins>+ <property name="enabled">
+ <bool>false</bool>
+ </property>
</ins><span class="cx"> <property name="text">
</span><span class="cx"> <string>Record</string>
</span><span class="cx"> </property>
</span><span class="lines">@@ -273,7 +276,7 @@
</span><span class="cx"> <bool>false</bool>
</span><span class="cx"> </property>
</span><span class="cx"> <property name="selectionMode">
</span><del>- <enum>QAbstractItemView::NoSelection</enum>
</del><ins>+ <enum>QAbstractItemView::SingleSelection</enum>
</ins><span class="cx"> </property>
</span><span class="cx"> <property name="selectionBehavior">
</span><span class="cx"> <enum>QAbstractItemView::SelectRows</enum>
</span></span></pre></div>
<a id="freeswitchtrunkfscommmod_qsettingsmod_qsettingscpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.cpp (16349 => 16350)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.cpp        2010-01-18 02:43:48 UTC (rev 16349)
+++ freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.cpp        2010-01-18 04:21:46 UTC (rev 16350)
</span><span class="lines">@@ -178,9 +178,103 @@
</span><span class="cx"> binding = NULL;
</span><span class="cx">
</span><span class="cx"> switch_xml_free(xml);
</span><ins>+
+ QSettings settings;
+ if (!settings.allKeys().contains("FreeSWITCH/conf"))
+ setQSettingsDefaults();
+ setGlobals();
+
</ins><span class="cx"> return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void setQSettingsDefaults()
+{
+ QSettings settings;
+ settings.beginGroup("FreeSWITCH/conf");
+
+ /* Globals config */
+ /* Sofia config */
+ settings.beginGroup("sofia.conf");
+
+ /* General Settings */
+ settings.beginGroup("global_settings/params");
+ settings.setValue("log-level", 0);
+ settings.setValue("auto-restart", "true");
+ settings.setValue("debug-presence", 0);
+ settings.endGroup();
+
+ /* Profile settings */
+ settings.beginGroup("profiles");
+ settings.beginGroup("profile");
+
+ settings.beginGroup("attrs");
+ settings.setValue("name", "softphone");
+ settings.endGroup();
+
+ settings.beginGroup("settings/params");
+ settings.setValue("user-agent-string", "FreeSWITCH/FSComm");
+ settings.setValue("debug", 0);
+ settings.setValue("sip-trace", "no");
+ settings.setValue("context", "public");
+ settings.setValue("rfc2833-pt", 101);
+ settings.setValue("sip-port", 12345);
+ settings.setValue("dialplan", "XML");
+ settings.setValue("dtmf-duration", 100);
+ settings.setValue("codec-prefs", "CELT@48000h,G7221@32000h,G7221@16000h,G722,PCMU,PCMA,GSM");
+ settings.setValue("use-rtp-timer", "true");
+ settings.setValue("rtp-timer-name", "soft");
+ settings.setValue("rtp-ip", "auto");
+ settings.setValue("sip-ip", "auto");
+ settings.setValue("hold-music", "local_stream://moh");
+ settings.setValue("apply-nat-acl", "rfc1918");
+ settings.setValue("manage-presence", "false");
+ settings.setValue("max-proceeding", 3);
+ settings.setValue("inbound-codec-negotiation", "generous");
+ settings.setValue("nonce-ttl", 60);
+ settings.setValue("auth-calls", "false");
+ settings.setValue("auth-all-packets", "false");
+ settings.setValue("ext-rtp-ip", "stun:stun.freeswitch.org");
+ settings.setValue("ext-sip-ip", "stun:stun.freeswitch.org");
+ settings.setValue("rtp-timeout-sec", 300);
+ settings.setValue("rtp-hold-timeout-sec", 1800);
+ settings.setValue("disable-register", "true");
+ settings.setValue("challenge-realm", "auto_from");
+ settings.endGroup();
+
+ settings.endGroup();
+ settings.endGroup();
+ settings.endGroup();
+
+ /* PortAudio config */
+ settings.beginGroup("portaudio.conf/settings/params");
+ settings.setValue("cid-name", "FSComm");
+ settings.setValue("cid-num", "00000000");
+ settings.setValue("ring-file", "tone_stream://%(2000,4000,440.0,480.0);loops=20");
+ settings.setValue("dialplan", "XML");
+ settings.setValue("ring-interval", 5);
+ settings.setValue("hold-file", "local_stream://moh");
+ settings.setValue("sample-rate", 48000);
+ settings.setValue("codec-ms", 10);
+ settings.setValue("indev", "");
+ settings.setValue("outdev", "");
+ settings.setValue("ringdev", "");
+ settings.endGroup();
+
+ /* Finish configs */
+ settings.endGroup();
+}
+
+void setGlobals()
+{
+ QSettings settings;
+ settings.beginGroup("FreeSWITCH/conf/globals");
+ foreach (QString k, settings.childKeys())
+ {
+ switch_core_set_variable(k.toAscii().data(), settings.value(k).toByteArray().data());
+ }
+ settings.endGroup();
+}
+
</ins><span class="cx"> switch_status_t mod_qsettings_load(void)
</span><span class="cx"> {
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchtrunkfscommmod_qsettingsmod_qsettingsh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.h (16349 => 16350)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.h        2010-01-18 02:43:48 UTC (rev 16349)
+++ freeswitch/trunk/fscomm/mod_qsettings/mod_qsettings.h        2010-01-18 04:21:46 UTC (rev 16350)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> #include <QSettings>
</span><span class="cx"> #include <switch.h>
</span><span class="cx">
</span><del>-switch_status_t mod_qsettings_load(void);
</del><ins>+class QXmlStreamWriter;
</ins><span class="cx">
</span><span class="cx"> class XMLBinding
</span><span class="cx"> {
</span><span class="lines">@@ -48,4 +48,8 @@
</span><span class="cx"> QSettings* _settings;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+switch_status_t mod_qsettings_load(void);
+void setQSettingsDefaults(void);
+void setGlobals(void);
+
</ins><span class="cx"> #endif // MOD_QSETTINGS_H
</span></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesprefaccountscpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/preferences/prefaccounts.cpp (16349 => 16350)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/prefaccounts.cpp        2010-01-18 02:43:48 UTC (rev 16349)
+++ freeswitch/trunk/fscomm/preferences/prefaccounts.cpp        2010-01-18 04:21:46 UTC (rev 16350)
</span><span class="lines">@@ -25,7 +25,6 @@
</span><span class="cx"> }
</span><span class="cx"> _accDlg = new AccountDialog(uuid);
</span><span class="cx"> connect(_accDlg, SIGNAL(gwAdded(QString)), this, SLOT(readConfig()));
</span><del>- connect(_accDlg, SIGNAL(gwAdded(QString)), this, SLOT(applyNewGw(QString)));
</del><span class="cx"> }
</span><span class="cx"> else
</span><span class="cx"> {
</span><span class="lines">@@ -44,26 +43,6 @@
</span><span class="cx"> _accDlg->activateWindow();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void PrefAccounts::applyNewGw(QString accId)
-{
- QString res;
- if (g_FSHost.sendCmd("sofia", "profile softphone rescan", &res) != SWITCH_STATUS_SUCCESS)
- {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not rescan the softphone profile.\n");
- return;
- }
-
- if (_ui->accountsTable->rowCount() == 1)
- {
- _settings->beginGroup("FreeSWITCH/conf/globals");
- _settings->setValue("default_gateway",_settings->value("/attrs/name"));
- _settings->endGroup();
- _settings->beginGroup(QString("FreeSWITCH/conf/sofia.conf/profiles/profile/gateways/%1/gateway").arg(accId));
- switch_core_set_variable("default_gateway",_settings->value("/attrs/name").toByteArray().data());
- _settings->endGroup();
- }
-}
-
</del><span class="cx"> void PrefAccounts::editAccountBtnClicked()
</span><span class="cx"> {
</span><span class="cx"> QList<QTableWidgetSelectionRange> selList = _ui->accountsTable->selectedRanges();
</span><span class="lines">@@ -113,6 +92,7 @@
</span><span class="cx"> if (offset > 0)
</span><span class="cx"> {
</span><span class="cx"> QString res;
</span><ins>+ _settings->sync();
</ins><span class="cx"> if (g_FSHost.sendCmd("sofia", "profile softphone rescan", &res) != SWITCH_STATUS_SUCCESS)
</span><span class="cx"> {
</span><span class="cx"> switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not rescan the softphone profile.\n");
</span><span class="lines">@@ -153,4 +133,23 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> _settings->endGroup();
</span><ins>+
+ QString res;
+ _settings->sync();
+ if (g_FSHost.sendCmd("sofia", "profile softphone rescan", &res) != SWITCH_STATUS_SUCCESS)
+ {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not rescan the softphone profile.\n");
+ return;
+ }
+
+ if (_ui->accountsTable->rowCount() == 1)
+ {
+ QString default_gateway = _settings->value(QString("/FreeSWITCH/conf/sofia.conf/profiles/profile/gateways/%1/gateway/attrs/name").arg(_ui->accountsTable->item(0,0)->data(Qt::UserRole).toString())).toString();
+ _settings->beginGroup("FreeSWITCH/conf/globals");
+ qDebug() << QString("Fucking gw: %1").arg(default_gateway);
+ _settings->setValue("default_gateway", default_gateway);
+ _settings->endGroup();
+ switch_core_set_variable("default_gateway", default_gateway.toAscii().data());
+ }
+
</ins><span class="cx"> }
</span></span></pre></div>
<a id="freeswitchtrunkfscommpreferencesprefaccountsh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/fscomm/preferences/prefaccounts.h (16349 => 16350)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/fscomm/preferences/prefaccounts.h        2010-01-18 02:43:48 UTC (rev 16349)
+++ freeswitch/trunk/fscomm/preferences/prefaccounts.h        2010-01-18 04:21:46 UTC (rev 16350)
</span><span class="lines">@@ -20,7 +20,6 @@
</span><span class="cx"> void addAccountBtnClicked();
</span><span class="cx"> void editAccountBtnClicked();
</span><span class="cx"> void remAccountBtnClicked();
</span><del>- void applyNewGw(QString);
</del><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> Ui::PrefDialog *_ui;
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>