# AoHTest - back to back test / plugging one span into another with cross over cable.
# ------------------------------------------------------------------------#
#
# This is a script to demonstrate the configuration of a singe-span
# digital HMP board.
#
# From the AoHTest console, this script can be executed by typing
# "script <filename>", in this case:
# > script isdn.txt
#
# The most commonly used configuration options are listed.
#
# Comments are made using the "#" character
#
# Type 'help' at the AoHTest console for more information.
#
# --------------------------------------------------------------------------
# Configure the logging masks to output ISDN-related log messages
log set masks api=0xffffffff isdn=0xffffffff span=0xffffffff
# Configure the board level settings
# -----------------------------------
# interface = <e1|t1>
# clockmode = <master|slave>
# master -> Board derives its own clock
# slave -> Board sources clock from the span
# -----------------------------------

board 0 open
board 0 set config interfacetype=t1 clockmode=master

# Configure the span-level (layer 2) settings
# -------------------------------------------
# framing = <esf | d4 | sf | crc4 | basic>
# encoding = <b8zs|t1ami|get|bell|jam8|hdb3|e1ami>
# loop length = <short|long>
# compand = <ulaw|alaw>

span 0 open
span 0 set config framing=esf encoding=b8zs looplength=short compand=ulaw
span 1 open
span 1 set config framing=esf encoding=b8zs looplength=short compand=ulaw

# Configure the ISDN-level (layer 3) settings
# -------------------------------------------
# switch = <4ess|dms100|lucent5e|ni2|net5>
# country = <none|euroisdn|france|germany|uk|australia>
# node = <client|network>
# client -> default. Normally it is the FAR
# end such as the PBX or Telco that
# is set to "network"

isdn 0 open 0
isdn 0 set config switch=4ess country=none node=network
isdn 1 open 1
isdn 1 set config switch=4ess country=none node=client

# Start the framers and wait until the ISDN groups linkup

isdn 0 start
span 0 start
isdn 1 start
span 1 start

# It may take up to 20 seconds for lines to SPAN UP.
wait 20000
# Indicate that all channels should autoanswer incoming calls
set behavior 0-45 autoanswer