Index: ipk/source.sh4/tools_callmonitor/_path_/usr/local/share/titan/plugins/callmonitor1/fritzbox_msg_new.sh
===================================================================
--- ipk/source.sh4/tools_callmonitor/_path_/usr/local/share/titan/plugins/callmonitor1/fritzbox_msg_new.sh	(revision 42833)
+++ ipk/source.sh4/tools_callmonitor/_path_/usr/local/share/titan/plugins/callmonitor1/fritzbox_msg_new.sh	(revision 42836)
@@ -206,5 +206,5 @@
 
 loadXML(){
-	#ID="$1"
+	
 	echo "Lese ID: $1"
 	$CURL --data "sid=$SID&pbid=$1" http://$FRITZBOXIP:49000/phonebook.lua  > /tmp/curlhelp7.tmp
@@ -213,5 +213,4 @@
 	    if [[ $E = realName ]]; then
 		name=$C
-		#exit
 	    fi
 	    if [[ $E = number* ]]; then
@@ -225,23 +224,22 @@
 
 loadXMLsh4(){
-	echo "Lese ID: $1"
+	local IFS=\> 	
+	echo "Lese ID: $1"	
 	$CURL --data "sid=$SID&pbid=$1" http://$FRITZBOXIP:49000/phonebook.lua  > /tmp/curlhelp7.tmp
-	while read line; do
-		X=`echo $line | grep realName | wc -c`
-		if [[ $X -gt 0 ]]; then
-			#E=`echo $line | cut -d'<' -f2 | cut -d'>' -f1`		
-			C=`echo $line | cut -d'>' -f2 | cut -d'<' -f1`
-			name=$C
-			#echo $name
+	grep "realName\|number " /tmp/curlhelp7.tmp > /tmp/curlhelp7a.tmp
+	 
+	while read line E; do
+		C=`echo $E | cut -d'/' -f2`
+		
+		if [[ $C = realName ]]; then
+			name=`echo $E | cut -d'<' -f1`
 		fi
-		
-		X=`echo $line | grep "number type" | wc -c`
-		if [[ $X -gt 0 ]]; then
+		if [[ $C = number ]]; then			
 			type=`echo $line| cut -d'"' -f2 | sed s/" "//g | sed s/"home"/"privat"/g | sed s/"work"/"geschaeftl."/g | sed s/"mobile"/"mobil"/g `
-			tel=`echo $line | cut -d'>' -f2 | cut -d'<' -f1`
+			tel=`echo $E | cut -d'<' -f1 | sed s/"+49"/"0"/g| sed s/" "//g`
 			echo "$tel#$name->$type"  >> $FRITZBUCH
 		fi
 		    
-	done < /tmp/curlhelp7.tmp
+	done < /tmp/curlhelp7a.tmp
 };
 
@@ -285,5 +283,5 @@
 loadFritzBook () {
  if [ $usePhoneBook = "1" ]; then
-        rm $FRITZBUCH
+        if [ -f $FRITZBUCH ];   then  rm $FRITZBUCH; fi
         if [ ! -f $FRITZBUCH ]; then
             echo "FritzBook new -> $FRITZBUCH"
@@ -291,7 +289,7 @@
             loadFritzBook70
             
-            rm /tmp/curlhelp1.tmp 
-	    rm /tmp/curlhelp7.tmp 
-            
+            if [ -f /tmp/curlhelp1.tmp ];   then  rm /tmp/curlhelp1.tmp; fi
+            if [ -f /tmp/curlhelp7.tmp ];   then  rm /tmp/curlhelp7.tmp; fi
+            if [ -f /tmp/curlhelp7a.tmp ];   then  rm /tmp/curlhelp7a.tmp; fi
         fi
     fi  
