📄 reference.sgml
字号:
<para> <command>log([level], message)</command> - Log a message. </para> <para> <emphasis>Example:</emphasis> log(1, "This is a message with high log-level set to 1\n"); </para> <para> Logging is very useful for troubleshooting or attracting administrator's attention to unusual situations. <application moreinfo="none">ser</application> reports log messages to <application moreinfo="none">syslog</application> facility unless it is configured to print them to <filename moreinfo="none">stderr</filename> with the <varname>log_stderr</varname> configuration option. Log messages are only issued if their log level exceeds threshold set with the <varname>debug</varname> configuration option. If log level is omitted, messages are issued at log level 4. </para> </listitem> </itemizedlist> <itemizedlist> <title>Miscellaneous</title> <listitem> <para> <command>len_gt</command> - If length of the message is greater than value given as parameter, the command will return 1 (indicating true). Otherwise -1 (indicating false) will be returned. It may take 'max_len' as parameter, in which case message size is limited to internal buffer size BUF_SIZE (3040 by default). </para> <example> <title>Use of <command>len_gt</command></title> <programlisting format="linespecific"># deny all requests larger in size than 1 kilobyteif (len_gt(1024)) { sl_send_reply("513", "Too big"); break;}; </programlisting> </example> </listitem> </itemizedlist> </section> <section> <title>Command Line Parameters</title> <note> <para> Command-Line parameters may be overridden by configuration file options which take precedence over them. </para> </note> <itemizedlist> <listitem> <para> <emphasis>-h</emphasis> - Displays a short usage description, including all available options. </para> </listitem> <listitem> <para> <emphasis>-c</emphasis> - Performs loop checks and computes branches. </para> </listitem> <listitem> <para> <emphasis>-r</emphasis> - Uses dns to check if it is necessary to add a "received=" field to a via. </para> </listitem> <listitem> <para> <emphasis>-R</emphasis> - Same as -r but uses reverse dns. </para> </listitem> <listitem> <para> <emphasis>-v</emphasis> - Turns on via host checking when forwarding replies. </para> </listitem> <listitem> <para> <emphasis>-d</emphasis> - Turns on debugging, multiple -d increase debugging level. </para> </listitem> <listitem> <para> <emphasis>-D</emphasis> - Runs ser in the foreground (it doesn't fork into daemon mode). </para> </listitem> <listitem> <para> <emphasis>-E</emphasis> - Sends all the log messages to stderr. </para> </listitem> <listitem> <para> <emphasis>-V</emphasis> - Displays the version number. </para> </listitem> <listitem> <para> <emphasis>-f config-file</emphasis> - Reads the configuration from "config-file" (default ./ser.cfg). </para> </listitem> <listitem> <para> <emphasis>-l address</emphasis> - Listens on the specified address. Multiple -l mean listening on multiple addresses. The default behavior is to listen on all the ipv4 interfaces. </para> </listitem> <listitem> <para> <emphasis>-p port</emphasis> - Listens on the specified port (default 5060). It applies to the last address specified with -l and to all the following that do not have a corresponding -p. </para> </listitem> <listitem> <para> <emphasis>-n processes-no</emphasis> - Specifies the number of children processes forked per interface (default 8). </para> </listitem> <listitem> <para> <emphasis>-b max_rcv_buf_size</emphasis> - Maximum receive buffer size which will not be exceeded by the auto-probing procedure even if the OS allows. </para> </listitem> <listitem> <para> <emphasis>-m shared_mem_size</emphasis> - Size of the shared memory which will be allocated (in Megabytes). </para> </listitem> <listitem> <para> <emphasis>-w working-dir</emphasis> - Specifies the working directory. In the very improbable event that will crash, the core file will be generated here. </para> </listitem> <listitem> <para> <emphasis>-t chroot-dir</emphasis> - Forces ser to chroot after reading the config file. </para> </listitem> <listitem> <para> <emphasis>-u uid</emphasis> - Changes the user id under which ser runs. </para> </listitem> <listitem> <para> <emphasis>-g gid</emphasis> - Changes the group id under which ser runs. </para> </listitem> <listitem> <para> <emphasis>-P pid-file</emphasis> - Creates a file containing the pid of the main ser process. </para> </listitem> <listitem> <para> <emphasis>-i fifo-path</emphasis> - Creates a fifo, useful for monitoring ser status. </para> </listitem> </itemizedlist> </section> <section id="modulereference"> <title>Modules</title> <para> Module description is currently located in READMEs of respective module directories. <filename moreinfo="none">README-MODULES</filename> lists all available modules, including their maturity status. In the current <application moreinfo="none">ser</application> distribution, there are the following modules: <itemizedlist> <listitem> <para> <emphasis> acc </emphasis> -- call accounting using <application moreinfo="none">syslog</application> facility. RADIUS and mysql support can be compiled in. Depends on tm. </para> </listitem> <listitem> <para> <emphasis> auth, auth_db, auth_radius </emphasis> -- digest authentication. Depends on sl and mysql. </para> </listitem> <listitem> <para> <emphasis>domain</emphasis> -- checks URIs whether they belong in a list of served domains or not. </para> </listitem> <listitem> <para> <emphasis>ENUM</emphasis> -- E.164 phone number resolution using ENUM. </para> </listitem> <listitem> <para> <emphasis> exec </emphasis> -- execution of shell programs. </para> </listitem> <listitem> <para> <emphasis> group, group_radius </emphasis> -- checks membership of users in groups </para> </listitem> <listitem> <para> <emphasis> jabber </emphasis> -- gateway between SIMPLE and Jabber instant messaging. Depends on tm and mysql. </para> </listitem> <listitem> <para> <emphasis> maxfwd </emphasis> -- checking max-forwards header field. </para> </listitem> <listitem> <para> <emphasis>msilo</emphasis> -- message silo. Store for undelivered instant messages. Depends on tm and mysql. </para> </listitem> <listitem> <para> <emphasis> mysql </emphasis> -- mysql database back-end. </para> </listitem> <listitem> <para> <emphasis> nathelper </emphasis> -- facilitates NAT traversal for symmetric SIP phones such as ATA. </para> </listitem> <listitem> <para> <emphasis> pa </emphasis> -- presence agent </para> </listitem> <listitem> <para> <emphasis> registrar, usrloc </emphasis> -- User Location database. Works in in-memory mode or with mysql persistence support. Depends on sl, and on mysql if configured for use with mysql. </para> </listitem> <listitem> <para> <emphasis> rr </emphasis> -- Record Routing (strict and loose) </para> </listitem> <listitem> <para> <emphasis> sl </emphasis> -- stateless User Agent server. </para> </listitem> <listitem> <para> <emphasis> sms </emphasis> -- SIMPLE/SMS gateway. Depends on tm. Takes special hardware. </para> </listitem> <listitem> <para> <emphasis>textops</emphasis> -- textual database back-end. </para> </listitem> <listitem> <para> <emphasis> tm </emphasis> -- transaction manager (stateful processing). </para> </listitem> <listitem> <para> <emphasis> uri, uri_radius </emphasis> -- checks digest identity against header URIs or a database list </para> </listitem> </itemizedlist> </para> <para> The most frequently used actions exported by modules are summarized in <xref linkend="moduleactions">. For a full explanation of module actions, see documentation in respective module directories in source distribution of <application moreinfo="none">ser</application>. </para> <table id="moduleactions"> <title>Frequently Used Module Actions</title> <tgroup cols="4"> <thead> <row> <entry> Command </entry> <entry> Modules </entry> <entry> Parameters </entry> <entry> Comments </entry> </row> </thead> <tbody> <row> <entry> append_hf </entry> <entry> textops </entry> <entry> header field </entry> <entry> append a header field to the end of request's header </entry> </row> <row> <entry> check_from </entry> <entry> uri </entry> <entry> none </entry> <entry> check if username in from header field matches authentication id </entry> </row> <row> <entry> check_to </entry> <entry> uri </entry> <entry> none </entry> <entry> check if username in To header field matched authentication id </entry> </row> <row> <entry> exec_dset </entry> <entry> exec </entry> <entry> command name </entry> <entry> execute an external command and replace destination set with its output </entry> </row> <row> <entry> exec_msg </entry> <entry> exec </entry> <entry> command name </entry> <entry> execute an external command and pass received SIP request to its input </entry> </row> <row> <entry> is_user </entry> <entry> uri </entry> <entry> user id </entry> <entry> returns true if request credentials belong to a user </entry> </row> <row> <entry> is_user_in </entry> <entry> auth </entry> <entry> user, group </entry> <entry> check if user is member of a group; user can be gained from request URI ("Request-URI"), To header field ("To"), From header field ("From") or digest credentials ("Credentials") </entry> </row> <row> <entry> lookup </entry> <entry> usrloc </entry> <entry> table name </entry> <entry> attempt to translate request URI using user location database; returns false if no contact for user found; </entry> </row> <row> <entry>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -