📄 yaps.html
字号:
<HTML><Head><Title>yaps</Title></Head><Body><H1>Table of Contents</H1><Ol Compact><Li> <a href="#intro">Introduction</a><Li> <a href="#install">Installation</a><Li> <a href="#config">Configuration</a><Li> <a href="#cmdline">Command Line</a><Li> <a href="#syntax">Sending/Expecting Syntax</a><Li> <a href="#script">Scripting</a><Li> <a href="#sample">Examples</a><Li> <a href="#chlog">Changelog</a></Ol><H1 ID="intro">Introduction</H1>Welcome to <em>Yaps</em>, Yet Another Paging Package. The program is usedto send textual messages to a remote paging device using a modem gateway.Many pager companies offer such modem gateways and are using specificprotocols. The most often used one, TAP is implemented beside others (moreor less complete.) This command line program uses a global and a privateconfiguration file to get information about each paging service, installedmodems and possibly other.<P>As the main part is implemented as a library it is not very complicated towrite a client/server solution. For the legal status see the File<a href="COPYING.GPL">Copying</a>.<H1 ID="install">Installation</H1>The software is written, tested and designed on and for Unix(tm) likeoperating systems and requires the so called Posix system calls and functionlibrary. Gnumake and GCC are required, too (or some changes to the Makefileand the code may be neccessary.) It is known to run at least on followingoperating systems:<Ul Compact><Li> <a href="http://www.linux.org/">Linux</a> (native system)<Li> <a href="http://www.sun.com/">Solaris 2.5.1</a> (Frank Käfer)<Li> <a href="http://www.sun.com/">SunOS 4.1.3 aka Solaris 1.1</a> (FrankKäfer)</Ul>(more may follow.)<P>Typically these steps should be enough to install the package:<Dl><Dt> Edit Config<Dd> For GCC the settings of CC and CFLAGS should be okay. Define<strong>SLANG=True</strong>, if you like to use the SLang scriptinglanguage, which can be found on<a href="ftp://space.mit.edu/pub/davis/slang/">space.mit.edu</a>. Install itsomewhere the compiler can find it. Define <strong>LUA=True</strong> forusing the lua scripting language, which is located on<a href="ftp://ftp.icad.puc-rio.br/pub/lua">ftp.icad.puc-rio.br</a>. READTHE COPYRIGHT RELATED FILES OF EACH PACKAGE BEFORE INSTALLING IT!<Dt> Edit config.h<Dd> This is used to adapt the software to various variants of Unix(tm). Ifyou do not have a regex.h file, either set HAVE_REGEX_T to zero or installthe GNU regular expression library. Be sure the library and includefile canbe found by the compiler and the name of the header file is<em>regex.h</em>, otherwise make a (symbolic) link to this file. Add thelibary to <em>EXLIB =</em> in Config.<Dt> make depend<Dd> This create the dependency file which will be included during make.<Dt> make (or make all)<Dd> This compiles the library, the program driver and links the program.The documentation is created using lynx. As lynx is not on every system thealready formated result is included as well.<Dt> make install<Dd> This copies the program and the global configuration file to the finallocation. This step requires a working <em>install</em> program. If this ismissing, you have to install it by hand (well, two files should not be toomuch.)<Dt> Edit the global configuration file<Dd> With your favorite editor you should edit the global configuration file(which will be installed as <em>/etc/yaps.rc</em> on default) and changeeverything as required. See the <a href="#config">Configuration</a> sectionfor a detailed description of the contents of the file.<Dt> Done!<Dd> You may play around with your configuration until you are satisfied,but this fine tuning is up to you.</Dl><P>If you have problems during compilation, feel free to send me a <a href="mailto:yaps@nitmar.tnet.de">mail</a>.<H1 ID="config">Configuration</H1>The program reads first the global configuration file <em>/etc/yaps.rc</em>(when not overwritten by command line switch), then the local one in<em>~/.yapsrc</em> to get its configuration. Command line options mayoverwrite some settings in these files. Both configuration files have thesame layout where the local one can overwrite settings of the global one.Each file is seperated in sections, where a section is started with<strong>[<name>]</strong> or <strong>[]</strong> for the globalsection. When a file is opened all entries are stored in the global sectionuntil a section name appears. If a section expression [..] is followed by acomma seperate list of names, then these are the fallback sections, i.e.variables not found int his section are taken from the fallback sectionsbefore trying the global one.<P>If the first character is a bar (<strong>|</strong>) then the rest is takenas a filename to be included at this point. The current section is<strong>NOT</strong> affected by this call.Each line may have exactly one entry (or a comment starting with a hash signin the first column) where the variable name is seperated by whitespacesfrom its value. If the first character of the value is a backslash(<strong>\</strong>), then this is removed. This allowes creating valuesstarting with whitespaces. But if a value should start with a backslashitself, be sure to escape it with another backslash. A line can split overseveral physical line, if each line (expect the last one) ends with abackslash. If the value starts with an opening curly bracket (<em>{</em>)then all lines up to the closing curly bracket (<em>}</em>) in the firstcolumn are taken as the value for that variable. The brackets (and the lineswhere they appear) are not part of the value.<P>The value may either be textual, numeric, boolean or a check expression.Textual values are starting with the first non whitespace character andcontinue to the end of the line. Numeric values are a sequence of digitswhich are parsed by the C-function <em>atoi(3)</em>. Boolean may either be<em>T</em>, <em>Y</em>, <em>1</em> or <em>+</em> for true and <em>F</em>,<em>N</em>, <em>0</em> or <em>-</em> for false (or in greater detail,everything that is not true is false.) Case is here not significant. Thecheck is a sequence of special characters which must match the given string.If a <em>></em> is found, then the rest is optional, but must stillmatch, if a <em><</em> is found and the string is not at its end, it isconsidered as too long. These characters are supported:<Ul Compact><Li> <em>1</em> numeric<Li> <em>h</em> hexadecimal<Li> <em>l</em> lowercase<Li> <em>u</em> uppercase<Li> <em>a</em> alpha<Li> <em>n</em> alphanumeric<Li> <em>p</em> printable<Li> <em>x</em> ascii<Li> every other character matches every character</Ul>Some simple examples:<Ul Compact><Li> <strong>>1</strong> A string with unlimited length, but made onlyout of numeric values.<Li> <strong>aaa</strong> A string of exact three alpha characters.<Li> <strong>>xxxx<</strong> A string of length zero up to four madeof ASCII characters.<Li> <strong>....>1111<</strong> A string starting with exact fourcharacters, followed by zero to four numeric characters.</Ul>Alternative one can specify the check by a description, if the checkstringis prefixed by a plus sign. This is then a comma seperated list of checks,which are seperated by an equal sign into variable and value. Thesevariables are supported:<Ul><Li> <strong>type=<type></strong> Each character in the string mustmatch the type, which may be one of the following: <Ul Compact> <Li> <strong>numeric</strong> only digits are allowed. <Li> <strong>sedecimal</strong> only hexdigits are allowed. <Li> <strong>lower</strong> only lowercase characters are allowed. <Li> <strong>upper</strong> only uppercase characters are allowed. <Li> <strong>alpha</strong> only alpha characters are allowed. <Li> <strong>alphanumeric</strong> only digits and alpha characters are allowed. <Li> <strong>print</strong> only printable characters are allowed. <Li> <strong>ascii</strong> only ASCII characters are allowed. </Ul><Li> <strong>length=<length></strong> The string must have exact thislength.<Li> <strong>minimum=<length></strong> The string must at least thislength.<Li> <strong>maximum=<length></strong> The string must not be longerthan this length.</Ul><P>The global section defines global values or default values for othersections. Some section may not inherit these values, but currently there isonly one and is marked as such.<P><H2>Global section</H2>These are typical found in the global section and can be overwritten inother sections, if required.<Dl><Dt> services <text><Dd> This is the comma seperated list of available services.<Dt> call-id <text><Dd> If the pager allows to send the source caller id this id is used, ifnot overwritten by a command line argument.<Dt> signature <text><Dd> If this is present, then the text is appended to each message sent tothe pager (and if use-signature is True).<Dt> verbose <num><Dd> Sets the debugging/verbosity level. The bigger the number, the moreoutput is generated.<Dt> logfile <text><Dd> If the given text is a valid filename the status of a sending requestis loged there.<Dt> <a ID="logstr"></a>logstring <text><Dd> If this is present, then only these parts are logged, which match thegiven string. Currently these elements are supported: <Ul Plain Compact> <Li> <strong>+</strong> message had been trasmitted successfully <Li> <strong>-</strong> message had not been transmitted <Li> <strong>*</strong> part had been transmitted successfully <Li> <strong>/</strong> part had not been transmitted <Li> <strong>i</strong> informal logfile entry <Li> <strong>c</strong> cost relevant informations <Li> <strong>s</strong> session start <Li> <strong>e</strong> session end <Li> <strong>p</strong> protocol specific </Ul><Dt> modems <text><Dd> This is a list of modem entries, seperated by commas.<Dt> final-report <text><Dd> If this is set, a final report is written to the given filename. Iffilename is <strong>-</strong>, then it is written to stdout. This featureis intended for use in shell scripts, so the script could proof whichmessage has actual send and which one has been rejected instead of simplerely on the return code of yaps.</Dl><H2>Service section</H2>The names of these section are free to the user, but their contents describea paging service (or a paging company.) Following variables are allowed forservice sections:<Dl><Dt> speed <num><Dd> The speed of the serial device.<Dt> bits-per-byte <num><Dd> The number of bits per byte, supported are 5 to 8.<Dt> parity <text><Dd> The used parity, this may either be <em>n</em>one, <em>e</em>ven or<em>o</em>dd.<Dt> stopbits <num><Dd> The number of stopbits, supported are 1 or 2.<Dt> phone <text><Dd> The phone number of the modem gateway for this service. If the numbercontains <strong>%P</strong> and <em>insert-pager-id</em> is set, then thepagerid is inserted into the phonenumber.<Dt> protocol <text><Dd> This is the communication protocol, that this service requires.Currently are <em>ascii</em>, <em>script</em>, <em>tap</em> and <em>ucp</em>allowed.<Dt> max-size <num><Dd> The maximal length of a message for this service.<Dt> may-split <bool><Dd> If this is true, then a message, which is too long will be split intoseveral messages.<Dt> max-messages <num><Dd> The maximum number of messages per message, that can be send. If thisis zero, then an unlimited number of messages can be send.<Dt> truncate <bool><Dd> If this is set a message is not split, but truncated to the lengthallowed by the provider.<Dt> use-call-id <bool><Dd> If this is true, then the caller-id is inserted. Where it is insert isprotocol specific.<Dt> use-signature <bool><Dd> If this is true and a signature is given, this is appended to eachmessage.<Dt> insert-pager-id <bool><Dd> If this is true, then the pagerid is inserted as part of the phonenumber. This implies, that only messages to the same receipiant can be sendat one call.<Dt> rm-invalids-cid <text><Dd> Remove every character in <em>text</em>, that appears in the caller id.This is designed to make a caller id more readable, but still useable by thedesired service.<Dt> rm-invalids-pid <text><Dd> Dito for pager ids.<Dt> valid-pid <text><Dd> This is a regular expression to check wether a pager-id is valid forthis service. If your system does not support Posix regular expression, youcan use a simple replacement. This is just a list of strings, seperated by abar which must match the beginning of the pager-id.<Dt> change-pid <text><Dd> If the pager-id matches the regular expression of <em>valid-pid</em>,then this matching part is replaced with this string. If the string is justa minus (<em>-</em>), then the match is removed from the resulting pager-id.<Dt> valid-cid <text><Dd> The same like <em>valid-pid</em> for the caller id.<Dt> change-cid <text><Dd> The same like <em>change-pid</em> for the caller id.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -