#!/bin/sh #------------------------------------------------------------------------------ # /var/install/bin/capi2text-test-broadcast - initiate test broadcast # # Copyright (c) 2009-2024 The Eisfair Team, team(at)eisfair(dot)org # # Creation : 2009-05-21 jed # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #------------------------------------------------------------------------------ # read eislib . /var/install/include/eislib configfile=/etc/config.d/capi2text if [ -f ${configfile} ] then . ${configfile} # CALL_DATE=2008-10-15 / CALL_TIME=21:10:01 / CALL_NR=022122233345 / CALL_MSN=21 CALL_DATE=${EISDATE} CALL_TIME=${EISTIME} CALL_NR='0044007007007' CALL_MSN=99 NAME='James Bond' DETAILS='Ian Fleming Street 7, London, UK' loginfo='[T]' # -> Test clrhome mecho --info "test broadcast" mecho # broadcast result to network if [ "${CAPI2TEXT_CALL2RESPOND}" = "yes" ] then if [ "${CAPI2TEXT_LOG2FILE}" = "yes" ] then # write entry to call log printf "${CALL_DATE}\t${CALL_TIME}\t${CALL_NR}\t${CALL_MSN}\t${NAME} ${loginfo}\t${DETAILS}\n" >> ${CAPI2TEXT_LOG2FILE_FILENAME} fi mecho "The Respond2 program, or whatever you are using to show call" mecho "notifications, should show a popup window now. The displayed" mecho "message may differ from what has been sent depending how the" mecho "program works." mecho RPARAM=`printf "[${CALL_DATE} ${CALL_TIME}] von ${CALL_NR} an ${CALL_MSN}\n${NAME} ${loginfo}\n${DETAILS}\n"` if [ -n "${CAPI2TEXT_CALL2RESPOND_BROADCAST}" ] then BROADCASTADDR=${CAPI2TEXT_CALL2RESPOND_BROADCAST} else # default BROADCASTADDR="255.255.255.255" fi mecho "--Broadcast-------------------------------------------------" mecho "Broadcasting message to address ${CAPI2TEXT_CALL2RESPOND_BROADCAST} on port ${CAPI2TEXT_CALL2RESPOND_UDPPORT}/udp" mecho mecho "${RPARAM}" /usr/sbin/respond.pl ${CAPI2TEXT_CALL2RESPOND_UDPPORT} "${RPARAM}" ${BROADCASTADDR} mecho "--Broadcast-------------------------------------------------" else echo "Error: CAPI2TEXT_CALL2RESPOND='no' has been set!" fi else echo "Error: No configuration file '${configfile}' found!" fi anykey exit 0