08-22-2017 12:10 PM
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.
Solved! Go to Solution.
08-24-2017 09:07 AM
Yes, I can dial *89 from any phone and initiate the paging.
D.
08-24-2017 09:29 AM
Just trying to put things together.
1. Do you have everything the same except a new piece of hardware ? (assuming on old system everything works) ?
2. You said 'When I try to dial 7777 from my extension I get the “call could not be completed as dialed.”' Do you know where this announcement coming from ? It could be before hitting script or after script routed the dest *89 or none of them, right ?
3. If script was triggered we really need the debug to see what's going on ?
My guess is that something went wrong out side of script, I mean nothing to do with script logic.
08-24-2017 09:49 AM
Do you have everything the same except a new piece of hardware ? (assuming on old system everything works) ?
Yes when I plug the rj-11 into the new old hardware (it is right next to the new system) it works fine.
You said 'When I try to dial 7777 from my extension I get the “call could not be completed as dialed.”' Do you know where this announcement coming from ? It could be before hitting script or after script routed the dest *89 or none of them, right ?
the Kron job has this listed
kron policy-list ShiftChange
cli csim start 7777
From what I’ve read the cli csim is a call simulator command and it would dial 7777
If script was triggered we really need the debug to see what's going on ?
I’ve tried the h.323 and SIP debugs. I’ll see if there is something I else I can use to get the them.
D.
08-24-2017 10:23 PM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide