[asterisk-commits] russell: trunk r85519 - /trunk/doc/tex/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 12 10:50:30 CDT 2007


Author: russell
Date: Fri Oct 12 10:50:29 2007
New Revision: 85519

URL: http://svn.digium.com/view/asterisk?view=rev&rev=85519
Log:
Many doc directory improvements, including:

- Added development section (backtrace.tex)
- Correct filesystem path formating
- Replace all "|" argument separator to ","
- Endless count of spaces at the end of line
- Using astlisting to make listings do not take so much place
- Take back ASTRISKVERSION on first page
- Make localchannel.tex readable by inserting extra end of lines

(closes issue #10962)
Reported by: IgorG
Patches: 
      texdoc-85177-1.patch uploaded by IgorG (license 20)

Modified:
    trunk/doc/tex/ael.tex
    trunk/doc/tex/app-sms.tex
    trunk/doc/tex/asterisk.tex
    trunk/doc/tex/cdrdriver.tex
    trunk/doc/tex/channelvariables.tex
    trunk/doc/tex/cliprompt.tex
    trunk/doc/tex/dundi.tex
    trunk/doc/tex/enum.tex
    trunk/doc/tex/extensions.tex
    trunk/doc/tex/ices.tex
    trunk/doc/tex/localchannel.tex
    trunk/doc/tex/manager.tex
    trunk/doc/tex/odbcstorage.tex
    trunk/doc/tex/privacy.tex
    trunk/doc/tex/queues-with-callback-members.tex
    trunk/doc/tex/sla.tex

Modified: trunk/doc/tex/ael.tex
URL: http://svn.digium.com/view/asterisk/trunk/doc/tex/ael.tex?view=diff&rev=85519&r1=85518&r2=85519
==============================================================================
--- trunk/doc/tex/ael.tex (original)
+++ trunk/doc/tex/ael.tex Fri Oct 12 10:50:29 2007
@@ -1,9 +1,9 @@
 \section{Introduction}
 
-AEL is a specialized language intended purely for 
+AEL is a specialized language intended purely for
 describing Asterisk dial plans.
 
-The current version was written by Steve Murphy, and is a rewrite of 
+The current version was written by Steve Murphy, and is a rewrite of
 the original version.
 
 This new version further extends AEL, and
@@ -18,7 +18,7 @@
 
     \item The second syntax is the Expression Syntax, which is normally
      handled by Asterisk extension engine, as expressions enclosed in
-     \$[...]. The right hand side of assignments are wrapped in \$[ ... ] 
+     \$[...]. The right hand side of assignments are wrapped in \$[ ... ]
      by AEL, and so are the if and while expressions, among others.
 
     \item The third syntax is the Variable Reference Syntax, the stuff
@@ -139,16 +139,16 @@
 nothing:
 
 Enable AEL contexts debug
-   *CLI> ael debug contexts 
+   *CLI> ael debug contexts
 
 Enable AEL macros debug
-   *CLI> ael debug macros 
+   *CLI> ael debug macros
 
 Enable AEL read debug
    *CLI> ael debug read
 
 Enable AEL tokens debug
-   *CLI> ael debug tokens 
+   *CLI> ael debug tokens
 
 Disable AEL debug messages
    *CLI> ael no debug
@@ -201,7 +201,7 @@
 You can just as easily say,
 
 \begin{verbatim}
-if(${x}=1) { NoOp(hello!); goto s|3; } else { NoOp(Goodbye!); goto s|12; }
+if(${x}=1) { NoOp(hello!); goto s,3; } else { NoOp(Goodbye!); goto s,12; }
 \end{verbatim}
 
 as you can say:
@@ -210,12 +210,12 @@
 if(${x}=1)
 {
        NoOp(hello!);
-   goto s|3;
+   goto s,3;
 }
 else
 {
        NoOp(Goodbye!);
-       goto s|12;
+       goto s,12;
 }
 \end{verbatim}
 
@@ -224,10 +224,10 @@
 \begin{verbatim}
 if(${x}=1) {
        NoOp(hello!);
-   goto s|3;
+   goto s,3;
 } else {
        NoOp(Goodbye!);
-       goto s|12;
+       goto s,12;
 }
 \end{verbatim}
 
@@ -235,9 +235,9 @@
 
 \begin{verbatim}
 if (${x}=1) {
-       NoOp(hello!); goto s|3;
+       NoOp(hello!); goto s,3;
 } else {
-       NoOp(Goodbye!); goto s|12;
+       NoOp(Goodbye!); goto s,12;
 }
 \end{verbatim}
 
@@ -274,12 +274,12 @@
     \item while
     \item case
     \item pattern
-    \item default   NOTE: the "default" keyword can be used as a context name, 
+    \item default   NOTE: the "default" keyword can be used as a context name,
                       for those who would like to do so.
     \item catch
     \item switches
     \item eswitches
-    \item includes 
+    \item includes
 \end{itemize}
 
 
@@ -288,15 +288,15 @@
 AEL first parses the extensions.ael file into a memory structure representing the file.
 The entire file is represented by a tree of "pval" structures linked together.
 
-This tree is then handed to the semantic check routine. 
-
-Then the tree is handed to the compiler. 
+This tree is then handed to the semantic check routine.
+
+Then the tree is handed to the compiler.
 
 After that, it is freed from memory.
 
 A program could be written that could build a tree of pval structures, and
 a pretty printing function is provided, that would dump the data to a file,
-or the tree could be handed to the compiler to merge the data into the 
+or the tree could be handed to the compiler to merge the data into the
 asterisk dialplan. The modularity of the design offers several opportunities
 for developers to simplify apps to generate dialplan data.
 
@@ -307,6 +307,7 @@
 
 First, some basic objects
 
+\begin{astlisting}
 \begin{verbatim}
 ------------------------
 <word>    a lexical token consisting of characters matching this pattern: [-a-zA-Z0-9"_/.\<\>\*\+!$#\[\]][-a-zA-Z0-9"_/.!\*\+\<\>\{\}$#\[\]]*
@@ -490,9 +491,8 @@
 
 <includes> :== 'includes' '{' <includeslist> '}'
        | 'includes' '{' '}'
-
-\end{verbatim}
-
+\end{verbatim}
+\end{astlisting}
 
 \section{AEL Example USAGE}
 
@@ -582,7 +582,7 @@
 name/number with a slash (/) and the number to match against the Caller ID:
 
 \begin{verbatim}
-context zoombo 
+context zoombo
 {
   819/7079953345 => { NoOp(hello, 3345); }
 }
@@ -701,14 +701,14 @@
 }
 \end{verbatim}
 
-NOTE: AEL wraps the right hand side of an assignment with \$[ ] to allow 
-expressions to be used If this is unwanted, you can protect the right hand 
-side from being wrapped by using the Set() application. 
-Read the README.variables about the requirements and behavior 
+NOTE: AEL wraps the right hand side of an assignment with \$[ ] to allow
+expressions to be used If this is unwanted, you can protect the right hand
+side from being wrapped by using the Set() application.
+Read the README.variables about the requirements and behavior
 of \$[ ] expressions.
 
-NOTE: These things are wrapped up in a \$[ ] expression: The while() test; 
-the if() test; the middle expression in the for( x; y; z) statement 
+NOTE: These things are wrapped up in a \$[ ] expression: The while() test;
+the if() test; the middle expression in the for( x; y; z) statement
 (the y expression); Assignments - the right hand side, so a = b -> Set(a=\$[b])
 
 Writing to a dialplan function is treated the same as writing to a variable.
@@ -719,7 +719,7 @@
          CALLERID(name)=ChickenMan;
          NoOp(My name is ${CALLERID(name)} !);
     }
-} 
+}
 \end{verbatim}
 
 You can declare variables in Macros, as so:
@@ -739,7 +739,7 @@
 
 In trunk (1.6 and higher), we have made all arguments local variables to
 a macro call. They will not affect channel variables of the same name.
-This includes the ARG1, ARG2, etc variables. 
+This includes the ARG1, ARG2, etc variables.
 
 Users can declare their own local variables by using the keyword 'local'
 before setting them to a value;
@@ -753,7 +753,7 @@
 \end{verbatim}
 
 In the above example, Myvar, firstarg, and secondarg are all local variables,
-and will not be visible to the calling code, be it an extension, or another Macro. 
+and will not be visible to the calling code, be it an extension, or another Macro.
 
 If you need to make a local variable within the Set() application, you can do it this way:
 
@@ -812,7 +812,7 @@
          }
          else
               Voicemail(${EXTEN}|u);
-         ifTime (14:00-25:00|sat-sun|*|*) 
+         ifTime (14:00-25:00|sat-sun|*|*)
               Voicemail(${EXTEN}|b);
          else
          {
@@ -858,7 +858,7 @@
 \end{verbatim}
 
 NOTE: The conditional expression in if() statements (the
-      "\${DIALSTATUS}" = "BUSY" above) is wrapped by the compiler in 
+      "\${DIALSTATUS}" = "BUSY" above) is wrapped by the compiler in
       \$[] for evaluation.
 
 NOTE: Neither the switch nor case values are wrapped in \$[ ]; they can
@@ -926,7 +926,7 @@
 
 context gotoexample2 {
      s =>  {
-   end: 
+   end:
            goto gotoexample|s|begin;   // go to label in different context
      }
 }
@@ -962,7 +962,7 @@
 
 context gotoexample2 {
      s =>  {
-   end: 
+   end:
            jump s at gotoexample;   // go to label in different context
      }
 }
@@ -980,7 +980,7 @@
 NOTE  AEL introduces the special label "1", which is the beginning
       context number for most extensions.
 
-NOTE: A NEW addition to AEL: you can now use ',' instead of '|' to 
+NOTE: A NEW addition to AEL: you can now use ',' instead of '|' to
       separate the items in the target address. You can't have a mix,
       though, of '|' and ',' in the target. It's either one, or the other.
 
@@ -1099,7 +1099,7 @@
           o the times have to be in range of 0 to 24 hours.
           o The weekdays have to match the internal list, if they are provided;
           o the day of the month, if provided, must be in range of 1 to 31;
-          o the month name or names have to match those in the internal list. 
+          o the month name or names have to match those in the internal list.
     \item (0.5) If an expression is wrapped in \$[ ... ], and the compiler
       will wrap it again, a warning is issued.
     \item (0.5) If an expression had operators (you know,
@@ -1107,7 +1107,7 @@
       issued. Maybe someone forgot to wrap a variable name?
     \item (0.12) check for duplicate context names.
     \item (0.12) check for abstract contexts that are not included by any context.
-    \item (0.13) Issue a warning if a label is a numeric value. 
+    \item (0.13) Issue a warning if a label is a numeric value.
 \end{itemize}
 
 There are a subset of checks that have been removed until the proposed
@@ -1249,18 +1249,18 @@
       commands
 
     \item Functions: Functions were implemented inside \${ .. } variable
-      references, and supply many useful capabilities. 
+      references, and supply many useful capabilities.
 
     \item Expressions: An expression evaluation engine handles items
       wrapped inside \$[...]. This includes some string manipulation
-      facilities, arithmetic expressions, etc. 
+      facilities, arithmetic expressions, etc.
 
     \item Application Gateway Interface: Asterisk can fork external
       processes that communicate via pipe. AGI applications can be
       written in any language. Very powerful applications can be added
-      this way. 
+      this way.
 
     \item Variables: Channels of communication have variables associated
       with them, and asterisk provides some global variables. These can be
-      manipulated and/or consulted by the above mechanisms. 
+      manipulated and/or consulted by the above mechanisms.
 \end{itemize}

Modified: trunk/doc/tex/app-sms.tex
URL: http://svn.digium.com/view/asterisk/trunk/doc/tex/app-sms.tex?view=diff&rev=85519&r1=85518&r2=85519
==============================================================================
--- trunk/doc/tex/app-sms.tex (original)
+++ trunk/doc/tex/app-sms.tex Fri Oct 12 10:50:29 2007
@@ -16,13 +16,13 @@
    can be encoded in a text message such as ring tones, and small
    graphic, etc. Text messaging is being used for voting and
    competitions, and also SPAM...
-   
+
    Sending a message involves the mobile phone contacting a message
    centre (SMSC) and passing the message to it. The message centre then
    contacts the destination mobile to deliver the message. The SMSC is
    responsible for storing the message and trying to send it until the
    destination mobile is available, or a timeout.
-   
+
    Landline SMS works in basically the same way. You would normally have
    a suitable text capable landline phone, or a separate texting box such
    as a Magic Messenger on your phone line. This sends a message to a
@@ -111,30 +111,33 @@
 \section{extensions.conf}
 
    The following contexts are recommended.
+
+\begin{astlisting}
 \begin{verbatim}
 ; Mobile Terminated, RX. This is used when an incoming call from the SMS arrive
 s, with the queue (called number and sub address) in ${EXTEN}
-; Running an app after receipt of the text allows the app to find all messages 
+; Running an app after receipt of the text allows the app to find all messages
 in the queue and handle them, e.g. email them.
-; The app may be something like   smsq --process=somecommand --queue=${EXTEN}  
+; The app may be something like   smsq --process=somecommand --queue=${EXTEN}
 to run a command for each received message
 ; See below for usage
 [smsmtrx]
-exten = _X.,1, SMS(${EXTEN}|a)
+exten = _X.,1, SMS(${EXTEN},a)
 exten = _X.,2,System("someapptohandleincomingsms ${EXTEN}")
 exten = _X.,3,Hangup
-; Mobile originated, RX. This is receiving a message from a device, e.g. 
+; Mobile originated, RX. This is receiving a message from a device, e.g.
 ; a Magic Messenger on a sip extension
-; Running an app after receipt of the text allows the app to find all messages 
+; Running an app after receipt of the text allows the app to find all messages
 ; in the queue and handle then, e.g. sending them to the public SMSC
-; The app may be something like   smsq --process=somecommand --queue=${EXTEN}  
+; The app may be something like   smsq --process=somecommand --queue=${EXTEN}
 ; to run a command for each received message
 ; See below for example usage
 [smsmorx]
-exten = _X.,1, SMS(${EXTEN}|sa)
+exten = _X.,1, SMS(${EXTEN},sa)
 exten = _X.,2,System("someapptohandlelocalsms ${EXTEN}")
 exten = _X.,3,Hangup
 \end{verbatim}
+\end{astlisting}
 
    smsmtrx is normally accessed by an incoming call from the SMSC. In the
    UK this call is from a CLI of 080058752X0 where X is the sub address.
@@ -318,7 +321,7 @@
    error. Any trailing arguments are processed as follows:-
 
 \begin{itemize}
-    
+
      \item If the message is mobile originating and no destination address
        has been specified, then the first argument is assumed to be a
        destination address
@@ -405,7 +408,7 @@
    Within this directory are sub directories mtrx, mttx, morx, motx which
    hold the received messages and the messages ready to send. Also,
    /var/log/asterisk/sms is a log file of all messages handled.
-   
+
    The file name in each queue directory starts with the queue parameter
    to SMS which is normally the CLI used for an outgoing message or the
    called number on an incoming message, and may have -X (X being sub

Modified: trunk/doc/tex/asterisk.tex
URL: http://svn.digium.com/view/asterisk/trunk/doc/tex/asterisk.tex?view=diff&rev=85519&r1=85518&r2=85519
==============================================================================
--- trunk/doc/tex/asterisk.tex (original)
+++ trunk/doc/tex/asterisk.tex Fri Oct 12 10:50:29 2007
@@ -32,7 +32,7 @@
 
 
 \author{Asterisk Development Team \\ Asterisk.org}
-\title{Asterisk Reference Information \\ Version SVN-trunk-r72921M}
+\title{Asterisk Reference Information \\ Version ASTERISKVERSION}
 
 \begin{document}
 \maketitle
@@ -132,6 +132,12 @@
   \section{Queue Logs}
   \input{queuelog.tex}
 
+\chapter{Development}
+  \section{Backtrace}
+  \input{backtrace.tex}
+
+
+
 % This is a list of files not yet integrated into this document:
 %
 %Misc
@@ -143,7 +149,6 @@
 %--------------
 %See http://www.asterisk.org/developers for more information
 %
-%backtrace.txt      How to produce a backtrace when Asterisk crashes
 %callfiles.txt      Asterisk callfiles using instruction
 %CODING-GUIDELINES  Guidelines for developers
 %externalivr.txt    Documentation of the protocol used in externalivr()

Modified: trunk/doc/tex/cdrdriver.tex
URL: http://svn.digium.com/view/asterisk/trunk/doc/tex/cdrdriver.tex?view=diff&rev=85519&r1=85518&r2=85519
==============================================================================
--- trunk/doc/tex/cdrdriver.tex (original)
+++ trunk/doc/tex/cdrdriver.tex Fri Oct 12 10:50:29 2007
@@ -249,26 +249,29 @@
 \subsection{Steps to follow in order to have RADIUS support}
 
 \subsubsection{Installation of the Radiusclient library}
-   Installation:
-\begin{verbatim}	
-	Download the sources from:
-		
-	http://developer.berlios.de/projects/radiusclient-ng/
-		
-	Untar the source tarball.
-		root at localhost:/usr/local/src# tar xvfz radiusclient-ng-0.5.2.tar.gz
-
-	Compile and install the library.
-		root at localhost:/usr/local/src# cd radiusclient-ng-0.5.2
-		root at localhost:/usr/local/src/radiusclient-ng-0.5.2# ./configure
-		root at localhost:/usr/local/src/radiusclient-ng-0.5.2# make
-		root at localhost:/usr/local/src/radiusclient-ng-0.5.2# make install
+
+	Download the sources from	
+	\url{http://developer.berlios.de/projects/radiusclient-ng/}
+		
+	Untar the source tarball:
+
+\begin{verbatim}
+	root at localhost:/usr/local/src# tar xvfz radiusclient-ng-0.5.2.tar.gz
+\end{verbatim}
+
+	Compile and install the library:
+
+\begin{verbatim}
+	root at localhost:/usr/local/src# cd radiusclient-ng-0.5.2
+	root at localhost:/usr/local/src/radiusclient-ng-0.5.2# ./configure
+	root at localhost:/usr/local/src/radiusclient-ng-0.5.2# make
+	root at localhost:/usr/local/src/radiusclient-ng-0.5.2# make install
 \end{verbatim}
 
 \subsubsection{Configuration of the Radiusclient library}
 	
 	By default all the configuration files of the radiusclient library will
-	be in /usr/local/etc/radiusclient-ng directory.
+	be in \path{/usr/local/etc/radiusclient-ng} directory.
 		
 	File "radiusclient.conf"
 		Open the file and find lines containing the following:
@@ -280,11 +283,12 @@
 	running on the same host as your Asterisk PBX.
 
 			acctserver      localhost
+
 	This is the hostname or IP address of the RADIUS server used for 
 	accounting. You will have to change this unless the server is running
 	on the same host as your Asterisk PBX.
 
-	File "servers" 
+	\textbf{File "servers"} 
 		
 	RADIUS protocol uses simple access control mechanism based on shared
 	secrets that allows RADIUS servers to limit access from RADIUS clients.
@@ -294,25 +298,23 @@
 
 	You need to configure a shared secret for each server you have 
 	configured in radiusclient.conf file in the previous step. The shared 
-	secrets are stored in /usr/local/etc/radiusclient-ng/servers file.
+	secrets are stored in \path{/usr/local/etc/radiusclient-ng/servers} file.
 
 	Each line contains hostname of a RADIUS server and shared secret 
 	used in communication with that server. The two values are separated 
 	by white spaces. Configure shared secrets for every RADIUS server you 
 	are going to use.
 
-	File "dictionary"
+	\textbf{File "dictionary"}
 			
 	Asterisk uses some attributes that are not included in the 
 	dictionary of radiusclient library, therefore it is necessary to add 
 	them. A file called dictionary.digium (kept in the contrib dir)
 	was created to list all new attributes used by Asterisk. 
 	Add to the end of the main dictionary file
-	/usr/local/etc/radiusclient-ng/dictionary
-	the line:
-\begin{verbatim}
+	\path{/usr/local/etc/radiusclient-ng/dictionary} the line:
+
 		\$INCLUDE /path/to/dictionary.digium
-\end{verbatim}
 
 \subsubsection{Install FreeRADIUS Server (Version 1.1.1)}
  
@@ -341,7 +343,7 @@
 
 	File "clients.conf"
 			
-	File /usr/local/etc/raddb/clients.conf contains description of 
+	File \path{/usr/local/etc/raddb/clients.conf} contains description of 
 	RADIUS clients that are allowed to use the server. For each of the 
 	clients you need to specify its hostname or IP address and also a 
 	shared secret. The shared secret must be the same string you configured
@@ -363,15 +365,15 @@
 		
 	File "dictionary"
 		
-	Note : as of version 1.1.2, the dictionary.digium file ships with FreeRADIUS. 
+	Note: as of version 1.1.2, the dictionary.digium file ships with FreeRADIUS. 
 	The following procedure brings the dictionary.digium file to previous versions 
 	of FreeRADIUS.
 	
-	File /usr/local/etc/raddb/dictionary contains the dictionary of 
+	File \path{/usr/local/etc/raddb/dictionary} contains the dictionary of 
 	FreeRADIUS server. You have to add the same dictionary file 
 	(dictionary.digium), which you added to the dictionary of radiusclient-ng
 	library. You can include it into the main file, adding the following line at the
-	end of file '/usr/local/etc/raddb/dictionary':
+	end of file \path{/usr/local/etc/raddb/dictionary}:
 		
 	\$INCLUDE /path/to/dictionary.digium
 
@@ -388,17 +390,16 @@
         library has been detected on your system.
 	
 	By default FreeRADIUS server will log all accounting requests into 
-	/usr/local/var/log/radius/radacct directory in form of plain text files. 
+	\path{/usr/local/var/log/radius/radacct} directory in form of plain text files. 
 	The server will create one file for each hostname in the directory. The 
 	following example shows how the log files look like. 
 
-	Asterisk now generates Call Detail Records. See /include/asterisk/cdr.h
+	Asterisk now generates Call Detail Records. See \path{/include/asterisk/cdr.h}
 	for all the fields which are recorded. By default, records in comma 
-	separated values will be created in /var/log/asterisk/cdr-csv. 
-
-	The configuration file for cdr\_radius.so module is :
-
-        /etc/asterisk/cdr.conf 
+	separated values will be created in \path{/var/log/asterisk/cdr-csv}. 
+
+	The configuration file for cdr\_radius.so module is \path{/etc/asterisk/cdr.conf}
+	 
 	This is where you can set CDR related parameters as well as the path to
 	the radiusclient-ng library configuration file.
 
@@ -423,7 +424,7 @@
   "Asterisk-Bill-Sec", 	        The duration that a call was up after other 
                                 end answered which will be <= to duration  
                                 "end time" minus "answer time" 
-  "Asterisk-Disposition",    	ANSWERED, NO ANSWER, BUSY 
+  "Asterisk-Disposition",    	  ANSWERED, NO ANSWER, BUSY 
   "Asterisk-AMA-Flags",       	DOCUMENTATION, BILL, IGNORE etc, specified on 
                                 a per channel basis like accountcode. 
   "Asterisk-Unique-ID",         Unique call identifier 

Modified: trunk/doc/tex/channelvariables.tex
URL: http://svn.digium.com/view/asterisk/trunk/doc/tex/channelvariables.tex?view=diff&rev=85519&r1=85518&r2=85519
==============================================================================
--- trunk/doc/tex/channelvariables.tex (original)
+++ trunk/doc/tex/channelvariables.tex Fri Oct 12 10:50:29 2007
@@ -4,8 +4,8 @@
 dial plan in extensions.conf.
 \begin{enumerate}
 \item The first, and most frequently used, is the substitution of variable
-  references with their values. 
-\item Then there are the evaluations of expressions done in \$[ .. ]. 
+  references with their values.
+\item Then there are the evaluations of expressions done in \$[ .. ].
   This will be discussed below.
 \end{enumerate}
 Asterisk has user-defined variables and standard variables set
@@ -16,69 +16,69 @@
 \begin{verbatim}
 exten => s,5,BackGround,blabla
 \end{verbatim}
-The parameter (blabla) can be quoted ("blabla"). In this case, a 
+The parameter (blabla) can be quoted ("blabla"). In this case, a
 comma does not terminate the field. However, the double quotes
 will be passed down to the Background command, in this example.
 
 Also, characters special to variable substitution, expression evaluation, etc
-(see below), can be quoted. For example, to literally use a \$ on the 
+(see below), can be quoted. For example, to literally use a \$ on the
 string "\$1231", quote it with a preceding \textbackslash. Special characters that must
-be quoted to be used, are [ ] \$ " \textbackslash. (to write \textbackslash itself, use \textbackslash). 
+be quoted to be used, are [ ] \$ " \textbackslash. (to write \textbackslash itself, use \textbackslash).
 
 These Double quotes and escapes are evaluated at the level of the
-asterisk config file parser. 
+asterisk config file parser.
 
 Double quotes can also be used inside expressions, as discussed below.
 
 \section{Variables}
 
-Parameter strings can include variables. Variable names are arbitrary strings. 
-They are stored in the respective channel structure. 
-
-To set a variable to a particular value, do: 
+Parameter strings can include variables. Variable names are arbitrary strings.
+They are stored in the respective channel structure.
+
+To set a variable to a particular value, do:
 \begin{verbatim}
     exten => 1,2,Set(varname=value)
 \end{verbatim}
 You can substitute the value of a variable everywhere using \${variablename}.
-For example, to stringwise append \$lala to \$blabla and store result in \$koko, 
-do: 
+For example, to stringwise append \$lala to \$blabla and store result in \$koko,
+do:
 \begin{verbatim}
    exten => 1,2,Set(koko=${blabla}${lala})
 \end{verbatim}
 
-There are two reference modes - reference by value and reference by name. 
-To refer to a variable with its name (as an argument to a function that 
-requires a variable), just write the name. To refer to the variable's value, 
-enclose it inside \${}. For example, Set takes as the first argument 
-(before the =) a variable name, so: 
+There are two reference modes - reference by value and reference by name.
+To refer to a variable with its name (as an argument to a function that
+requires a variable), just write the name. To refer to the variable's value,
+enclose it inside \${}. For example, Set takes as the first argument
+(before the =) a variable name, so:
 \begin{verbatim}
   exten => 1,2,Set(koko=lala)
   exten => 1,3,Set(${koko}=blabla)
 \end{verbatim}
-stores to the variable "koko" the value "lala" and to variable "lala" the 
-value "blabla". 
-
-In fact, everything contained \${here} is just replaced with the value of 
-the variable "here". 
+stores to the variable "koko" the value "lala" and to variable "lala" the
+value "blabla".
+
+In fact, everything contained \${here} is just replaced with the value of
+the variable "here".
 
 \section{Variable Inheritance}
 
-Variable names which are prefixed by "\_" will be inherited to channels 
-that are created in the process of servicing the original channel in 
-which the variable was set.  When the inheritance takes place, the 
-prefix will be removed in the channel inheriting the variable.  If the 
-name is prefixed by "\_\_" in the channel, then the variable is 
+Variable names which are prefixed by "\_" will be inherited to channels
+that are created in the process of servicing the original channel in
+which the variable was set.  When the inheritance takes place, the
+prefix will be removed in the channel inheriting the variable.  If the
+name is prefixed by "\_\_" in the channel, then the variable is
 inherited and the "\_\_" will remain intact in the new channel.
 
-In the dialplan, all references to these variables refer to the same 
-variable, regardless of having a prefix or not.  Note that setting any 
-version of the variable removes any other version of the variable, 
+In the dialplan, all references to these variables refer to the same
+variable, regardless of having a prefix or not.  Note that setting any
+version of the variable removes any other version of the variable,
 regardless of prefix.
 
 \subsection{Example}
 \begin{verbatim}
-Set(__FOO=bar) ; Sets an inherited version of "FOO" variable 
-Set(FOO=bar)   ; Removes the inherited version and sets a local 
+Set(__FOO=bar) ; Sets an inherited version of "FOO" variable
+Set(FOO=bar)   ; Removes the inherited version and sets a local
                ; variable.
 
 However,
@@ -101,11 +101,11 @@
   exten => _9X.,1,Set(number=${EXTEN:1})
 \end{verbatim}
 Assuming we've dialed 918005551234, the value saved to the 'number' variable
-would be 18005551234. This is useful in situations when we require users to 
-dial a number to access an outside line, but do not wish to pass the first 
+would be 18005551234. This is useful in situations when we require users to
+dial a number to access an outside line, but do not wish to pass the first
 digit.
 
-If you use a negative offset number, Asterisk starts counting from the end 
+If you use a negative offset number, Asterisk starts counting from the end
 of the string and then selects everything after the new position. The following
 example will save the numbers 1234 to the 'number' variable, still assuming
 we've dialed 918005551234.
@@ -137,13 +137,13 @@
   exten => _XXXX#,1,Set(pin=${EXTEN:0:-1})
 \end{verbatim}
 
-\section{Expressions} 
-
-Everything contained inside a bracket pair prefixed by a \$ (like \$[this]) is 
-considered as an expression and it is evaluated. Evaluation works similar to 
-(but is done on a later stage than) variable substitution: the expression 
-(including the square brackets) is replaced by the result of the expression 
-evaluation. 
+\section{Expressions}
+
+Everything contained inside a bracket pair prefixed by a \$ (like \$[this]) is
+considered as an expression and it is evaluated. Evaluation works similar to
+(but is done on a later stage than) variable substitution: the expression
+(including the square brackets) is replaced by the result of the expression
+evaluation.
 
 For example, after the sequence:
 \begin{verbatim}
@@ -170,7 +170,7 @@
 As an example:
 
 \begin{verbatim}
-exten => s,6,GotoIf($[ "${CALLERID(name)}" : "Privacy Manager" ]?callerid-liar|s|1:s|7)
+exten => s,6,GotoIf($[ "${CALLERID(name)}" : "Privacy Manager" ]?callerid-liar,s,1:s,7)
 \end{verbatim}
 
 The variable CALLERID(name) could evaluate to "DELOREAN MOTORS" (with a space)
@@ -189,7 +189,7 @@
 \end{verbatim}
 
 and will result in syntax errors, because token DELOREAN is immediately
-followed by token MOTORS and the expression parser will not know how to 
+followed by token MOTORS and the expression parser will not know how to
 evaluate this expression, because it does not match its grammar.
 
 \subsection{Operators}
@@ -246,8 +246,8 @@
        regular expression.  The regular expression is anchored to the
        beginning of  the string with an implicit `\^'.
 
-       If the match succeeds and the pattern contains at least one regular 
-       expression subexpression `\(...\)', the string corresponing 
+       If the match succeeds and the pattern contains at least one regular
+       expression subexpression `\(...\)', the string corresponing
        to `\textbackslash1' is returned; otherwise the matching operator
        returns the number of characters matched.  If the match fails and
        the pattern contains a regular expression subexpression the null
@@ -288,13 +288,13 @@
 
 In 1.6 and above, we shifted the \$[...] expressions to be calculated
 via floating point numbers instead of integers. We use 'long double' numbers
-when possible, which provide around 16 digits of precision with 12 byte numbers. 
-
-To specify a floating point constant, the number has to have this format: D.D, where D is 
+when possible, which provide around 16 digits of precision with 12 byte numbers.
+
+To specify a floating point constant, the number has to have this format: D.D, where D is
 a string of base 10 digits. So, you can say 0.10, but you can't say .10 or 20.-- we hope
 this is not an excessive restriction!
 
-Floating point numbers are turned into strings via the '%g'/'%Lg' format of the printf
+Floating point numbers are turned into strings via the '\%g'/'\%Lg' format of the printf
 function set. This allows numbers to still 'look' like integers to those counting
 on integer behavior. If you were counting on 1/4 evaluating to 0, you need to now say
 TRUNC(1/4). For a list of all the truncation/rounding capabilities, see the next section.
@@ -309,7 +309,7 @@
 \$[..] expressions without the \$\{...\} operators. The only trouble might be in the fact that
 the arguments to these functions must be specified with a comma. If you try to call
 the MATH function, for example, and try to say 3 + MATH(7*8), the expression parser will
-evaluate 7*8 for you into 56, and the MATH function will most likely complain that its 
+evaluate 7*8 for you into 56, and the MATH function will most likely complain that its
 input doesn't make any sense.
 
 We also provide access to most of the floating point functions in the C library. (but not all of them).
@@ -323,7 +323,7 @@
 though! -- you still need to wrap variable names in curly braces!
 
 \begin{enumerate}
-\item COS(x) x is in radians. Results vary from -1 to 1. 
+\item COS(x) x is in radians. Results vary from -1 to 1.
 \item SIN(x) x is in radians. Results vary from -1 to 1.
 \item TAN(x) x is in radians.
 \item ACOS(x) x should be a value between -1 and 1.
@@ -431,7 +431,6 @@
 
 TRUNC(-3.5)
    returns -3.
-
 \end{verbatim}
 \end{astlisting}
 
@@ -450,7 +449,7 @@
 
 \subsection{Conditionals}
 
-There is one conditional application - the conditional goto : 
+There is one conditional application - the conditional goto :
 
 \begin{verbatim}
   exten => 1,2,GotoIf(condition?label1:label2)
@@ -460,21 +459,21 @@
 exactly as in the normal goto command.
 
 "condition" is just a string. If the string is empty or "0", the condition
-is considered to be false, if it's anything else, the condition is true. 
-This is designed to be used together with the expression syntax described 
-above, eg : 
-
-\begin{verbatim}
-  exten => 1,2,GotoIf($[${CALLERID(all)} = 123456]?2|1:3|1)
-\end{verbatim}
-
-Example of use : 
+is considered to be false, if it's anything else, the condition is true.
+This is designed to be used together with the expression syntax described
+above, eg :
+
+\begin{verbatim}
+  exten => 1,2,GotoIf($[${CALLERID(all)} = 123456]?2,1:3,1)
+\end{verbatim}
+
+Example of use :
 
 \begin{verbatim}
 exten => s,2,Set(vara=1)
 exten => s,3,Set(varb=$[${vara} + 2])
 exten => s,4,Set(varc=$[${varb} * 2])
-exten => s,5,GotoIf($[${varc} = 6]?99|1:s|6)
+exten => s,5,GotoIf($[${varc} = 6]?99,1:s,6)
 \end{verbatim}
 
 \subsection{Parse Errors}
@@ -483,16 +482,20 @@
 
 If the extensions.conf file contains a line like:
 
-\begin{verbatim}
-exten => s,6,GotoIf($[ "${CALLERID(num)}"  = "3071234567" & &  "${CALLERID(name)}" : "Privacy Manager" ]?callerid-liar|s|1:s|7)
-\end{verbatim}
+\begin{astlisting}
+\begin{verbatim}
+exten => s,6,GotoIf($[ "${CALLERID(num)}"  = "3071234567" & &  "${CALLERID(name)}" : "Privacy Manager" ]?callerid-liar,s,1:s,7)
+\end{verbatim}
+\end{astlisting}
 
 You may see an error in /var/log/asterisk/messages like this:
+\begin{astlisting}
 \begin{verbatim}
 Jul 15 21:27:49 WARNING[1251240752]: ast_yyerror(): syntax error: parse error, unexpected TOK_AND, expecting TOK_MINUS or TOK_LP or TOKEN; Input:
-"3072312154"  = "3071234567" & & "Steves Extension" : "Privacy Manager" 
-                               ^
-\end{verbatim}
+"3072312154"  = "3071234567" & & "Steves Extension" : "Privacy Manager"
+               ^
+\end{verbatim}
+\end{astlisting}
 
 The log line tells you that a syntax error was encountered. It now
 also tells you (in grand standard bison format) that it hit an "AND"
@@ -506,12 +509,12 @@
 \subsection{NULL Strings}
 Testing to see if a string is null can be done in one of two different ways:
 \begin{verbatim}
-  exten => _XX.,1,GotoIf($["${calledid}" != ""]?3) 
-
-  exten => _XX.,1,GotoIf($[foo${calledid} != foo]?3) 
-\end{verbatim}
-
-The second example above is the way suggested by the WIKI. It will 
+  exten => _XX.,1,GotoIf($["${calledid}" != ""]?3)
+
+  exten => _XX.,1,GotoIf($[foo${calledid} != foo]?3)
+\end{verbatim}
+
+The second example above is the way suggested by the WIKI. It will
 work as long as there are no spaces in the evaluated value.
 
 The first way should work in all cases, and indeed, might now
@@ -529,7 +532,7 @@
 \subsection{Incompatabilities}
 
 The asterisk expression parser has undergone some evolution. It is hoped
-that the changes will be viewed as positive. 
+that the changes will be viewed as positive.
 
 The "original" expression parser had a simple, hand-written scanner,
 and a simple bison grammar. This was upgraded to a more involved bison
@@ -545,7 +548,7 @@
 
 If you have not touched your extensions.conf files in a year or so, the
 above upgrades may cause you some heartburn in certain circumstances, as
-several changes have been made, and these will affect asterisk's behavior on 
+several changes have been made, and these will affect asterisk's behavior on
 legacy extension.conf constructs.  The changes have been engineered
 to minimize these conflicts, but there are bound to be problems.
 
@@ -558,21 +561,21 @@
    to the value '2', but '1+1' would evaluate to the string '1+1'. If this
    behavior was depended on, then the expression evaluation will break. '1+1'
    will now evaluate to '2', and something is not going to work right.
-   To keep such strings from being evaluated, simply wrap them in double 
+   To keep such strings from being evaluated, simply wrap them in double
    quotes: '  "1+1" '
 
 \item The colon operator. In versions previous to double quoting, the
-   colon operator takes the right hand string, and using it as a 
+   colon operator takes the right hand string, and using it as a
    regex pattern, looks for it in the left hand string. It is given
-   an implicit \^ operator at the beginning, meaning the pattern 
-   will match only at the beginning of the left hand string. 
+   an implicit \^ operator at the beginning, meaning the pattern
+   will match only at the beginning of the left hand string.
    If the pattern or the matching string had double quotes around
    them, these could get in the way of the pattern match. Now,
-   the wrapping double quotes are stripped from both the pattern 
+   the wrapping double quotes are stripped from both the pattern
    and the left hand string before applying the pattern. This
    was done because it recognized that the new way of
    scanning the expression doesn't use spaces to separate tokens,
-   and the average regex expression is full of operators that 
+   and the average regex expression is full of operators that
    the scanner will recognize as expression operators. Thus, unless
    the pattern is wrapped in double quotes, there will be trouble.
    For instance,      \${VAR1} : (Who|What*)+
@@ -601,7 +604,7 @@
 
 \item  Added the conditional operator  'expr1 ? true\_expr :: false\_expr'
     First, all 3 exprs are evaluated, and if expr1 is false, the 'false\_expr'
-    is returned as the result. See above for details. 
+    is returned as the result. See above for details.
 
 \item  Unary operators '-' and '!' were made right associative.
 \end{enumerate}
@@ -682,7 +685,7 @@
 are in UPPER CASE only.
 
 Variables marked with a * are builtin functions and can't be set,
-only read in the dialplan.  Writes to such variables are silently 
+only read in the dialplan.  Writes to such variables are silently
 ignored.
 
 \begin{verbatim}
@@ -701,7 +704,7 @@
 ${CALLINGTON}          * Caller Type of Number (PRI channels)
 ${CHANNEL}             * Current channel name
 ${CONTEXT}             * Current context
-${DATETIME}            * Current date time in the format: DDMMYYYY-HH:MM:SS 
+${DATETIME}            * Current date time in the format: DDMMYYYY-HH:MM:SS
                          (Deprecated; use ${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)})
 ${DB_RESULT}             Result value of DB_EXISTS() dial plan function
 ${EPOCH}               * Current unix style epoch
@@ -719,7 +722,7 @@
 ${LEN(VAR)}            * String length of VAR (integer)
 ${PRIORITY}            * Current priority in the dialplan
 ${PRIREDIRECTREASON}     Reason for redirect on PRI, if a call was directed
-${TIMESTAMP}           * Current date time in the format: YYYYMMDD-HHMMSS 
+${TIMESTAMP}           * Current date time in the format: YYYYMMDD-HHMMSS
                          (Deprecated; use ${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)})
 ${TRANSFER_CONTEXT}      Context for transferred calls
 ${FORWARD_CONTEXT}       Context for forwarded calls
@@ -791,7 +794,7 @@
 
 \subsection{The MeetMe Conference Bridge}
 \begin{verbatim}

[... 1067 lines stripped ...]



More information about the asterisk-commits mailing list