[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

9537.0. "cu command" by MSE1::RAO () Thu Apr 17 1997 10:41

    
    Hi,
         I tried to use "cu" command to dial a phone to beep network
         operator when certain type of alarm is received by a TeMIP network
         management station on Digital UNIX
    
         Used the following script and it does not work...
         any help appreciated. I noticed that when I run this
         cu command does not get dev or telephone information
    
    
    
    # EXAMPLE:
    #       beep_95lx 9,1-800-555-7243 123456 2001
    #
    ###########################################
    #
    # Parameters to modify for your environment
    #
    DEVICE=/dev/cul00   # Modem device over which to place the call
    #
    # Define CU options
    # see cu(1) man page for options
    #
    CU_OPTS="-l${DEVICE} -m dir"
    #
    #
    # File to log errors and calls to.  Use /dev/null to ignore
    #
    LOG=/tmp/${0##*/}.log
    ###########################################
    
    elif [ $# -ne 2 ]; then
        echo "usage: ${0##*/} phone pager [code]" >&2
        echo "       phone: phone number to dial" >&2
        echo "       pager: pager id" >&2
        echo "       code: display code for pager" >&2
        exit 1
    else
        CODE=0000
    fi
    PHONE="$1"
    PAGER="$2"
    
    # Put the following commands inside of curley braces so we can
    # pipe the output to cu.  Redirect stdout and stderr of cu to
    /dev/null, since
    # we really don't care much about the progress of the call
    {
        #
        # Log the call
        #
        echo "\n`date`\nDialing ${PHONE} pager ${PAGER} code ${CODE}" >>
    $LOG
    
        #
        # Be sure we have the modem's attention by sending it
        # the AT command twich
        #
        echo "AT<CR>"
        echo "AT<CR>"
        sleep 1
    
        #
        # Output commands to dial paging system, to enter pager number, and
    to
        # enter callback number.  The paging system in this example accepts
    an
        # asterisk (*) to turn off voice prompts and a pound sign (#) after
        # each input field and a final pound sign to confirm.  Other paging
        # systems may require different commands.
        # As is typical with the "AT" dial set commas separate the commands
        # with a short pause.  Add several pauses after dialing to be sure
        # we have gotten through the phone system
        #
       #
    
        echo "ATDT${PHONE},,,,,*,${PAGER}#${CODE}##\n<CR>"
    
        # Wait long enough for modem to complete call, and then output
    command to
        # terminate the cu executable.
    
        sleep 30
        echo "~."
    } | cu ${CU_OPTS} >> $LOG 2>&1
     
    
    
T.RTitleUserPersonal
Name
DateLines