diff --git a/FHEM/72_FB_CALLMONITOR.pm b/FHEM/72_FB_CALLMONITOR.pm index a595279bb..42c056199 100755 --- a/FHEM/72_FB_CALLMONITOR.pm +++ b/FHEM/72_FB_CALLMONITOR.pm @@ -464,12 +464,12 @@ sub FB_CALLMONITOR_loadInternalPhonebookFile($) { $phonebook = join('', ); - if($phonebook =~ // and $phonebook =~ // and $phonebook =~ //) + if($phonebook =~ // and $phonebook =~ //) { Log GetLogLevel($name, 2), "FB_CALLMONITOR: $name found FritzBox phonebook $phonebook_file"; - while($phonebook =~ m/(.+?)<\/contact>/gs) + while($phonebook =~ m/]*>(.+?)<\/contact>/gs) { $contact = $1; @@ -478,11 +478,15 @@ sub FB_CALLMONITOR_loadInternalPhonebookFile($) $contact_name = $1; Log GetLogLevel($name, 4), "FB_CALLMONITOR: $name found $contact_name"; - while($contact =~ m/]*?>(.+?)<\/number>/gs) { if($1 ne "intern" and $1 ne "memo") { $number = $2; + + $number =~ s/\D//g unless($number =~ /@/); + $number =~ s/\s//g if($number =~ /@/); + if(not $number =~ /^0/ and not $number =~ /@/ and $area_code ne "") { if($area_code =~ /^0[1-9]\d+$/)