diff --git a/scripts/modem/sxmo_modemcall.sh b/scripts/modem/sxmo_modemcall.sh index b00349a..52bb4f4 100755 --- a/scripts/modem/sxmo_modemcall.sh +++ b/scripts/modem/sxmo_modemcall.sh @@ -34,9 +34,7 @@ vid_to_number() { mmcli -m "$(modem_n)" -o "$1" -K | grep call.properties.number | cut -d ':' -f2 | - tr -d ' ' | - sed 's/^[+]//' | - sed 's/^1//' + tr -d ' ' } log_event() { diff --git a/scripts/modem/sxmo_modemdial.sh b/scripts/modem/sxmo_modemdial.sh index 29b7910..f6587e0 100755 --- a/scripts/modem/sxmo_modemdial.sh +++ b/scripts/modem/sxmo_modemdial.sh @@ -25,12 +25,7 @@ dialmenu() { )" echo "$NUMBER" | grep "Close Menu" && kill 0 - NUMBER="$( - echo "$NUMBER" | - awk -F' ' '{print $NF}' | - tr -d - | - cut -f2 - )" + NUMBER="$(echo "$NUMBER" | cut -d: -f1 tr -d '- ')" echo "$NUMBER" | grep -qE '^[+0-9]+$' || fatalerr "$NUMBER is not a number" echo "Attempting to dial: $NUMBER" >&2 diff --git a/scripts/modem/sxmo_modemmonitor.sh b/scripts/modem/sxmo_modemmonitor.sh index d8201f8..b981e05 100755 --- a/scripts/modem/sxmo_modemmonitor.sh +++ b/scripts/modem/sxmo_modemmonitor.sh @@ -50,8 +50,7 @@ checkforincomingcalls() { mmcli -m "$(modem_n)" --voice-list-calls -o "$VOICECALLID" -K | grep call.properties.number | cut -d ':' -f 2 | - sed 's/^[+]//' | - sed 's/^1//' + tr -d ' ' ) # Log to /tmp/incomingcall to allow pickup and log into modemlog @@ -86,9 +85,7 @@ checkfornewtexts() { NUM="$( echo "$TEXTDATA" | grep sms.content.number | - sed -E 's/^sms\.content\.number\s+:\s+[+]?//' | - sed 's/^[+]//' | - sed 's/^1//' + sed -E 's/^sms\.content\.number\s+:\s+[+]?//' )" TIME="$(echo "$TEXTDATA" | grep sms.properties.timestamp | sed -E 's/^sms\.properties\.timestamp\s+:\s+//')" diff --git a/scripts/modem/sxmo_modemtext.sh b/scripts/modem/sxmo_modemtext.sh index 7ff4622..44a049e 100755 --- a/scripts/modem/sxmo_modemtext.sh +++ b/scripts/modem/sxmo_modemtext.sh @@ -22,7 +22,7 @@ editmsg() { sendmsg() { MODEM="$(modem_n)" - NUMBER="$(echo "$1" | sed 's/^[+]//' | sed 's/^1//')" + NUMBER="$1" TEXT="$2" TEXTSIZE="${#TEXT}"