From 86d6408b938639c617b03b12c32200c045d051aa Mon Sep 17 00:00:00 2001 From: Bhushan Shah Date: Thu, 30 Jan 2020 14:57:06 +0530 Subject: [PATCH] dialer: normalize the numbers before dialing fixes #20 --- dialer/src/dialerutils.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dialer/src/dialerutils.cpp b/dialer/src/dialerutils.cpp index 83d462df..cb2483d8 100644 --- a/dialer/src/dialerutils.cpp +++ b/dialer/src/dialerutils.cpp @@ -54,9 +54,14 @@ DialerUtils::~DialerUtils() void DialerUtils::dial(const QString &number) { + using namespace ::i18n::phonenumbers; + PhoneNumberUtil* util = PhoneNumberUtil::GetInstance(); + string stdnumber = number.toUtf8().constData(); + util->Normalize(&stdnumber); + // FIXME: this should be replaced by kpeople thing qDebug() << "Starting call..."; - Tp::PendingChannelRequest *pendingChannel = m_simAccount->ensureAudioCall(number); + Tp::PendingChannelRequest *pendingChannel = m_simAccount->ensureAudioCall(QString::fromStdString(stdnumber)); connect(pendingChannel, &Tp::PendingChannelRequest::finished, pendingChannel, [=](){ if (pendingChannel->isError()) { qWarning() << "Error when requesting channel" << pendingChannel->errorMessage();