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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 lvl tcl autoattendant did

Status
Not open for further replies.

lisandroq

IS-IT--Management
May 30, 2011
1
AR
Hi i am Lisandro from Argentina i junior and is my first time working on a tcl.. someone give a script that works as autoattendant its has 2 levels.. I modified and add some function and works great.... so when it starts has
a prompt and you could enter a valid number to connect directly or just the option that you heard in the prompt.. then in depending of the number of the option you chose you could enter in the second level where you here more options and its has a new collectdigit..
in the proc act_Setup { }
the script has this:

leg setupack leg_incoming
leg proceeding leg_incoming
set callingnumber [infotag get leg_ani]
if { [string len $callingnumber] == "3" || [string len $callingnumber] == "4" || [string len $callingnumber] == "5" || [string len $callingnumber] == "7"} {
leg connect leg_incoming

i really couldn't figure out what is this.. if someone could tell me how its works and what is it do i would really appreciate that...

the else of the if play the prompt and collect the digit..

I get my doubt on this because i want to add direct inward dial (did) on the script i have the code for this i got it from other tcl that:

if { [infotag get leg_isdid] } {
set dest [infotag get leg_dnis]
leg proceeding leg_incoming
leg setup $dest callInfo leg_incoming
fsm setstate PLACECALL



so i want to now is the infotag get leg_ will bother me or not or what does it do..

i post you the entire proc act_Setup


proc act_Setup { } {
global param
global source
global header
global a
global dest
global callingnumber

set a(0) "*110"
set a(1) "*111"
set a(21) "*112"
set a(22) "*113"
set a(23) "*114"
set a(31) "*115"
set a(32) "*116"
set a(33) "*117"
set a(4) "*118"
set a(9) "*119"
set a(10) "*120"
set a(11) "*121"
set a(12) "*122"
set a(13) "*123"
puts "\n entro primero aca"
set header "01"
leg setupack leg_incoming
leg proceeding leg_incoming
set callingnumber [infotag get leg_ani]
if { [string len $callingnumber] == "3" || [string len $callingnumber] == "4" || [string len $callingnumber] == "5" || [string len $callingnumber] == "7"} {
leg connect leg_incoming
}
puts "\n header:"
puts $header
media play leg_incoming "$source$header.au"
leg collectdigits leg_incoming param
}


could i just add :

if { [infotag get leg_isdid] } {
set dest [infotag get leg_dnis]
leg proceeding leg_incoming
leg setup $dest callInfo leg_incoming
fsm setstate PLACECALL

on the
proc act_Setup { } {

and it should work?


the fsm state:

set fsm(PLACECALL,ev_setup_done) "act_CallSetupDone, CALLACTIVE"


thanks..
 
There must be more to it since "leg" isn't a Tcl command as far as I know. So, you must have a "proc leg..." somewhere in code you didn't post.
No matter, do I understand correctly that what you don't understand is this?
Code:
if { [string len $callingnumber] == "3" || [string len $callingnumber] == "4" || [string len $callingnumber] == "5" || [string len $callingnumber] == "7"} {

That's saying: if the length of the string that is the value of the variable, "callingnumber" is 3 characters OR 4 characters OR 5 characters OR 7 characters, then execute the following statements (which appear to be truncated in your post).

If you're asking about "infotag", I don't recognize that command and I suspect it's another proc in your environment.

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top