Create the chat script as an ASCII file.
Invoke the chat script in any PPP configuration file by using the following syntax:
connect 'chat -f /etc/ppp/chatfile'
The -f flag indicates that a file name is to follow. /etc/ppp/chatfile represents the name of the chat file.
Give read permission for the external chat file to the user who runs the pppd command.
The chat program always runs with the user's privileges, even if the connect 'chat ...' option is invoked from a privileged source. Thus, a separate chat file that is read with the -f option must be readable by the invoking user. This privilege can be a security problem if the chat script contains passwords or other sensitive information.
You can place the entire chat script conversation on a single line, similar to the following:
connect 'chat "" "AT&F1" OK ATDT5551212 CONNECT "\c"'
The complete chat script follows the chat keyword. The script terminates with "\c"'. You use this form in any PPP configuration file or on the command line as an argument to pppd.
If the chat script that is needed for a particular peer is long or complicated, consider creating the script as a separate file. External chat files are easy to maintain and to document. You can add comments to the chat file by preceding the comments with the hash (#) sign.
The procedure How to Create the Instructions for Calling a Peer shows the use of a chat script that is contained in an external file.