Created
May 8, 2012 19:32
-
-
Save sulrich/2638704 to your computer and use it in GitHub Desktop.
an old shell script to enable one to do vonage dialing from the command line. particularly nice when you have the phone number in your clipboard and you want to use quicksilver or something along those lines to make the call.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
RCFILE=$HOME/.vonage | |
PREFIX='1' | |
#if [ a$1 = a ] | |
#then | |
# printf '\n\nUsage: dial \n\n' | |
# exit | |
#fi | |
if [ ! -f $HOME/.vonage ] | |
then | |
printf 'phone number: ' | |
read aPhoneNum | |
printf 'phone username: ' | |
read aUser | |
printf 'phone password (not echoed): ' | |
stty -echo | |
read aPass | |
stty echo | |
echo #!/bin/sh >$RCFILE | |
echo VONAGE_USERNAME=$aUser >>$RCFILE | |
echo VONAGE_PASSWORD=$aPass >>$RCFILE | |
echo VONAGE_NUMBER=$aPhoneNum >>$RCFILE | |
chmod 600 $RCFILE | |
fi | |
. $HOME/.vonage | |
# | |
PHONENUM=`pbpaste | sed 's/[^[:alnum:]]//g'`; | |
DIGITS=$PREFIX$PHONENUM | |
echo Dialing $DIGITS... | |
DIAL_URL="https://secure.click2callu.com/tpcc/makecall?username=$VONAGE_USERNAME | |
&password=$VONAGE_PASSWORD&fromnumber=$VONAGE_NUMBER&tonumber=$DIGITS" | |
curl $DIAL_URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment