cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
4965
Views
5
Helpful
18
Replies
1damianjones
Beginner

Upgrade TCL Play Message script

I'm in the processing of migrating from my cme 2821 to cucm 11.5.  One of the last things I need to do is migrate the play_message_2 script I had on the old system.  The script was written about 10 years ago and TAC says it may need to be upgraded to work on my isr4331.

I've started researching by reading Cisco IOS Scripting with TCL Configuration Guide, Cisco IOS Release 12.4T.  My version on the isr  is Cisco IOS Software, ISR Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 15.5(3)S4b, RELEASE SOFTWARE (fc1).

My initial question:  Is it even worth trying to modify my old script or should I just look to make a new one?

Here's the old script:

r-gnc-2821-1#more flash:paging_89.tcl

####################################################################

### Copyright (c) 2013 by Cisco Systems, Inc.                    ###

##  All rights reserved.  ##

#  -----------------------------------------------------------   #

# Script Version: 1.0           #

# Script Name: play_message_2_AB.tcl   #

# Script Lock Date:   #

# Script Locked By:   #

#  -----------------------------------------------------------     #

# Configs Needed from IOS           #

#  -----------------------------------------------------------     #

# application .   #

#    service nato_in  flash:play_message_2_AB.tcl                  #

#     param ring-prompt flash:ring.au                              #

##                                                                ##

###         ###

####################################################################

# initialize the parameters that configured from IOS CLI

proc init_configs { }  {

    global prompt1

   

    if [infotag get cfg_avpair_exists prompt-1] {

           set prompt1 [string trim [infotag get cfg_avpair prompt-1]]    

        } else {

         puts ">>> TCL: ERROR need to configure prompt-1 <<<"

    } 

   

   

}

#procedure to setup call

proc act_Setup { } {

    global in_leg

    global out_leg

    puts ">>>>>> act_Setup      <<<<<<<<"

    leg setupack leg_incoming

    leg connect leg_incoming

    set dest [infotag get leg_dnis]  

    set in_leg [infotag get leg_incoming]

set out_leg ""

    # set ani [infotag get leg_ani]

    puts "******** DNIS from infotag get leg_dnis is : $dest"

    #for SIP trunk

    regexp {[0-9]+} $dest dest

    # regexp {[0-9]+} $ani ani

    #for SIP trunk

    puts "******** Destination number is : $dest"

    set dest *89

    leg setup $dest callInfo leg_incoming

  

}

proc act_CallSetupDone { } {

    global out_leg

    global in_leg

    global busy_prompt

    set status [infotag get evt_status]

    puts ">>> TCL: Status of leg setup is $status <<<"

   

   

    if { $status == "ls_000"} {

     set out_leg [infotag get leg_outgoing]

         puts  "Destroy Connection All"

         connection destroy con_all   

    }

}

# disconnect the call

proc act_Cleanup { } {

   

    puts ">>> Tcl: act_Cleanup <<<"

    

    call close

}

proc act_Destroy { } {

     global ring_prompt

     global in_leg

   

     puts ">>>>>> act_Destroy <<<<<<<<"

     act_Play_prompt1  

}

proc act_Play_prompt1 { } {

     global prompt1

     global out_leg

   

     puts ">>>>>> act_Play_prompt1 <<<<<<<<"

     media play $out_leg $prompt1

   

}

proc act_MediaDone { } {

 

    puts ">>>>>> act_MediaDone <<<<<<<<"

   

    call close

}

init_configs

set fsm(CALL_INIT,ev_setup_indication)   "act_Setup CALLSETUP"

set fsm(CALLSETUP,ev_media_done)   "act_Play_ring    same_state"

set fsm(CALLSETUP,ev_setup_done)    "act_CallSetupDone    CONNECT"

set fsm(CONNECT,ev_named_timer)   "act_Cleanup       CALLDISCONNECT"

set fsm(DESTBUSY,ev_disconnected)   "act_Cleanup       CALLDISCONNECT"

set fsm(DESTBUSY,ev_media_done)   "act_Cleanup       CALLDISCONNECT"

set fsm(CALLSETUP,ev_disconnected)   "act_Cleanup       CALLDISCONNECT"

set fsm(CONNECT,ev_destroy_done)    "act_Destroy    same_state"

set fsm(CONNECT,ev_disconnected)   "act_Cleanup       CALLDISCONNECT"

set fsm(CONNECT,ev_media_done)   "act_MediaDone       same_state"

set fsm(CALLSETUPDONE,ev_disconnected)   "act_Cleanup         same_state"

set fsm(CALLDISCONNECT,ev_disconnect_done) "act_Cleanup         same_state"

fsm define fsm CALL_INIT

Any help is appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

Is your router IP address is 10.3.222.102, session target should be your router IP to pick up the script.

dial-peer voice 7777 voip
service paging
destination-pattern 7777
session target ipv4:10.3.222.102
incoming called-number 7777


"cli csim start 7777" wont work in latest IOS version. You should manually make call to trigger the script.

Thanks,
Raghavendra

View solution in original post