Compare commits
2 Commits
b615aaa634
...
de37f626c7
Author | SHA1 | Date |
---|---|---|
Gandalf | de37f626c7 | |
Gandalf | 9f96328b70 |
11
callerid.sh
11
callerid.sh
|
@ -1,7 +1,14 @@
|
||||||
BASEPATH=$(dirname $(realpath $0))
|
BASEPATH=$(dirname $(realpath $0))
|
||||||
. $BASEPATH/authorization.sh
|
#. $BASEPATH/authorization.sh
|
||||||
|
CALLER_ID="+49"
|
||||||
|
CALLER_ID_JSON=
|
||||||
case "$SPOOF" in
|
case "$SPOOF" in
|
||||||
"1")
|
"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}'"}'
|
CALLER_ID_JSON='{"value":"'${CALLER_ID}'"}'
|
||||||
;;
|
;;
|
||||||
"-1")
|
"-1")
|
||||||
|
@ -13,4 +20,4 @@ case "$SPOOF" in
|
||||||
esac
|
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)
|
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
|
||||||
|
|
3
fax.sh
3
fax.sh
|
@ -44,6 +44,8 @@ do
|
||||||
shift ;;
|
shift ;;
|
||||||
"--spoof-callerid")
|
"--spoof-callerid")
|
||||||
SPOOF=1
|
SPOOF=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
"--")
|
"--")
|
||||||
shift
|
shift
|
||||||
break ;;
|
break ;;
|
||||||
|
@ -62,7 +64,6 @@ fi
|
||||||
#Spoof CallerID if wanted
|
#Spoof CallerID if wanted
|
||||||
if [ $SPOOF -eq 1 ]
|
if [ $SPOOF -eq 1 ]
|
||||||
then
|
then
|
||||||
$CALLER_ID="+491234556789"
|
|
||||||
. $BASEPATH/callerid.sh
|
. $BASEPATH/callerid.sh
|
||||||
SPOOF=-1
|
SPOOF=-1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue