Makes calling work
Much of the code that interfaces with the modem was taken from SXMO. Calling now works for both incoming and outgoing calls
This commit is contained in:
parent
ec6bad4c1a
commit
72ecf44743
6 changed files with 242 additions and 45 deletions
41
bin/.bin/modem/makeCall
Executable file
41
bin/.bin/modem/makeCall
Executable file
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
source "$DIR/common"
|
||||
|
||||
export DISPLAY=:0.0
|
||||
|
||||
usage(){
|
||||
echo "makeCall number"
|
||||
echo "Options:"
|
||||
echo " -h|--help Display this help text"
|
||||
echo " -m|--modem Specify a modem"
|
||||
echo " --dry-run Don't actually call"
|
||||
}
|
||||
|
||||
modem="$(mmcli -L | grep -oE 'Modem\/[0-9]+' | head -n 1 | cut -d'/' -f2)"
|
||||
|
||||
# Read the options and set stuff
|
||||
while [[ $1 = -?* ]]; do
|
||||
case $1 in
|
||||
-h|--help) usage; exit;;
|
||||
-m|--modem) modem="$2"; shift ;;
|
||||
--dry-run) dryrun="--dry-run" ;;
|
||||
--) shift; break ;;
|
||||
*) die "invalid option: '$1'." ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
number="$1"
|
||||
|
||||
[ -z "$number" ] && die "No Number Specified"
|
||||
|
||||
callID="$(mmcli -m "$modem" --voice-create-call "number=$number" |
|
||||
grep -Eo 'Call\/[0-9]+' | head -n 1 | cut -d'/' -f2)"
|
||||
|
||||
|
||||
|
||||
checkCall $dryrun "$callID"
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue