On Thu, 01 Dec 2011 17:23:59 +0000
Kingsley Tart <[email protected]> wrote:

> Hi. Aside from converting spaces to plus signs, you don't encode any
> special characters before putting them in the URL. It might be safer
> to run $line through some sort of encoding before calling Google with
> it, even if most special characters probably don't result in any
> sound. Google say "and" if you give it an ampersand, but unescaped
> you couldn't include that in the string.
> 
> You may decide to have an option to locally cache pre-produced sound
> files in case that phrase is used again.
> 
> Cheers,
> Kingsley.
> 

Thanks for the suggestion. Ther's already some sort of input sanitation:
 $AGI{arg_1} =~ s/[\\\/|*~<>^\(\)\[\]\{\}\n\r]/ /g;
that strips most special characters but i guess it needs some more work.
As for the caching the script supports it already, its enabled by
default and controlled by these 2 variables in the script:
 $usecache   = 1;
 $cachedir   = "/tmp";
Voice data gets stored in the cachedir for future use so we don't have
to fetch it from google each time.

----------------
Lefteris Zafiris

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to