diff --git a/src/account.cpp b/src/account.cpp index 6645313d5d8cb5016792e5b49cda654968687b0f..8cc01fd1f0dbde1c33eb314c40f4fceca3e3c21a 100644 --- a/src/account.cpp +++ b/src/account.cpp @@ -167,9 +167,6 @@ Account* AccountPrivate::buildNewAccountFromAlias(Account::Protocol proto, const case Account::Protocol::SIP: tmp = configurationManager.getAccountTemplate(DRing::Account::ProtocolNames::SIP); break; - case Account::Protocol::IAX: - tmp = configurationManager.getAccountTemplate(DRing::Account::ProtocolNames::IAX); - break; case Account::Protocol::RING: tmp = configurationManager.getAccountTemplate(DRing::Account::ProtocolNames::RING); break; @@ -360,12 +357,10 @@ const QString AccountPrivate::accountDetail(const QString& param) const if (param == DRing::Account::ConfProperties::Registration::STATUS) { //If an account is new, then it is unregistered return DRing::Account::States::UNREGISTERED; } - if (q_ptr->protocol() != Account::Protocol::IAX) {//IAX accounts lack some fields, be quiet - static QHash<QString,bool> alreadyWarned; - if (!alreadyWarned[param]) { - alreadyWarned[param] = true; - qDebug() << "Account parameter \"" << param << "\" not found"; - } + static QHash<QString,bool> alreadyWarned; + if (!alreadyWarned[param]) { + alreadyWarned[param] = true; + qDebug() << "Account parameter \"" << param << "\" not found"; } return QString(); } @@ -657,8 +652,6 @@ QString Account::password() const if (credentialModel()->primaryCredential(Credential::Type::SIP)) return credentialModel()->primaryCredential(Credential::Type::SIP)->password(); break; - case Account::Protocol::IAX: - return d_ptr->accountDetail(DRing::Account::ConfProperties::PASSWORD); case Account::Protocol::RING: return tlsPassword(); case Account::Protocol::COUNT__: @@ -860,7 +853,6 @@ int Account::localPort() const { switch (protocol()) { case Account::Protocol::SIP: - case Account::Protocol::IAX: if (isTlsEnabled()) return d_ptr->accountDetail(DRing::Account::ConfProperties::TLS::LISTENER_PORT).toInt(); else @@ -892,8 +884,6 @@ Account::Protocol Account::protocol() const if (str.isEmpty() || str == DRing::Account::ProtocolNames::SIP) return Account::Protocol::SIP; - else if (str == DRing::Account::ProtocolNames::IAX) - return Account::Protocol::IAX; else if (str == DRing::Account::ProtocolNames::RING) return Account::Protocol::RING; qDebug() << "Warning: unhandled protocol name" << str << ", defaulting to SIP"; @@ -1287,11 +1277,6 @@ bool Account::supportScheme( URI::SchemeType type ) if (protocol() == Account::Protocol::SIP) return true; break; - case URI::SchemeType::IAX : - case URI::SchemeType::IAX2 : - if (protocol() == Account::Protocol::IAX) - return true; - break; case URI::SchemeType::RING : if (protocol() == Account::Protocol::RING) return true; @@ -1390,7 +1375,7 @@ void Account::setId(const QByteArray& id) d_ptr->m_AccountId = id; } -///Set the account type, SIP or IAX +///Set the account type, SIP or RING void Account::setProtocol(Account::Protocol proto) { //TODO prevent this if the protocol has been saved @@ -1398,9 +1383,6 @@ void Account::setProtocol(Account::Protocol proto) case Account::Protocol::SIP: d_ptr->setAccountProperty(DRing::Account::ConfProperties::TYPE ,DRing::Account::ProtocolNames::SIP ); break; - case Account::Protocol::IAX: - d_ptr->setAccountProperty(DRing::Account::ConfProperties::TYPE ,DRing::Account::ProtocolNames::IAX ); - break; case Account::Protocol::RING: d_ptr->setAccountProperty(DRing::Account::ConfProperties::TYPE ,DRing::Account::ProtocolNames::RING); break; @@ -1427,7 +1409,6 @@ void Account::setUsername(const QString& detail) { d_ptr->setAccountProperty(DRing::Account::ConfProperties::USERNAME, detail); switch (protocol()) { - case Account::Protocol::IAX: case Account::Protocol::RING: case Account::Protocol::COUNT__: //nothing to do @@ -1471,9 +1452,6 @@ void Account::setPassword(const QString& detail) credentialModel()->setData(idx,detail,CredentialModel::Role::PASSWORD); } break; - case Account::Protocol::IAX: - d_ptr->setAccountProperty(DRing::Account::ConfProperties::PASSWORD, detail); - break; case Account::Protocol::RING: setTlsPassword(detail); break; @@ -1600,12 +1578,11 @@ void Account::setTlsNegotiationTimeoutSec(int detail) d_ptr->regenSecurityValidation(); } -///Set the local port for SIP/IAX communications +///Set the local port for SIP/RING communications void Account::setLocalPort(unsigned short detail) { switch (protocol()) { case Account::Protocol::SIP: - case Account::Protocol::IAX: if (isTlsEnabled()) d_ptr->setAccountProperty(DRing::Account::ConfProperties::TLS::LISTENER_PORT, QString::number(detail)); else @@ -1805,7 +1782,6 @@ void Account::setUseDefaultPort(bool value) if (value) { switch (protocol()) { case Account::Protocol::SIP: - case Account::Protocol::IAX: setLocalPort(5060); //FIXME check is TLS is used break; case Account::Protocol::RING: @@ -2233,7 +2209,6 @@ Account::RoleState Account::roleState(Account::Role role) const Account::RoleState::READ_WRITE : Account::RoleState::UNAVAILABLE; } [[clang::fallthrough]]; - case Account::Protocol::IAX : case Account::Protocol::COUNT__ : switch(role) { case Account::Role::BannedCertificatesModel : @@ -2508,7 +2483,7 @@ void AccountPrivate::modify() { /* ALIAS : While valid, an account without one cause usability issues */ /* HOSTNAME: Without hostname, an account cannot be "READY" */ /* USERNAME: All protocols but IP2IP require an username */ - /* PASSWORD: SIP and IAX accounts require a password */ + /* PASSWORD: SIP accounts require a password (unless used as IP2IP) */ m_hRoleStatus[(int)R::Alias ] = q_ptr->alias ().isEmpty() ? ST::REQUIRED_EMPTY : ST::OK; m_hRoleStatus[(int)R::Hostname] = q_ptr->hostname().isEmpty() ? ST::REQUIRED_EMPTY : ST::OK; @@ -2537,7 +2512,6 @@ void AccountPrivate::modify() { m_hRoleStatus[(int)R::Username] = ST::INVALID; break; - case Account::Protocol::IAX: case Account::Protocol::COUNT__: //No changes needed break; diff --git a/src/account.h b/src/account.h index a61c2ce1217b65c3eee4ee7ab99c2c5a32a44f64..e5239f0d4f0e8cdb5508aa4df14de5177ff3a01e 100644 --- a/src/account.h +++ b/src/account.h @@ -328,8 +328,7 @@ class LIB_EXPORT Account : public ItemBase { enum class Protocol { SIP = 0, /*!< Used for both SIP and IP2IP calls */ - IAX = 1, /*!< Inter Asterisk exchange protocol */ - RING = 2, /*!< Used for RING-DHT calls */ + RING = 1, /*!< Used for RING-DHT calls */ COUNT__, }; Q_ENUMS(Protocol) diff --git a/src/accountmodel.cpp b/src/accountmodel.cpp index 06949100f43f4d727a6c6cfcfde5228841560ad5..4d0842b0f818c66e4c75cdeda33f74435aee6162 100644 --- a/src/accountmodel.cpp +++ b/src/accountmodel.cpp @@ -54,7 +54,6 @@ AccountModelPrivate::AccountModelPrivate(AccountModel* parent) : QObject(parent) m_pIP2IP(nullptr),m_pProtocolModel(nullptr),m_pSelectionModel(nullptr),m_lMimes({RingMimes::ACCOUNT}), m_lSupportedProtocols {{ /* SIP */ false, - /* IAX */ false, /* RING */ false, }} {} @@ -798,8 +797,6 @@ QList<Account*> AccountModel::getAccountsByProtocol( const Account::Protocol pro switch(protocol) { case Account::Protocol::SIP: return d_ptr->m_lSipAccounts; - case Account::Protocol::IAX: - return d_ptr->m_lIAXAccounts; case Account::Protocol::RING: return d_ptr->m_lRingAccounts; case Account::Protocol::COUNT__: @@ -841,11 +838,6 @@ bool AccountModel::isSipSupported() const return d_ptr->m_lSupportedProtocols[Account::Protocol::SIP]; } -bool AccountModel::isIAXSupported() const -{ - return d_ptr->m_lSupportedProtocols[Account::Protocol::IAX]; -} - bool AccountModel::isIP2IPSupported() const { if (auto a = ip2ip()) @@ -888,9 +880,6 @@ void AccountModelPrivate::insertAccount(Account* a, int idx) case Account::Protocol::SIP: m_lSipAccounts << a; break; - case Account::Protocol::IAX: - m_lIAXAccounts << a; - break; case Account::Protocol::RING: m_lRingAccounts << a; break; diff --git a/src/accountmodel.h b/src/accountmodel.h index b4a2ea1ab88629ecea3b04873a49ee67ac7febab..6260eb9b7c1d9cb4a2806f19e410e8335e4b2def 100644 --- a/src/accountmodel.h +++ b/src/accountmodel.h @@ -44,7 +44,6 @@ public: Q_PROPERTY(bool presenceSubscribeSupported READ isPresenceSubscribeSupported ) Q_PROPERTY(ProtocolModel* protocolModel READ protocolModel ) Q_PROPERTY(bool isSipSupported READ isSipSupported NOTIFY supportedProtocolsChanged) - Q_PROPERTY(bool isIAXSupported READ isIAXSupported NOTIFY supportedProtocolsChanged) Q_PROPERTY(bool isIP2IPSupported READ isIP2IPSupported NOTIFY supportedProtocolsChanged) Q_PROPERTY(bool isRingSupported READ isRingSupported NOTIFY supportedProtocolsChanged) @@ -76,7 +75,6 @@ public: bool isPresenceSubscribeSupported( ) const; ProtocolModel* protocolModel ( ) const; bool isSipSupported ( ) const; - bool isIAXSupported ( ) const; bool isIP2IPSupported ( ) const; bool isRingSupported ( ) const; EditState editState ( ) const; diff --git a/src/availableaccountmodel.cpp b/src/availableaccountmodel.cpp index 745417897622b85a7ce8028ec6bc3215a9880f6c..db1c24c6d0aa4b1b82c70ea6aec36c8cf9426f0b 100644 --- a/src/availableaccountmodel.cpp +++ b/src/availableaccountmodel.cpp @@ -116,9 +116,6 @@ Account* AvailableAccountModel::currentDefaultAccount(ContactMethod* method) case URI::ProtocolHint::SIP_HOST: type = URI::SchemeType::SIP; break; - case URI::ProtocolHint::IAX: - type = URI::SchemeType::IAX; - break; case URI::ProtocolHint::IP: break; case URI::ProtocolHint::RING: diff --git a/src/contactmethod.cpp b/src/contactmethod.cpp index 5eff37e108714f78e909183552c140667780bb17..a95aba20a249692e0e2b85fdf2df5a321b79d060 100644 --- a/src/contactmethod.cpp +++ b/src/contactmethod.cpp @@ -624,7 +624,6 @@ QString ContactMethod::toHash() const uristr = uri().userinfo(); break; case URI::ProtocolHint::SIP_OTHER: - case URI::ProtocolHint::IAX : case URI::ProtocolHint::IP : case URI::ProtocolHint::SIP_HOST : //Some URI have port number in them. They have to be stripped prior to the hash creation @@ -769,7 +768,6 @@ bool ContactMethod::isReachable() const auto& m = AccountModel::instance(); const bool hasSip = m.isSipSupported (); - const bool hasIAX = m.isIAXSupported (); const bool hasIP2IP = m.isIP2IPSupported(); const bool hasRing = m.isRingSupported (); @@ -784,10 +782,6 @@ bool ContactMethod::isReachable() const if (hasSip) return true; break; - case URI::ProtocolHint::IAX : - if (hasIAX) - return true; - break; case URI::ProtocolHint::RING : if (hasRing) return true; diff --git a/src/credentialmodel.cpp b/src/credentialmodel.cpp index 39ad53ff1c6bf93464483230e77157bbe1a1612e..9f8f244f5673972ea9c924ba22918c8558357850 100644 --- a/src/credentialmodel.cpp +++ b/src/credentialmodel.cpp @@ -550,10 +550,10 @@ Credential* CredentialModel::primaryCredential(Credential::Type type) ///Is a credential type available for an account protocol const Matrix2D<Credential::Type, Account::Protocol, bool> NewCredentialTypeModel::m_smAvailableInProtocol = { - /* SIP IAX RING */ - { Credential::Type::SIP , {{true, false, false}}}, - { Credential::Type::STUN, {{true, false, true }}}, - { Credential::Type::TURN, {{true, false, true }}}, + /* SIP RING */ + { Credential::Type::SIP , {{true, false}}}, + { Credential::Type::STUN, {{true, true }}}, + { Credential::Type::TURN, {{true, true }}}, }; ///The maximum number of credentials (-1 = inf), this could be protocol dependent diff --git a/src/hookmanager.cpp b/src/hookmanager.cpp index 48790b4b23bc17659be28def58d671522ea88a6b..1ef329e4ea361f925fef91ed16af4f303a9f6a0e 100644 --- a/src/hookmanager.cpp +++ b/src/hookmanager.cpp @@ -30,7 +30,6 @@ public: constexpr static const char* PHONE_NUMBER_HOOK_ADD_PREFIX = "PHONE_NUMBER_HOOK_ADD_PREFIX"; constexpr static const char* URLHOOK_SIP_FIELD = "URLHOOK_SIP_FIELD" ; constexpr static const char* URLHOOK_COMMAND = "URLHOOK_COMMAND" ; - constexpr static const char* URLHOOK_IAX2_ENABLED = "URLHOOK_IAX2_ENABLED" ; constexpr static const char* URLHOOK_SIP_ENABLED = "URLHOOK_SIP_ENABLED" ; constexpr static const char* PHONE_NUMBER_HOOK_ENABLED = "PHONE_NUMBER_HOOK_ENABLED" ; }; @@ -39,7 +38,6 @@ public: QString m_AddPrefix ; QString m_SipFeild ; QString m_Command ; - bool m_Iax2Enabled ; bool m_SipEnabled ; bool m_ContactMethodEnabled; }; @@ -51,7 +49,6 @@ HookManager::HookManager() : QObject(QCoreApplication::instance()),d_ptr(new Hoo d_ptr->m_AddPrefix = hooks[HookManagerPrivate::Names::PHONE_NUMBER_HOOK_ADD_PREFIX]; d_ptr->m_SipFeild = hooks[HookManagerPrivate::Names::URLHOOK_SIP_FIELD ]; d_ptr->m_Command = hooks[HookManagerPrivate::Names::URLHOOK_COMMAND ]; - d_ptr->m_Iax2Enabled = hooks[HookManagerPrivate::Names::URLHOOK_IAX2_ENABLED ]=="true"?true:false; d_ptr->m_SipEnabled = hooks[HookManagerPrivate::Names::URLHOOK_SIP_ENABLED ]=="true"?true:false; d_ptr->m_ContactMethodEnabled = hooks[HookManagerPrivate::Names::PHONE_NUMBER_HOOK_ENABLED ]=="true"?true:false; @@ -69,7 +66,6 @@ void HookManagerPrivate::save() hooks[HookManagerPrivate::Names::PHONE_NUMBER_HOOK_ADD_PREFIX] = m_AddPrefix; hooks[HookManagerPrivate::Names::URLHOOK_SIP_FIELD ] = m_SipFeild; hooks[HookManagerPrivate::Names::URLHOOK_COMMAND ] = m_Command; - hooks[HookManagerPrivate::Names::URLHOOK_IAX2_ENABLED ] = m_Iax2Enabled?"true":"false"; hooks[HookManagerPrivate::Names::URLHOOK_SIP_ENABLED ] = m_SipEnabled?"true":"false"; hooks[HookManagerPrivate::Names::PHONE_NUMBER_HOOK_ENABLED ] = m_ContactMethodEnabled?"true":"false"; configurationManager.setHookSettings(hooks); @@ -96,11 +92,6 @@ QString HookManager::command() const return d_ptr->m_Command; } -bool HookManager::isIax2Enabled() const -{ - return d_ptr->m_Iax2Enabled; -} - bool HookManager::isSipEnabled() const { return d_ptr->m_SipEnabled; @@ -129,12 +120,6 @@ void HookManager::setCommand(const QString& command) d_ptr->save(); } -void HookManager::setIax2Enabled(bool enabled) -{ - d_ptr->m_Iax2Enabled = enabled; - d_ptr->save(); -} - void HookManager::setSipEnabled(bool enabled) { d_ptr->m_SipEnabled = enabled; diff --git a/src/hookmanager.h b/src/hookmanager.h index fd899404bddfbd2c93a4ecfb4365dceb8917275f..8d866fb90bb36b3eea758ae34fd3d1c7f38b6110 100644 --- a/src/hookmanager.h +++ b/src/hookmanager.h @@ -34,7 +34,6 @@ public: Q_PROPERTY(QString prefix READ prefix WRITE setPrefix ) Q_PROPERTY(QString sipFeild READ sipFeild WRITE setSipFeild ) Q_PROPERTY(QString command READ command WRITE setCommand ) - Q_PROPERTY(bool iax2Enabled READ isIax2Enabled WRITE setIax2Enabled ) Q_PROPERTY(bool sipEnabled READ isSipEnabled WRITE setSipEnabled ) Q_PROPERTY(bool phoneNumberEnabled READ isContactMethodEnabled WRITE setContactMethodEnabled ) @@ -42,7 +41,6 @@ public: QString prefix () const; QString sipFeild () const; QString command () const; - bool isIax2Enabled () const; bool isSipEnabled () const; bool isContactMethodEnabled() const; @@ -50,7 +48,6 @@ public: void setPrefix (const QString& prefix ); void setSipFeild (const QString& field ); void setCommand (const QString& command); - void setIax2Enabled (bool enabled ); void setSipEnabled (bool enabled ); void setContactMethodEnabled (bool enabled ); @@ -60,4 +57,3 @@ private: QScopedPointer<HookManagerPrivate> d_ptr; }; - diff --git a/src/numbercompletionmodel.cpp b/src/numbercompletionmodel.cpp index e9d739bee641a158c44f7b238bfb8b1a0cfeed3d..6b0eebea6a2bbdc9211a7119bd153476b989f8e5 100644 --- a/src/numbercompletionmodel.cpp +++ b/src/numbercompletionmodel.cpp @@ -76,7 +76,7 @@ public: QItemSelectionModel* m_pSelectionModel ; bool m_HasCustomSelection ; - QHash<Account*,TemporaryContactMethod*> m_hSipIaxTemporaryNumbers; + QHash<Account*,TemporaryContactMethod*> m_hSipTemporaryNumbers; QHash<Account*,TemporaryContactMethod*> m_hRingTemporaryNumbers; QHash<int, TemporaryContactMethod*> m_pPreferredTemporaryNumbers; @@ -113,7 +113,7 @@ m_pSelectionModel(nullptr),m_HasCustomSelection(false) if (!hasNonIp2Ip) { TemporaryContactMethod* cm = new TemporaryContactMethod(); cm->setAccount(ip2ip); - m_hSipIaxTemporaryNumbers[ip2ip] = cm; + m_hSipTemporaryNumbers[ip2ip] = cm; } connect(&AccountModel::instance(), &AccountModel::accountAdded , this, &NumberCompletionModelPrivate::accountAdded ); @@ -127,9 +127,9 @@ NumberCompletionModel::NumberCompletionModel() : QAbstractTableModel(&PhoneDirec NumberCompletionModel::~NumberCompletionModel() { - QList<TemporaryContactMethod*> l = d_ptr->m_hSipIaxTemporaryNumbers.values(); + QList<TemporaryContactMethod*> l = d_ptr->m_hSipTemporaryNumbers.values(); - d_ptr->m_hSipIaxTemporaryNumbers.clear(); + d_ptr->m_hSipTemporaryNumbers.clear(); while(l.size()) { TemporaryContactMethod* cm = l.takeAt(0); @@ -317,7 +317,7 @@ void NumberCompletionModelPrivate::setPrefix(const QString& str) cm->setUri(m_Prefix); } } else { - for(auto cm : m_hSipIaxTemporaryNumbers) { + for(auto cm : m_hSipTemporaryNumbers) { if (cm) cm->setUri(m_Prefix); } @@ -363,7 +363,7 @@ void NumberCompletionModelPrivate::updateModel() } } } else { - for (auto cm : m_hSipIaxTemporaryNumbers) { + for (auto cm : m_hSipTemporaryNumbers) { if (!cm) continue; if (auto weight = getWeight(cm->account())) { q_ptr->beginInsertRows(QModelIndex(), m_hNumbers.size(), m_hNumbers.size()); @@ -598,18 +598,15 @@ bool NumberCompletionModelPrivate::accountAdded(Account* a) bool hasNonIp2Ip = false; switch(a->protocol()) { - case Account::Protocol::SIP : + case Account::Protocol::SIP : { hasNonIp2Ip = true; - //no break - [[clang::fallthrough]]; - case Account::Protocol::IAX : { TemporaryContactMethod* cm = new TemporaryContactMethod(); if (!m_pPreferredTemporaryNumbers[(int)a->protocol()]) m_pPreferredTemporaryNumbers[(int)a->protocol()] = cm; cm->setAccount(a); - m_hSipIaxTemporaryNumbers[a] = cm; + m_hSipTemporaryNumbers[a] = cm; } break; case Account::Protocol::RING: { @@ -631,12 +628,12 @@ bool NumberCompletionModelPrivate::accountAdded(Account* a) void NumberCompletionModelPrivate::accountRemoved(Account* a) { - TemporaryContactMethod* cm = m_hSipIaxTemporaryNumbers[a]; + TemporaryContactMethod* cm = m_hSipTemporaryNumbers[a]; if (!cm) cm = m_hRingTemporaryNumbers[a]; - m_hSipIaxTemporaryNumbers[a] = nullptr; + m_hSipTemporaryNumbers[a] = nullptr; m_hRingTemporaryNumbers [a] = nullptr; setPrefix(q_ptr->prefix()); diff --git a/src/private/accountmodel_p.h b/src/private/accountmodel_p.h index c0ce1b0dcd6b5851daca2e085b10683b552e4004..6f4b7905f5b93b2a4f16ec4c540ac392ab56802d 100644 --- a/src/private/accountmodel_p.h +++ b/src/private/accountmodel_p.h @@ -57,7 +57,6 @@ public: QItemSelectionModel* m_pSelectionModel ; QStringList m_lMimes ; QList<Account*> m_lSipAccounts ; - QList<Account*> m_lIAXAccounts ; QList<Account*> m_lRingAccounts ; Matrix1D<Account::Protocol, bool> m_lSupportedProtocols; @@ -74,4 +73,3 @@ public Q_SLOTS: void slotMediaParametersChanged(const QString& accountId); void slotIncomingTrustRequest(const QString& accountId, const QString& hash, const QByteArray& payload, time_t time); }; - diff --git a/src/protocolmodel.cpp b/src/protocolmodel.cpp index ec3cf89ddc525a42c49a1c2020f31ffcf7cbdfce..0e3e033fb8bab65bee409363da1ead009e31e2dc 100644 --- a/src/protocolmodel.cpp +++ b/src/protocolmodel.cpp @@ -42,7 +42,6 @@ public: struct ToolTips { static const QString RING_ACCOUNT_TOOLTIP; static const QString SIP_ACCOUNT_TOOLTIP ; - static const QString IAX2_ACCOUNT_TOOLTIP; }; public Q_SLOTS: @@ -51,7 +50,6 @@ public Q_SLOTS: const QString ProtocolModelPrivate::ToolTips::RING_ACCOUNT_TOOLTIP = QObject::tr("Ring Account"); const QString ProtocolModelPrivate::ToolTips::SIP_ACCOUNT_TOOLTIP = QObject::tr("SIP Account" ); -const QString ProtocolModelPrivate::ToolTips::IAX2_ACCOUNT_TOOLTIP = QObject::tr("IAX2 Account"); ProtocolModelPrivate::ProtocolModelPrivate(Account* a) : m_pSelectionModel(nullptr), m_pAccount(a) @@ -90,8 +88,6 @@ QVariant ProtocolModel::data( const QModelIndex& index, int role) const switch (proto) { case Account::Protocol::SIP : return DRing::Account::ProtocolNames::SIP; - case Account::Protocol::IAX : - return DRing::Account::ProtocolNames::IAX; case Account::Protocol::RING : return DRing::Account::ProtocolNames::RING; case Account::Protocol::COUNT__: @@ -117,8 +113,7 @@ Qt::ItemFlags ProtocolModel::flags( const QModelIndex& index ) const //Account type cannot be changed, the daemon doesn't support that and crash //it was considered a client responsibility to disallow it. It is not worth //fixing - return (static_cast<Account::Protocol>(index.row()) == Account::Protocol::IAX ? - Qt::NoItemFlags : (Qt::ItemIsEnabled|Qt::ItemIsSelectable)); + return (Qt::ItemIsEnabled|Qt::ItemIsSelectable); } bool ProtocolModel::setData( const QModelIndex& index, const QVariant &value, int role) diff --git a/src/qtwrapper/configurationmanager_wrap.h b/src/qtwrapper/configurationmanager_wrap.h index b8b58ebc7c5a8647866cfd841622882a8d859e16..454a8698058fe67ebf224b6f6273ae8e2bf8bd71 100644 --- a/src/qtwrapper/configurationmanager_wrap.h +++ b/src/qtwrapper/configurationmanager_wrap.h @@ -396,11 +396,6 @@ public Q_SLOTS: // METHODS return DRing::isDtmfMuted(); } - int isIax2Enabled() - { - return DRing::isIax2Enabled(); - } - bool isPlaybackMuted() { return DRing::isPlaybackMuted(); diff --git a/src/uri.cpp b/src/uri.cpp index 69fed1a681a3bb1372ca6576d45304bbf9526133..16a26acb1ea8883f3be0a41b3bf1072b63ebee37 100644 --- a/src/uri.cpp +++ b/src/uri.cpp @@ -94,8 +94,6 @@ const Matrix1D<URI::SchemeType, const char*> URIPrivate::schemeNames = {{ /*NONE = */ "" , /*SIP = */ "sip:" , /*SIPS = */ "sips:", - /*IAX = */ "iax:" , - /*IAX2 = */ "iax2:", /*RING = */ "ring:", }}; @@ -185,14 +183,11 @@ QString URIPrivate::strip(const QString& uri, URI::SchemeType& scheme) const char c = uriTrimmed[start].toLatin1(); - //Assume the scheme is either iax, sip or ring using the first letter and length, this + //Assume the scheme is either sip or ring using the first letter and length, this //is dangerous and can cause undefined behaviour that will cause the call to fail //later on, but this is not really a problem for now if (end > start+3 && uriTrimmed[start+3] == ':') { switch (c) { - case 'i': - scheme = URI::SchemeType::IAX; - break; case 's': scheme = URI::SchemeType::SIP; break; @@ -201,9 +196,6 @@ QString URIPrivate::strip(const QString& uri, URI::SchemeType& scheme) } else if (end > start+4 && uriTrimmed[start+4] == ':') { switch (c) { - case 'i': - scheme = URI::SchemeType::IAX2; - break; case 'r': scheme = URI::SchemeType::RING; break; @@ -346,24 +338,19 @@ URI::ProtocolHint URI::protocolHint() const bool isHash = d_ptr->m_Userinfo.size() == 40; d_ptr->m_ProtocolHint = \ ( - //Step one : Check IAX protocol, is has already been detected at this point - d_ptr->m_HeaderType == URI::SchemeType::IAX2 || d_ptr->m_HeaderType == URI::SchemeType::IAX - ? URI::ProtocolHint::IAX - - : ( - //Step two : check IP + //Step one : check IP URIPrivate::checkIp(d_ptr->m_Userinfo,isHash,d_ptr->m_HeaderType) ? URI::ProtocolHint::IP : ( - //Step three : Check RING protocol, is has already been detected at this point + //Step two : Check RING protocol, is has already been detected at this point (d_ptr->m_HeaderType == URI::SchemeType::RING && isHash) || (isHash && d_ptr->m_Userinfo.size() == 40) ? URI::ProtocolHint::RING : ( - //Step four : Differentiate between ***@*** and *** type URIs + //Step three : Differentiate between ***@*** and *** type URIs d_ptr->m_HasAt ? URI::ProtocolHint::SIP_HOST : URI::ProtocolHint::SIP_OTHER - )))); + ))); d_ptr->m_HintParsed = true; } @@ -536,7 +523,6 @@ QString URI::format(FlagPack<URI::Section> sections) const // Use SIP scheme type on last resort if (header_type == SchemeType::NONE) { switch (protocolHint()) { - case ProtocolHint::IAX: header_type = SchemeType::IAX; break; case ProtocolHint::RING: header_type = SchemeType::RING; break; case ProtocolHint::SIP_HOST: case ProtocolHint::SIP_OTHER: @@ -584,9 +570,6 @@ QDataStream& operator<<( QDataStream& stream, const URI::ProtocolHint& ph ) case URI::ProtocolHint::SIP_OTHER: stream << QStringLiteral("SIP_OTHER"); break; - case URI::ProtocolHint::IAX : - stream << QStringLiteral("IAX"); - break; case URI::ProtocolHint::RING : stream << QStringLiteral("RING"); break; diff --git a/src/uri.h b/src/uri.h index 54fc07853fb3f6cf964bbaa91d4ac62df2ef33fb..6d1e9609e2808d3a70e37ad28771b48acd9f1a33 100644 --- a/src/uri.h +++ b/src/uri.h @@ -45,9 +45,6 @@ class QDataStream; * * <sip:c8oqz84zk7z@privacy.org>;tag=hyh8 * * 1 800 123-4567 * * 18001234567 - * * iax:example.com/alice - * * iax:johnQ@example.com/12022561414 - * * iax:example.com:4570/alice?friends * * @ref http://tools.ietf.org/html/rfc5456#page-8 * @ref http://tools.ietf.org/html/rfc3986 @@ -94,11 +91,9 @@ public: ///@enum SchemeType The very first part of the URI followed by a ':' enum class SchemeType { - NONE , //Implicit SIP or IAX, use account type as reference + NONE , //Implicit SIP, use account type as reference SIP , SIPS , - IAX , - IAX2 , RING , COUNT__ }; @@ -167,10 +162,9 @@ public: */ enum class ProtocolHint { SIP_OTHER = 0, /*!< Anything non empty that doesn't fit in other categories */ - IAX = 1, /*!< Start with "iax:" or "iax2:" */ - RING = 2, /*!< Start with "ring:" and 45 ASCII chars OR 40 ASCII chars */ - IP = 3, /*!< Match an IPv4 address */ - SIP_HOST = 4, /*!< Has an @ and no "ring:" prefix */ + RING = 1, /*!< Start with "ring:" and 45 ASCII chars OR 40 ASCII chars */ + IP = 2, /*!< Match an IPv4 address */ + SIP_HOST = 3, /*!< Has an @ and no "ring:" prefix */ }; Q_ENUMS(URI::ProtocolHint) diff --git a/src/useractionmodel.cpp b/src/useractionmodel.cpp index 91115f8a56601b6e5b0cb047368f71dca8f26884..affb22b6cf951c6c2aa5a64df522a542bd9f7020 100644 --- a/src/useractionmodel.cpp +++ b/src/useractionmodel.cpp @@ -259,31 +259,31 @@ const Matrix1D< UAMA, bool > UserActionModelPrivate::heterogenous_call_options = * This matrix allow to enable/disable actions depending on the call protocol */ const Matrix2D< UAMA, Account::Protocol, bool > UserActionModelPrivate::availableProtocolActions = { - /* SIP IAX DHT */ - { UAMA::ACCEPT , {{ true , true , true }}}, - { UAMA::HOLD , {{ true , true , true }}}, - { UAMA::MUTE_AUDIO , {{ true , true , true }}}, - { UAMA::MUTE_VIDEO , {{ true , true , true }}}, - { UAMA::SERVER_TRANSFER , {{ true , false, false }}}, - { UAMA::RECORD , {{ true , true , true }}}, - { UAMA::HANGUP , {{ true , true , true }}}, - - { UAMA::JOIN , {{ true , true , true }}}, - - { UAMA::ADD_NEW , {{ true , true , true }}}, - - { UAMA::TOGGLE_VIDEO , {{ true, true , true }}}, - { UAMA::ADD_CONTACT , {{ true, true , true }}}, - { UAMA::ADD_TO_CONTACT , {{ true, true , true }}}, - { UAMA::DELETE_CONTACT , {{ true, true , true }}}, - { UAMA::EMAIL_CONTACT , {{ true, true , true }}}, - { UAMA::COPY_CONTACT , {{ true, true , true }}}, - { UAMA::BOOKMARK , {{ true, true , true }}}, - { UAMA::VIEW_CHAT_HISTORY , {{ true, true , true }}}, - { UAMA::ADD_CONTACT_METHOD, {{ true, true , true }}}, - { UAMA::CALL_CONTACT , {{ true, true , true }}}, - { UAMA::EDIT_CONTACT , {{ true, true , true }}}, - { UAMA::REMOVE_HISTORY , {{ true, true , true }}}, + /* SIP DHT */ + { UAMA::ACCEPT , {{ true , true }}}, + { UAMA::HOLD , {{ true , true }}}, + { UAMA::MUTE_AUDIO , {{ true , true }}}, + { UAMA::MUTE_VIDEO , {{ true , true }}}, + { UAMA::SERVER_TRANSFER , {{ true , false }}}, + { UAMA::RECORD , {{ true , true }}}, + { UAMA::HANGUP , {{ true , true }}}, + + { UAMA::JOIN , {{ true , true }}}, + + { UAMA::ADD_NEW , {{ true , true }}}, + + { UAMA::TOGGLE_VIDEO , {{ true, true }}}, + { UAMA::ADD_CONTACT , {{ true, true }}}, + { UAMA::ADD_TO_CONTACT , {{ true, true }}}, + { UAMA::DELETE_CONTACT , {{ true, true }}}, + { UAMA::EMAIL_CONTACT , {{ true, true }}}, + { UAMA::COPY_CONTACT , {{ true, true }}}, + { UAMA::BOOKMARK , {{ true, true }}}, + { UAMA::VIEW_CHAT_HISTORY , {{ true, true }}}, + { UAMA::ADD_CONTACT_METHOD, {{ true, true }}}, + { UAMA::CALL_CONTACT , {{ true, true }}}, + { UAMA::EDIT_CONTACT , {{ true, true }}}, + { UAMA::REMOVE_HISTORY , {{ true, true }}}, }; /**