From 9f96328b70973dab08a8e6fd16fe86145551eef2 Mon Sep 17 00:00:00 2001 From: Gandalf Date: Sat, 5 Feb 2022 18:30:52 +0100 Subject: [PATCH] randomisierte Telefonnummer --- callerid.sh | 11 +++++++++-- fax.sh | 1 - 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/callerid.sh b/callerid.sh index dc6317e..7a914a7 100755 --- a/callerid.sh +++ b/callerid.sh @@ -1,7 +1,14 @@ BASEPATH=$(dirname $(realpath $0)) . $BASEPATH/authorization.sh +CALLER_ID="+49" +CALLER_ID_JSON= case "$SPOOF" in "1") + RANDOM=$(date +%s%N | cut -b10-19) + for (( x=1;x<=11;x++ )); + do + CALLER_ID="${CALLER_ID}$[$RANDOM % 10]" + done CALLER_ID_JSON='{"value":"'${CALLER_ID}'"}' ;; "-1") @@ -12,5 +19,5 @@ case "$SPOOF" in ;; esac OLD_CALLER_ID_JSON=$(curl --request GET --header 'Content-Type: application/json' --header 'Accept: application/json' --header "Authorization: Bearer $AUTH_TOKEN" "https://api.sipgate.com/v2/w0/faxlines/f0/callerid" -s) -REPLY=$(curl --request PUT --header 'Content-Type: application/json' --header 'Accept: application/json' --header "Authorization: Bearer $AUTH_TOKEN" --data ${CALLER_ID_JSON} "https://api.sipgate.com/v2/w0/faxlines/f0/callerid" -s) - +#REPLY=$(curl --request PUT --header 'Content-Type: application/json' --header 'Accept: application/json' --header "Authorization: Bearer $AUTH_TOKEN" --data ${CALLER_ID_JSON} "https://api.sipgate.com/v2/w0/faxlines/f0/callerid" -s) +echo $OLD_CALLER_ID_JSON $CALLER_ID_JSON diff --git a/fax.sh b/fax.sh index e4831bc..4a42b75 100755 --- a/fax.sh +++ b/fax.sh @@ -62,7 +62,6 @@ fi #Spoof CallerID if wanted if [ $SPOOF -eq 1 ] then - $CALLER_ID="+491234556789" . $BASEPATH/callerid.sh SPOOF=-1 fi