diff --git a/fhem/FHEM/72_FB_CALLMONITOR.pm b/fhem/FHEM/72_FB_CALLMONITOR.pm index 35b51f127..6ed4fdbad 100755 --- a/fhem/FHEM/72_FB_CALLMONITOR.pm +++ b/fhem/FHEM/72_FB_CALLMONITOR.pm @@ -250,6 +250,34 @@ FB_CALLMONITOR_Read($) readingsBulkUpdate($hash, "internal_connection", $connection_type{$array[3]}) if($array[1] eq "CALL" or $array[1] eq "CONNECT" and defined($connection_type{$array[3]})); readingsBulkUpdate($hash, "call_duration", $array[3]) if($array[1] eq "DISCONNECT"); + + if ($array[1] eq "RING") + { + $hash->{helper}{MISSED_CALL_DETECTION}{$array[2]}{EVENT} = $array[1]; + my $no = "unknown"; + + if (defined($external_number)) + { + $no = $external_number; + if (defined($reverse_search)) + { + $no .= " (".$reverse_search.")"; + } + } + + $hash->{helper}{MISSED_CALL_DETECTION}{$array[2]}{NUMBER} = $no; + } + elsif ($array[1] eq "DISCONNECT") + { + if (($array[3] eq "0") and ($hash->{helper}{MISSED_CALL_DETECTION}{$array[2]}{EVENT} eq "RING")) + { + readingsBulkUpdate($hash, "missed_call", $hash->{helper}{MISSED_CALL_DETECTION}{$array[2]}{NUMBER}) + } + + delete($hash->{helper}{MISSED_CALL_DETECTION}{$array[2]}) if(defined($hash->{helper}{MISSED_CALL_DETECTION}{$array[2]})); + } + + if(AttrVal($name, "unique-call-ids", "0") eq "1") { if($array[1] eq "RING" or $array[1] eq "CALL") @@ -730,6 +758,7 @@ sub FB_CALLMONITOR_loadCacheFile($)
  • external_connection: $connection - The external connection (fixed line, VoIP account) which is used to take the call
  • call_duration: $seconds - 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: $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 $number - This event will be raised in case of a missing incoming call. If available, also the name of the calling number will be displayed.
  • @@ -834,6 +863,7 @@ sub FB_CALLMONITOR_loadCacheFile($)
  • external_connection: $connection - Der externe Anschluss welcher genutzt wird um das Gespräch durchzuführen (Festnetz, VoIP Nummer, ...)
  • call_duration: $seconds - 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: $id - Die Identifizierungsnummer eines einzelnen Gesprächs. Dient der Zuordnung bei 2 oder mehr parallelen Gesprächen, damit alle Events eindeutig einem Gespräch zugeordnet werden können
  • +
  • missed_call: $number - Dieses Event wird nur generiert, wenn ein eingehender Anruf nicht beantwortet wird. Sofern der Name dazu bekannt ist, wird dieser ebenfalls mit angezeigt.