Fixup inconsistent usage of default country on phone numbers

master
Stacy Harper 3 years ago
parent 03b7a9d59f
commit 469f7cbd13
No known key found for this signature in database
GPG Key ID: 5BAC92328B7C5D65
  1. 6
      configs/appcfg/xinit_template
  2. 4
      scripts/core/sxmo_contactmenu.sh

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

@ -4,13 +4,13 @@
. "$(dirname "$0")/sxmo_common.sh"
valid_number() {
if pn valid "$1"; then
if pn valid ${DEFAULT_COUNTRY:+-c "$DEFAULT_COUNTRY"} "$1"; then
echo "$1"
return
fi
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"
return
fi

Loading…
Cancel
Save