-vicar (0.5-3) unstable; urgency=low
+vicar (0.6-1) unstable; urgency=low
- * Fix for infrequent "No routing profile defined for this number" error.
- * Vicar will only process phone numbers with 0-9,+,p,* and #.
+ * Added support for blank space in phone numbers.
+ * Added a default profile to be used if no matching profile is found for a number. This feature can be accessed via "Edit Default Profile" button in context menu.
+ * Removed the pause before the DTMF tone (This was hardcoded in previous releases, to add more delay before sending DTMF tone, add "p" (pause) characters in DTMF Prefix field as necessary.
+ * Minor UI changes in VICaR config screen (Button resize, label changes).
- -- Sudheer K. <scifi1947 at gmail.com> Fri, 07 Nov 2010 23:10:00 -0800
+ -- Sudheer K. <scifi1947 at gmail.com> Sun, 27 Feb 2011 16:10:00 -0800
-vicar_0.5-3_armel.deb user/network extra
+vicar_0.6-1_armel.deb user/network extra
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
*/
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
*/
#include "ui_profilesettingsdialog.h"
#include "vicarprofiletypes.h"
#include <QMessageBox>
+#include <QDebug>
ProfileSettingsDialog::ProfileSettingsDialog(QWidget *parent, org::maemo::vicar::Profile *profile) :
QDialog(parent),
if (profile != 0){
//Load Profile values
+
+ if (profile->phoneNumberPattern == "%"){
+ ui->labelNumberStartsWith->setText("-- Default Profile --");
+ ui->lineEditNumberStartsWith->setVisible(false);
+ }
+
ui->lineEditNumberStartsWith->setText(profile->phoneNumberPattern);
ui->lineEditCallingCardNumber->setText(profile->gatewayNumber);
int intIndex = ui->comboBoxDTMFFormat->findText(profile->dtmfFormat);
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
*/
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
*/
TelepathyUtility *tpUtility;
DatabaseUtility *databaseUtility;
org::maemo::vicar::Profile *profile;
- ProfilesWindow * const parent;
+ ProfilesWindow * const parent;
};
// ---------------------------------------------------------------------------
qDebug() << "Error fetching profiles list. "<< d->databaseUtility->lastError();
}
else{
- //ui->profilesListWidget->clear();
org::maemo::vicar::Profile currentProfile;
- foreach (currentProfile,profileList){
- QString strProfileDetails = QString("Number starts with %1 then call via %2")
- .arg(currentProfile.phoneNumberPattern)
- .arg(currentProfile.gatewayNumber);
- QListWidgetItem *item = new QListWidgetItem(strProfileDetails,ui->profilesListWidget);
+ QString strProfileDetails;
+ QListWidgetItem *item;
+ foreach (currentProfile,profileList){
+ if (currentProfile.phoneNumberPattern != "%"){
+ strProfileDetails = QString("Number starts with %1, then call via %2")
+ .arg(currentProfile.phoneNumberPattern)
+ .arg(currentProfile.gatewayNumber);
+ }
+ else{
+ strProfileDetails = QString("No profile found, then call via %1")
+ .arg(currentProfile.gatewayNumber);
+ }
+ item = new QListWidgetItem(strProfileDetails,ui->profilesListWidget);
item->setData(Qt::UserRole,currentProfile.profileID);
}
}
qDebug() << "Error inserting new profile record. "<< d->databaseUtility->lastError();
}
else{
- QString strProfileDetails = QString("Number starts with %1 then call via %2")
+ QString strProfileDetails = QString("Number starts with %1, then call via %2")
.arg(newProfile.phoneNumberPattern)
.arg(newProfile.gatewayNumber);
QListWidgetItem *item = new QListWidgetItem(strProfileDetails,ui->profilesListWidget);
<<". "<< d->databaseUtility->lastError();
}
else{
- QString strProfileDetails = QString("Number starts with %1 then \n call via %2")
- .arg(profile.phoneNumberPattern)
- .arg(profile.gatewayNumber);
+ QString strProfileDetails;
+ if (profile.phoneNumberPattern != "%"){
+ strProfileDetails = QString("Number starts with %1, then call via %2")
+ .arg(profile.phoneNumberPattern)
+ .arg(profile.gatewayNumber);
+ }
+ else{
+ strProfileDetails = QString("No profile found, then call via %1")
+ .arg(profile.gatewayNumber);
+ }
item->setText(strProfileDetails);
- item->setData(Qt::UserRole,result);
+ item->setData(Qt::UserRole,profile.profileID);
}
}
}
void ProfilesWindow::on_removeButton_clicked(){
QListWidgetItem *item = ui->profilesListWidget->currentItem();
if (item != 0){
+ qDebug() << "Selected item data is " << item->data(Qt::UserRole).toInt();
int intProfileID = item->data(Qt::UserRole).toInt();
bool result = d->databaseUtility->deleteProfile(intProfileID);
if (!result){
void ProfilesWindow::on_actionRouteOnDefault_triggered(bool checked){
d->gconfUtility->setGconfValueBoolean("route_on_default",checked);
}
+
+void ProfilesWindow::on_actionEditDefaultProfile_triggered(){
+ org::maemo::vicar::Profile profile;
+ bool result = d->databaseUtility->getDefaultProfile(&profile);
+ qDebug() << "Default profile exits? " <<result;
+ if (result){
+ //Default profile does not exist - edit it
+ ProfileSettingsDialog *dialog = new ProfileSettingsDialog(this,&profile);
+ int response = dialog->exec();
+ if (response == QDialog::Accepted){
+ qDebug() << "Updating default profile record";
+ bool result = d->databaseUtility->updateProfile(profile);
+ if (!result){
+ d->dbusUtility->displayNotification("Unable to update default profile.");
+ qDebug() << "Error updating default profile."<< d->databaseUtility->lastError();
+ }
+ else{
+ ui->profilesListWidget->clear();
+ this->loadProfilesList();
+ }
+ }
+ }
+ else{
+ //Create new default profile
+ profile.phoneNumberPattern = "%";
+ ProfileSettingsDialog *dialog = new ProfileSettingsDialog(this,&profile);
+ int result = dialog->exec();
+ if (result == QDialog::Accepted){
+ qDebug() << "Inserting new default profile record";
+ int result = d->databaseUtility->insertProfile(profile);
+ if (result == -1){
+ d->dbusUtility->displayNotification("Unable to create default profile.");
+ qDebug() << "Error inserting new default profile record. "<< d->databaseUtility->lastError();
+ }
+ else{
+ QString strProfileDetails = QString("No profile found, then call via %1")
+ .arg(profile.gatewayNumber);
+ QListWidgetItem *item = new QListWidgetItem(strProfileDetails,ui->profilesListWidget);
+ item->setData(Qt::UserRole,result);
+ }
+ }
+ }
+}
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
*/
void on_removeButton_clicked();
void on_actionRoutingEnabled_triggered(bool checked);
void on_actionRouteOnDefault_triggered(bool checked);
+ void on_actionEditDefaultProfile_triggered();
};
#endif // PROFILESWINDOW_H
<rect>
<x>0</x>
<y>0</y>
- <width>679</width>
- <height>369</height>
+ <width>677</width>
+ <height>367</height>
</rect>
</property>
<widget class="QWidget" name="formLayoutWidget">
<item row="1" column="0">
<widget class="QLabel" name="labelCallingCardNumber">
<property name="text">
- <string>Calling Card Number:</string>
+ <string>Calling card number:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelDTMFPrefix">
<property name="text">
- <string>Prefix before DTMF tone:</string>
+ <string>DTMF tone prefix: </string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="labelDTMFSuffix">
<property name="text">
- <string>Suffix after DTMF tone:</string>
+ <string>DTMF tone suffix:</string>
</property>
</widget>
</item>
</widget>
</item>
<item>
- <spacer name="horizontalSpacer1">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>58</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
<widget class="QPushButton" name="editButton">
<property name="text">
<string>Edit</string>
</widget>
</item>
<item>
- <spacer name="horizontalSpacer2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>58</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
<widget class="QPushButton" name="removeButton">
<property name="text">
<string>Remove</string>
<x>0</x>
<y>0</y>
<width>800</width>
- <height>23</height>
+ <height>27</height>
</rect>
</property>
<widget class="QMenu" name="menuVicarProfiles">
</property>
<addaction name="actionRoutingEnabled"/>
<addaction name="actionRouteOnDefault"/>
+ <addaction name="actionEditDefaultProfile"/>
</widget>
<addaction name="menuVicarProfiles"/>
</widget>
<string>Call directly if no match found?</string>
</property>
</action>
+ <action name="actionEditDefaultProfile">
+ <property name="text">
+ <string>Edit Default Profile</string>
+ </property>
+ <property name="toolTip">
+ <string>Create/Edit profile to be used when no other profile is found for a number</string>
+ </property>
+ </action>
</widget>
<resources/>
<connections/>
/********************************************************************************
** Form generated from reading UI file 'profilesettingsdialog.ui'
**
-** Created: Tue Sep 7 04:21:07 2010
+** Created: Sat Feb 26 17:43:30 2011
** by: Qt User Interface Compiler version 4.6.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
scrollArea->setWidgetResizable(true);
scrollAreaWidgetContents = new QWidget();
scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents"));
- scrollAreaWidgetContents->setGeometry(QRect(0, 0, 679, 369));
+ scrollAreaWidgetContents->setGeometry(QRect(0, 0, 677, 367));
formLayoutWidget = new QWidget(scrollAreaWidgetContents);
formLayoutWidget->setObjectName(QString::fromUtf8("formLayoutWidget"));
formLayoutWidget->setGeometry(QRect(10, 10, 661, 351));
sizePolicy1.setHeightForWidth(lineEditNumberStartsWith->sizePolicy().hasHeightForWidth());
lineEditNumberStartsWith->setSizePolicy(sizePolicy1);
lineEditNumberStartsWith->setMinimumSize(QSize(0, 60));
- lineEditNumberStartsWith->setInputMethodHints(Qt::ImhDigitsOnly);
+ lineEditNumberStartsWith->setInputMethodHints(Qt::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoPredictiveText|Qt::ImhPreferNumbers);
formLayoutBasic->setWidget(0, QFormLayout::FieldRole, lineEditNumberStartsWith);
sizePolicy1.setHeightForWidth(lineEditCallingCardNumber->sizePolicy().hasHeightForWidth());
lineEditCallingCardNumber->setSizePolicy(sizePolicy1);
lineEditCallingCardNumber->setMinimumSize(QSize(0, 60));
- lineEditCallingCardNumber->setInputMethodHints(Qt::ImhDigitsOnly);
+ lineEditCallingCardNumber->setInputMethodHints(Qt::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoPredictiveText|Qt::ImhPreferNumbers);
formLayoutBasic->setWidget(1, QFormLayout::FieldRole, lineEditCallingCardNumber);
sizePolicy1.setHeightForWidth(lineEditDTMFPrefix->sizePolicy().hasHeightForWidth());
lineEditDTMFPrefix->setSizePolicy(sizePolicy1);
lineEditDTMFPrefix->setMinimumSize(QSize(0, 60));
- lineEditDTMFPrefix->setInputMethodHints(Qt::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoAutoUppercase|Qt::ImhNoPredictiveText|Qt::ImhPreferLowercase|Qt::ImhPreferNumbers);
+ lineEditDTMFPrefix->setInputMethodHints(Qt::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoPredictiveText|Qt::ImhPreferNumbers);
formLayoutBasic->setWidget(3, QFormLayout::FieldRole, lineEditDTMFPrefix);
sizePolicy1.setHeightForWidth(lineEditDTMFSuffix->sizePolicy().hasHeightForWidth());
lineEditDTMFSuffix->setSizePolicy(sizePolicy1);
lineEditDTMFSuffix->setMinimumSize(QSize(0, 60));
- lineEditDTMFSuffix->setInputMethodHints(Qt::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoAutoUppercase|Qt::ImhNoPredictiveText|Qt::ImhPreferLowercase|Qt::ImhPreferNumbers);
+ lineEditDTMFSuffix->setInputMethodHints(Qt::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoPredictiveText|Qt::ImhPreferNumbers);
formLayoutBasic->setWidget(4, QFormLayout::FieldRole, lineEditDTMFSuffix);
{
ProfileSettingsDialog->setWindowTitle(QApplication::translate("ProfileSettingsDialog", "Edit Profile", 0, QApplication::UnicodeUTF8));
labelNumberStartsWith->setText(QApplication::translate("ProfileSettingsDialog", "Number starts with:", 0, QApplication::UnicodeUTF8));
- labelCallingCardNumber->setText(QApplication::translate("ProfileSettingsDialog", "Calling Card Number:", 0, QApplication::UnicodeUTF8));
+ labelCallingCardNumber->setText(QApplication::translate("ProfileSettingsDialog", "Calling card number:", 0, QApplication::UnicodeUTF8));
labelDTMFFormat->setText(QApplication::translate("ProfileSettingsDialog", "Format required for DTMF tone:", 0, QApplication::UnicodeUTF8));
comboBoxDTMFFormat->clear();
comboBoxDTMFFormat->insertItems(0, QStringList()
<< QApplication::translate("ProfileSettingsDialog", "00<Country Code><Area Code><Phone Number>", 0, QApplication::UnicodeUTF8)
<< QApplication::translate("ProfileSettingsDialog", "011<Country Code><Area Code><Phone Number>", 0, QApplication::UnicodeUTF8)
);
- labelDTMFPrefix->setText(QApplication::translate("ProfileSettingsDialog", "Prefix before DTMF tone:", 0, QApplication::UnicodeUTF8));
- labelDTMFSuffix->setText(QApplication::translate("ProfileSettingsDialog", "Suffix after DTMF tone:", 0, QApplication::UnicodeUTF8));
+ labelDTMFPrefix->setText(QApplication::translate("ProfileSettingsDialog", "DTMF tone prefix: ", 0, QApplication::UnicodeUTF8));
+ labelDTMFSuffix->setText(QApplication::translate("ProfileSettingsDialog", "DTMF tone suffix:", 0, QApplication::UnicodeUTF8));
saveButton->setText(QApplication::translate("ProfileSettingsDialog", "Save", 0, QApplication::UnicodeUTF8));
closeButton->setText(QApplication::translate("ProfileSettingsDialog", "Close", 0, QApplication::UnicodeUTF8));
} // retranslateUi
/********************************************************************************
** Form generated from reading UI file 'profileswindow.ui'
**
-** Created: Tue Sep 7 04:21:07 2010
+** Created: Sat Feb 26 17:43:29 2011
** by: Qt User Interface Compiler version 4.6.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
public:
QAction *actionRoutingEnabled;
QAction *actionRouteOnDefault;
+ QAction *actionEditDefaultProfile;
QWidget *centralwidget;
QWidget *layoutWidget;
QVBoxLayout *verticalLayout;
QHBoxLayout *horizontalLayout;
QPushButton *addButton;
- QSpacerItem *horizontalSpacer1;
QPushButton *editButton;
- QSpacerItem *horizontalSpacer2;
QPushButton *removeButton;
QSpacerItem *verticalSpacer;
QListWidget *profilesListWidget;
actionRouteOnDefault = new QAction(ProfilesWindow);
actionRouteOnDefault->setObjectName(QString::fromUtf8("actionRouteOnDefault"));
actionRouteOnDefault->setCheckable(true);
+ actionEditDefaultProfile = new QAction(ProfilesWindow);
+ actionEditDefaultProfile->setObjectName(QString::fromUtf8("actionEditDefaultProfile"));
centralwidget = new QWidget(ProfilesWindow);
centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
layoutWidget = new QWidget(centralwidget);
horizontalLayout->addWidget(addButton);
- horizontalSpacer1 = new QSpacerItem(58, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- horizontalLayout->addItem(horizontalSpacer1);
-
editButton = new QPushButton(layoutWidget);
editButton->setObjectName(QString::fromUtf8("editButton"));
horizontalLayout->addWidget(editButton);
- horizontalSpacer2 = new QSpacerItem(58, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- horizontalLayout->addItem(horizontalSpacer2);
-
removeButton = new QPushButton(layoutWidget);
removeButton->setObjectName(QString::fromUtf8("removeButton"));
ProfilesWindow->setCentralWidget(centralwidget);
menubar = new QMenuBar(ProfilesWindow);
menubar->setObjectName(QString::fromUtf8("menubar"));
- menubar->setGeometry(QRect(0, 0, 800, 23));
+ menubar->setGeometry(QRect(0, 0, 800, 27));
menuVicarProfiles = new QMenu(menubar);
menuVicarProfiles->setObjectName(QString::fromUtf8("menuVicarProfiles"));
ProfilesWindow->setMenuBar(menubar);
menubar->addAction(menuVicarProfiles->menuAction());
menuVicarProfiles->addAction(actionRoutingEnabled);
menuVicarProfiles->addAction(actionRouteOnDefault);
+ menuVicarProfiles->addAction(actionEditDefaultProfile);
retranslateUi(ProfilesWindow);
#ifndef QT_NO_TOOLTIP
actionRouteOnDefault->setToolTip(QApplication::translate("ProfilesWindow", "Call directly if no match found?", 0, QApplication::UnicodeUTF8));
#endif // QT_NO_TOOLTIP
+ actionEditDefaultProfile->setText(QApplication::translate("ProfilesWindow", "Edit Default Profile", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ actionEditDefaultProfile->setToolTip(QApplication::translate("ProfilesWindow", "Create/Edit profile to be used when no other profile is found for a number", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
addButton->setText(QApplication::translate("ProfilesWindow", "Add", 0, QApplication::UnicodeUTF8));
editButton->setText(QApplication::translate("ProfilesWindow", "Edit", 0, QApplication::UnicodeUTF8));
removeButton->setText(QApplication::translate("ProfilesWindow", "Remove", 0, QApplication::UnicodeUTF8));
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
*/
#include <QDBusMessage>
#include <QStringListIterator>
-
-//static QString strLastDialedNumber = QString();
-//static org::maemo::vicar::Profile currentProfile;
-
class CallRouterPrivate
{
public:
GConfUtility * gconfUtility;
TelepathyUtility *tpUtility;
QString strLastDialedNumber;
+ QString strLastDTMFCode;
org::maemo::vicar::Profile *currentProfile;
CallRouter * const parent;
};
qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
}
+
+ /* Declare the slot to be executed when the DTMF code is sent.
+ */
+
+ success = connection.connect(QString(""),
+ CSD_CALL_INSTANCE_PATH,
+ CSD_CALL_INSTANCE_INTERFACE,
+ QString("StoppedDTMF"),this,
+ SLOT(displayDTMFConfirmation()));
+
+ if (success){
+ qDebug() << "Vicar-Daemon: Successfully connected to Dbus signal StoppedDTMF in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+ }
+ else{
+ qDebug() << "Vicar-Daemon: Failed to connect to Dbus signal StoppedDTMF in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+ qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
+ }
+
+
/* Declare the slot to be executed when the call is terminated (due to connection errors etc).
We need this to avoid sending DTMF code on wrong calls.
*/
void CallRouter::stopCallStatusMonitors(){
+ d->strLastDTMFCode.clear();
d->strLastDialedNumber.clear();
delete d->currentProfile;
d->currentProfile = 0;
qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
}
+ // Disconnect the slot for monitoring DTMF completion
+ status = connection.disconnect(QString(""),
+ CSD_CALL_INSTANCE_PATH,
+ CSD_CALL_INSTANCE_INTERFACE,
+ QString("StoppedDTMF"),this,
+ SLOT(displayDTMFConfirmation()));
+
+ if (status){
+ qDebug() << "Vicar-Daemon: Successfully disconnected from Dbus signal StoppedDTMF in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+ }
+ else{
+ qDebug() << "Vicar-Daemon: Failed to disconnect from Dbus signal StoppedDTMF in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+ qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
+ }
+
+
// Disconnect the slot for monitoring terminated calls
status = connection.disconnect(QString(""),
CSD_CALL_INSTANCE_PATH,
qDebug() << "Vicar-Daemon: Audio connection established. Sending DTMF code "<< strDTMFCode;
+
QList<QVariant> argsToSend;
argsToSend.append(strDTMFCode);
-
bool status = d->dbusUtility->sendMethodCall(CSD_SERVICE,
CSD_CALL_PATH,
CSD_CALL_INTERFACE,
QString("SendDTMF"),argsToSend);
if (status){
- QString strMessage = strDTMFCode.append(" sent as DTMF code");
- qDebug() << strMessage;
- d->dbusUtility->displayNotification(strMessage);
+ qDebug() << "Vicar-Daemon: Sending " << strDTMFCode << " as DTMF code.";
+ d->strLastDTMFCode = strDTMFCode;
}
else{
qDebug() << "Vicar-Daemon: Unable to send DTMF code.";
}
-
-
- /*
- Connecting and Disconnecting from/to DBus signal for each international call
- may not be the most efficient way of handling this. But we need to make sure
- that the DTMF codes are sent only for the calls placed by this app (i.e calls to Calling card number).
- */
-
- qDebug() << "Vicar-Daemon: Now disconnecting from call status monitors..";
- stopCallStatusMonitors();
-
- d->strLastDialedNumber.clear();
- delete d->currentProfile;
- d->currentProfile = 0;
}
else{
qDebug() << "Vicar-Daemon: Audio not yet connected.";
}
}
+void CallRouter::displayDTMFConfirmation(){
+ //This slot is called when the all the DTMF tones are sent (i.e StoppedDTMF signal is emitted)
+ //Just display confirmation message and cleanup
+
+
+ if (!d->strLastDTMFCode.isEmpty()){
+ QString strMessage = d->strLastDTMFCode.append(" sent as DTMF code");
+ d->dbusUtility->displayNotification(strMessage);
+ qDebug() << "Vicar-Daemon: "<< d->strLastDTMFCode << " sent as DTMF code.";
+ }
+
+ /*
+ Connecting and Disconnecting from/to DBus signal for each international call
+ may not be the most efficient way of handling this. But we need to make sure
+ that the DTMF codes are sent only for the calls placed by this app (i.e calls to Calling card number).
+ */
+
+ qDebug() << "Vicar-Daemon: Now disconnecting from call status monitors..";
+ stopCallStatusMonitors();
+}
+
QString CallRouter::convertToDTMFCode(QString strNumber){
QString strDTMFCode;
if (!strNumber.isEmpty()){
- int intDTMFDelay = 1;
+ //int intDTMFDelay = 1;
//Add the prefix p so that there is some delay after the call is picked up by the automated system to send DTMF tones.
- strDTMFCode = QString("").fill('p',intDTMFDelay);
+ //strDTMFCode = QString("").fill('p',intDTMFDelay);
+ strDTMFCode = "";
//Now check whether we need a prefix
QString strDTMFPrefix = d->currentProfile->dtmfPrefix;
if (isValidPhoneNumber(strDestinationNumber)){
- strErrorMessage = this->callViaCallingCard(strDestinationNumber);
+ //Remove spaces in the phone number before using
+ QString numberWithoutSpaces = QString(strDestinationNumber).remove(" ");
+
+ strErrorMessage = this->callViaCallingCard(numberWithoutSpaces);
}
else{
strErrorMessage = QString("Vicar-Daemon: %1 is not a valid number").arg(strDestinationNumber);
+ if (strDestinationNumber != "publish" && strDestinationNumber != "subscribe"){
+ d->dbusUtility->displayNotification(QString("Vicar: %1 is not a valid number").arg(strDestinationNumber));
+ }
}
qDebug() << strErrorMessage;
//Check whether a string is valid phone number
bool CallRouter::isValidPhoneNumber(QString strPhoneNumber){
-
-/* Remove all dialble characters. The resulting string should be a valid number */
- QRegExp regexp = QRegExp("[p+*#]");
+/* Remove all dialble characters and space. The resulting string should be a valid number */
+ QRegExp regexp = QRegExp("[p+*# ]");
strPhoneNumber = strPhoneNumber.replace(regexp,"");
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
*/
protected slots:
QString callViaCallingCard(QString);
void sendNumberAsDTMFCode(const QDBusMessage& dbusMessage);
+ void displayDTMFConfirmation();
void stopCallStatusMonitors();
//D-Bus Interface Methods
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
*/
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
return result;
}
+bool DatabaseUtility::getDefaultProfile(org::maemo::vicar::Profile *profile){
+ bool result = false;
+ if (profilesDB.isOpen()){
+ QString strQuery = QString("select * from profiles where numberpattern = '%' order by id");
+ qDebug() << "SQL>"<<strQuery;
+ QSqlQuery query(strQuery);
+ if (query.next()){
+ profile->profileID = query.value(0).toInt();
+ profile->phoneNumberPattern = query.value(1).toString();
+ profile->gatewayNumber = query.value(2).toString();
+ profile->dtmfFormat = query.value(3).toString();
+ profile->dtmfPrefix = query.value(4).toString();
+ profile->dtmfSuffix = query.value(5).toString();
+ result = true;
+ }
+ }
+ return result;
+}
+
int DatabaseUtility::insertProfile(org::maemo::vicar::Profile profile){
int newId = -1;
bool result = false;
bool result = false;
if (profilesDB.isOpen()){
QSqlQuery query;
- result = query.exec(QString("delete from profiles where id=%1").arg(id));
+ QString strQuery = QString("delete from profiles where id=%1").arg(id);
+ qDebug() << "SQL>"<<strQuery;
+ result = query.exec(strQuery);
}
return result;
}
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
*/
bool selectProfile(int id,org::maemo::vicar::Profile* profile);
bool getAllProfiles(org::maemo::vicar::ProfileList* profileList);
bool findProfileByNumber(QString number,org::maemo::vicar::Profile* profile);
+ bool getDefaultProfile(org::maemo::vicar::Profile* profile);
bool deleteProfile(int id);
QSqlError lastError();
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
*/
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
*/
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
*/
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
*/
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
*/
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
*/
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
"VICaR - Invalid request. Phone Number is empty.");
return channel_path;
}
+ else if (strNumber == "publish" || strNumber == "subscribe"){
+ //Deny the persistent Mission control requests to publish and subscribe
+ QString strError = "VICaR - Invalid request. " + strNumber + " is not supported.";
+ sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument",
+ strError);
+ return channel_path;
+
+ }
//Only allow requests with handle type as contact
QVariant vTargetHandleType = request.value("org.freedesktop.Telepathy.Channel.TargetHandleType");
sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument",
strMessage);
+ return channel_path;
}
+
/*
Send an error reply to Tp Client (Mission Control) to force it to close the active channel.
Once it recieves the reply, the client does not bother what we return.
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
/*
-@version: 0.5
+@version: 0.6
@author: Sudheer K. <scifi1947 at gmail.com>
@license: GNU General Public License
*/