ここhttps://s.webry.info/sp/vogel.at.webry.info/201801/article_4.htmlを参考にして構築。 注意点のみ記載する。
# apt-get install portaudio19-dev
baresip 2>&1| sed -n "s/^.\+from: \(.\+\) sip.\+/\1/gp"
netcat 127.0.0.1 5555 -N < ab.txt 2>&1 > /dev/null
----- ~/hangup.sh ----- #!/bin/bash NUMX="Connection" DATX="1234" while : do NUM0=`tail -1 /var/log/messages | cut -d":" -f7 | cut -c 2-12` DAT0=`tail -1 /var/log/messages | cut -d" " -f1-3` #echo "$DAT0: $NUM0" if test "$DAT0" != "$DATX" && test "$DATX" != "1234" ; then if echo "$NUM0" | grep '^0120\|^0800' >/dev/null; then echo "迷惑電話着信?あり" cat /home/pi/ab.txt | netcat -u 127.0.0.1 5556 & else echo "$DAT0: $NUM0" fi fi DATX="$DAT0" sleep 2 done
----- =/ab.txt ------ /accept /hangup
if echo "$NUM0" | grep -f /home/pi/rjectno.txt >/dev/null; then