<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html><head><meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
<style>BODY{font:10pt Tahoma, Verdana, sans-serif}</style></head><body>
<DIV>You can't do it all in XML, you need to use scripting or a module. You need to respond to the input events for the session. Look at the Pizza example.</DIV>
<DIV>&nbsp;</DIV>
<DIV>--Dave</DIV><BR>
<BLOCKQUOTE style="BORDER-LEFT: #0000ff 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<HR>
<B>From:</B> Chad Engler [mailto:Chad.Engler@patlive.com]<BR><B>To:</B> FreeSWITCH Users Help [mailto:freeswitch-users@lists.freeswitch.org]<BR><B>Sent:</B> Tue, 12 Feb 2013 12:42:52 -0800<BR><B>Subject:</B> [Freeswitch-users] mod_pocketsphinx dialplan example<BR><BR>
<DIV class=WordSection1>
<P class=MsoNormal>I'm looking for a good example of doing speech detection in a dialplan, and I can't find one.</P>
<P class=MsoNormal>&nbsp;</P>
<P class=MsoNormal>Right now I am trying:</P>
<P class=MsoNormal>&nbsp;</P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal>&lt;include&gt;</P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal>&nbsp; &lt;extension name="dot_license"&gt;</P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal>&nbsp;&nbsp;&nbsp; &lt;condition field="destination_number" expression="^dot_license$"/&gt;</P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal>&nbsp;&nbsp;&nbsp; &lt;condition field="${module_exists(mod_pocketsphinx)}" expression="true"&gt;</P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="answer"/&gt;</P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="sleep" data="1000"/&gt;</P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="speak" data="flite|kal|Say the license number"/&gt;</P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action application="detect_speech" data="pocketsphinx dot_license dot_license"/&gt;</P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal>&nbsp;&nbsp;&nbsp; &lt;/condition&gt;</P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal>&nbsp; &lt;/extension&gt;</P>
<P style="MARGIN-LEFT: 0.5in" class=MsoNormal>&lt;/include&gt;</P>
<P class=MsoNormal>&nbsp;</P>
<P class=MsoNormal>But after enabling speech detection it just hangs up. How can I let the caller respond and collect/use the result from a dialplan?</P>
<P class=MsoNormal>&nbsp;</P>
<P class=MsoNormal>Thanks,</P>
<P class=MsoNormal>&nbsp;</P>
<P class=MsoNormal><B><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: navy; FONT-SIZE: 10pt">Chad Engler</SPAN></B></P>
<P class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: gray; FONT-SIZE: 10pt">Telephony Programmer</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial Black','sans-serif'; COLOR: gray; FONT-SIZE: 10pt">PATLive</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: gray; FONT-SIZE: 10pt">1.800.775.7790 x746</SPAN></P>
<P class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: gray; FONT-SIZE: 10pt"><A href="mailto:chad.engler@patlive.com"><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: gray">chad.engler@patlive.com</SPAN></A></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: gray; FONT-SIZE: 10pt"></SPAN>&nbsp;</P>
<P class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: gray; FONT-SIZE: 10pt">Hosted Communications | Friendly Service&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #4067cd; FONT-SIZE: 10pt"><A href="http://www.patlive.com/"><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #4067cd">www.patlive.com</SPAN></A></SPAN><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: gray; FONT-SIZE: 10pt"></SPAN></P>
<P class=MsoNormal>&nbsp;</P></DIV></BLOCKQUOTE>
<STYLE>
 @font-face {font-family:"Arial Black";panose-1:2 11 10 4 2 1 2 2 2 4;}
 p.MsoNormal,li.MsoNormal,div.MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";}
 a:link,span.MsoHyperlink {mso-style-priority:99;color:blue;text-decoration:underline;}
 a:visited,span.MsoHyperlinkFollowed {mso-style-priority:99;color:purple;text-decoration:underline;}
 span.EmailStyle17 {mso-style-type:personal-compose;font-family:"Calibri","sans-serif";color:windowtext;}
 .MsoChpDefault {mso-style-type:export-only;}
 @page WordSection1 {size:8.5in 11.0in;margin:1.0in 1.0in 1.0in 1.0in;}
 div.WordSection1 {page:WordSection1;}
</STYLE>

<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV></body></html>