FasdUAS 1.101.10 k l :4 Using Launchbox to dial a phone number via Fritzbox  h Using Launchbox to dial a phone number via Fritzbox l       l <6 This script dials phone number via the Fritzbox. It'sl This script dials phone number via the Fritzbox. It's l :4 supposed to be used together with Launchbar but canh supposed to be used together with Launchbar but can l 93 easily be used for other purposes by adjusting thef easily be used for other purposes by adjusting the l !  handle_string function.!""0 handle_string function.#$ #l%& %A; It's mainly based on a script by Christian Felder found at&''v It's mainly based on a script by Christian Felder found at$() (l*+ *LF http://www.cybton.com/view_thread,FritzBox+_+lwp_request,26152,1.html+,, http://www.cybton.com/view_thread,FritzBox+_+lwp_request,26152,1.html)-. -l/0 /=7 and the example script for dialing with Skype from the011n and the example script for dialing with Skype from the.23 2l45 4 Launchbox help.566 Launchbox help.378 7l9: 9B< The login procedure with SID authentication was copied from:;;x The login procedure with SID authentication was copied from8<= <l>? > http://wehavemorefun.de/fritzbox/Hilfsprogramme_/_Tipps_&_Tricks#Anrufliste_von_der_Box_holen_.28Beispiel_f.C3.BCr_neues_Loginverfahren_mit_SID.29?@@& http://wehavemorefun.de/fritzbox/Hilfsprogramme_/_Tipps_&_Tricks#Anrufliste_von_der_Box_holen_.28Beispiel_f.C3.BCr_neues_Loginverfahren_mit_SID.29=AB AlBCD ClEF E" Author: Dennis FrommknechtFGG8 Author: Dennis FrommknechtDHI HlJK J Contact: dev@maclovin.deKLL2 Contact: dev@maclovin.deIMN MlNOP OlQR Q  Version: 0.1 - 2009/05/17RSS4 Version: 0.1 - 2009/05/17PTU TlUVW VlXY X Changelog:YZZ Changelog:W[\ [l]^ ] 0.1 - 2009/05/17^__" 0.1 - 2009/05/17\`a `lbc b * initial releasecdd* * initial releaseaef elgh g 0.2 - 2010/02/04hii" 0.2 - 2010/02/04fjk jllm l\V * adjusted to new login procedure (thx to Christopher Fseschi for the bug report)mnn * adjusted to new login procedure (thx to Christopher Fseschi for the bug report)kop olpqr qlrst sltuv ulwx w Setup parameters:xyy$ Setup parameters:vz{ zl{|} |l}~ ~l  country code country code j 0 countryprefix countryPrefix m+49 l  Fritzbox password$ Fritzbox password j 0 fbpassword fbPassword mYOUR_PASSWORD l ! Phoneport used for calling6 Phoneport used for calling j 0 phoneport phonePort m FON 2 l /) number of seconds trying to reach numberR number of seconds trying to reach number j 0 hangupdelay hangupDelay m  l l  Format phone number( Format phone number l (" remove spaces and convert + to 00D remove spaces and convert + to 00 i  I 0 formatnumber formatNumber o 0 thestring theString ke r m o 0 thenumber theNumber l Z+ C o 0 thestring theString o 0 countryprefix countryPrefix k' r# n! 7!  ctxt l [ l n 1  leng o 0 countryprefix countryPrefix m m  o 0 thestring theString o 0 thestring theString r$' m$%0 o 0 thenumber theNumber l,, Y,b k9] r9? n9= 4:=  cha o;< 0i o9: 0 thestring theString o 0c l@@ Z@] =@C o@A 0c mAB+ rFK bFI oFG 0 thenumber theNumber mGH00 o 0 thenumber theNumber ENQ mNO0123456789 oOP 0c rTY bTW oTU 0 thenumber theNumber oUV 0c o 0 thenumber theNumber 0i m/0 l04 n04 113  leng o01 0 thestring theString Lce ocd 0 thenumber theNumber l    l    +% send dial/hangup command to Fritzbox J send dial/hangup command to Fritzbox  i I &0fbsenddialcommandfbSendDialCommand o 0command o 0 thenumber theNumber o 0thesidtheSID k& r I 0 formatnumber formatNumber o 0 thenumber theNumber o 0 thenumber theNumber !  r "# "b $% $b &' &b () (b *+ *b ,- ,b ./ .b 01 0b 23 2m 4455curl -d "getpage=../html/de/menus/menu2.html&var:lang=de&telcfg:settings/UseClickToDial=1&telcfg:command/ 3o ~ ~ 0command 1m 6677= /o} }0 thenumber theNumber -m8899 &sid= +o| |0thesidtheSID )m::;;4&telcfg:settings/DialPort= 'o{ {0 phoneport phonePort %m<<==@" http://fritz.box/cgi-bin/webcm #oz z0cmd!>y >I!&x?w x.sysoexecTEXTTEXT ?o!"v v0cmdwy@A @lutsutsABC BlrDEr D get Fritzbox SIDEFF" get Fritzbox SIDCGH GiIJ IIqKp q0 getfritzsid getFritzSIDKLo Lon n0pwdop Jk0MMNO NrPQ PImRl m.sysoexecTEXTTEXT RmSSTTFcurl "http://fritz.box/cgi-bin/webcm?getpage=../html/login_sid.xml" 2>/dev/null| grep Challenge | awk '{match($0,/>[^<>]+</); print substr($0,RSTART+1,RLENGTH-2)}'l Qok k 0 challengeOUV UrWX WIjYi j.sysoexecTEXTTEXT YbZ[ Zb\] \b ^_ ^b `a `m bbcc/bin/echo -n ao h h 0 challenge _m ddee- ]o g g0pwd [mffgg| iconv -f ISO8859-1 -t UTF-16LE | md5 | awk '{print substr($0,1,32)}'i Xof f0md5Vhi hr!jk jblm lbno nbpq pmrrssvgetpage=../html/de/menus/menu2.html&login:command/response= qoe e 0 challenge omttuu- mod d0md5 koc c0postdatapostDataivw vr"-xy xI"+bza b.sysoexecTEXTTEXT zb"'{| {b"%}~ }m"#curl -d " ~o#$` `0postdatapostData |m%&(" http://fritz.box/cgi-bin/webcm 2>/dev/null| grep "name=\"sid\"" | head -1 | awk '{match($0,/value="[^"]+"/); print substr($0,RSTART+7,RLENGTH-8)}'a yo_ _0thesidtheSIDw^ L.0 o./] ]0thesidtheSID^H l\[Z\[Z lYY & entry point for Launchbox calls@ entry point for Launchbox calls i IXW X0 handle_stringV oU U0sVW kO ZTS C oR R0s mtel: k r n 7Q Q ctxt m PP mOO oN N0s oM M0sL lKK +% trims the URL's "tel:" scheme prefixJ trims the URL's "tel:" scheme prefixLTS lJIHJIH r& I$GF G0 getfritzsid getFritzSIDE o D D0 fbpassword fbPasswordEF oC C0thesidtheSID l''BA@BA@ I'/?> ?&0fbsenddialcommandfbSendDialCommand m()Dial o)*= =0s< o*+; ;0thesidtheSID<> l00:98:98 O0< k4; l4477 3- display it in large type (needs Launchbox 5)Z display it in large type (needs Launchbox 5)6 I4;54 5.odlbltyp******** b47 m45Dialing o563 30s46 m01r@alis Macintosh HDGH+$ LaunchBar.appA G LaunchBar.app Macintosh HDApplications/LaunchBar.app/ l==210210 I=F/. /.sysodelanullnmbr o=B- -0 hangupdelay hangupDelay., IGO+* +&0fbsenddialcommandfbSendDialCommand mHI Hangup oIJ) )0s( oJK' '0thesidtheSID(*,& l%$#%$#& "!"  0 countryprefix countryPrefix 0 fbpassword fbPassword 0 phoneport phonePort 0 hangupdelay hangupDelay 0 formatnumber formatNumber &0fbsenddialcommandfbSendDialCommand 0 getfritzsid getFritzSID 0 handle_string! 0 formatnumber formatNumber 0 thestring theString 0 thestring theString 0 thenumber theNumber 0i 0c  ctxt  leng  cha fEOb[\[Zb,k\Zi2EOEYhO5k,Ekh/EO %EY %EYh[OYO   &0fbsenddialcommandfbSendDialCommand   0command 0 thenumber theNumber 0thesidtheSID   0command 0 thenumber theNumber 0thesidtheSID 0cmd468:< 0 formatnumber formatNumber .sysoexecTEXTTEXT'*k+EO%%%%%%b%%EOj J 0 getfritzsid getFritzSID 0pwd 0pwd 0 challenge 0md5 0postdatapostData 0thesidtheSID Sbdfrt .sysoexecTEXTTEXT1j EO%%%%j EO%%%EO%%j EO 0 handle_string 0s 0s 0thesidtheSID   ctxt 0 getfritzsid getFritzSID &0fbsenddialcommandfbSendDialCommand .odlbltyp******** .sysodelanullnmbrP[\[Z\Zi2EOPYhO*bk+EO*䠡m+O %j UObj O*ꠡm+ascr ޭ