Jonathan H
2017-Dec-06 23:25 UTC
[asterisk-users] Simple speech recognition for driving IVR - "press or say one".
Thanks for your responses - it looks like I have the following options, in order of ease: 1: Modify and recompile app_record.c Change line 471 https://github.com/asterisk/asterisk/blob/master/apps/app_record.c#L471 from status_response = "DTMF"; to status_response = dtmf_integer; Pro: Free, easy Con: Have to remember to edit module each time a new Asterisk update comes out 2: Use the Jean Aunis "mix ARI and AGI" trick. Pro: Doesn't need recompiling on each Asterisk release. Con: A bit of fiddling and requires an ARI library. 3: Pay $50 for uniMRCP module Pro: Does what I need to do Con: $50 per channel. Requires account. Lots of setup to basically add DTMF to the speech recognition I'm already doing. Yes? No? None of the above? Other?! On 6 December 2017 at 14:54, Jurijs Ivolga <jurijs.ivolga at gmail.com> wrote:> Hi, > > Please check code of it. It listens for # and it is quite easy to add all > other keys 1-9 and etc.... > > Then change code accordingly so script returns value of key. > > As far as I remember it wasn't hard. > > With kind regards, > > > Jurijs > > On Wed, Dec 6, 2017 at 4:50 PM, Jonathan H <lardconcepts at gmail.com> wrote: >> >> Thanks Jurijs, >> >> Yes, in fact I'm already using that, and it works fine. The problem >> here is that I cannot find a way of recording speech AND listening for >> a DTMF digit being pressed as an alternative. >> >> That's where the problem lies. >> >> J. >> >> -- >> _____________________________________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> Check out the new Asterisk community forum at: >> https://community.asterisk.org/ >> >> New to Asterisk? Start here: >> https://wiki.asterisk.org/wiki/display/AST/Getting+Started >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users > > > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: > https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
Jonathan H
2017-Dec-10 21:51 UTC
[asterisk-users] Simple speech recognition for driving IVR - "press or say one".
Hang on, all of the fiddling in this thread seems remarkably over-complicating what should be an incredibly simple task. We know that a DTMF keypress interrupted the recording. We also know that app_record.c knows which keypress it was from * \param dtmf_integer the integer value of the DTMF key received as in static enum dtmf_response record_dtmf_response(struct ast_channel *chan, struct ast_flags *flags, int dtmf_integer, int terminator) For reasons which have me scratching my head, app_record turns a useful DTMF value into a rather meaningless "DTMF" in the RECORD_STATUS variable. But SOMETHING must be floating around in Asterisk for app_record.c to know what number was pushed. If I'm using RFC2833, is there ANY way of getting that last keypress. In other words: "The user pressed a number, recording stopped, now what was that number?" - WITHOUT rewriting and recompiling a core application or doing any complex workaround? Thanks On 6 December 2017 at 23:25, Jonathan H <lardconcepts at gmail.com> wrote:> Thanks for your responses - it looks like I have the following > options, in order of ease: > > 1: Modify and recompile app_record.c > > Change line 471 > https://github.com/asterisk/asterisk/blob/master/apps/app_record.c#L471 > from > status_response = "DTMF"; > to > status_response = dtmf_integer; > > Pro: Free, easy > Con: Have to remember to edit module each time a new Asterisk update comes out > > 2: Use the Jean Aunis "mix ARI and AGI" trick. > Pro: Doesn't need recompiling on each Asterisk release. > Con: A bit of fiddling and requires an ARI library. > > 3: Pay $50 for uniMRCP module > Pro: Does what I need to do > Con: $50 per channel. Requires account. Lots of setup to basically add > DTMF to the speech recognition I'm already doing. > > Yes? No? None of the above? Other?! > > On 6 December 2017 at 14:54, Jurijs Ivolga <jurijs.ivolga at gmail.com> wrote: >> Hi, >> >> Please check code of it. It listens for # and it is quite easy to add all >> other keys 1-9 and etc.... >> >> Then change code accordingly so script returns value of key. >> >> As far as I remember it wasn't hard. >> >> With kind regards, >> >> >> Jurijs >> >> On Wed, Dec 6, 2017 at 4:50 PM, Jonathan H <lardconcepts at gmail.com> wrote: >>> >>> Thanks Jurijs, >>> >>> Yes, in fact I'm already using that, and it works fine. The problem >>> here is that I cannot find a way of recording speech AND listening for >>> a DTMF digit being pressed as an alternative. >>> >>> That's where the problem lies. >>> >>> J. >>> >>> -- >>> _____________________________________________________________________ >>> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >>> >>> Check out the new Asterisk community forum at: >>> https://community.asterisk.org/ >>> >>> New to Asterisk? Start here: >>> https://wiki.asterisk.org/wiki/display/AST/Getting+Started >>> >>> asterisk-users mailing list >>> To UNSUBSCRIBE or update options visit: >>> http://lists.digium.com/mailman/listinfo/asterisk-users >> >> >> >> -- >> _____________________________________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> Check out the new Asterisk community forum at: >> https://community.asterisk.org/ >> >> New to Asterisk? Start here: >> https://wiki.asterisk.org/wiki/display/AST/Getting+Started >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users
Joshua Colp
2017-Dec-10 23:38 UTC
[asterisk-users] Simple speech recognition for driving IVR - "press or say one".
On Sun, Dec 10, 2017, at 05:51 PM, Jonathan H wrote:> Hang on, all of the fiddling in this thread seems remarkably > over-complicating what should be an incredibly simple task. > > We know that a DTMF keypress interrupted the recording. We also know > that app_record.c knows which keypress it was from > > * \param dtmf_integer the integer value of the DTMF key received > > as in > > static enum dtmf_response record_dtmf_response(struct ast_channel > *chan, struct ast_flags *flags, int dtmf_integer, int terminator) > > For reasons which have me scratching my head, app_record turns a > useful DTMF value into a rather meaningless "DTMF" in the > RECORD_STATUS variable.When originally added it was only possible to terminate based on a termination DTMF, so you'd know which DTMF key was used because no other DTMF would stop. Afterwards a community member contributed a change[1] to add an option to allow any DTMF key to terminate it, but the dialplan variable stuff was not extended to make the knowledge of which DTMF was used available.> But SOMETHING must be floating around in Asterisk for app_record.c to > know what number was pushed. If I'm using RFC2833, is there ANY way of > getting that last keypress. > > In other words: "The user pressed a number, recording stopped, now > what was that number?" - WITHOUT rewriting and recompiling a core > application or doing any complex workaround?Within the code f->subclass.integer is where the DTMF digit is. You'd need to make a code change to set another dialplan variable which contains it. [1] https://issues.asterisk.org/jira/browse/ASTERISK-14380 -- Joshua Colp Digium, Inc. | Senior Software Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - US Check us out at: www.digium.com & www.asterisk.org