Index: /ipk/source.sh4/titanswaptools_callmonitor/var/swap/titanplugins/callmonitor1/fritzbox_msg_new.sh
===================================================================
--- /ipk/source.sh4/titanswaptools_callmonitor/var/swap/titanplugins/callmonitor1/fritzbox_msg_new.sh	(revision 20763)
+++ /ipk/source.sh4/titanswaptools_callmonitor/var/swap/titanplugins/callmonitor1/fritzbox_msg_new.sh	(revision 20764)
@@ -209,4 +209,6 @@
 	 	#rm $FRITZBUCH
 	 	if [ ! -f $FRITZBUCH ]; then
+	 	 
+	 	 if [ -z $FritzVersion ] || [ $FritzVersion -lt 50 ]; then
 	 	 	# Challenge abholen
 			echo "Challenge abholen start"
@@ -285,5 +287,85 @@
 				rm /tmp/curlhelp.tmp
 			fi
-
+		 
+		 else
+		 	
+			#Fritzbox Version > 50
+			
+		 	Challenge=`wget -O - "http://$FRITZBOXIP/login_sid.lua" 2>/dev/null | grep Challenge | cut -d"<" -f6 | cut -d">" -f2`
+			Passwd="$FritzPass"
+			# login aufbauen und hashen
+			echo "login aufbauen und hashen start"
+			CPSTR="$Challenge-$Passwd"
+			MD5=`echo -n $CPSTR | $ICONV -f ISO8859-1 -t UTF-16LE > /tmp/helpx; md5sum /tmp/helpx | awk '{print substr($0,1,32)}'`
+			RESPONSE="$Challenge-$MD5"
+
+			POSTDATA="username=$FritzUser&response=$RESPONSE"
+
+			SID=`wget -O - --post-data="$POSTDATA" "http://$FRITZBOXIP/login_sid.lua" 2>/dev/null  | grep SID | cut -d"<" -f4 | cut -d">" -f2`
+
+			echo "login aufbauen und hashen ende"
+
+			$CURL --data "sid=$SID" http://$FRITZBOXIP/fon_num/fonbook_select.lua  > /tmp/curlhelp.tmp
+
+			BOOKID=`cat curlhelp.tmp | grep '<label for="uiBookid' | grep ritzcall | cut -d: -f2 | cut -d'"' -f1`
+			if [ -z "$BOOKID" ]; then
+				BOOKID=0
+			fi
+
+			$CURL --data "bookid=$BOOKID&sid=$SID" http://$FRITZBOXIP/fon_num/fonbook_list.lua  | grep "<td class=\"tname\" title=" | sed s/'class="tname" '/"\nfritztele<"/  | sed s/">"/"<"/g | sed s/"'"//g | sed s/'"'//g | sed s/"&amp;"/"+"/g > /tmp/curlhelp3.tmp
+
+			while read line 
+				do
+					nummer1="0"
+					nummer2="0"
+					nummer3="0"
+					nummer4="0"
+					pos1=11
+					pos2=0
+					pos3=0
+					art=`echo $line | cut -d'<' -f1`
+					if [ ! -z $art ] && [ $art = "fritztele" ]; then
+						name=`echo $line | cut -d'<' -f2 | sed s/"title="//g`
+						nummer1=`echo $line | cut -d'<' -f7`
+						help=`echo $line | cut -d'<' -f8`
+						if [ $help = "br" ]; then
+							nummer2=`echo $line | cut -d'<' -f9`
+							pos1=13
+							pos2=15
+							help=`echo $line | cut -d'<' -f10`
+							if [ $help = "br" ]; then
+								nummer3=`echo $line | cut -d'<' -f11`
+								pos1=15
+								pos2=17
+								pos3=19
+								help=`echo $line | cut -d'<' -f12`
+								if [ $help = "br" ]; then
+									nummer4=`echo $line | cut -d'<' -f13`
+									pos1=17
+									pos2=19
+									pos3=21
+									pos4=23
+								fi
+							fi
+						fi
+						if [ $nummer1 != "0" ]; then
+							typ=`echo $line | cut -d'<' -f$pos1`
+							echo "$nummer1#$name - $typ" >> $FRITZBUCH
+						fi
+						if [ $nummer2 != "0" ]; then
+							typ=`echo $line | cut -d'<' -f$pos2`
+							echo "$nummer2#$name - $typ" >> $FRITZBUCH
+						fi
+						if [ $nummer3 != "0" ]; then
+							typ=`echo $line | cut -d'<' -f$pos3`
+							echo "$nummer3#$name - $typ" >> $FRITZBUCH
+						fi
+						if [ $nummer4 != "0" ]; then
+							typ=`echo $line | cut -d'<' -f$pos4`
+							echo "$nummer3#$name - $typ" >> $FRITZBUCH
+						fi
+					fi
+			done < /tmp/curlhelp3.tmp
+		 fi	
 		fi
 		cp $FRITZBUCH $FRITZCACHE
