Resettin voice-port every time it is used

Version 1
    This document was generated from CDN thread

    Created by: Christopher Bomba on 13-12-2012 12:20:32 PM
    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"

    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
                             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


    Subject: RE: Resettin voice-port every time it is used
    Replied by: Yaw-Ming Chen on 13-12-2012 12:47:21 PM
    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: