RYAN WEST | I tried researching this one as much as possible, but I'm hitting a wall. I have modified the ani_filter script to play a message when a number is being blocked (redirected). However, the script completes the redirect too early. It seems to work in my test system, but the early redirect on another system is causing an ISDN failure and early termination.
# ani_filter.tcl # Script Version 1.0(1) #------------------------------------------------------------------ # October 2002, Niels Brunsgaard # # Copyright (c) 1998-2002 by cisco Systems, Inc. # All rights reserved. #------------------------------------------------------------------ # # This tcl script filters calls based on ANI. If there is a match # against a pe-configured list of numbers it changes the DNIS # to a configurable value # # proc init { } { global param } proc act_Setup { } { leg setupack leg_incoming set dnis [infotag get leg_dnis] set new_dnis [infotag get cfg_avpair new_dest] set ani [infotag get leg_ani] set ani_deny NULL set ani_pi [infotag get leg_ani_pi] puts "dnis $dnis new_dnis $new_dnis ani $ani ani_pi $ani_pi" if { $ani_pi != "presentation_allowed" } { set ani NULL } if [infotag get cfg_avpair_exists welcome-prompt] { set welcomePrompt [string trim [infotag get cfg_avpair welcome-prompt]] } else { set welcomePrompt flash:en_bacd_disconnect.au } set x 1 while {1} { if {[infotag get cfg_avpair_exists clid$x]} { set ani_deny [infotag get cfg_avpair clid$x] puts "clid$x = $ani_deny" if { $ani == $ani_deny} { set dnis $new_dnis puts "match clid $ani_deny x=$x" media play leg_incoming $welcomePrompt # # I would like a pause here before completing the rest of the script # # timer start named_timer 20 PROMPT_TIMER break } } else { puts "No more clid at $x" break } incr x if { $x > 1000 } { puts "Too many clids" } } puts "Final dnis $dnis" leg proceeding leg_incoming leg setup $dnis callInfo leg_incoming } proc act_CallSetupDone { } { global beep set status [infotag get evt_status] puts "Entering act_CallSetupDone" if { $status != "ls_000"} { puts "Call [infotag get con_all] got event $status while placing an outgoing call" call close } } proc act_Cleanup { } { puts "Entering act_Cleanup" call close } proc act_Abort { } { puts "Unexpected event - entering act_Abort" call close } init #---------------------------------- # State Machine #---------------------------------- set TopFSM(any_state,ev_disconnected) "act_Abort,same_state" set TopFSM(CALL_INIT,ev_setup_indication) "act_Setup,PLACECALL" set TopFSM(PLACECALL,ev_setup_done) "act_CallSetupDone,CALLACTIVE" set TopFSM(CALLACTIVE,ev_disconnected) "act_Cleanup,CALLDISCONNECTED" set TopFSM(CALLDISCONNECTED,ev_disconnect_done) "act_Cleanup,same_state" fsm define TopFSM CALL_INIT
Thanks!
-ryan |