Fixup inconsistent usage of default country on phone numbers
This commit is contained in:
parent
03b7a9d59f
commit
469f7cbd13
2 changed files with 5 additions and 5 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue