Attach TCL application in outbound direction on outbound dial-peer

Version 1
    This document was generated from CDN thread

    Created by: Hesham Moussa on 26-06-2009 05:32:35 PM
    Hi all,
     
    I have an issue with a TCL script which I want to bind to a dial-peer in the outbound direction. The mechanics of it in my head are:
     
    1.) Outgoing call hits outbound dial-peer
    2.) Script which is applied in the direction out-bound gets invoked and runs.
    3.) Calls gets put through transparently without any action from the script as it is just a timer script counting down.
    4.) Once timer expires, it clears all call legs.
     
    I just can't seem to invoke the script as the call hits the outbound dial-peer but the script doesn't run.
     
    Think I am missing something fundamental here between the differences between outbound and inbound scripts.
     
    Any help would be appreciated.
     
    An example of the script is below:
     
    proc init { } {

    puts "\noutbound.tcl Debug: In init process.

    }

    proc do_setup { } {

        global dnis

        set dnis [infotag get leg_dnis]

        leg setup leg_outgoing

        set eventstatus [infotag get evt_event]

        puts "\noutbound.tcl Debug: In do_setup process. Event status is $eventstatus"
    }

    proc do_place_call { } {

        puts "\noutbound.tcl Debug: In do_place_call process. Event status is $eventstatus"   

        set eventstatus [infotag get evt_event]
    }

    proc do_active_timer { } {

        set eventstatus [infotag get evt_event]

        puts "\nKube Debug: In do_active_timer state. Event status is $eventstatus"

        timer start named_timer 10 timer_1

        set eventstatus [infotag get evt_event]

        puts "\nKube Debug: In do_active_timer state. Event status is $eventstatus"

    }

    proc do_cleanup { } {

        set eventstatus [infotag get evt_event]

        puts "\noutbound.tcl Debug: In do_cleanup process. Event status is $eventstatus"   

        call close

        puts "\nEB Debug: Clean and close call"
    }

    init

    #----------------------------------
    #   State Machine
    #----------------------------------

      set TopFSM(CALL_INIT,ev_any_event) "do_setup,PLACING_CALL"

      set TopFSM(PLACING_CALL,ev_any_event) "do_place_call,HAND_OVER"

      set TopFSM(HAND_OVER,do_active_timer) "do_active_timer,COUNT_DOWN"

      set TopFSM(COUNT_DOWN,ev_named_timer) "CLEAN_UP,do_cleanup"

      set TopFSM(any_state,ev_any_event) "do_cleanup,CLEAN_UP"

      fsm define TopFSM  CALL_INIT

    Subject: RE: Attach TCL application in outbound direction on outbound dial-peer
    Replied by: VijayPrasad Neelamegam on 29-06-2009 09:52:42 AM
    Hi,
     
    I have gone through your script,If you want to set it for outbound direction,kindly try the following.
    Use this
    set TopFSM(CALL_INIT,ev_handoff) "do_setup,PLACING_CALL"
    instead of
    set TopFSM(CALL_INIT,ev_any_event) "do_setup,PLACING_CALL"
    and remove     leg setup leg_outgoing.
     
    Moreover i found that FSM's and events you are waitnig for are incorrect.
     
    Thanks
    Vijay