1
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-05-07 22:29:19 +00:00

FB_CALLMONITOR: new attribute "disable", minor code make-up

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@4982 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
markusbloch 2014-02-17 23:14:38 +00:00
parent b2368f7b39
commit fb0eb78e72
2 changed files with 108 additions and 94 deletions

View File

@ -1,6 +1,8 @@
# 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.
- SVN
- feature FB_CALLMONITOR: new attribute "disable" to
disable FB_CALLMONITOR
- feature: YAMAHA_BD: new attribute "disable" to disable cyclic status
updates of player
- change: 09_CUL_FHTTK.pm: added event-on...readings and event-min-interval

View File

@ -94,7 +94,7 @@ FB_CALLMONITOR_Initialize($)
$hash->{AttrList}= "do_not_notify:0,1 unique-call-ids:0,1 local-area-code remove-leading-zero:0,1 reverse-search-cache-file reverse-search:all,internal,klicktel.de,dasoertliche.de,search.ch,dasschnelle.at,none reverse-search-cache:0,1 reverse-search-phonebook-file ".
$hash->{AttrList}= "do_not_notify:0,1 disable:0,1 unique-call-ids:0,1 local-area-code remove-leading-zero:0,1 reverse-search-cache-file reverse-search:all,internal,klicktel.de,dasoertliche.de,search.ch,dasschnelle.at,none reverse-search-cache:0,1 reverse-search-phonebook-file ".
$readingFnAttributes;
}
@ -209,7 +209,6 @@ FB_CALLMONITOR_Read($)
my $area_code = AttrVal($name, "local-area-code", "");
my $external_number = undef;
@array = split(";", $data);
$external_number = $array[3] if(not $array[3] eq "0" and $array[1] eq "RING" and $array[3] ne "");
@ -249,7 +248,6 @@ FB_CALLMONITOR_Read($)
{
$hash->{helper}{MISSED_CALL_DETECTION}{$array[2]}{EVENT} = $array[1];
my $no = "unknown";
if(defined($external_number))
{
$no = $external_number;
@ -267,7 +265,6 @@ FB_CALLMONITOR_Read($)
{
readingsBulkUpdate($hash, "missed_call", $hash->{helper}{MISSED_CALL_DETECTION}{$array[2]}{NUMBER})
}
delete($hash->{helper}{MISSED_CALL_DETECTION}{$array[2]}) if(exists($hash->{helper}{MISSED_CALL_DETECTION}{$array[2]}));
}
@ -278,7 +275,6 @@ FB_CALLMONITOR_Read($)
{
$hash->{helper}{CALLID}{$array[2]} = Digest::MD5::md5_hex($data);
}
readingsBulkUpdate($hash, "call_id", $hash->{helper}{CALLID}{$array[2]});
if($array[1] eq "DISCONNECT")
@ -295,22 +291,13 @@ FB_CALLMONITOR_Read($)
}
sub
FB_CALLMONITOR_DoInit($)
{
# No Initialization needed
return undef;
}
sub
FB_CALLMONITOR_Ready($)
{
my ($hash) = @_;
return DevIo_OpenDev($hash, 1, "FB_CALLMONITOR_DoInit");
return DevIo_OpenDev($hash, 1, undef);
}
@ -324,21 +311,31 @@ FB_CALLMONITOR_Attr($@)
if($a[0] eq "set")
{
if($a[2] eq "reverse-search" or $a[2] eq "reverse-search-phonebook-file")
{
$attr{$name}{"reverse-search-phonebook-file"} = $a[3] if($a[2] eq "reverse-search-phonebook-file");
FB_CALLMONITOR_loadInternalPhonebookFile($hash);
}
if($a[2] eq "reverse-search-cache-file")
{
$attr{$name}{"reverse-search-cache-file"} = $a[3];
FB_CALLMONITOR_loadCacheFile($hash);
}
if($a[2] eq "disable")
{
if($a[3] eq "0")
{
DevIo_OpenDev($hash, 0, "FB_CALLMONITOR_DoInit");
}
elsif($a[3] eq "1")
{
DevIo_CloseDev($hash);
$hash->{STATE} = "disabled";
}
}
}
elsif($a[0] eq "del")
{
@ -348,7 +345,12 @@ FB_CALLMONITOR_Attr($@)
delete($hash->{helper}{PHONEBOOK}) if(defined($hash->{helper}{PHONEBOOK}));
}
if( $a[2] eq "disable")
{
DevIo_OpenDev($hash, 0, "FB_CALLMONITOR_DoInit");
}
}
return undef;
@ -782,7 +784,12 @@ sub FB_CALLMONITOR_loadCacheFile($)
<b>Attributes</b><br><br>
<ul>
<li><a href="#do_not_notify">do_not_notify</a></li>
<li><a href="#readingFnAttributes">readingFnAttributes</a></li>
<li><a href="#readingFnAttributes">readingFnAttributes</a></li><br>
<li><a name="disable">disable</a></li>
Optional attribute to disable the Callmonitor. When disabled, no phone events can be detected.
<br><br>
Possible values: 0 => Callmonitor is activated, 1 => Callmonitor is deactivated.<br>
Default Value is 0 (activated)<br><br>
<li><a name="reverse-search">reverse-search</a> (all|internal|klicktel.de|dasoertliche.de|search.ch|dasschnelle.at|none)</li>
Activate the reverse searching of the external number (at dial and call receiving).
It is possible to select a specific web service, which should be used for reverse searching.
@ -880,7 +887,12 @@ sub FB_CALLMONITOR_loadCacheFile($)
<b>Attribute</b><br><br>
<ul>
<li><a href="#do_not_notify">do_not_notify</a></li>
<li><a href="#readingFnAttributes">readingFnAttributes</a></li>
<li><a href="#readingFnAttributes">readingFnAttributes</a></li><br>
<li><a name="disable">disable</a></li>
Optionales Attribut zur Deaktivierung des Callmonitors. Es k&ouml;nnen dann keine Anruf-Events mehr erkannt und erzeugt werden.
<br><br>
M&ouml;gliche Werte: 0 => Callmonitor ist aktiv, 1 => Callmonitor ist deaktiviert.<br>
Standardwert ist 0 (aktiv)<br><br>
<li><a name="reverse-search">reverse-search</a> (all|internal|klicktel.de|dasoertliche.de|search.ch|dasschnelle.at|none)</li>
Aktiviert die R&uuml;ckw&auml;rtssuche der externen Rufnummer der Gegenstelle (bei eingehenden/abgehenden Anrufen).
Es ist m&ouml;glich einen bestimmten Suchanbieter zu verwenden, welcher f&uuml;r die R&uuml;ckw&auml;rtssuche verwendet werden soll.