diff --git a/fhem/FHEM/72_FRITZBOX.pm b/fhem/FHEM/72_FRITZBOX.pm index ee08f1815..296a3f614 100644 --- a/fhem/FHEM/72_FRITZBOX.pm +++ b/fhem/FHEM/72_FRITZBOX.pm @@ -1071,6 +1071,7 @@ sub ############################################ FRITZBOX_Telnet_Open($) { my ($hash) = @_; + my $name = $hash->{NAME}; my $host = $hash->{HOST}; my $pwdFile = "fb_pwd.txt"; my $pwd; @@ -1084,12 +1085,22 @@ FRITZBOX_Telnet_Open($) FRITZBOX_Log $hash, 2, "Cannot open password file '$pwdFile': $!"; return "Cannot open password file $pwdFile: $!"; } + + my $user = AttrVal( $name, "telnetUser", "" ); $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Prompt=>'/# $/'); FRITZBOX_Log $hash, 4, "Open Telnet Connection to $host"; $telnet->open( $host ); + if ( $user ne "" ) + { + FRITZBOX_Log $hash, 5, "Telnet: Wait for user request"; + $telnet->waitfor( '/user: $/i' ); + FRITZBOX_Log $hash, 5, "Telnet: Entering user"; + $telnet->print( $user ); + } + FRITZBOX_Log $hash, 5, "Telnet: Wait for password request"; $telnet->waitfor( '/password: $/i' ); @@ -1299,7 +1310,7 @@ sub FRITZBOX_fritztris($) $returnStr .= 'game = null;'; $returnStr .= '}'; $returnStr .= ''; - $returnStr .= '
FritzTris'; + $returnStr .= ''; $returnStr .= '
FritzTris'; $returnStr .= '
Start'; $returnStr .= '
Stop
'; @@ -1317,18 +1328,15 @@ sub FRITZBOX_fritztris($)

FRITZBOX

    - Controls some features of a Fritz!Box router. Connected Fritz!Fon's (MT-F, MT-D, C3, C4) can be used as signaling devices. -
    - The modul switches in local mode if FHEM runs on a Fritz!Box (as root user!). -
    - If FHEM does not run on a Fritz!Box, it tries to open a telnet connection to "fritz.box", so telnet (#96*7*) has to be enabled on the Fritz!Box. -
    - For remote access the password must be stored in the file 'fb_pwd.txt' in the root directory of FHEM. + Controls some features of a Fritz!Box router. Connected Fritz!Fon's (MT-F, MT-D, C3, C4) can be used as + signaling devices. The modul switches in local mode if FHEM runs on a Fritz!Box (as root user!). +

    + If FHEM does not run on a Fritz!Box, it tries to open a telnet connection to "fritz.box", so telnet (#96*7*) has to be enabled on the Fritz!Box. For remote access the password must be stored in the file 'fb_pwd.txt' in the root directory of FHEM. +

    + Check also the other Fritz!Box moduls: SYSMON and FB_CALLMONITOR.
    So fare, the module has been tested on Fritz!Box 7390 and 7490 and Fritz!Fon MT-F and C4.
    - Check also the other Fritz!Box moduls: SYSMON and FB_CALLMONITOR. -
    The modul uses the Perl modul 'Net::Telnet' for remote access.

    @@ -1337,11 +1345,13 @@ sub FRITZBOX_fritztris($)
    define <name> FRITZBOX

    - Example: define fritzbox FRITZBOX + Example: define Fritzbox FRITZBOX +

    + The Fritz!Box OS has a hidden function (easter egg). +
    + Test it with: define MyEasterEgg weblink htmlCode { FRITZBOX_fritztris("Fritzbox") } +

- The Fritz!Box OS has a hidden function. Test it with -
define MyEasterEgg weblink htmlCode { FRITZBOX_fritztris("MyEasterEgg") } -

Set @@ -1437,18 +1447,24 @@ sub FRITZBOX_fritztris($)
Maximal 30 characters are allowed. The attribute "ringWithIntern" must also be specified.
-
  • ringWithIntern <internalNumber> -
    - To ring a fon a caller must always be specified. Default of this modul is 50 "ISDN:Wählhilfe". -
    - To show a message (default: "FHEM") during a ring the internal phone numbers 1 or 2 can be specified here. -

  • defaultUploadDir <fritzBoxPath>
    This is the default path that will be used if a file name does not start with / (slash).
    It needs to be the name of the path on the Fritz!Box. So, it should start with /var/InternerSpeicher if it equals in Windows \\ip-address\fritz.nas

  • +
  • telnetUser <user name> +
    + User name that is used for telnet access. By default no user name is required to login. +
    + If the Fritz!Box is configured differently, the user name has to be defined with this attribute. +

  • +
  • ringWithIntern <internalNumber> +
    + To ring a fon a caller must always be specified. Default of this modul is 50 "ISDN:Wählhilfe". +
    + To show a message (default: "FHEM") during a ring the internal phone numbers 1 or 2 can be specified here. +

  • readingFnAttributes