[cisco-voip] TCL Script to play announcement

Tim Smith thsglobal at gmail.com
Thu Jun 25 20:40:13 EDT 2009


Hi Guys,

I created a very very basic announcement TCL script.

All it has to is accept a call, play a prompt, hang up.

Im going to look into changing it, so I read the announcement file from a
parameter in the service config on the router.

But apart from that, could someone give it a once over, and tell me if it
should be "safe" to deploy?

Is there anything I should do from the script perspective to improve it?

Cheers,

Tim

 # playAnnouncement-1-0-0.tcl

# Initialisation

proc init { } {

global param

global callInfo

global legConnected

set param(interruptPrompt) true

set param(abortKey) *

set param(terminationKey) #

set legConnected false

}

# SET FSM

set fsm(any_state,ev_disconnected) "act_Cleanup same_state"

set fsm(CALL_INIT,ev_setup_indication) "act_Setup GETDEST"

set fsm(GETDEST,ev_collectdigits_done) "act_GotDest CONNECT"

set fsm(CONNECT,ev_media_done) "act_OutboundCall CONNECTED"

set fsm(CONNECTED,ev_setup_done) "act_SendDigit same_state"

set fsm(CONNECTED,ev_media_done) "act_SendDigit same_state"

set fsm(FINISHED,ev_media_done) "act_Cleanup same_state"

fsm define fsm CALL_INIT

proc act_Setup { } {

global prompt

set prompt "flash:announcement.au"

leg setupack leg_incoming

leg proceeding leg_incoming

leg connect leg_incoming

media play leg_incoming $prompt

fsm setstate FINISHED

}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://puck.nether.net/pipermail/cisco-voip/attachments/20090626/644f019d/attachment.html>


More information about the cisco-voip mailing list