summaryrefslogtreecommitdiffstats
path: root/abs/core/ncid/ncid-linhes
blob: 1a9e74c6fbd64db6b63ef6c12dbc0facc3a811bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/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<MESSAGE>\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

ConfigDir=/etc/ncid
ConfigFile=$ConfigDir/ncidmodules.conf

[ -f $ConfigFile ] && . $ConfigFile

read CIDDATE
read CIDTIME
read CIDNMBR
read CIDNAME
read CIDLINE
read CIDTYPE

#echo "$CIDDATE|$CIDTIME|$CIDNMBR|$CIDNAME|$CIDLINE|$CIDTYPE" > /dev/tty
/usr/LH/bin/lh_message.sh "$CIDNMBR\n$CIDNAME\n$CIDTYPE"
exit 0