Select Git revision
currentcallview.cpp
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
newcallmodel.cpp 51.26 KiB
/****************************************************************************
* Copyright (C) 2017-2021 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"
// Lrc
#include "callbackshandler.h"
#include "api/behaviorcontroller.h"
#include "api/conversationmodel.h"
#include "api/contact.h"
#include "api/contactmodel.h"
#include "api/pluginmodel.h"
#include "api/lrc.h"
#include "api/newaccountmodel.h"
#include "authority/storagehelper.h"
#include "dbus/callmanager.h"
#include "vcard.h"
#include "video/renderer.h"
#include "typedefs.h"
#include "uri.h"
// Ring daemon
#include <media_const.h>
#include <account_const.h>
// Qt
#include <QObject>
#include <QString>
#include <QUrl>
// std
#include <chrono>
#include <random>
#include <map>
using namespace DRing::Media;
static std::uniform_int_distribution<int> dis {0, std::numeric_limits<int>::max()};
static const std::map<short, QString>
sip_call_status_code_map {{0, QObject::tr("Null")},
{100, QObject::tr("Trying")},
{180, QObject::tr("Ringing")},
{181, QObject::tr("Being Forwarded")},
{182, QObject::tr("Queued")},
{183, QObject::tr("Progress")},
{200, QObject::tr("OK")},
{202, QObject::tr("Accepted")},
{300, QObject::tr("Multiple Choices")},
{301, QObject::tr("Moved Permanently")},
{302, QObject::tr("Moved Temporarily")},
{305, QObject::tr("Use Proxy")},
{380, QObject::tr("Alternative Service")},
{400, QObject::tr("Bad Request")},
{401, QObject::tr("Unauthorized")},