cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6128
Views
5
Helpful
18
Replies

Upgrade TCL Play Message script

1damianjones
Level 1
Level 1

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

18 Replies 18

yawming
Cisco Employee
Cisco Employee

Script is around 4 years old and is a very simple script. I will try to deploy without doing anything on your new system first, if really doesn't work come back here with debug message I think should have someone to help you from there.

how would I put it in debug mode to get the info?  I've tried in in the new system and no joy.

Thanks for your response.    

Two commonly used debug are :

debug  voip application ?

for example : deb voip app tcl

debug voip ccapi ?

for example: deb voip ccapi inout

Thanks. Willdo.

@yawchen I’m not getting out put on the logs. So that answers the question. I’ll have to create a new one.

Thanks,

D.

Please make sure TCL script configured to correct dialpeer. You don’t need to create new one, you can use same script.

Router#debug voip app
Router#debug voip ccapi inout

please use below command to make sure script registered sucessfully.

Router#sh call application voice <appname>

Thanks,
Raghavendra

From my untrained eye things look in order. Kron statements activate the script :

kron occurrence ShiftChange1 at 6:00 recurring

policy-list ShiftChange

!

kron occurrence ShiftChange2 at 9:00 recurring

policy-list ShiftChange

!

kron occurrence ShiftChange3 at 9:12 recurring

policy-list ShiftChange

!

kron occurrence ShiftChange4 at 9:15 recurring

policy-list ShiftChange

!

kron policy-list ShiftChange

cli csim start 7777

cli csim start 7777

When I try to dial 7777 from my extension I get the “call could not be completed as dialed.” I assumed it would active the script manually.

These are my dial-peers

dial-peer voice 7777 voip

service paging

destination-pattern 7777

session target ipv4:10.3.222.102

incoming called-number 7777

dtmf-relay h245-alphanumeric

codec g711ulaw

no vad

!

dial-peer voice 89 pots:

description Paging Adapter

destination-pattern *89

port 1/0/1

forward-digits all

This is how I call the application:

application

service paging flash:paging_89.tcl

param prompt-1 flash:500hztone.au

!

sh call application voice paging

Script Name : paging

URL : flash:paging_89.tcl

Type : Service

State: Registered

Life : Configured

Exec Instances: 0

Parameters registered under paging namespace:

name type default value description

retry-count I 3 the number of attempts to reenter PIN

redirect-number S the telephone number where a call is redirected to

uid-len I 10 the number of digits in UID

warning-time I 30 the time (in secs) within which a user is warned before the calling time expires (call terminates)

pin-len I 4 the number of digits in PIN

  1. Script Code Begin:

#

I don't think "csim start" command will work in latest IOS version.

could you please share the logs by calling with your extension.

Thanks,

Raghavendra

I still have the debugs in place but surprisingly still not output on the logs. Here the show log and show deb commands and outputs:

isr4331-222.100#sh log

Syslog logging: enabled (0 messages dropped, 16 messages rate-limited, 17 flushes, 0 overruns, xml disabled, filtering disabled)

No Active Message Discriminator.

No Inactive Message Discriminator.

Console logging: disabled

Monitor logging: disabled

Buffer logging: level debugging, 264183 messages logged, xml disabled,

filtering disabled

Exception Logging: size (4096 bytes)

Count and timestamp logging messages: disabled

Persistent logging: disabled

No active filter modules.

Trap logging: level debugging, 3956174 message lines logged

Logging to 10.1.10.117 (udp port 514, audit disabled,

link up),

3956173 message lines logged,

0 message lines rate-limited,

0 message lines dropped-by-MD,

xml disabled, sequence number disabled

filtering disabled

Logging Source-Interface: VRF Name:

Log Buffer (10000000 bytes):

isr4331-222.100# sh deb

IOSXE Conditional Debug Configs:

Conditional Debug Global State: Stop

IOSXE Packet Tracing Configs:

Packet Infra debugs:

Ip Address Port

Please refer below link for collecting debugs. You need to configure few commands for collecting the logs.

How to properly and safely collect debu... - Cisco Support Community

Thanks,

Raghavendra

Thanks for the document. That cleared some of the mysterious debug.

I also noticed this in the script:

#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

set in_leg

set out_leg ""

  1. set ani

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

#for SIP trunk

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

  1. regexp {[0-9]+} $ani ani

#for SIP trunk

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

set dest *89

leg setup $dest callInfo leg_incoming

I’ve got a H.323 trunk to my CUCM if that has anything to do with the price of Tea as it seems this is setup for SIP.

Here’s my new debug settings and log:

isr4331-222.100#sh deb

IOSXE Conditional Debug Configs:

Conditional Debug Global State: Stop

IOSXE Packet Tracing Configs:

Packet Infra debugs:

Ip Address Port

From the script I see destination is hardcoded to *89 -    "set dest *89".

In this case it's nothing to do with protocol.

Is this the destination to setup the call ?

Yes, *89 is what we dial from the phone to activate the paging system.

Is there a way to dial *89 without script to make sure you have proper call routing ?

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: