10-16-2008 05:15 AM - edited 03-13-2019 05:44 PM
Hi All
The following is my script for IVR. However, when User press "0" to operator, the system must wait for 7-10 seconds to forward "0" digit to CallManager.
How can I make Script forward immediately "0" digit to CallManager ?
==============================================================
proc act_Setup { } {
global flag
global param
set param(interruptPrompt) true
set param(enableReporting) true
set param(terminationKey) #
set param(interDigitTimeout) 1
set flag 1
leg proceeding leg_incoming
set dest [infotag get leg_dnis]
leg connect leg_incoming
set pattern(account) .+
leg collectdigits leg_incoming param pattern
media play leg_incoming flash:IVR.au
}
proc act_process_dtmf { } {
global flag
global param
set dtmf_pressed [infotag get evt_digit]
puts "Processing DTMF: $dtmf_pressed"
if {$flag == "0"} { return }
if { $dtmf_pressed == "0" } {
set flag 0
set dest "2000"
fsm setstate PLACECALL
puts "dest = $dest"
leg setup $dest callInfo leg_incoming
}
}
proc act_PromptCollect_acct1 { } {
global param
set status [infotag get evt_status]
puts "act_PromptCollect_acct1, status=$status"
if {$dest == "0"} {set dest "2000"}
puts "make call ... to Operator = $dest"
leg setup $dest callInfo leg_incoming
call close
}
proc act_CallSetupDone { } {
set status [infotag get evt_status]
puts "act_CallSetupDone, status=$status"
if { $status == "ls_000" } {
puts "Setup successful, start timer..."
} else {
puts "Setup unsuccessful"
call close
}
}
proc act_Cleanup { } {
puts "call close"
call close
}
set fsm(CALL_INIT,ev_setup_indication) "act_Setup GETDEST"
set fsm(GETDEST,ev_digit_end) "act_process_dtmf same_state"
set fsm(GETDEST,ev_collectdigits_done) "act_PromptCollect_acct1 PLACECALL"
set fsm(PLACECALL,ev_setup_done) "act_CallSetupDone CALLACTIVE"
set fsm(CALLACTIVE,ev_disconnected) "act_Cleanup CALLDISCONNECT"
set fsm(CALLDISCONNECT,ev_any_event) "act_Cleanup same_state"
fsm define fsm CALL_INIT
=================================================
10-16-2008 07:30 PM
Hi!
Srcript waiting end collect digits,
because you set: "set pattern(account) .+", change pattern and i think it help you.
10-18-2008 08:25 PM
Thanks for replying.
The pattern I used is ".+" because I want to sent "XXXX" number to CCM. However, "0" is special character so I don't know how to solve this problem.
Can you recommend the way to solve this problem ?
(My system still working properly with "XXXX" number. For example, when customer press 1234, the call is forwarded without timeout.)
Futhermore, I processed "0" character by using the following code:
proc act_PromptCollect_acct1 { } {
global param
set status [infotag get evt_status]
puts "act_PromptCollect_acct1, status=$status"
if {$dest == "0"} {set dest "2000"}
puts "make call ... to Operator = $dest"
leg setup $dest callInfo leg_incoming
call close
}
I don't know why it must wait for end digit.
Hic, Script is so complicated.
10-20-2008 12:25 AM
try run this, with configuration:
---------------------------------
service test flash:test_help.tcl
param debug 1
---------------------------------
set myname "Help_TEST"
proc msgSend {str} {
global myname
global debug
if {$debug == 1} { puts "$myname $str" }
}
proc act_Setup { } {
global flag
global debug
global myname
set debug [string trim [infotag get cfg_avpair debug]]
msgSend "act_Setup"
set flag 1
leg setupack leg_incoming
leg proceeding leg_incoming
leg connect leg_incoming
media play leg_incoming flash:IVR.au
set param(enableReporting) true
set param(interDigitTimeout) 10
set param(dialPlan) true
set pattern ".+"
leg collectdigits leg_incoming param pattern
}
proc act_process_dtmf { } {
global flag
msgSend "act_process_dtmf"
set dtmf_pressed [infotag get evt_digit]
msgSend "Processing DTMF: $dtmf_pressed"
if {$flag == "0"} { return }
if { $dtmf_pressed == "0" } {
set flag 0
set dest "2000"
msgSend "dest = $dest"
leg setup $dest callInfo leg_incoming
fsm setstate PLACECALL
}
}
proc act_PromptCollect_acct { } {
global param
msgSend "act_PromptCollect_acct"
set status [infotag get evt_status]
set dest [infotag get evt_dcdigits]
msgSend "Status=$status"
if {$dest == "0"} {set dest "2000"}
msgSend "make call ... to Operator = $dest"
set callInfo(alertTime) 60
leg setup $dest callInfo leg_incoming
#call close ???
}
proc act_CallSetupDone { } {
msgSend "act_CallSetupDone"
set status [infotag get evt_status]
msgSend "act_CallSetupDone, status=$status"
if { $status == "ls_000" } {
msgSend "Setup successful, start timer..."
} else {
msgSend "Setup unsuccessful"
call close
}
}
proc act_Cleanup { } {
msgSend "act_Cleanup"
call close
}
proc act_Ignore { } {
set ev [infotag get evt_event]
msgSend "is ignoring event $ev"
}
set fsm(any_state,ev_disconnected) "act_Cleanup same_state"
set fsm(CALL_INIT,ev_setup_indication) "act_Setup GETDEST"
set fsm(GETDEST,ev_digit_end) "act_process_dtmf same_state"
set fsm(GETDEST,ev_collectdigits_done) "act_PromptCollect_acct PLACECALL"
set fsm(PLACECALL,ev_setup_done) "act_CallSetupDone CALLACTIVE"
set fsm(CALLACTIVE,ev_disconnected) "act_Cleanup CALLDISCONNECT"
set fsm(CALLDISCONNECT,ev_any_event) "act_Cleanup same_state"
set fsm(any_state,ev_any_event) "act_Ignore same_state"
fsm define fsm CALL_INIT
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide