File: callhandler

package info (click to toggle)
smstools 3.1.21-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,500 kB
  • sloc: ansic: 18,624; sh: 1,196; php: 115; makefile: 42; awk: 17
file content (16 lines) | stat: -rwxr-xr-x 430 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

# Incoming missed call sample (eventhandler).

# In the modem section of smsd.conf define phonecalls = yes
# and use this script as an eventhandler or part of it.

if [ "$1" = "CALL" ]; then
  TO=`formail -zx From: <$2`
  FILE=`mktemp /tmp/send_XXXXXX`
  echo "To: $TO" > $FILE
  echo "" >> $FILE
  echo "This number only accepts SMS." >> $FILE
  FILE2=`mktemp /var/spool/sms/outgoing/send_XXXXXX`
  mv $FILE $FILE2
fi