diff --git a/CHANGED b/CHANGED
index b0920f8f6..62f94662b 100644
--- a/CHANGED
+++ b/CHANGED
@@ -1,5 +1,11 @@
# 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.
+ - change: FB_CALLMONITOR: reading "missed_call_line" will not be triggered
+ anymore. Use internal_number instead, which
+ contains the same content
+ - feature: FB_CALLMONITOR: new attribute answMachine-is-missed-call to
+ treat incoming calls, which were taken by
+ an answering machine, as "missed call"
- feature: 98_weekprofile: send profile to other weekprofile intance
send profile to multible devices
multi-select of devices in widget
diff --git a/FHEM/72_FB_CALLMONITOR.pm b/FHEM/72_FB_CALLMONITOR.pm
index 7cf9adc46..b5f093817 100755
--- a/FHEM/72_FB_CALLMONITOR.pm
+++ b/FHEM/72_FB_CALLMONITOR.pm
@@ -60,6 +60,7 @@ FB_CALLMONITOR_Initialize($)
"local-area-code ".
"country-code ".
"remove-leading-zero:0,1 ".
+ "answMachine-is-missed-call:0,1 ".
"reverse-search-cache-file ".
"reverse-search:sortable-strict,phonebook,textfile,klicktel.de,dasoertliche.de,search.ch,dasschnelle.at ".
"reverse-search-cache:0,1 ".
@@ -370,6 +371,10 @@ FB_CALLMONITOR_Read($)
{
$hash->{helper}{TEMP}{$array[2]}{call_id} = Digest::MD5::md5_hex($data);
}
+ else
+ {
+ $hash->{helper}{TEMP}{$array[2]}{call_id} = $array[2];
+ }
}
if($array[1] eq "CALL")
@@ -378,7 +383,7 @@ FB_CALLMONITOR_Read($)
$hash->{helper}{TEMP}{$array[2]}{external_name} = (defined($reverse_search) ? $reverse_search : "unknown");
$hash->{helper}{TEMP}{$array[2]}{internal_number} = $array[4];
$hash->{helper}{TEMP}{$array[2]}{external_connection} = $array[6];
- $hash->{helper}{TEMP}{$array[2]}{internal_connection} = $connection_type{$array[3]} if(defined($connection_type{$array[3]}));
+ $hash->{helper}{TEMP}{$array[2]}{internal_connection} = $connection_type{$array[3]} if(defined($connection_type{$array[3]}));
$hash->{helper}{TEMP}{$array[2]}{direction} = "outgoing";
}
@@ -393,35 +398,31 @@ FB_CALLMONITOR_Read($)
if($array[1] eq "CONNECT" and not exists($hash->{helper}{TEMP}{$array[2]}{internal_connection}))
{
- $hash->{helper}{TEMP}{$array[2]}{internal_connection} = $connection_type{$array[3]} if(defined($connection_type{$array[3]}));
+ $hash->{helper}{TEMP}{$array[2]}{internal_connection} = $connection_type{$array[3]} if(defined($connection_type{$array[3]}));
+ $hash->{helper}{TEMP}{$array[2]}{".internal_connection_id"} = $array[3] if(defined($connection_type{$array[3]}));
}
if($array[1] eq "DISCONNECT")
{
$hash->{helper}{TEMP}{$array[2]}{call_duration} = $array[3];
- if(exists($hash->{helper}{TEMP}{$array[2]}{direction}) and exists($hash->{helper}{TEMP}{$array[2]}{external_number}) and $hash->{helper}{TEMP}{$array[2]}{direction} eq "incoming" and $array[3] eq "0")
+ if(exists($hash->{helper}{TEMP}{$array[2]}{direction}) and $hash->{helper}{TEMP}{$array[2]}{direction} eq "incoming")
{
- $hash->{helper}{TEMP}{$array[2]}{missed_call} = $hash->{helper}{TEMP}{$array[2]}{external_number}.(exists($hash->{helper}{TEMP}{$array[2]}{external_name}) and $hash->{helper}{TEMP}{$array[2]}{external_name} ne "unknown" ? " (".$hash->{helper}{TEMP}{$array[2]}{external_name}.")" : "");
- $hash->{helper}{TEMP}{$array[2]}{missed_call_line} = $hash->{helper}{TEMP}{$array[2]}{internal_number};
+ if(($hash->{helper}{TEMP}{$array[2]}{".last-event"} eq "RING") or (AttrVal($name, "answMachine-is-missed-call", "0") eq "1" and exists($hash->{helper}{TEMP}{$array[2]}{internal_connection}) and $hash->{helper}{TEMP}{$array[2]}{".internal_connection_id"} =~/^4[0-4]$/))
+ {
+ $hash->{helper}{TEMP}{$array[2]}{missed_call} = $hash->{helper}{TEMP}{$array[2]}{external_number}.(exists($hash->{helper}{TEMP}{$array[2]}{external_name}) and $hash->{helper}{TEMP}{$array[2]}{external_name} ne "unknown" ? " (".$hash->{helper}{TEMP}{$array[2]}{external_name}.")" : "");
+ }
}
}
+ $hash->{helper}{TEMP}{$array[2]}{".last-event"} = $array[1];
+
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 eq "call_id");
- }
-
- if(AttrVal($name, "unique-call-ids", "0") eq "1" and exists($hash->{helper}{TEMP}{$array[2]}{call_id}))
- {
- readingsBulkUpdate($hash, "call_id", $hash->{helper}{TEMP}{$array[2]}{call_id});
- }
- else
- {
- readingsBulkUpdate($hash, "call_id", $array[2]);
+ readingsBulkUpdate($hash, $key, $hash->{helper}{TEMP}{$array[2]}{$key}) unless($key =~ /^\./);
}
if($array[1] eq "DISCONNECT")
@@ -1790,6 +1791,11 @@ sub FB_CALLMONITOR_normalizePhoneNumber($$)
To specify an interval spawning midnight, you have to specify two intervals, e.g.:
23:00-24:00 00:00-01:00Default Value is empty (no intervals defined, FB_CALLMONITOR is always active)
23:00-24:00 00:00-01:00Standardwert ist nicht gesetzt (dauerhaft aktiv)