# 29.5.拨出服务

## 29.5.1. 使用标准 Hayes 调制解调器

`tip` 中内置了一个通用的 Hayes 拨号器。在 **/etc/remote** 中使用 `at=hayes`。

Hayes 驱动程序不能识别某些新调制解调器的高级功能消息，如 `BUSY`、`NO DIALTONE` 或 `CONNECT 115200`。在使用 `tip` 时，使用 `ATX0&W` 关闭这些消息。

`tip` 的拨号超时时间为 60 秒。调制解调器应该使用较短的超时时间，否则 `tip` 会认为存在通信问题。尝试设置 `ATS7=45&W`。

## 29.5.2. 使用 `AT` 命令

在 **/etc/remote** 中创建一个“直接”条目。例如，如果调制解调器连接到第一个串行端口 **/dev/cuau0**，则使用以下行：

```sh
cuau0:dv=/dev/cuau0:br#19200:pa=none
```

在 `br` 功能中使用调制解调器支持的最高 bps 速率。然后，输入 `tip cuau0` 以连接到调制解调器。

或者，以 `root` 用户身份使用 `cu`，并输入以下命令：

```sh
# cu -lline -sspeed
```

其中 *line* 是串行端口，如 **/dev/cuau0**，*speed* 是速率，如 `57600`。完成 AT 命令输入后，输入 `~.` 退出。

## 29.5.3. `@` 符号无效

**/etc/remote** 中的电话号功能会告知 `tip` 在 **/etc/phones** 中查找电话号码。但 `@` 符号在 **/etc/remote** 等功能文件中是一个特殊字符，因此需要使用反斜杠进行转义：

```sh
pn=\@
```

## 29.5.4. 从命令行拨号

在 **/etc/remote** 中放入一个“通用”条目。例如：

```sh
tip115200|以 115200 bps 拨打任何电话号码:\
        :dv=/dev/cuau0:br#115200:at=hayes:pa=none:du:
tip57600|以 57600 bps 拨打任何电话号码:\
        :dv=/dev/cuau0:br#57600:at=hayes:pa=none:du:
```

现在可以使用以下命令：

```sh
# tip -115200 5551234
```

喜欢 `cu` 而非 `tip` 的用户，可以使用通用的 `cu` 条目：

```sh
cu115200|使用 cu 拨打任何号码，速率为 115200bps:\
        :dv=/dev/cuau1:br#57600:at=hayes:pa=none:du:
```

并输入：

```sh
# cu 5551234 -s 115200
```

## 29.5.5. 设置 bps 速率

为 `tip1200` 或 `cu1200` 创建条目，但可以使用任何适合的 bps 速率，并在 `br` 功能中指定。`tip` 认为默认的适当速率是 1200 bps，因此它会查找 `tip1200` 条目。但并不一定要使用 1200 bps。

## 29.5.6. 通过终端服务器访问多个主机

与其等到连接后每次输入 `CONNECT host`，不如使用 `tip` 的 `cm` 功能。例如，下面的条目会让你通过输入 `tip pain` 或 `tip muffin` 来连接主机 `pain` 或 `muffin`，并通过 `tip deep13` 连接到终端服务器。

```sh
pain|pain.deep13.com|Forrester's machine:\
        :cm=CONNECT pain\n:tc=deep13:
muffin|muffin.deep13.com|Frank's machine:\
        :cm=CONNECT muffin\n:tc=deep13:
deep13:Gizmonics Institute terminal server:\
        :dv=/dev/cuau2:br#38400:at=hayes:du:pa=none:pn=5551234:
```

## 29.5.7. 使用多个线路与 `tip`

这通常是大学有多条调制解调器线路，而有成千上万的学生试图使用它们时遇到的问题。

在 **/etc/remote** 中创建条目，并使用 `@` 作为 `pn` 功能：

```sh
big-university:\
        :pn=\@:tc=dialout
dialout:\
        :dv=/dev/cuau3:br#9600:at=courier:du:pa=none:
```

然后，在 **/etc/phones** 中列出电话号码：

```sh
big-university 5551111
big-university 5551112
big-university 5551113
big-university 5551114
```

`tip` 会按列出的顺序尝试每个号码，直到放弃。为了保持重试，可以在 `while` 循环中运行 `tip`。

## 29.5.8. 使用强制字符

**Ctrl**+**P** 是默认的“强制”字符，用于告诉 `tip` 后续的字符是字面数据。可以通过 `~s` 转义将强制字符设置为任何其他字符，这意味着“设置一个变量”。

输入 `~sforce=single-char` 后按回车。*single-char* 是任何单个字符。如果省略 *single-char*，则强制字符为空字符，可以通过输入 **Ctrl**+**2** 或 **Ctrl**+**Space** 来访问。对于某些终端服务器，Shift\*\*+**Ctrl**+**6** 是一个不错的选择。

要更改强制字符，可以在 **\~/.tiprc** 中指定以下内容：

```sh
force=single-char
```

## 29.5.9. 大写字符

当按下 **Ctrl**+**A** 时，会触发 `tip` 的“升字符”功能，这对于键盘上的 Caps Lock 键损坏的用户来说特别有用。使用 `~s` 设置 `raisechar` 为合理的字符。如果两个功能都不使用，可以将其设置为与强制字符相同。

以下是一个为需要输入 **Ctrl**+\*\***2** 和 **Ctrl**+**A** 的 Emacs 用户准备的 **\~/.tiprc** 示例：

```sh
force=^^
raisechar=^^
```

其中 `^^` 表示 **Shift**+**Ctrl**+**6**。

## 29.5.10. 使用 `tip` 进行文件传输

当与另一个类似 UNIX® 的操作系统通信时，可以使用 `~p`（put）和 `~t`（take）命令发送和接收文件。这些命令在远程系统上运行 `cat` 和 `echo` 来接收和发送文件。语法是：`~p` 本地文件 \[ 远程文件 ] `~t` 远程文件 \[ 本地文件 ]

由于没有错误检查，建议使用其他协议，例如 zmodem。

## 29.5.11. 使用 zmodem 与 `tip`

要接收文件，在远程端启动发送程序。然后，输入 `~C rz` 以开始在本地接收文件。

要发送文件，在远程端启动接收程序。然后，输入 `~C sz files` 以将文件发送到远程系统。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.bsdcn.org/hanbook/di-29-zhang-chuan-xing-tong-xin/29.5.-bo-chu-fu-wu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
