diff --git a/fhem/CHANGED b/fhem/CHANGED index b32114bec..204014238 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +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. + - feature: FB_CALLLIST: new attribute number-cmd to execute a FHEM command + when clicking on a external number within the calllist. Can be any + valid FHEM command or Perl code. For details see commandref - change: 49_SSCAM: a little bit code optimization - bugfix: 31_MilightDevice: Queue length correction for long transitions - feature: 31_MilightDevice: Color changes during dim on lower brightness diff --git a/fhem/FHEM/72_FB_CALLLIST.pm b/fhem/FHEM/72_FB_CALLLIST.pm index 8381f3c10..c761e8f9c 100755 --- a/fhem/FHEM/72_FB_CALLLIST.pm +++ b/fhem/FHEM/72_FB_CALLLIST.pm @@ -31,6 +31,7 @@ use warnings; use MIME::Base64; use Data::Dumper; +use HttpUtils; sub FB_CALLLIST_Initialize($) @@ -57,6 +58,7 @@ FB_CALLLIST_Initialize($) "answMachine-is-missed-call:0,1 ". "language:de,en ". "disable:0,1 ". + "number-cmd ". "disabledForIntervals ". "do_not_notify:0,1 ". "no-heading:0,1 ". @@ -656,6 +658,16 @@ sub FB_CALLLIST_list2html($;$) { my $data = \%{$hash->{helper}{DATA}{$index}}; + my $number = $data->{external_number}; + + if(defined(my $cmd = AttrVal($name, "number-cmd", undef))) + { + $cmd =~ s/\$NUMBER/$number/g; + + $number = ''.$number.""; + } + + $line = { index => $index, line => $count, @@ -663,7 +675,7 @@ sub FB_CALLLIST_list2html($;$) state => FB_CALLLIST_returnCallState($hash, $index), timestamp => strftime(AttrVal($name, "time-format-string", "%a, %d %b %Y %H:%M:%S"), localtime($index)), name => ($data->{external_name} eq "unknown" ? "-" : $data->{external_name}), - number => $data->{external_number}, + number => $number, external => ($data->{external_connection} ? ((exists($hash->{helper}{EXTERNAL_MAP}) and exists($hash->{helper}{EXTERNAL_MAP}{$data->{external_connection}})) ? $hash->{helper}{EXTERNAL_MAP}{$data->{external_connection}} : $data->{external_connection} ) : "-"), internal => ((exists($hash->{helper}{INTERNAL_FILTER}) and exists($hash->{helper}{INTERNAL_FILTER}{$data->{internal_number}})) ? $hash->{helper}{INTERNAL_FILTER}{$data->{internal_number}} : $data->{internal_number} ), connection => ($data->{internal_connection} ? ((exists($hash->{helper}{CONNECTION_MAP}) and exists($hash->{helper}{CONNECTION_MAP}{$data->{internal_connection}})) ? $hash->{helper}{CONNECTION_MAP}{$data->{internal_connection}} : $data->{internal_connection} ) : "-"), @@ -1194,6 +1206,18 @@ sub FB_CALLLIST_returnTableHeader($) Defines the language of the table header, some keywords and the timestamp format. You need to have the selected locale installed and available in your operating system.

Possible values: en => English , de => German
Default Value is en (English)

+
  • number-cmd <command>
  • + Can be set, to execute a specific FHEM command, when clicking on a number in the list. The value can be any valid FHEM command or Perl code (in curly brackets: { ... } ). + The placeholder $NUMBER will be replaced with the current external number of each row. +

    + This can be used for example to initiate a call to this number. + e.g.:

    + +
    + If not set, no link will be shown in the list.

  • show-icons 0,1
  • Normally the call state is shown with icons (used from the openautomation icon set). You need to have openautomation in your iconpath attribute of your appropriate FHEMWEB definition to use this icons. @@ -1407,6 +1431,18 @@ sub FB_CALLLIST_returnTableHeader($) Definiert die Sprache in der die Anrufliste angezeigt werden soll (Tabellenkopf, Datum). Die entsprechende Sprache muss auch im Betriebssystem installiert und unterstützt werden.

    Mögliche Werte: en => Englisch , de => Deutsch
    Standardwert ist en (Englisch)

    +
  • number-cmd <Befehl>
  • + Kann gesetzt werden, um ein FHEM-Befehl oder Perl-Code (in geschweiften Klammern: { ... } ) auszuführen, wenn man auf eine Rufnummer in der Anrufliste klickt. + Der Platzhalter $NUMBER wird dabei mit der entsprechenden Rufnummer der jeweiligen Zeile ersetzt. +

    + Damit kann man beispielsweise einen Rückruf starten. + e.g.:

    + +
    + Sofern nicht gesetzt, wird kein Link angezeigt.

  • show-icons 0,1
  • Im Normalfall wird der Status eines jeden Anrufs mit einem Icon angezeigt. Dazu muss das openautomation Icon-Set im iconpath-Attribut der entsprechenden FHEMWEB Instanz konfiguriert sein. Sollte man keine Icons wünschen, so kann man diese hiermit abschalten. Der Status wird dann mittels Textzeichen dargestellt.

    Mögliche Werte: 0 => keine Icons , 1 => benutze Icons