[Freeswitch-users] lua trouble
Alex
alex at thewinelake.com
Mon Jun 18 18:03:45 MSD 2012
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 at 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 at 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 at 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 at 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 at 193.105.54.10
transfer(-bleg 123 XML dp0)
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users
mailing list