# AddPrompt.tcl # Script Version 1.0(1) #------------------------------------------------------------------ # October 2018, Irakli Marikhashvili # # Copyright (c) 1998-2002 by cisco Systems, Inc. # All rights reserved. #------------------------------------------------------------------ # # This tcl script after call is active or was successful destroys the call, plays Your_Call_Is_Been_Recorded.au audio file # to both sides and as soon as prompt finishes to play (ev_media_done) recreats the connection (proc act_Played) proc init { } { #es aucilebeli nacilia yvela scriptshi } proc act_Setup { } { leg setupack leg_incoming set dnis [infotag get leg_dnis] leg proceeding leg_incoming leg setup $dnis callInfo leg_incoming } proc act_CallSetupDone { } { global incoming global outgoing set incoming [infotag get leg_incoming] set outgoing [infotag get leg_outgoing] set status [infotag get evt_status] puts "Entering act_CallSetupDone" #tu code aris ls_000 ese igi pasuxia if { $status == "ls_000"} { puts "-----------------Call is Answered, so run: connection destroy con_all---------------" #droebit kavshiris gackveta, imistvis rom gaeshvas prompti connection destroy con_all } } proc act_Destroy { } { #promptis gashveba orive mxares media play leg_incoming flash:Your_Call_Has_Been_Recorded.wav media play leg_outgoing flash:Your_Call_Has_Been_Recorded.wav } proc act_Played { } { global incoming global outgoing #promptis damtavrebistanave kavshiris aghdgena connection create $incoming $outgoing } proc act_Cleanup { } { #gatishvisas ra gaaketos 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,INSERTPROMPT" set TopFSM(INSERTPROMPT,ev_destroy_done) "act_Destroy,same_state" set TopFSM(INSERTPROMPT,ev_media_done) "act_Played,CALLACTIVE" set TopFSM(CALLACTIVE,ev_disconnected) "act_Cleanup,CALLDISCONNECTED" set TopFSM(CALLDISCONNECTED,ev_disconnect_done) "act_Cleanup,same_state" fsm define TopFSM CALL_INIT