[Freeswitch-users] Running a BASH script within a dialplan

Brian Foster bdfoster at endigotech.com
Fri Jan 20 05:50:00 MSK 2012


Hola,

I'm trying to run a BASH script which turns sends a message to Google's
Transcription API. It's a modified version of the example posted on the
wiki. Here we go:


!. #!/bin/sh
2. sox $1 message.flac pad .1 0 rate 16k
3. wget -q -U "Mozilla/5.0" --post-file message.flac
--header="Content-Type: audio/x-flac; rate=16000" -O - "
http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium" >
message.ret
4. echo "$(cat message.ret | sed 's/.*utterance":"//' | sed
's/","confidence.*//')"
5. rm message.flac
6. rm message.ret
7. # rm $1

Before I stick that in a dialplan, I've been trying to run it within fs_cli
to make sure it works. However, I get:

-ERR no reply

...every time I run it. Is there some fundamental flaw that FreeSWITCH
doesn't recognize as an output? I plan on putting together a few BASH
scripts and a dialplan to basically do the same thing that Mundy has done
with "Siriously".

-BDF
-- 

This message contains confidential information and is intended for those
listed in the "To:", "CC:", and/or "BCC:" fields of the message header.If
you are not the intended recipient you are notified that disclosing,
copying, distributing or taking any action in reliance on the contents of
this information is strictly prohibited. E-mail transmission cannot be
guaranteed to be secure or error-free as information could be intercepted,
corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.
The sender therefore does not accept liability for any errors or omissions
in the contents of this message, which arise as a result of e-mail
transmission. If verification is required please request a hard-copy
version.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120119/b40b392c/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list