From 528b49e42bf7361be8623f2e24c62eb0c8da70b0 Mon Sep 17 00:00:00 2001
From: markusbloch <>
Date: Mon, 13 Apr 2020 09:09:31 +0000
Subject: [PATCH] FB_CALLMONITOR: new reading "calls_count" to reflect the
number of active calls in parallel (Forum: #109734)
git-svn-id: https://svn.fhem.de/fhem/trunk@21657 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/CHANGED | 2 ++
fhem/FHEM/72_FB_CALLMONITOR.pm | 10 +++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/fhem/CHANGED b/fhem/CHANGED
index 53e23f831..190b0fcfc 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -1,5 +1,7 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
+ - feature: 72_FB_CALLMONITOR: new reading/event "calls_count" which reflects
+ the number of active calls in parallel
- bugfix: 50_TelegramBot: parsemode corrected for multiple lines - msg1041326
- change: 37_echodevice.pm more loginformations set "NPM_login new"
- change: 93_Log2Syslog: new reading 'Parse_Err_LastData', minor changes
diff --git a/fhem/FHEM/72_FB_CALLMONITOR.pm b/fhem/FHEM/72_FB_CALLMONITOR.pm
index bbb5652fc..2adf5ca69 100755
--- a/fhem/FHEM/72_FB_CALLMONITOR.pm
+++ b/fhem/FHEM/72_FB_CALLMONITOR.pm
@@ -531,17 +531,16 @@ FB_CALLMONITOR_Read($)
}
$hash->{helper}{TEMP}{$array[2]}{".last-event"} = $array[1];
-
+
+ readingsBeginUpdate($hash);
unless($hash->{helper}{TEMP}{$array[2]}{".deflected"})
{
- readingsBeginUpdate($hash);
readingsBulkUpdate($hash, "event", lc($array[1]));
foreach my $key (keys %{$hash->{helper}{TEMP}{$array[2]}})
{
readingsBulkUpdate($hash, $key, $hash->{helper}{TEMP}{$array[2]}{$key}) unless($key =~ /^\./);
}
- readingsEndUpdate($hash, 1);
}
else
{
@@ -552,6 +551,9 @@ FB_CALLMONITOR_Read($)
{
delete($hash->{helper}{TEMP}{$array[2]});
}
+
+ readingsBulkUpdate($hash, "calls_count", scalar keys %{$hash->{helper}{TEMP}});
+ readingsEndUpdate($hash, 1);
}
$hash->{PARTIAL} = $buffer;
@@ -2484,6 +2486,7 @@ sub FB_CALLMONITOR_sendKeepAlive($)
internal_number - The internal number (fixed line, VoIP number, ...) on which the participant is calling (event: ring) or is used for calling (event: call)
internal_connection - The internal connection (FON1, FON2, ISDN, DECT, ...) which is used to take or perform the call
external_connection - The external connection ("POTS" => fixed line, "SIPx" => VoIP account, "ISDN", "GSM" => mobile call via GSM/UMTS stick) which is used to take or perform the call
+ calls_count - The number of active calls in parallel. The value 0 means, there is no active call currently.
call_duration - The call duration in seconds. Is only generated at a disconnect event. The value 0 means, the call was not taken by anybody.
call_id - The call identification number to separate events of two or more different calls at the same time. This id number is equal for all events relating to one specific call.
missed_call - This event will be raised in case of a incoming call, which is not answered. If available, also the name of the calling number will be displayed.
@@ -2669,6 +2672,7 @@ sub FB_CALLMONITOR_sendKeepAlive($)
internal_number - Die interne Rufnummer (Festnetz, VoIP-Nummer, ...) auf welcher man angerufen wird (event: ring) oder die man gerade nutzt um jemanden anzurufen (event: call)
internal_connection - Der interne Anschluss an der Fritz!Box welcher genutzt wird um das Gespräch durchzuführen (FON1, FON2, ISDN, DECT, ...)
external_connection - Der externe Anschluss welcher genutzt wird um das Gespräch durchzuführen ("POTS" => analoges Festnetz, "SIPx" => VoIP Nummer, "ISDN", "GSM" => Mobilfunk via GSM/UMTS-Stick)
+ calls_count - Die Anzahl aller aktiven Verbindungen (gleichzeitig). Ist der Wert 0, so wird gerade kein Gespräch geführt.
call_duration - Die Gesprächsdauer in Sekunden. Dieser Wert wird nur bei einem disconnect-Event erzeugt. Ist der Wert 0, so wurde das Gespräch von niemandem angenommen.
call_id - Die Identifizierungsnummer eines einzelnen Gesprächs. Dient der Zuordnung bei zwei oder mehr parallelen Gesprächen, damit alle Events eindeutig einem Gespräch zugeordnet werden können
missed_call - Dieses Event wird nur generiert, wenn ein eingehender Anruf nicht beantwortet wird. Sofern der Name dazu bekannt ist, wird dieser ebenfalls mit angezeigt.