« Back to TCL-API

Resettin voice-port every time it is used

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Not sure if this is doable, but we have a voice-port that hangs all the time.  We are trying to configure a TCL script that is tied to a dial-peer that when the dial-peer receives a call it triggers the service that waits 15 seconds, shuts the port, waits 3 more seconds and then no-shuts the port.  When we use the tclsh and send the commands through there it works.   When we configure the TCL script as a service and apply it to the dial-peer the router throws us errors back saying our commands are invalid. 
 
Here is what works in tclsh:
after 15000
ios_config "voice-port 0/3/0" "shut"
after 3000
ios_config "voice-port 0/3/0" "no shut"
exit


 
Here is the error we get on every call to the dial-peer:
2467068: Dec 13 13:16:22.026 EST: //-1//AFW_:EE17BF30B4000:/Tcl_Link: Linking script pageport
2467069: Dec 13 13:16:22.026 EST: //-1//AFW_:EE17BF30B4000:/Tcl_Link: Tcl_Eval Failed on top-level eval. code=1 code=ERROR
2467070: Dec 13 13:16:22.026 EST: TCL script failure
        Result:
                         invalid command name "after"
2467071: Dec 13 13:16:22.026 EST:       TCL script failure errorInfo:
                        invalid command name "after"
    while executing
"
2467072: Dec 13 13:16:22.026 EST: //-1//AFW_:EE17BF30B4000:/AFW_ExecEnv_Link: Cannot link script: pageport
2467073: Dec 13 13:16:22.026 EST: //-1//SCRI:/AFW_M_Script_Register:  Cannot set the script: pageport


 
 

You need to use timer command Tcl IVR. This is different from tclsh But Tcl IVR cannot excute IOS command.
So I see the possible solution is this:
After 15 seconds we use log command to ask IOS generate syslog then use EEM to pickup syslog trigger and execute "shut". Do the same after 3 seconds with different syslog message to do "no shut".
You can check here for Cisco EEM detail:
https://supportforums.cisco.com/community/netpro/network-infrastructure/eem