#!/bin/sh # keep "ncid-" in the name # input is 6 lines obtained from ncid # input: DATE\nTIME\nNUMBER\nNAME\nLINE\nTYPE\n # # input is 6 lines if a message was sent # input: \n\n\n\n\nMSG\n # Message will be in $CIDNAME # # ncid usage: # ncid --no-gui [--message] --program ncid-linhes # $CIDTYPE is one of: # CID: incoming call # OUT: outgoing call # HUP: blacklisted hangup # MSG: message instead of a call MYTH_RUN_STATUS=1 . /etc/profile ConfigDir=/etc/ncid ConfigFile=$ConfigDir/ncidmodules.conf [ -f $ConfigFile ] && . $ConfigFile read CIDDATE read CIDTIME read CIDNMBR read CIDNAME read CIDLINE read CIDTYPE LOC='' #areacode=`echo $CIDNMBR | cut -d "(" -f2 | cut -d ")" -f1` areacode=`echo $CIDNMBR | cut -d "-" -f1` if [ -e $MV_ROOT/templates/ncid/areacodes.csv ] then LOC=`grep $areacode $MV_ROOT/templates/ncid/areacodes.csv |cut -d "," -f2` fi #echo "$CIDDATE|$CIDTIME|$CIDNMBR|$CIDNAME|$CIDLINE|$CIDTYPE" > /dev/tty /usr/LH/bin/msg_client.py --clear /usr/LH/bin/msg_client.py --kill sleep .2 /usr/LH/bin/msg_client.py --msg "$CIDNMBR\n$CIDNAME\n$CIDTYPE\n$LOC" exit 0