#!/bin/bash
#******************************************************************************
# TX Series COMMUNICATIONS PROCESSOR BOOT FILE
#
# Execute this file to perform the following:
# - Reset the TX board
# - Synchronize the on-board flash image with the installed software
# - Download TDM configuration
# - Download all TX-based tasks
# - Configure SS7
#******************************************************************************
if [ -z "$DIALOGIC_ROOT" ]
then
DIALOGIC_ROOT=/opt/dialogic
fi
if [ -z "$TX_ROOT" ]
then
TX_ROOT=$DIALOGIC_ROOT/tx
fi
#******************************************************************************
# Set transport (if not already determined)
# Valid options are mtp and sigtran
if [ -z "$TXTRANSPORT" ]
then
TXTRANSPORT=mtp
fi
#******************************************************************************
# Set mode (if not already determined)
# Valid options are standalone and redundant
if [ -z "$TXMODE" ]
then
TXMODE=standalone
fi
#******************************************************************************
# Set configuration (if not already determined)
#
if [ -z "$TXCONFIG" ]
then
TXCONFIG=$TX_ROOT/etc/$TXMODE/ansi
fi
#******************************************************************************
# Define all other script parameters
#
if [ -z "$TXUTIL" ]
then
TXUTIL=$TX_ROOT/bin
fi
if [ -z "$TXBASE" ]
then
TXBASE=$TX_ROOT/cp
fi
#******************************************************************************
# Process arguments - Get the board number
#
case $# in
0)
BRD=1
;;
1)
BRD=$1
;;
*)
echo "Usage: ss7load <board#>"
exit 1
esac
#******************************************************************************
# Clear driver statistics
#
$TXUTIL/txstats -b $BRD -z -q
#******************************************************************************
# Get the model number (TX board type)
#
BOARDTYPE=`$TXUTIL/cpmodel -b$BRD | tail -1 | cut -d' ' -f6`
case $BOARDTYPE in
4000)
FLASH="cpk4000.fls"
;;
5000E)
FLASH="cpk5000.elf"
;;
5020E)
FLASH="cpk5000.elf"
;;
5500E)
FLASH="cpk5000.elf"
;;
*)
echo "ERROR! Board number $BRD not available"
exit 1
;;
esac
#*****************************************************************************
# Reset TX board (and verify TX flash image in sync with installed software)
#
$TXUTIL/txflash -s $TXBASE/$FLASH -b$BRD
#*****************************************************************************
# Perform TX board type-specific load
#
# Perform board type-specific boot for TX 4000
TASKTYPE=elf
# load TDM or IP configuration
if [ $TXTRANSPORT = "mtp" ]
then
$TXUTIL/txconfig -b $BRD -f $TXCONFIG/txcfg$BRD.txt
else
$TXUTIL/txconfig -b $BRD -f $TXCONFIG/ipcfg$BRD.txt
fi
#*****************************************************************************
# Load all TX-based tasks that are common to all board types
#
# To use txdbg,
# you should uncomment the following line to load the debug task
#$TXUTIL/cplot -c $BRD -f $TXBASE/debug.$TASKTYPE -n debug -p 11 -a
# Load TXMON
#
# ***** IMPORTANT NOTE *****
# For convenience we are loading TXMON only in redundant mode. This is
# convenient because MTP will detect the lack of TXMON and will automatically
# enter standalone mode and attempt to bring up the links, without
# application intervention. NOTE HOWEVER, TXMON can be used as a health
# monitor for a single board application in standalone mode. In this case
# the MTP will remain in a Starting state until an application (ie. RMG),
# using the HMI API, specifically sets the mode to Standalone. In other
# words links will not automatically try to align if TXMON is loaded.
#
if [ $TXMODE = "redundant" ]
then
$TXUTIL/cplot -c $BRD -f $TXBASE/txmon.$TASKTYPE -n txmon -p 19 -a
fi
# Load MTP task
#
if [ $TXTRANSPORT = "mtp" ]
then
$TXUTIL/cplot -c $BRD -f $TXBASE/mtp.$TASKTYPE -n mtp -p 20 -a -s 40960
else
$TXUTIL/cplot -c $BRD -f $TXBASE/sigtran.$TASKTYPE -n sigtran -p 20 -a -s 40960
fi
# Enable the following to use JNTT
#
# $TXUTIL/cplot -c $BRD -f $TXBASE/jntt.$TASKTYPE -n jntt -p 15 -a
# Enable the following downloads for SS7 layers you do use
#
#$TXUTIL/cplot -c $BRD -f $TXBASE/sccp.$TASKTYPE -n sccp -p 21 -a
#$TXUTIL/cplot -c $BRD -f $TXBASE/isup.$TASKTYPE -n isup -p 21 -a -s 40960
#$TXUTIL/cplot -c $BRD -f $TXBASE/tup.$TASKTYPE -n tup -p 22 -a -s 40960
#$TXUTIL/cplot -c $BRD -f $TXBASE/tcap.$TASKTYPE -n tcap -p 23 -a
# ISUP only: Enable the download of the ISUP database
# required for your configuration.
#
#$TXUTIL/cplot -c $BRD -f $TXBASE/itublue.$TASKTYPE -n itublue -p 15 -a
#$TXUTIL/cplot -c $BRD -f $TXBASE/ituwhite.$TASKTYPE -n ituwhite -p 15 -a
#$TXUTIL/cplot -c $BRD -f $TXBASE/q767.$TASKTYPE -n q767 -p 15 -a
#$TXUTIL/cplot -c $BRD -f $TXBASE/ansi88.$TASKTYPE -n ansi88 -p 15 -a
#$TXUTIL/cplot -c $BRD -f $TXBASE/ansi92.$TASKTYPE -n ansi92 -p 15 -a
#$TXUTIL/cplot -c $BRD -f $TXBASE/ansi95.$TASKTYPE -n ansi95 -p 15 -a
#$TXUTIL/cplot -c $BRD -f $TXBASE/itu97.$TASKTYPE -n itu97 -p 15 -a
#$TXUTIL/cplot -c $BRD -f $TXBASE/etsiv2.$TASKTYPE -n etsiv2 -p 15 -a
#$TXUTIL/cplot -c $BRD -f $TXBASE/etsiv3.$TASKTYPE -n etsiv3 -p 15 -a
#$TXUTIL/cplot -c $BRD -f $TXBASE/ansibicc.$TASKTYPE -n ansibicc -p 15 –a
#$TXUTIL/cplot -c $BRD -f $TXBASE/itubicc.$TASKTYPE -n itubicc -p 15 -a
#******************************************************************************
# Configure SS7 MTP2, MTP3, SCTP, M3UA, ISUP, TUP, TCAP & SCCP
# (enable these commands for any SS7 layers you do use)
#
# NOTE: MTP level 2 configurability is now available.
# However, level 2 configuration is not strictly necessary.
# The defaults will work for most installations.
#
if [ $TXMODE = "redundant" ]
then
#
# Load redundant configuration files - note that both boards in redundant
# pair use the same configuration file
#
if [ $TXTRANSPORT = "mtp" ]
then
$TXUTIL/mtp2cfg -b $BRD -f $TXCONFIG/MTP3cp${BRD}.cfg
$TXUTIL/mtp3cfg -b $BRD -f $TXCONFIG/MTP3cp${BRD}.cfg
else
$TXUTIL/sctpcfg -b $BRD -f $TXCONFIG/SCTPcp${BRD}.cfg
$TXUTIL/m3uacfg -b $BRD -f $TXCONFIG/M3UAcp${BRD}.cfg
fi
# $TXUTIL/sccpcfg -b $BRD -f $TXCONFIG/SCCP.cfg
# $TXUTIL/tcapcfg -b $BRD -f $TXCONFIG/TCAP.cfg
# $TXUTIL/isupcfg -b $BRD -f $TXCONFIG/ISUP.cfg
# $TXUTIL/tupcfg -b $BRD -f $TXCONFIG/TUP.cfg
else
#
# Load standalone configuration files - note that each board in a standalone
# configuration gets a configuration file unique to that board
#
if [ $TXTRANSPORT = "mtp" ]
then
$TXUTIL/mtp2cfg -b $BRD -f $TXCONFIG/MTP3cp${BRD}.cfg
$TXUTIL/mtp3cfg -b $BRD -f $TXCONFIG/MTP3cp${BRD}.cfg
else
$TXUTIL/sctpcfg -b $BRD -f $TXCONFIG/SCTPcp${BRD}.cfg
$TXUTIL/m3uacfg -b $BRD -f $TXCONFIG/M3UAcp${BRD}.cfg
fi
# $TXUTIL/sccpcfg -b $BRD -f $TXCONFIG/SCCPcp${BRD}.cfg
# $TXUTIL/tcapcfg -b $BRD -f $TXCONFIG/TCAPcp${BRD}.cfg
# $TXUTIL/isupcfg -b $BRD -f $TXCONFIG/ISUPcp${BRD}.cfg
# $TXUTIL/tupcfg -b $BRD -f $TXCONFIG/TUPcp${BRD}.cfg
fi
#******************************************************************************
# Exit load script
exit 0