[Freeswitch-users] lua IVR interactivity problem

Peter Hartmann peter at hartmanncomputer.com
Wed Dec 30 20:32:14 MSK 2015


Thanks, Stanislav.  The ESL way looks very cool.



Peter Hartmann
Hartmann Computer Consulting
http://blog.hartmanncomputer.com
(212)203-8870

If I can't explain it to you in plain language, that means I don't
understand it.


On Mon, Dec 28, 2015 at 5:41 PM, Stanislav Sinyagin <ssinyagin at gmail.com> wrote:
> it's much easier to implement the IVR logic via an ESL connection.
> Then you can script it in your preferred programming language and
> perform all necessary database lookups or whatever your application
> requires.
>
> But in both cases (Lua or mod_perl or mod_python or an ESL
> application), you would need to execute playAndGetDigits in order to
> let the user enter DTMF during the playback of the prompt. If you have
> multiple audio files to play back, you just execute playAndGetDigits
> with every audio file in the sequence until the DTMF input is
> detected. You can also build a phrase macro and use it instead.
>
> In case of ESL, you can also subscribe to DTMF events and play audio
> files asynchronously if playAndGetDigits is not sufficient for your
> needs.
>
> Here is a short example in Golang, probably you'll find it useful:
> https://github.com/xlab1/go-fs-secretary-prototype/blob/master/golang/secretary_server.go
>
>
>
>
> On Mon, Dec 28, 2015 at 6:46 PM, Peter Hartmann
> <peter at hartmanncomputer.com> wrote:
>> I'm trying to port an IVR to lua. I'm new to lua by the way.  The big
>> picture: the goal is that the IVR should change based on the output of
>> a shell script.
>>
>> I've followed the basic example over here, substituting my several wav files
>> for the TTS prompts.
>>
>> https://freeswitch.org/confluence/display/FREESWITCH/Lua+Welcome+IVR+example
>>
>> But I've noticed a huge difference between this and the core IVR
>> functionality.  DTMF will not interrupt the prompts, it will only be
>> accepted when the script reaches the session:getDigits line.   It
>> seems like session:playAndGetDigits could be interactive, but it only
>> accepts one wav.  Is there a way for either playAndGetDigits to accept
>> multiple wav files (without concatinating)?  Or otherwise is there a
>> way for a scripted IVR to have this interactive functionality?   Seems
>> like I need to fork the getDigits first and then play the wavs, right?
>>
>> I realize I could probably do the logic in the dialplan and then send
>> the caller to different IVRs, but I'd rather not maintain 2 mostly
>> similar IVRs.
>>
>> Does anyone use a scripting language based IVR and have this solved?
>> Or otherwise have a solution that doesn't involve maintaining 2
>> distinct IVRs?
>>
>> Thanks much
>>
>>
>>
>>
>>
>> Peter Hartmann
>> Hartmann Computer Consulting
>> http://blog.hartmanncomputer.com
>> (212)203-8870
>>
>> If I can't explain it to you in plain language, that means I don't
>> understand it.
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org



Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list