[Asterisk-doc] docs extensions.xml,1.8,1.9

websmith asterisk-doc@lists.digium.com
Thu, 20 May 2004 05:41:01 +0000


Comments:
Update of /cvsroot/asterisk/docs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24319

Modified Files:
	extensions.xml 
Log Message:
Added more notes to what I'd like written in chapter 4.  Someday I'll have to come back and actually write it up :-)
Index: extensions.xml
===================================================================
RCS file: /cvsroot/asterisk/docs/extensions.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** extensions.xml	19 May 2004 06:08:49 -0000	1.8
--- extensions.xml	20 May 2004 05:40:54 -0000	1.9
***************
*** 2,11 ****
  	<title>Creating Dialplans</title>
  	<para>
! 	The dialplan is the central piece of any Asterisk system.  Simply put, the dialplan specifies what Asterisk should do when it answers a call or when an extension is dialed.  The dialplan consists of a list of instuctions or steps that Asterisk should follow.  It is <emphasis role="strong">absolutely vital</emphasis> that you understand dialplans if you want to setup an Asterisk system.  
  	</para>
  	<sect1>
  		<title>Introduction to <filename>extensions.conf</filename></title>
  		<para>
! 			The majority of the dialplan is specified in the file <filename>extension.conf</filename>.  This file is made up of three main parts, namely contexts, extensions, and priorities.
  		</para>
  		<sect2>
--- 2,11 ----
  	<title>Creating Dialplans</title>
  	<para>
! 	The dialplan is the central piece of any Asterisk system.  Simply put, the dialplan specifies what Asterisk should do when it answers a call or when an extension is dialed.  The dialplan consists of a list of instuctions or steps that Asterisk should follow.  It is <emphasis>absolutely vital</emphasis> that you understand dialplans if you want to setup an Asterisk system.  
  	</para>
  	<sect1>
  		<title>Introduction to <filename>extensions.conf</filename></title>
  		<para>
! 			The majority of the dialplan is specified in the file <filename>extension.conf</filename>.  This file is made up of three main parts: contexts, extensions, and priorities.
  		</para>
  		<sect2>
***************
*** 102,105 ****
--- 102,135 ----
  			</para>
  		</sect2>
+ 		<sect2>
+ 			<title>A more useful example</title>
+ 			<para>
+ 			[Here we'll build upon our first example, by explaining the <function>Background()</function> and <function>Goto()</function> functions.]
+ 			</para>
+ 			<informalexample>
+ 			<programlisting>
+ 			[incoming]
+ 			exten=&gt;s,1,Answer()<lineannotation> ; Answer the line</lineannotation>
+ 			exten=&gt;s,2,Background('current-movies')<lineannotation> ; Play back the 'current movies' sound file</lineannotation>
+ 			exten=&gt;s,3,Hangup()<lineannotation> ; Now hangup the line if the caller doesn't press a key</lineannotation>
+ 			exten=&gt;1,1,Playback('movie1')<lineannotation> ; Now hangup the line if the caller doesn't press a key</lineannotation>
+ 			exten=&gt;1,2,Goto(incoming,s,1)<lineannotation> ; Now go back to the beginning</lineannotation>
+ 			exten=&gt;2,1,Playback('movie2')<lineannotation> ; Now hangup the line if the caller doesn't press a key</lineannotation>
+ 			exten=&gt;2,2,Goto(incoming,s,1)<lineannotation> ; Now go back to the beginning</lineannotation>
+ 			</programlisting>
+ 			</informalexample>	
+ 			<para>
+ 			[Don't get too worried about the complexity of this example.  We'll go through it and explain each item.  Imagine that you've been asked to setup an Asterisk system for a small two-screen movie theater.  When you call into the system, it will tell you which movies are playing.  If you press 1, you get the times that the movie in theater 1 is playing.  Pressing 2 gets the times for the other movie.  When the call enters the context, it goes to the "s" extension.  Background() is just like Playback(), only it lets the caller interrupt the playback and jump to another extension *in this context*.  So when the caller presses 1 or 2, it takes them to the first priority in that extension.  Also explain that Goto() is a simple way to jump to a different context, extension, and/or priority.  We should probably mention that we won't go into detail right now on how to actually record the details about the movies, but that those will come shortly.]
+ 			</para>
+ 		</sect2>
+ 		<sect2>
+ 			<title>The <function>Dial()</function> function</title>
+ 			<para>
+ 			[Add to our movie theater example, and make it so that if someone presses 0 during the playback, it will ring the ticket office.  Tell the reader that we're assuming that the channel for the ticket office has already been setup, and we'll show them how to do that in a different section of the book.]
+ 			</para>
+ 			<para>
+ 			[By this section of the chapter, the reader should understand Answer(), Playback(), Background(), Hangup(), GoTo(), and the basics of Dial().  Not too bad so far.]
+ 			</para>
+ 		</sect2>
  	</sect1>
  
***************
*** 165,170 ****
  
  			[internal]
! 			exten=>&gt;1001,1,Dial(Zap/2)<lineannotation> ; Dialing extension 1001 calls channel Zap/2</lineannotation>
! 			exten=>&gt;1002,1,Dial(Zap/3)<lineannotation> ; Dialing extension 1002 calls channel Zap/3</lineannotation>
  			</programlisting>
  			</informalexample>	
--- 195,200 ----
  
  			[internal]
! 			exten=&gt;>1001,1,Dial(Zap/2)<lineannotation> ; Dialing extension 1001 calls channel Zap/2</lineannotation>
! 			exten=&gt;>1002,1,Dial(Zap/3)<lineannotation> ; Dialing extension 1002 calls channel Zap/3</lineannotation>
  			</programlisting>
  			</informalexample>	
***************
*** 231,236 ****
  
  			[internal]
! 			exten=>&gt;1001,1,Dial(Zap/2)<lineannotation> ; Dialing extension 1001 calls channel Zap/2</lineannotation>
! 			exten=>&gt;1002,1,Dial(Zap/3)<lineannotation> ; Dialing extension 1002 calls channel Zap/3</lineannotation>
  			</programlisting>
  			</informalexample>	
--- 261,266 ----
  
  			[internal]
! 			exten=&gt;>1001,1,Dial(Zap/2)<lineannotation> ; Dialing extension 1001 calls channel Zap/2</lineannotation>
! 			exten=&gt;>1002,1,Dial(Zap/3)<lineannotation> ; Dialing extension 1002 calls channel Zap/3</lineannotation>
  			</programlisting>
  			</informalexample>