Statusabfrage der von diesem Gerät gesendeten Faxe

callerid
Gandalf 2021-03-04 20:12:46 +01:00
parent e94b3dc78e
commit 5ca77e7479
1 changed files with 11 additions and 0 deletions

11
status.sh Executable file
View File

@ -0,0 +1,11 @@
#! /bin/bash
. $(dirname $(realpath $0))/authorization.sh
while read LINE;
do
JSON=$(curl --request GET --header 'Content-Type: application/json' --header 'Accept: application/json' --header "Authorization: Bearer $AUTH_TOKEN" "https://api.sipgate.com/v2/history/$LINE" -s)
STATUS=$(echo $JSON | jq '.faxStatusType' | sed -e 's:"::g' )
DATE=$(echo $JSON | jq '.created' | sed -e 's:"::g' )
TARGET=$(echo $JSON | jq '.target' | sed -e 's:"::g' )
echo "Fax $LINE vom $(date +%d.%m.%Y -d $DATE) an $TARGET: $STATUS"
done < .fax_history