Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IVR Call flow implementation - Array FSM and other questions

Status
Not open for further replies.

Consolas

Technical User
Nov 5, 2007
6
0
0
PT
Hello all!

How are you today?

I've got a few questions i would like to place.

I'm beginning to learn TCL and there are a few things i've yet to understand. Namely, FSM and EVENT / STATUS codes.

About the FSM, someone showed me a drawing that explained the work of the FSM, comparing it to a automatic door action: states like in open and close, state transitions like in opening door because i click the sensor or close door and the end states like in door opened or closed.

So, i want to implement a simple ivr menu where a person would call and liste: "choose your option. 1 or 2". Then the person would choose the option and hear, according to its choice, the corresponding prompt - "you choose 1" or "you choose 2".

Is this better done with FSM ? I mean, i was thinking of having a proc called PLAY_DIGIT_MESSAGE and inside it a cycle with IFS, so IF CHOISE WAS 1 PLAY THIS..something like this.

I think i didnt fully understand the correct function of the FSM nor its states. Can anyone point me in the right direction?

What i currently have is this:


(...)

media play leg_incoming "tftp://192.168.255.10/ptFantasporto01.au"
leg collectdigits leg_incoming param

and

set fsm(any_state,ev_collectdigits_done) "act_GotDest same_state"

that calls

proc act_GotDest { } {
puts "Entrei no proc act_GotDest"
global dest
global status

set status [infotag get evt_status]
if { $status == "cd_005" } {
set dest [infotag get evt_dcdigits]
puts "$dest"

if { $dest == 1 } {
media play leg_incoming "tftp://192.168.255.10/ptFantasporto02.au"
}
if { $dest == 2 } {
media play leg_incoming "tftp://192.168.255.10/ptCruzVermelha01.au"
}
if { $dest == 3 } {
media play leg_incoming "tftp://192.168.255.10/ptCaixaForteAcertou.au"
}
} else {
call close
}
}


is this a good way to start? I've been told i choose use FSM to manage this type of calls. I will have lots of traffic and a second menu. Is this a good start?




--- got some help and comments, so i changed to this ---

Hello again.

I'm been told i could do something like this ( and it would be a lot better )

#
roc init { } {
#

#
global param
#

#
set param(maxDigits) 1
#
set param(initialDigitTimeout) 5
#
set param(dialPlan) true
#

#
array set transition {
#
Start,1 {Review_submenu Play_review_prompt}
#
Start,2 {Send_submenu Play_send_prompt}
#
Review_submenu,1 {Play_menu Play_first_message}
#
}
#

#

#
}
#

#
proc act_Setup { } {
#

#
puts "enter act_Setup"
#
global ani
#
global dnis
#
global param
#

#
#ani - number from where user is calling
#
set ani [infotag get leg_ani]
#
#dnis - number to where user is calling
#
set dnis [infotag get leg_dnis]
#

#
leg setupack leg_incoming
#
leg proceeding leg_incoming
#
leg connect leg_incoming
#

#
media play leg_incoming "tftp://192.168.255.10/ptFantasporto01.au"
#
leg collectdigits leg_incoming param
#

#

#
}
#

#

#

#
#=========================================================================
#
# I want to implement this
#
proc act_GotDest { } {
#
puts "Entrei no proc act_GotDest"
#
global dest
#
global status
#

#
set status [infotag get evt_status]
#
if { $status == "cd_005" } {
#
set dest [infotag get evt_dcdigits]
#
puts "$dest"
#

#
if { $dest == 1 } {
#
media play leg_incoming "tftp://192.168.255.10/ptFantasporto02.au"
#
}
#
if { $dest == 2 } {
#
media play leg_incoming "tftp://192.168.255.10/ptCruzVermelha01.au"
#
}
#
if { $dest == 3 } {
#
media play leg_incoming "tftp://192.168.255.10/ptCaixaForteAcertou.au"
#
}
#
} else {
#
call close
#
}
#
}
#

#
using the fsm system implemented witht the array.
#

#
#=========================================================================
#

#

#
init
#
requiredversion 2.0
#

#
set fsm(CALL_INIT,ev_setup_indication) "act_Setup MEDIAPLAY"
#
#
fsm define fsm CALL_INIT


Any ideas? Inside the === are my questions!

How does the array system work? I mean, i need some kind of cycle to say "hey, keep reading doing this routine until it ends" in order the array to be read everytime or somehing..

And how would i ADD something to the array? and which format....? im completely lost!!

:( THANKS

Ricardo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top