Skip to content

Instantly share code, notes, and snippets.

@sulrich
Created August 27, 2013 16:36
Show Gist options
  • Save sulrich/6355901 to your computer and use it in GitHub Desktop.
Save sulrich/6355901 to your computer and use it in GitHub Desktop.
old script to enable dialing via quicksilver on cisco ip phones. so much has changed since then ...
#!/bin/sh
#
RCFILE=$HOME/.ipphone
PREFIX='91'
#if [ a$1 = a ]
#then
# printf '\n\nUsage: dial <dial string>\n\n'
# exit
#fi
if [ ! -f $HOME/.ipphone ]
then
printf 'phone IP address (press settings-3-6 to find out): '
read aIP
printf 'phone username: '
read aUser
printf 'phone password (not echoed): '
stty -echo
read aPass
stty echo
echo #!/bin/sh >$RCFILE
echo IPPHONE_CREDENTIALS=$aUser:$aPass >>$RCFILE
echo IPPHONE_ADDRESS=$aIP >>$RCFILE
chmod 600 $RCFILE
fi
. $HOME/.ipphone
#
PHONENUM=`pbpaste | sed 's/[^[:alnum:]]//g'`;
DIGITS=$PREFIX$PHONENUM
echo Dialing $DIGITS...
curl --user $IPPHONE_CREDENTIALS -d 'XML=%3CCiscoIPPhoneExecute%3E%3CExecuteItem+URL%3D%27Dial%3A'$DIGITS'%27%2F%3E%3C%2FCiscoIPPhoneExecute%3E&B1=Submit' http://$IPPHONE_ADDRESS/CGI/Execute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment