[cisco-nas] TCL IVR API v1.0 playPrompt problem in direct inward dial

Ganbold ganbold at micom.mng.net
Mon Apr 26 23:26:28 EDT 2004


Hi,

I'm using TCL IVR API 1.0 tcl scripts for VOIP direct inward dial with 
Cisco AS5300.
Script is working fine, but it is not playing audio files.

I want TCL script to play customers balance and total call minutes.

The script which is used by Prepaid customers are working fine and playing 
prompt without any problem.
I debugged Cisco and there it says Play complete at the end. No any error.
There is no problem with the Audio files, they exist.

One interesting problem is script is not playing balance and total call 
minutes, however it is playing
"You have 60 seconds" prompt when call reaches warnTime left.

How can I make TCL script to play audio files for direct inward dial? Is 
there any tips and tricks?
Can somebody give me some recommendation and advice?
I hope somebody in this list point me to the right direction.

thanks in advance,

Ganbold


Following is TCL script part which is used for direct inward dial:

set CityNoOpen 0
set dest_no_collect 0
set isani 0
set ani_count 0

set ctrltran 0
set fcnt 0
set selectCnt 0
set lang 0
set count 0
set counter 0
set promptFlag 0
set promptFlag2 0
set wrongLanguage 0
set noPlay 0
set prefix mn
set pound 0
set destBusy 0
set noTimeLimit 0
set opcount 0
set amt 0
set preLang 0
set playcredit 0
set pin 0
set optionselect 0

set returnInfo 0
set playcredit 1
set param1(interrupt) true
set param1(abortKey) *
set param1(terminationKey) #
set param2(interrupt) true
set param2(abortKey) *
set param2(terminationKey) #
set param2(playComplete) true
set param3(interrupt) true
set param3(abortKey) *
set param3(terminationKey) #
set param3(dialPlanTerm) true
set param4(interrupt) true
set param4(abortKey) *
set param4(terminationKey) #
set param4(playComplete) true
set param4(insertMessage) true
set param5(interrupt) true
set pound 0
set destBusy 0
set count 0
set counter 0
set promptFlag 0
set promptFlag2 0

##install params
set pstnLen [getVariable config uidLen]
set pinLen [getVariable config pinLen]
set areacode [getVariable config redirectNumber]

set preLanguage [getVariable radius preferredLang]
setVariable language 1
set prefix1 en
setVariable language 2
set prefix2 [getVariable local language]
setVariable language 3
set prefix3 [getVariable local language]
setVariable language 4
set prefix4 [getVariable local language]
setVariable language 5
set prefix5 [getVariable local language]
setVariable language 6
set prefix6 [getVariable local language]

setVariable longPound true
set totalLang [getVariable local totalLanguages]

set beginindex 0

setVariable language 1
set prefix en
set langSel [setVariable language 1]

set warnTime 60
set state end

#========================
set init_ani [ani]
set cuted_ani $init_ani
set anilen [string length $init_ani]
puts "======$init_ani==="

if { $anilen > $pstnLen } {
      set cut [string range $init_ani 0 1]
      if { $cut == "13" } {
          #mobil,do nothing
      } else {
          set aniindex [expr $anilen - $areacode]
          set cuted_ani [string range $init_ani $aniindex $anilen]
      }
}

#====================================
#====================================
set dest [dnis]
set slength [string length $dest]
set is800 [string range $dest 3 6]
set destination [string range $dest 3 $slength]

if { $pinLen != 1 } {
         callProceeding
}
if { $is800 == "800" || $destination == "000" } {
         set destination [string range $dest 3 $slength]
         set et [authorize $destination "8888" "" "" info]
         if { $et == "authorized" } {
             set noTimeLimit 1
             set state place_call
         } else {
             acceptCall
             set ev [playPrompt param2 info [set prefix]_ani_invalid_dest.au]
             set state end
         }
} else {
         if { $slength == 5 } {
             set state end
             return 0
         }
	puts "cuted_ani = $cuted_ani"

	set ev [authorize $cuted_ani "" "" $cuted_ani info]

         setVariable language 1
         set prefix en

         puts "Set prefix and language: $prefix"

	set count 0
	set counter 0
	set promptFlag 0

	set returncode [getVariable radius returnCode]
         set beginindex [expr $slength - 5]
         set destination [string range $dest 3 $slength]

         set usertype [getVariable aaa billing-model billing-model]
         puts "ev= $ev usertype=$usertype returncode = $returncode"

	####if usertype == 1 credit   usertype == 0 debit

         if { $ev == "authorization failed" } {
                 if { $returncode == "Uknown variable name" } {
                      set ev [playPrompt param2 info [set 
prefix]_ani_no_aaa.au [set prefix]_disconnect.au]
                      set state end
		} elseif {$returncode == 7} {
			puts "first_authorize: 7 : ev is $ev, returncode is $returncode"
			set state first_authorize_fail_no_funds
			return 0
		} else {
                      if { $destination == "818" || $destination == 
"818000" } {
                           acceptCall
                           do_play_ani_number
                      }
                      playPrompt param2 info [set 
prefix]_ani_no_service_available.au
                      set state end
                 }
         }

         if { $ev == "authorized" } {
                if { $destination == "818" || $destination == "818000" } {
                     acceptCall
                     set amt [getVariable radius creditAmount]
                     playPrompt param2 info [set prefix]_you_have.au %a$amt
                     setVariable language 2
                     set prefix [getVariable local language]
                     playPrompt param2 info [set prefix]_you_have.au %a$amt
                     set state end
                } else {
                     set amt [getVariable radius creditAmount]


######################### f ollowing is not playing
                    playPrompt param2 info [set prefix]_you_have.au %a$amt

                     set state second_authorize
                 }
         }
}

  while { $state != "end" } {
     if {$state == "second_authorize"} {
         do_second_authorize
     } elseif {$state == "place_call"} {
         do_place_call
     } elseif {$state == "active"} {
         do_active
     } elseif {$state == "out_of_time"} {
         do_out_of_time
     } elseif {$state == "first_authorize_fail_no_funds"} {
	do_first_authorize_fail_no_funds
     } else {
         break
     }
}




More information about the cisco-nas mailing list