Skip to content

Commit

Permalink
comgt: add support for defining dial number in config file
Browse files Browse the repository at this point in the history
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>

SVN-Revision: 40942
  • Loading branch information
John Crispin committed Jun 2, 2014
1 parent f91dd34 commit 8e7b974
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package/network/utils/comgt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=comgt
PKG_VERSION:=0.32
PKG_RELEASE:=21
PKG_RELEASE:=22

PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
PKG_SOURCE_URL:=@SF/comgt
Expand Down
2 changes: 1 addition & 1 deletion package/network/utils/comgt/files/3g.chat
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ OK "ATE1"
OK 'AT+CGDCONT=1,"IP","$USE_APN"'
SAY "Calling UMTS/GPRS"
TIMEOUT 30
OK "ATD*99***1#"
OK "ATD$DIALNUMBER"
CONNECT ' '
9 changes: 8 additions & 1 deletion package/network/utils/comgt/files/3g.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ proto_3g_init_config() {
proto_config_add_string "apn"
proto_config_add_string "service"
proto_config_add_string "pincode"
proto_config_add_string "dialnumber"
}

proto_3g_setup() {
Expand All @@ -23,6 +24,7 @@ proto_3g_setup() {
json_get_var apn apn
json_get_var service service
json_get_var pincode pincode
json_get_var dialnumber dialnumber

[ -e "$device" ] || {
proto_set_available "$interface" 0
Expand Down Expand Up @@ -74,10 +76,15 @@ proto_3g_setup() {
[ -n "$SIERRA" ] && {
gcom -d "$device" -s /etc/gcom/getcarrier.gcom || return 1
}

if [ -z "$dialnumber" ]; then
dialnumber="*99***1#"
fi

;;
esac

connect="${apn:+USE_APN=$apn }/usr/sbin/chat -t5 -v -E -f $chat"
connect="${apn:+USE_APN=$apn }DIALNUMBER=$dialnumber /usr/sbin/chat -t5 -v -E -f $chat"
ppp_generic_setup "$interface" \
noaccomp \
nopcomp \
Expand Down

0 comments on commit 8e7b974

Please sign in to comment.