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 Launchbox but canh supposed to be used together with Launchbox but can l 93 easily be adjusted for other purposes by adjustingf easily be adjusted for other purposes by adjusting l ! " the handle_string function.!""8 the 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 7l89: 9l;< ;" Author: Dennis Frommknecht<==8 Author: Dennis Frommknecht:>? >l@A @ Contact: dev@maclovin.deABB2 Contact: dev@maclovin.de?CD ClDEF ElGH G  Version: 0.1 - 2009/05/17HII4 Version: 0.1 - 2009/05/17FJK JlKLM LlMNO NlOPQ PlRS R Setup parameters:STT$ Setup parameters:QUV UlVWX WlXYZ Yl[\ [ country code\]] country codeZ^_ ^j` 0 countryprefix countryPrefix `maabb+49_cd clef e Fritzbox passwordfgg$ Fritzbox passworddhi hjj 0 fbpassword fbPassword jmkkllYOUR_PASSWORDimn mlop o! Phoneport used for callingpqq6 Phoneport used for callingnrs rjt 0 phoneport phonePort tmuuvv FON 2swx wlyz y/) number of seconds trying to reach numberz{{R number of seconds trying to reach numberx|} |j ~ 0 hangupdelay hangupDelay ~m } l 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 command to Fritzbox2 send command to Fritzbox i I 0 fbsendcommand fbSendCommand o 0postdatapostData k  r b b mXcurl -d "getpage=../html/de/menus/menu2.html o 0postdatapostData m@" http://fritz.box/cgi-bin/webcm o 0cmd I  .sysoexecTEXTTEXT o 0cmd l l  authenticate at Fritzbox2 authenticate at Fritzbox i   I 0fbloginfbLogin   o 0pwd  k r b b mH&var:lang=de&login:command/password= o~ ~0pwd mB&telcfg:settings/UseClickToDial=1 o} }0postdatapostData| I{z {0 fbsendcommand fbSendCommandy o x x0postdatapostDatayz|  lwvuwvu !  lt"#t "*$ dial the number with specified port#$$H dial the number with specified port!%& %i'( 'Is)r s0 fbdialnumber fbDialNumber)*+ *oq q0 thenumber theNumber+,p ,oo o0theportthePortpr (k--./ .r01 0In2m n0 formatnumber formatNumber23l 3ok k0 thenumber theNumberlm 1oj j0 thenumber theNumber/45 4r 67 6b 89 8b :; :b <= <m >>??&var:lang=de&telcfg:settings/UseClickToDial=1&telcfg:command/Dial= =o i i0 thenumber theNumber ;m @@AA4&telcfg:settings/DialPort= 9oh h0theportthePort 7og g0postdatapostData5BC BlfedfedCDc DIbEa b0 fbsendcommand fbSendCommandEF` Fo_ _0postdatapostData`ac&GH Gl^]\^]\HIJ Il[KL[ K(" give up trying to call the numberLMMD give up trying to call the numberJNO NiPQ PIZRY Z 0fbhangupnumberfbHangupNumberRST SoX X0 thenumber theNumberTUW UoV V0theportthePortWY QkVVWX WrYZ YIU[T U0 formatnumber formatNumber[\S \oR R0 thenumber theNumberST ZoQ Q0 thenumber theNumberX]^ ]r _` _b ab ab cd cb ef em gghh&var:lang=de&telcfg:settings/UseClickToDial=1&telcfg:command/Hangup= fo P P0 thenumber theNumber dm iijj4&telcfg:settings/DialPort= boO O0theportthePort `oN N0postdatapostData^kl klMLKMLKlmJ mIInH I0 fbsendcommand fbSendCommandnoG ooF F0postdatapostDataGHJOpq plEDCEDCqrs rlBtuB t& entry point for Launchbox callsuvv@ entry point for Launchbox callsswx wi #yz yIA{@ A0 handle_string{|? |o> >0s?@ zkS}}~ ~Z=< C o; ;0s mtel: k r n 7: : ctxt m 99 m88 o7 70s o6 60s5 l44 +% trims the URL's "tel:" scheme prefixJ trims the URL's "tel:" scheme prefix5=< l321321 I$0/ 00fbloginfbLogin. o - -0 fbpassword fbPassword./ I%0,+ ,0 fbdialnumber fbDialNumber o&'* *0s) o',( (0 phoneport phonePort)+ l11'&%'&% O1= k5< l55$$ 3- display it in large type (needs Launchbox 5)Z display it in large type (needs Launchbox 5)# I5<"! ".odlbltypnullctxt b58 m56Dialing o67 0s!# m12ODLBalisX Macintosh HDŪ H+ LaunchBar.app&| Applicationsũ_ 'Macintosh HD:Applications:LaunchBar.app LaunchBar.app Macintosh HDApplications/LaunchBar.app/ l>> I>G .sysodelanullnmbr o>C 0 hangupdelay hangupDelay IHS  0fbhangupnumberfbHangupNumber oIJ 0s oJO 0 phoneport phonePortx l aku  0 countryprefix countryPrefix 0 fbpassword fbPassword 0 phoneport phonePort 0 hangupdelay hangupDelay 0 formatnumber formatNumber 0 fbsendcommand fbSendCommand 0fbloginfbLogin 0 fbdialnumber fbDialNumber  0fbhangupnumberfbHangupNumber 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 0 fbsendcommand fbSendCommand 0postdatapostData 0postdatapostData 0cmd .sysoexecTEXTTEXT%%EOj   0fbloginfbLogin 0pwd 0pwd 0postdatapostData 0 fbsendcommand fbSendCommand%%EO*k+( 0 fbdialnumber fbDialNumber 0 thenumber theNumber 0theportthePort 0 thenumber theNumber 0theportthePort 0postdatapostData>@ 0 formatnumber formatNumber 0 fbsendcommand fbSendCommand*k+EO%%%EO*k+Q 0fbhangupnumberfbHangupNumber 0 thenumber theNumber 0theportthePort 0 thenumber theNumber 0theportthePort 0postdatapostDatagi 0 formatnumber formatNumber 0 fbsendcommand fbSendCommand*k+EO%%%EO*k+z 0 handle_string 0s 0s   ctxt 0fbloginfbLogin 0 fbdialnumber fbDialNumber .odlbltypnullctxt .sysodelanullnmbr 0fbhangupnumberfbHangupNumberT[\[Z\Zi2EOPYhO*bk+O*bl+O %j UObj O*bl+ ascr ޭ