Skip to content
Snippets Groups Projects
Select Git revision
  • de87ae908925900356bfdfcc321ddd309f40b57d
  • master default protected
  • release/202005
  • release/202001
  • release/201912
  • release/201911
  • release/releaseWindowsTestOne
  • release/windowsReleaseTest
  • release/releaseTest
  • release/releaseWindowsTest
  • release/201910
  • release/qt/201910
  • release/windows-test/201910
  • release/201908
  • release/201906
  • release/201905
  • release/201904
  • release/201903
  • release/201902
  • release/201901
  • release/201812
  • 4.0.0
  • 2.2.0
  • 2.1.0
  • 2.0.1
  • 2.0.0
  • 1.4.1
  • 1.4.0
  • 1.3.0
  • 1.2.0
  • 1.1.0
31 results

string_utils.h

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    newcallmodel.cpp 30.89 KiB
    /****************************************************************************
     *    Copyright (C) 2017-2019 Savoir-faire Linux Inc.                             *
     *   Author : Nicolas Jäger <nicolas.jager@savoirfairelinux.com>            *
     *   Author : Sébastien Blin <sebastien.blin@savoirfairelinux.com>          *
     *                                                                          *
     *   This library is free software; you can redistribute it and/or          *
     *   modify it under the terms of the GNU Lesser General Public             *
     *   License as published by the Free Software Foundation; either           *
     *   version 2.1 of the License, or (at your option) any later version.     *
     *                                                                          *
     *   This library is distributed in the hope that it will be useful,        *
     *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
     *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      *
     *   Lesser General Public License for more details.                        *
     *                                                                          *
     *   You should have received a copy of the GNU General Public License      *
     *   along with this program.  If not, see <http://www.gnu.org/licenses/>.  *
     ***************************************************************************/
    
    #include "api/newcallmodel.h"
    
    // std
    #include <chrono>
    #include <random>
    #include <map>
    
    // Lrc
    #include "callbackshandler.h"
    #include "api/conversationmodel.h"
    #include "api/contact.h"
    #include "api/contactmodel.h"
    #include "api/lrc.h"
    #include "api/newaccountmodel.h"
    #include "authority/storagehelper.h"
    #include "dbus/callmanager.h"
    #include "vcard.h"
    #include "video/renderer.h"
    
    // Ring daemon
    #include <media_const.h>
    
    // Qt
    #include <QObject>
    #include <QString>
    
    static std::uniform_int_distribution<int> dis{ 0, std::numeric_limits<int>::max() };
    static const std::map<short, std::string> sip_call_status_code_map {
        {0, QObject::tr("Null").toStdString()},
        {100, QObject::tr("Trying").toStdString()},
        {180, QObject::tr("Ringing").toStdString()},
        {181, QObject::tr("Being Forwarded").toStdString()},
        {182, QObject::tr("Queued").toStdString()},
        {183, QObject::tr("Progress").toStdString()},
        {200, QObject::tr("OK").toStdString()},
        {202, QObject::tr("Accepted").toStdString()},
        {300, QObject::tr("Multiple Choices").toStdString()},
        {301, QObject::tr("Moved Permanently").toStdString()},
        {302, QObject::tr("Moved Temporarily").toStdString()},
        {305, QObject::tr("Use Proxy").toStdString()},
        {380, QObject::tr("Alternative Service").toStdString()},
        {400, QObject::tr("Bad Request").toStdString()},
        {401, QObject::tr("Unauthorized").toStdString()},
        {402, QObject::tr("Payment Required").toStdString()},
        {403, QObject::tr("Forbidden").toStdString()},
        {404, QObject::tr("Not Found").toStdString()},
        {405, QObject::tr("Method Not Allowed").toStdString()},
        {406, QObject::tr("Not Acceptable").toStdString()},
        {407, QObject::tr("Proxy Authentication Required").toStdString()},
        {408, QObject::tr("Request Timeout").toStdString()},
        {410, QObject::tr("Gone").toStdString()},