Table of Contents
修改dialer文件,通常位于/etc/dialer。在char一行中增加-s参数,如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#!/bin/sh # # This is part 2 of the on-line script. It will perform the connection # protocol for the desired connection. # exec chat -s -v \ TIMEOUT 3 \ ABORT '\nBUSY\r' \ ABORT '\nNO ANSWER\r' \ ABORT '\nRINGING\r\n\r\nRINGING\r' \ '' \rAT \ '' \rAT+CGDCONT=1,"IP","CMNET" \ 'OK-+++\c-OK' ATH0 \ TIMEOUT 30 \ OK ATDT$TELEPHONE \ CONNECT '' |
其中,-s为使用标准错误。所有由“-v”产生的日志信息和所有的错误信息将发送到标准错误。如果pppd在前台运行则信息输出到stdout和stderr,否则输出到/etc/ppp/connect-errors。
然后查看/etc目录下是否有ppp目录。
调用拨号脚本
查看/etc/ppp/connect-errors文件,此文件包含的拨号的详细过程。下面为成功拨号的信息
# cat /etc/ppp/connect-errors timeout set to 3 seconds
abort on (\nBUSY\r)
abort on (\nNO ANSWER\r)
abort on (\nRINGING\r\n\r\nRINGING\r)
send (rAT^M)
send (rAT+CGDCONT=1,IP,CMNET^M)
expect (OK)
AT^M^M
OK
— got itsend (ATH0^M)
timeout set to 30 seconds
expect (OK)
^M
AT+CGDCONT=1,IP,CMNET^MAT^M
OK
— got itsend (ATDT*99***1#^M)
expect (CONNECT)
^M
ATDT*99***1#^M^M
CONNECT
— got itsend (^M)