Accept/Decline the current call from CLI commands.

This commit is contained in:
Julien Wadel 2023-01-24 14:19:38 +01:00
parent febdf8b4a7
commit 05c461ff7f
17 changed files with 147 additions and 1 deletions

View file

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- VFS Encryption
- File viewer in chats (Image/Animated Image/Video/Texts) with the option to export the file.
- Accept/decline CLI commands.
## 5.0.8 - 2023-01-20

View file

@ -796,6 +796,14 @@ Server url ikke konfigureret.</translation>
<source>byeFunctionDescription</source>
<translation>Afslut opkald, alle eller det nuværende.</translation>
</message>
<message>
<source>acceptFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>declineFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CodecsViewer</name>

View file

@ -796,6 +796,14 @@ Server URL ist nicht konfiguriert.</translation>
<source>byeFunctionDescription</source>
<translation>Beendet einen spezifischen Anruf, alle Anrufe oder den aktuellen Anruf.</translation>
</message>
<message>
<source>acceptFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>declineFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CodecsViewer</name>

View file

@ -796,6 +796,14 @@ Server URL not configured.</translation>
<source>joinConferenceAsFunctionDescription</source>
<translation>Join the conference hosted by the sip-address as with the guest-sip-address. If you are not connected to a proxy-config, see join-conference.</translation>
</message>
<message>
<source>acceptFunctionDescription</source>
<translation>Accept the current call.</translation>
</message>
<message>
<source>declineFunctionDescription</source>
<translation>Decline the current call.</translation>
</message>
</context>
<context>
<name>CodecsViewer</name>

View file

@ -796,6 +796,14 @@ URL del servidor no configurada.</translation>
<source>byeFunctionDescription</source>
<translation>Terminar una llamada específica, todas las llamadas o la llamada actual.</translation>
</message>
<message>
<source>acceptFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>declineFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CodecsViewer</name>

View file

@ -796,6 +796,14 @@ URL du serveur non configurée.</translation>
<source>byeFunctionDescription</source>
<translation>Terminer un appel spécifique, tous les appels ou l&apos;appel en cours.</translation>
</message>
<message>
<source>acceptFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>declineFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CodecsViewer</name>

View file

@ -790,6 +790,14 @@ A kiszolgáló URL-je nincs konfigurálva.</translation>
<source>byeFunctionDescription</source>
<translation>Egy adott hívás, az összes hívás vagy az jelenlegi hívás befejezése.</translation>
</message>
<message>
<source>acceptFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>declineFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CodecsViewer</name>

View file

@ -796,6 +796,14 @@ URL del server non configurato.</translation>
<source>byeFunctionDescription</source>
<translation>Termina una chiamata specifica, tutte le chiamate o la chiamata corrente.</translation>
</message>
<message>
<source>acceptFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>declineFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CodecsViewer</name>

View file

@ -790,6 +790,14 @@
<source>byeFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>acceptFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>declineFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CodecsViewer</name>

View file

@ -802,6 +802,14 @@ Nesukonfigūruotas serverio url.</translation>
<source>byeFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>acceptFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>declineFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CodecsViewer</name>

View file

@ -796,6 +796,14 @@ URL do servidor não configurado.</translation>
<source>byeFunctionDescription</source>
<translation>Encerre uma chamada específica, todas as chamadas ou a chamada atual.</translation>
</message>
<message>
<source>acceptFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>declineFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CodecsViewer</name>

View file

@ -802,6 +802,14 @@
<source>byeFunctionDescription</source>
<translation>Завершить определённый звонок, все звонки или текущий звонок.</translation>
</message>
<message>
<source>acceptFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>declineFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CodecsViewer</name>

View file

@ -796,6 +796,14 @@ Serverwebbadressen är inte konfigurerad.</translation>
<source>byeFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>acceptFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>declineFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CodecsViewer</name>

View file

@ -790,6 +790,14 @@ Sunucu url&apos;si yapılandırılmadı.</translation>
<source>byeFunctionDescription</source>
<translation>Belirli çağrıyı, tüm çağrıları veya geçerli çağrıyı bitir.</translation>
</message>
<message>
<source>acceptFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>declineFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CodecsViewer</name>

View file

@ -802,6 +802,14 @@
<source>byeFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>acceptFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>declineFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CodecsViewer</name>

View file

@ -790,6 +790,14 @@
<source>byeFunctionDescription</source>
<translation></translation>
</message>
<message>
<source>acceptFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>declineFunctionDescription</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CodecsViewer</name>

View file

@ -52,7 +52,6 @@ static void cliShow (QHash<QString, QString> &args) {
static void cliCall (QHash<QString, QString> &args) {
QString addressToCall = args["sip-address"];
if(args.size() > 1){// Call with options
App *app = App::getInstance();
args["call"] = args["sip-address"];// Swap cli def to parser
@ -63,6 +62,30 @@ static void cliCall (QHash<QString, QString> &args) {
CoreManager::getInstance()->getCallsListModel()->launchAudioCall(args["sip-address"], "");
}
static void cliAccept (QHash<QString, QString> &args) {
auto currentCall = CoreManager::getInstance()->getCore()->getCurrentCall();
App *app = App::getInstance();
if( args.size() > 0){
app->processArguments(args);
app->initContentApp();
}
if(currentCall){
currentCall->accept();
}
}
static void cliDecline (QHash<QString, QString> &args) {
auto currentCall = CoreManager::getInstance()->getCore()->getCurrentCall();
App *app = App::getInstance();
if( args.size() > 0){
app->processArguments(args);
app->initContentApp();
}
if(currentCall){
currentCall->decline(linphone::Reason::Declined);
}
}
static void cliBye (QHash<QString, QString> &args) {
auto currentCall = CoreManager::getInstance()->getCore()->getCurrentCall();
if(args.size() > 0) {
@ -427,6 +450,8 @@ QMap<QString, Cli::Command> Cli::mCommands = {
{ "sip-address", {} }, { "conference-id", {} }, { "guest-sip-address", {} }
}),
createCommand("bye", QT_TR_NOOP("byeFunctionDescription"), cliBye, QHash<QString, Argument>(), true),
createCommand("accept", QT_TR_NOOP("acceptFunctionDescription"), cliAccept, QHash<QString, Argument>(), true),
createCommand("decline", QT_TR_NOOP("declineFunctionDescription"), cliDecline, QHash<QString, Argument>(), true),
};
// -----------------------------------------------------------------------------