diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-05-15 21:58:32 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-05-15 21:58:32 +0000 |
commit | 4e2a9d48289adbbcf05201ea1f0b576a9ad81eb2 (patch) | |
tree | b93b61fe28eb378f40c61c8f9ba441af36d7fda1 | |
parent | 901e4311169f664951a7664efa0900f214ede862 (diff) | |
download | drakx-net-4e2a9d48289adbbcf05201ea1f0b576a9ad81eb2.tar drakx-net-4e2a9d48289adbbcf05201ea1f0b576a9ad81eb2.tar.gz drakx-net-4e2a9d48289adbbcf05201ea1f0b576a9ad81eb2.tar.bz2 drakx-net-4e2a9d48289adbbcf05201ea1f0b576a9ad81eb2.tar.xz drakx-net-4e2a9d48289adbbcf05201ea1f0b576a9ad81eb2.zip |
make dial number optional when writing chat script
-rw-r--r-- | lib/network/connection/ppp.pm | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/network/connection/ppp.pm b/lib/network/connection/ppp.pm index d1db2b3..0d90d8a 100644 --- a/lib/network/connection/ppp.pm +++ b/lib/network/connection/ppp.pm @@ -71,24 +71,25 @@ sub build_ifcfg_settings { sub build_chat { my ($self) = @_; - #- required access parameters: - #- dial_number #- optional: #- auth_method: key of %authentication_methods + #- dial_number #- login #- password #- at_commands: array ref of AT commands (map { "ABORT $_" } "BUSY", "ERROR", "'NO CARRIER'", "'NO DIALTONE'", "'Invalid Login'", "'Login incorrect'", "VOICE", "'NO ANSWER'", "DELAYED", "'SIM PIN'"), qq('' ATZ), if_(ref $self->{access}{at_commands}, map { qq(OK-AT-OK '$_') } @{$self->{access}{at_commands}}), - qq(OK 'ATDT$self->{access}{dial_number}'), - qq(TIMEOUT 120), - qq(CONNECT ''), - if_(member($self->{access}{auth_method}, qw(script terminal)), - qq('ogin:--ogin:' '$self->{access}{login}'), - qq('ord:' '$self->{access}{password}')), - qq(TIMEOUT 5), - qq('~--' ''); + if_($self->{access}{dial_number}, + qq(OK 'ATDT$self->{access}{dial_number}'), + qq(TIMEOUT 120), + qq(CONNECT ''), + if_(member($self->{access}{auth_method}, qw(script terminal)), + qq('ogin:--ogin:' '$self->{access}{login}'), + qq('ord:' '$self->{access}{password}')), + qq(TIMEOUT 5), + qq('~--' ''), + ); } sub write_chat { |