[COLOR=#942192][FONT=Menlo]
[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo]
[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo]property phoneURL : "http://192.168.xx.xx"[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo]on run {input, parameters}[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] [/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] set theNumber to filter(input as text)[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] do shell script "curl -d xml=\"<AastraIPPhoneExecute><ExecuteItem URI=\\\"Dial:" & theNumber & "\\\"/></AastraIPPhoneExecute>\" " & phoneURL[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] [/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] [/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] return input[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo]end run[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo]
[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo]on filter(theNumber)[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] set newNumber to ""[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] repeat with c in every character of theNumber[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] if "+01234567890" contains c then[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] set newNumber to newNumber & c[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] --display dialog newNumber[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] end if[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] end repeat[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] if newNumber contains "+49" then[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] set newNumber to "0" & text 4 through -1 of newNumber[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] end if[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] if character 1 of newNumber is equal to "+" then set newNumber to "00" & text 2 through -1 of newNumber[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] [/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo] return newNumber[/FONT][/COLOR]
[COLOR=#942192][FONT=Menlo]end filter
[/FONT][/COLOR]