Select Git revision
-
Sébastien Blin authored
Change-Id: I1177d216bed15091642dec84bdef623b55e4d44b
Sébastien Blin authoredChange-Id: I1177d216bed15091642dec84bdef623b55e4d44b
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()},