TCL Script

Unanswered Question
May 25th, 2009
User Badges:

Hi All,

We have wrote a tcl script in which it going to play a prompt and will transfer to an extension.For us first half (Playing prompt)is working fine the second part(transfer) of the script is not working.could you please any one check where the script is correct or not.


  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
mstoychev Mon, 06/01/2009 - 08:58
User Badges:


do you understand the concept of event-> action in TCL version 2 ?

In your script you do not wait for media to stop playing ( ev_media_done) before doing "setup leg" to the extension.

I have a scrirpt doing exactly the same - you need to put " leg setup " in a separate procedure(act_CallSetup in my example) and modify the state machine to do something like this:

set fsm(PLAYMSG,ev_media_done) "act_CallSetup PLACECALL"

set fsm(PLACECALL,ev_setup_done) "act_CallSetupDone CALLACTIVE"


I hope this helps. If you need something else, you can e-mail me.

P.S. BTW, I do not see why you set state to HANDOFF and wait for ev_returned event. You can just set it to CALLACTIVE and wait for ev_disconnected. Use one of the cisco demo applications as a base.

partheeban1 Wed, 06/03/2009 - 05:49
User Badges:

Hi Milen,

Thanks a lot for your comments.

I have modified the script as you told, now the prompt is playing and disconnects without placing a call to my internal phone number.Please check whether i need to change anything else in the script. awaiting for your reply.



mstoychev Wed, 06/03/2009 - 15:12
User Badges:


according to the state machine, your script hangs up immediately after the call to the internal extension is set up. The right thing to do when the call is set up is to go in state CALLACTIVE and wait for disconnect event. This way the call continues until any of the parties hangs up.

The extension should receive the call even now.But the call will be disconnected immediately after you pick up.

So you may have 2 problems:

1) Change some lines in the state machine like I told you in my previous post - this line is wrong :

set fsm(PLACECALL,ev_setup_done) "act_Cleanup CALLDISCONNECT"

change to:

set fsm(PLACECALL,ev_setup_done) "act_CallSetupDone CALLACTIVE"

set fsm(CALLACTIVE,ev_disconnected) "act_Cleanup CALLDISCONNECT"

where act_CallSetupDone

can be almost empty, just to wait until disconnected. Look in the attached script that does almost the same thing.

My script can be put on a incoming dial peer - it plays message and then connects the call to the destination.It will take its destination number automatically from the called number, but you can change this.

2) check why calls do not arrive to the extension.

You can always look in the Cisco example scripts for most of the applications you need - even more complicated. Just make sure you understand the states and events.




This Discussion