Fixup inconsistent usage of default country on phone numbers

This commit is contained in:
Stacy Harper 2021-06-18 10:30:49 +02:00
parent 03b7a9d59f
commit 469f7cbd13
No known key found for this signature in database
GPG key ID: 5BAC92328B7C5D65
2 changed files with 5 additions and 5 deletions

View file

@ -25,9 +25,9 @@ amixer set "Line Out" 50%
#mpv --quiet --no-video ~/welcome.ogg & #mpv --quiet --no-video ~/welcome.ogg &
# You will sometime get SMS or calls from not # You will sometime get SMS or calls from not
# country code prefixed phone numbers. To ensure # country code prefixed phone numbers. To make
# we match your contacts, we will use this one. # it easy to fixup configure the default countryu.
#export DEFAULT_NUMBER_PREFIX=+33 #export DEFAULT_COUNTRY=FR
# turn on modemmonitor on login # turn on modemmonitor on login
# Note: if the modemmonitor is not on you can # Note: if the modemmonitor is not on you can

View file

@ -4,13 +4,13 @@
. "$(dirname "$0")/sxmo_common.sh" . "$(dirname "$0")/sxmo_common.sh"
valid_number() { valid_number() {
if pn valid "$1"; then if pn valid ${DEFAULT_COUNTRY:+-c "$DEFAULT_COUNTRY"} "$1"; then
echo "$1" echo "$1"
return return
fi fi
REFORMATTED="$(pn find ${DEFAULT_COUNTRY:+-c "$DEFAULT_COUNTRY"} "$1")" REFORMATTED="$(pn find ${DEFAULT_COUNTRY:+-c "$DEFAULT_COUNTRY"} "$1")"
if pn valid "$REFORMATTED"; then if pn valid ${DEFAULT_COUNTRY:+-c "$DEFAULT_COUNTRY"} "$REFORMATTED"; then
echo "$REFORMATTED" echo "$REFORMATTED"
return return
fi fi