2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

FB_CALLMONITOR regognize "user:" as login prompt for remote telnet connection (phonebook) (Forum #30244)

git-svn-id: https://svn.fhem.de/fhem/trunk@7595 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
markusbloch 2015-01-17 10:25:46 +00:00
parent 298ca27ac6
commit 67ba45ca8d
2 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,7 @@
# 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.
- bugfix: FB_CALLMONITOR regognize "user:" as login prompt for
remote telnet connection (phonebook)
- changed: 73_km200.pm: DoNotPoll includes top-down hierarchy
- bugfix : 73_km200.pm: Correction of commandref - entry
- changed: 98_Text2Speech (thanks to TeeVau):

View File

@ -858,7 +858,7 @@ sub FB_CALLMONITOR_readRemotePhonebook($;$)
Log3 $name, 4, "FB_CALLMONITOR ($name) - connected to FritzBox via telnet";
my ($prematch, $match) = $telnet->waitfor('/(?:login|password):\s*$/i');
my ($prematch, $match) = $telnet->waitfor('/(?:login|user|password):\s*$/i');
unless(defined($prematch) and defined($match))
{
@ -866,7 +866,7 @@ sub FB_CALLMONITOR_readRemotePhonebook($;$)
return "Couldn't recognize login prompt: ".$telnet->errmsg;
}
if($match =~ /login/ and defined($fb_user))
if($match =~ /(login|user):/ and defined($fb_user))
{
Log3 $name, 4, "FB_CALLMONITOR ($name) - setting user to FritzBox: $fb_user";
$telnet->print($fb_user);
@ -876,12 +876,12 @@ sub FB_CALLMONITOR_readRemotePhonebook($;$)
return "Error giving password to FritzBox: ".$telnet->errmsg;
}
}
elsif($match =~ /login/ and not defined($fb_user))
elsif($match =~ /(login|user):/ and not defined($fb_user))
{
$telnet->close;
return "FritzBox needs a username to login via telnet. Please provide a valid username/password combination";
}
elsif($match =~ /password/)
elsif($match =~ /password:/)
{
Log3 $name, 4, "FB_CALLMONITOR ($name) - giving password to FritzBox";
$telnet->print($fb_pw);