Trying to do a lua-based bit of IVR and inexplicably struggling with this bit. Maybe something to do with use of variables in session:playAndGetDigits or possibly the regexp? destnum = getDestNumber() session:execute("log", "INFO User dialled "..destnum) confPrompt = "say:'Now calling telephone number "..destnum.."'" session:execute("log", "INFO Confirming with "..confPrompt) confirmkey = session:playAndGetDigits(0, 1, 1, 1000, "#", confPrompt, "", "\\d|\\*") session:execute("log", "INFO mcm.lua Number confirm (not) interrupted with "..confirmkey.." mcmoption="..mcmoption) if confirmkey == "*" then -- return to call break end session:execute("transfer","-bleg "..destnum.." XML dp"..tenant_id) The problem is with confirmkey = session:playAndGetDigits(0, 1, 1, 1000, "#", confPrompt, "", "\\d|\\*") It complains of "Invalid Args" (and doesn't say anything). All it has to do is read out the number that it's intending to call, allowing the user to change their mind by hitting *. Logfile reports: 2012-06-18 14:00:22.975225 [INFO] mod_dptools.c:1444 mcm2.lua getDestNumber 2012-06-18 14:00:22.975225 [DEBUG] switch_ivr_play_say.c:1309 Codec Activated L16@8000hz 1 channels 20ms 2012-06-18 14:00:26.035180 [DEBUG] switch_rtp.c:3457 RTP RECV DTMF 1:1040 2012-06-18 14:00:26.035180 [DEBUG] switch_ivr_play_say.c:1682 done playing file /home/oev/fs-pabx/prompts/dmsb12_mcm3.wav 2012-06-18 14:00:26.205278 [DEBUG] switch_rtp.c:3457 RTP RECV DTMF 2:720 2012-06-18 14:00:26.605240 [DEBUG] switch_rtp.c:3457 RTP RECV DTMF 3:1040 2012-06-18 14:00:27.415292 [DEBUG] switch_rtp.c:3457 RTP RECV DTMF #:1120 2012-06-18 14:00:27.415292 [DEBUG] switch_ivr_play_say.c:2026 Test Regex [123][\d+] EXECUTE sofia/internal/898000000000202074904605@193.105.54.10 log(INFO User dialled 123) 2012-06-18 14:00:27.415292 [INFO] mod_dptools.c:1444 User dialled 123 EXECUTE sofia/internal/898000000000202074904605@193.105.54.10 log(INFO Confirming with say:'Now calling telephone number 123') 2012-06-18 14:00:27.415292 [INFO] mod_dptools.c:1444 Confirming with say:'Now calling telephone number 123' 2012-06-18 14:00:27.415292 [ERR] switch_ivr_play_say.c:1174 Invalid Args EXECUTE sofia/internal/898000000000202074904605@193.105.54.10 log(INFO mcm.lua Number confirm (not) interrupted with mcmoption=8) 2012-06-18 14:00:28.425260 [INFO] mod_dptools.c:1444 mcm.lua Number confirm (not) interrupted with mcmoption=8 EXECUTE sofia/internal/898000000000202074904605@193.105.54.10 transfer(-bleg 123 XML dp0)
The problem is with confirmkey = session:playAndGetDigits(0, 1, 1, 1000, "#", confPrompt, "", "\\d|\\*")
It complains of "Invalid Args" (and doesn't say anything). All it has to
do is read out the number that it's intending to call, allowing the user to change their mind by hitting *.
You can't have an argument of "0" for the minimum number of digits. See this page for details on play_and_get_digits args: http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_play_and_get_digits -MC
Uhm I thought I just wrote code that did that last week in lua. Seemed to work GREAT. if(phone_required==true) then ... else phone_min=0 --no minimum on the match length end phone=session:playAndGetDigits(phone_min, phone_max, 3, 20000, "#", "phrase:cc_phone_prompt:"..phone_skip, "phrase:cc_invalid_entry","\\d{"..phone_min..","..phone_max.."}"); -Avi On Mon, Jun 18, 2012 at 5:55 PM, Michael Collins <msc@freeswitch.org> wrote:
The problem is with confirmkey = session:playAndGetDigits(0, 1, 1, 1000, "#", confPrompt, "", "\\d|\\*")
It complains of "Invalid Args" (and doesn't say anything). All it has to
do is read out the number that it's intending to call, allowing the user to change their mind by hitting *.
You can't have an argument of "0" for the minimum number of digits. See this page for details on play_and_get_digits args: http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_play_and_get_digits
-MC
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
But but but the wiki says! The wiki just CAN'T be wrong! ;) Actually, according to switch_ivr_play_say.c it looks like you can have a min_digits of "0". Still, I'd make the min digits "1" unless there's a compelling reason to want zero digits. -MC On Mon, Jun 18, 2012 at 8:00 AM, Avi Marcus <avi@avimarcus.net> wrote:
Uhm I thought I just wrote code that did that last week in lua. Seemed to work GREAT.
if(phone_required==true) then ... else phone_min=0 --no minimum on the match length end phone=session:playAndGetDigits(phone_min, phone_max, 3, 20000, "#", "phrase:cc_phone_prompt:"..phone_skip, "phrase:cc_invalid_entry","\\d{"..phone_min..","..phone_max.."}");
-Avi
On Mon, Jun 18, 2012 at 5:55 PM, Michael Collins <msc@freeswitch.org>wrote:
The problem is with confirmkey = session:playAndGetDigits(0, 1, 1, 1000, "#", confPrompt, "", "\\d|\\*")
It complains of "Invalid Args" (and doesn't say anything). All it has to
do is read out the number that it's intending to call, allowing the user to change their mind by hitting *.
You can't have an argument of "0" for the minimum number of digits. See this page for details on play_and_get_digits args: http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_play_and_get_digits
-MC
For me there was. "enter the value or press # to skip" because it's optional... seems a very possible use-case. It's an IVR for gathering information, not navigating a menu. -Avi On Mon, Jun 18, 2012 at 6:09 PM, Michael Collins <msc@freeswitch.org> wrote:
But but but the wiki says! The wiki just CAN'T be wrong! ;) Actually, according to switch_ivr_play_say.c it looks like you can have a min_digits of "0". Still, I'd make the min digits "1" unless there's a compelling reason to want zero digits. -MC
On Mon, Jun 18, 2012 at 8:00 AM, Avi Marcus <avi@avimarcus.net> wrote:
Uhm I thought I just wrote code that did that last week in lua. Seemed to work GREAT.
if(phone_required==true) then ... else phone_min=0 --no minimum on the match length end phone=session:playAndGetDigits(phone_min, phone_max, 3, 20000, "#", "phrase:cc_phone_prompt:"..phone_skip, "phrase:cc_invalid_entry","\\d{"..phone_min..","..phone_max.."}");
-Avi
On Mon, Jun 18, 2012 at 5:55 PM, Michael Collins <msc@freeswitch.org>wrote:
The problem is with confirmkey = session:playAndGetDigits(0, 1, 1, 1000, "#", confPrompt, "", "\\d|\\*")
It complains of "Invalid Args" (and doesn't say anything). All it has to
do is read out the number that it's intending to call, allowing the user to change their mind by hitting *.
You can't have an argument of "0" for the minimum number of digits. See this page for details on play_and_get_digits args: http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_play_and_get_digits
-MC
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
I think in mod_dptools.c in the play_and_get_digits_function there's some code that does: if (min_digits <= 1) { min_digits = 1; } My C is rusty and this may be irrelevant though! -Gabe On Mon, Jun 18, 2012 at 11:09 AM, Michael Collins <msc@freeswitch.org>wrote:
But but but the wiki says! The wiki just CAN'T be wrong! ;) Actually, according to switch_ivr_play_say.c it looks like you can have a min_digits of "0". Still, I'd make the min digits "1" unless there's a compelling reason to want zero digits. -MC
I've changed the 0 to a 1 and it didn't make any difference. I'm pretty sure it's all to do with trying to use "say" within the lua incarnation of playAndGetDigits.
I think in mod_dptools.c in the play_and_get_digits_function there's some code that does:
if (min_digits <= 1) { min_digits = 1; }
My C is rusty and this may be irrelevant though!
-Gabe
On Mon, Jun 18, 2012 at 11:09 AM, Michael Collins <msc@freeswitch.org <mailto:msc@freeswitch.org>> wrote:
But but but the wiki says! The wiki just CAN'T be wrong! ;) Actually, according to switch_ivr_play_say.c it looks like you can have a min_digits of "0". Still, I'd make the min digits "1" unless there's a compelling reason to want zero digits. -MC
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No virus found in this message. Checked by AVG - www.avg.com <http://www.avg.com> Version: 2012.0.2177 / Virus Database: 2433/5076 - Release Date: 06/17/12
maybe.. try turning your "confPrompt" into a "phrase:confPrompt" and see what happens. <macro name="confPrompt" pause="100"> <input pattern=".*"><match> <action function="speak-text" data="My spoken prompt."/> </match></input> </macro> -Avi
Maybe there's a simpler way to do a "speak" that's interruptable by DTMF and then finding out what the DTMF was?
I think in mod_dptools.c in the play_and_get_digits_function there's some code that does:
if (min_digits <= 1) { min_digits = 1; }
My C is rusty and this may be irrelevant though!
-Gabe
On Mon, Jun 18, 2012 at 11:09 AM, Michael Collins <msc@freeswitch.org <mailto:msc@freeswitch.org>> wrote:
But but but the wiki says! The wiki just CAN'T be wrong! ;) Actually, according to switch_ivr_play_say.c it looks like you can have a min_digits of "0". Still, I'd make the min digits "1" unless there's a compelling reason to want zero digits. -MC
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No virus found in this message. Checked by AVG - www.avg.com <http://www.avg.com> Version: 2012.0.2177 / Virus Database: 2433/5076 - Release Date: 06/17/12
If you're just trying to do "say" (using the existing pre-recorded prompts) or "speak" (for TTS) then just use a phrase macro. Look in conf/lang/en for examples of different types of phrase macros. See chapter 6 of the original FS book for a gentle tutorial on using phrase macros. (It mentions them in the context of using XML IVRs but phrase macros can be used anywhere in FreeSWITCH where a sound file would normally be specified.) -MC On Mon, Jun 18, 2012 at 9:03 AM, Alex <alex@thewinelake.com> wrote:
Maybe there's a simpler way to do a "speak" that's interruptable by DTMF and then finding out what the DTMF was?
I think in mod_dptools.c in the play_and_get_digits_function there's some code that does:
if (min_digits <= 1) { min_digits = 1; }
My C is rusty and this may be irrelevant though!
-Gabe
On Mon, Jun 18, 2012 at 11:09 AM, Michael Collins <msc@freeswitch.org>wrote:
But but but the wiki says! The wiki just CAN'T be wrong! ;) Actually, according to switch_ivr_play_say.c it looks like you can have a min_digits of "0". Still, I'd make the min digits "1" unless there's a compelling reason to want zero digits. -MC
_________________________________________________________________________ Professional FreeSWITCH Consulting Services:consulting@freeswitch.orghttp://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Serverhttp://www.cudatel.com
Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing listFreeSWITCH-users@lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.frees...
No virus found in this message. Checked by AVG - www.avg.com Version: 2012.0.2177 / Virus Database: 2433/5076 - Release Date: 06/17/12
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Ah, just seen this: http://lists.freeswitch.org/pipermail/freeswitch-users/2011-June/073877.html I thought I wanted say, but maybe could be persuaded to use speak if it came to it....
I think in mod_dptools.c in the play_and_get_digits_function there's some code that does:
if (min_digits <= 1) { min_digits = 1; }
My C is rusty and this may be irrelevant though!
-Gabe
On Mon, Jun 18, 2012 at 11:09 AM, Michael Collins <msc@freeswitch.org <mailto:msc@freeswitch.org>> wrote:
But but but the wiki says! The wiki just CAN'T be wrong! ;) Actually, according to switch_ivr_play_say.c it looks like you can have a min_digits of "0". Still, I'd make the min digits "1" unless there's a compelling reason to want zero digits. -MC
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No virus found in this message. Checked by AVG - www.avg.com <http://www.avg.com> Version: 2012.0.2177 / Virus Database: 2433/5076 - Release Date: 06/17/12
Phrases let you mix and match speak, say, play-file, silence, other macros, and even passing in options. http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_phrase http://wiki.freeswitch.org/wiki/Speech_Phrase_Management -Avi
OK - something for a rainy day. No confirmations for now ;-)
Phrases let you mix and match speak, say, play-file, silence, other macros, and even passing in options.
http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_phrase http://wiki.freeswitch.org/wiki/Speech_Phrase_Management
-Avi
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No virus found in this message. Checked by AVG - www.avg.com <http://www.avg.com> Version: 2012.0.2177 / Virus Database: 2433/5076 - Release Date: 06/17/12
More lua trouble - real beginner stuff, I'm afraid. Why does this not work: destnum = session:playAndGetDigits(3, 20, 3, 5000, "#", "/home/oev/fs-pabx/prompts/dmsb12_mcm3.wav", "", "\\d+\\*") l = strlen(destnum) The objection is 2012-06-18 16:52:30.415261 [ERR] mod_lua.cpp:198 /usr/local/freeswitch/scripts/mcm2.lua:13: attempt to call global 'strlen' (a nil value) stack traceback: /usr/local/freeswitch/scripts/mcm2.lua:13: in function 'getDestNumber' /usr/local/freeswitch/scripts/mcm2.lua:49: in function 'unattendedTransfer' /usr/local/freeswitch/scripts/mcm2.lua:24: in function 'processMcmOption' /usr/local/freeswitch/scripts/mcm2.lua:153: in main chunk I was just assuming that lua is lua and that anything in the lua wiki (eg. http://www.lua.org/manual/2.4/node32.html#exstring) would work.
Phrases let you mix and match speak, say, play-file, silence, other macros, and even passing in options.
http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_phrase http://wiki.freeswitch.org/wiki/Speech_Phrase_Management
-Avi
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No virus found in this message. Checked by AVG - www.avg.com <http://www.avg.com> Version: 2012.0.2177 / Virus Database: 2433/5076 - Release Date: 06/17/12
lua uses: myString:len() or tostring(myNumber):len() -Avi On Mon, Jun 18, 2012 at 7:55 PM, Alex <alex@thewinelake.com> wrote:
More lua trouble - real beginner stuff, I'm afraid.
Why does this not work:
destnum = session:playAndGetDigits(3, 20, 3, 5000, "#", "/home/oev/fs-pabx/prompts/dmsb12_mcm3.wav", "", "\\d+\\*") l = strlen(destnum)
The objection is
2012-06-18 16:52:30.415261 [ERR] mod_lua.cpp:198 /usr/local/freeswitch/scripts/mcm2.lua:13: attempt to call global 'strlen' (a nil value) stack traceback: /usr/local/freeswitch/scripts/mcm2.lua:13: in function 'getDestNumber' /usr/local/freeswitch/scripts/mcm2.lua:49: in function 'unattendedTransfer' /usr/local/freeswitch/scripts/mcm2.lua:24: in function 'processMcmOption' /usr/local/freeswitch/scripts/mcm2.lua:153: in main chunk
I was just assuming that lua is lua and that anything in the lua wiki (eg. http://www.lua.org/manual/2.4/node32.html#exstring) would work.
Phrases let you mix and match speak, say, play-file, silence, other macros, and even passing in options.
http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_phrase http://wiki.freeswitch.org/wiki/Speech_Phrase_Management
-Avi
_________________________________________________________________________ Professional FreeSWITCH Consulting Services:consulting@freeswitch.orghttp://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Serverhttp://www.cudatel.com
Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing listFreeSWITCH-users@lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.frees...
No virus found in this message. Checked by AVG - www.avg.com Version: 2012.0.2177 / Virus Database: 2433/5076 - Release Date: 06/17/12
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
OK, so replying to myself, I think I need to include the string library... I can see in lua.conf.xml that one can have a "module-directory" but I'm not sure where I should get these modules from. Any recommended quick reading on this?
More lua trouble - real beginner stuff, I'm afraid.
Why does this not work:
destnum = session:playAndGetDigits(3, 20, 3, 5000, "#", "/home/oev/fs-pabx/prompts/dmsb12_mcm3.wav", "", "\\d+\\*") l = strlen(destnum)
The objection is
2012-06-18 16:52:30.415261 [ERR] mod_lua.cpp:198 /usr/local/freeswitch/scripts/mcm2.lua:13: attempt to call global 'strlen' (a nil value) stack traceback: /usr/local/freeswitch/scripts/mcm2.lua:13: in function 'getDestNumber' /usr/local/freeswitch/scripts/mcm2.lua:49: in function 'unattendedTransfer' /usr/local/freeswitch/scripts/mcm2.lua:24: in function 'processMcmOption' /usr/local/freeswitch/scripts/mcm2.lua:153: in main chunk
I was just assuming that lua is lua and that anything in the lua wiki (eg. http://www.lua.org/manual/2.4/node32.html#exstring) would work.
Phrases let you mix and match speak, say, play-file, silence, other macros, and even passing in options.
http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_phrase http://wiki.freeswitch.org/wiki/Speech_Phrase_Management
-Avi
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No virus found in this message. Checked by AVG - www.avg.com <http://www.avg.com> Version: 2012.0.2177 / Virus Database: 2433/5076 - Release Date: 06/17/12
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No virus found in this message. Checked by AVG - www.avg.com <http://www.avg.com> Version: 2012.0.2177 / Virus Database: 2437/5077 - Release Date: 06/18/12
I didn't need to do any such thing... Did you get an error using myString:len()? -Avi On Mon, Jun 18, 2012 at 8:07 PM, Alex <alex@thewinelake.com> wrote:
OK, so replying to myself, I think I need to include the string library... I can see in lua.conf.xml that one can have a "module-directory" but I'm not sure where I should get these modules from. Any recommended quick reading on this?
More lua trouble - real beginner stuff, I'm afraid.
Why does this not work:
destnum = session:playAndGetDigits(3, 20, 3, 5000, "#", "/home/oev/fs-pabx/prompts/dmsb12_mcm3.wav", "", "\\d+\\*") l = strlen(destnum)
The objection is
2012-06-18 16:52:30.415261 [ERR] mod_lua.cpp:198 /usr/local/freeswitch/scripts/mcm2.lua:13: attempt to call global 'strlen' (a nil value) stack traceback: /usr/local/freeswitch/scripts/mcm2.lua:13: in function 'getDestNumber' /usr/local/freeswitch/scripts/mcm2.lua:49: in function 'unattendedTransfer' /usr/local/freeswitch/scripts/mcm2.lua:24: in function 'processMcmOption' /usr/local/freeswitch/scripts/mcm2.lua:153: in main chunk
I was just assuming that lua is lua and that anything in the lua wiki (eg. http://www.lua.org/manual/2.4/node32.html#exstring) would work.
Phrases let you mix and match speak, say, play-file, silence, other macros, and even passing in options.
http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_phrase http://wiki.freeswitch.org/wiki/Speech_Phrase_Management
-Avi
_________________________________________________________________________ Professional FreeSWITCH Consulting Services:consulting@freeswitch.orghttp://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Serverhttp://www.cudatel.com
Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing listFreeSWITCH-users@lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.frees...
No virus found in this message. Checked by AVG - www.avg.com Version: 2012.0.2177 / Virus Database: 2433/5076 - Release Date: 06/17/12
_________________________________________________________________________ Professional FreeSWITCH Consulting Services:consulting@freeswitch.orghttp://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Serverhttp://www.cudatel.com
Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing listFreeSWITCH-users@lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.frees...
No virus found in this message. Checked by AVG - www.avg.com Version: 2012.0.2177 / Virus Database: 2437/5077 - Release Date: 06/18/12
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Dunno - haven't tried it, but will do now! On 18 Jun 2012, at 18:10, Avi Marcus <avi@avimarcus.net> wrote:
I didn't need to do any such thing... Did you get an error using myString:len()? -Avi
On Mon, Jun 18, 2012 at 8:07 PM, Alex <alex@thewinelake.com> wrote: OK, so replying to myself, I think I need to include the string library... I can see in lua.conf.xml that one can have a "module-directory" but I'm not sure where I should get these modules from. Any recommended quick reading on this?
More lua trouble - real beginner stuff, I'm afraid.
Why does this not work:
destnum = session:playAndGetDigits(3, 20, 3, 5000, "#", "/home/oev/fs-pabx/prompts/dmsb12_mcm3.wav", "", "\\d+\\*") l = strlen(destnum)
The objection is
2012-06-18 16:52:30.415261 [ERR] mod_lua.cpp:198 /usr/local/freeswitch/scripts/mcm2.lua:13: attempt to call global 'strlen' (a nil value) stack traceback: /usr/local/freeswitch/scripts/mcm2.lua:13: in function 'getDestNumber' /usr/local/freeswitch/scripts/mcm2.lua:49: in function 'unattendedTransfer' /usr/local/freeswitch/scripts/mcm2.lua:24: in function 'processMcmOption' /usr/local/freeswitch/scripts/mcm2.lua:153: in main chunk
I was just assuming that lua is lua and that anything in the lua wiki (eg. http://www.lua.org/manual/2.4/node32.html#exstring) would work.
Phrases let you mix and match speak, say, play-file, silence, other macros, and even passing in options.
http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_phrase http://wiki.freeswitch.org/wiki/Speech_Phrase_Management
-Avi
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No virus found in this message. Checked by AVG - www.avg.com Version: 2012.0.2177 / Virus Database: 2433/5076 - Release Date: 06/17/12
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No virus found in this message. Checked by AVG - www.avg.com Version: 2012.0.2177 / Virus Database: 2437/5077 - Release Date: 06/18/12
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Yes, but this works: function getDestNumber() session:execute("log", "INFO mcm2.lua getDestNumber") destnum = session:playAndGetDigits(3, 20, 3, 5000, "#", "/home/oev/fs-pabx/prompts/dmsb12_mcm3.wav", "", "\\d+\\*?") l = string.len(destnum) if string.sub(destnum,l)=="*" then destnum = "" end return destnum end Unfortunately, it still doesn't quite work as I'd like. The * doesn't act as a "remembered but terminating" key, so the customer still has to press # (or, presumably, wait 5s) after pressing * for the message to get through! Is there a DTMF history buffer one can inspect? Then I could make * a terminating key and then just see if that was the last DTMF. Alex
I didn't need to do any such thing... Did you get an error using myString:len()? -Avi
On Mon, Jun 18, 2012 at 8:07 PM, Alex <alex@thewinelake.com <mailto:alex@thewinelake.com>> wrote:
OK, so replying to myself, I think I need to include the string library... I can see in lua.conf.xml that one can have a "module-directory" but I'm not sure where I should get these modules from. Any recommended quick reading on this?
More lua trouble - real beginner stuff, I'm afraid.
Why does this not work:
destnum = session:playAndGetDigits(3, 20, 3, 5000, "#", "/home/oev/fs-pabx/prompts/dmsb12_mcm3.wav", "", "\\d+\\*") l = strlen(destnum)
The objection is
2012-06-18 16:52:30.415261 [ERR] mod_lua.cpp:198 /usr/local/freeswitch/scripts/mcm2.lua:13: attempt to call global 'strlen' (a nil value) stack traceback: /usr/local/freeswitch/scripts/mcm2.lua:13: in function 'getDestNumber' /usr/local/freeswitch/scripts/mcm2.lua:49: in function 'unattendedTransfer' /usr/local/freeswitch/scripts/mcm2.lua:24: in function 'processMcmOption' /usr/local/freeswitch/scripts/mcm2.lua:153: in main chunk
I was just assuming that lua is lua and that anything in the lua wiki (eg. http://www.lua.org/manual/2.4/node32.html#exstring) would work.
Phrases let you mix and match speak, say, play-file, silence, other macros, and even passing in options.
http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_phrase http://wiki.freeswitch.org/wiki/Speech_Phrase_Management
-Avi
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No virus found in this message. Checked by AVG - www.avg.com <http://www.avg.com> Version: 2012.0.2177 / Virus Database: 2433/5076 - Release Date: 06/17/12
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No virus found in this message. Checked by AVG - www.avg.com <http://www.avg.com> Version: 2012.0.2177 / Virus Database: 2437/5077 - Release Date: 06/18/12
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <mailto:FreeSWITCH-users@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No virus found in this message. Checked by AVG - www.avg.com <http://www.avg.com> Version: 2012.0.2177 / Virus Database: 2437/5078 - Release Date: 06/18/12
Maybe try: http://wiki.freeswitch.org/wiki/Mod_lua#session:setInputCallback -Avi On Tue, Jun 19, 2012 at 11:14 AM, Alex <alex@thewinelake.com> wrote:
Yes, but this works:
function getDestNumber() session:execute("log", "INFO mcm2.lua getDestNumber") destnum = session:playAndGetDigits(3, 20, 3, 5000, "#", "/home/oev/fs-pabx/prompts/dmsb12_mcm3.wav", "", "\\d+\\*?") l = string.len(destnum) if string.sub(destnum,l)=="*" then destnum = "" end return destnum end
Unfortunately, it still doesn't quite work as I'd like. The * doesn't act as a "remembered but terminating" key, so the customer still has to press # (or, presumably, wait 5s) after pressing * for the message to get through!
Is there a DTMF history buffer one can inspect? Then I could make * a terminating key and then just see if that was the last DTMF.
Alex
I didn't need to do any such thing... Did you get an error using myString:len()? -Avi
On Mon, Jun 18, 2012 at 8:07 PM, Alex <alex@thewinelake.com> wrote:
OK, so replying to myself, I think I need to include the string library... I can see in lua.conf.xml that one can have a "module-directory" but I'm not sure where I should get these modules from. Any recommended quick reading on this?
More lua trouble - real beginner stuff, I'm afraid.
Why does this not work:
destnum = session:playAndGetDigits(3, 20, 3, 5000, "#", "/home/oev/fs-pabx/prompts/dmsb12_mcm3.wav", "", "\\d+\\*") l = strlen(destnum)
The objection is
2012-06-18 16:52:30.415261 [ERR] mod_lua.cpp:198 /usr/local/freeswitch/scripts/mcm2.lua:13: attempt to call global 'strlen' (a nil value) stack traceback: /usr/local/freeswitch/scripts/mcm2.lua:13: in function 'getDestNumber' /usr/local/freeswitch/scripts/mcm2.lua:49: in function 'unattendedTransfer' /usr/local/freeswitch/scripts/mcm2.lua:24: in function 'processMcmOption' /usr/local/freeswitch/scripts/mcm2.lua:153: in main chunk
I was just assuming that lua is lua and that anything in the lua wiki (eg. http://www.lua.org/manual/2.4/node32.html#exstring) would work.
Phrases let you mix and match speak, say, play-file, silence, other macros, and even passing in options.
http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_phrase http://wiki.freeswitch.org/wiki/Speech_Phrase_Management
-Avi
_________________________________________________________________________ Professional FreeSWITCH Consulting Services:consulting@freeswitch.orghttp://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Serverhttp://www.cudatel.com
Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing listFreeSWITCH-users@lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.frees...
No virus found in this message. Checked by AVG - www.avg.com Version: 2012.0.2177 / Virus Database: 2433/5076 - Release Date: 06/17/12
_________________________________________________________________________ Professional FreeSWITCH Consulting Services:consulting@freeswitch.orghttp://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Serverhttp://www.cudatel.com
Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing listFreeSWITCH-users@lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.frees...
No virus found in this message. Checked by AVG - www.avg.com Version: 2012.0.2177 / Virus Database: 2437/5077 - Release Date: 06/18/12
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@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@freeswitch.orghttp://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Serverhttp://www.cudatel.com
Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing listFreeSWITCH-users@lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.frees...
No virus found in this message. Checked by AVG - www.avg.com Version: 2012.0.2177 / Virus Database: 2437/5078 - Release Date: 06/18/12
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
Join Us At ClueCon - Aug 7-9, 2012
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (5)
-
Alex
-
Alex Lake
-
Avi Marcus
-
Gabe Shepard
-
Michael Collins