[svn-commits] lmadsen: branch 1.6.1 r253258 - /branches/1.6.1/doc/tex/localchannel.tex

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Mar 18 10:48:17 CDT 2010


Author: lmadsen
Date: Thu Mar 18 10:48:13 2010
New Revision: 253258

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=253258
Log:
Merged revisions 253256 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r253256 | lmadsen | 2010-03-18 10:46:52 -0500 (Thu, 18 Mar 2010) | 9 lines
  
  Update to new Local channel documentation.
  
  Add same changes as commit to 1.4, but convert to TeX.
  
  (issue #16963)
  Reported by: kobaz
  Patches: 
        localchannel-2.txt uploaded by kobaz (license 834)
........

Modified:
    branches/1.6.1/doc/tex/localchannel.tex

Modified: branches/1.6.1/doc/tex/localchannel.tex
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.1/doc/tex/localchannel.tex?view=diff&rev=253258&r1=253257&r2=253258
==============================================================================
--- branches/1.6.1/doc/tex/localchannel.tex (original)
+++ branches/1.6.1/doc/tex/localchannel.tex Thu Mar 18 10:48:13 2010
@@ -373,6 +373,22 @@
 
 \subsection{Understanding When To Use /n}
 
+Lets take a look at an example that demonstrates when the use of the /n
+directive is necessary. If we spawn a Local channel which does a Dial()
+to a SIP channel, but we use the L() option (which is used to limit the
+amount of time a call can be active, along with warning tones when the
+time is nearly up), it will be associated with the Local channel,
+which is then optimized out of the call path, and thus won't perform
+as expected.
+
+This following dialplan will not perform as expected.
+
+[services]
+exten => 2,1,Dial(SIP/PHONE_B,,L(60000:45000:15000))
+
+[internal]
+exten => 4,1,Dial(Local/2 at services);
+
 By default, the Local channel will try to optimize itself out of the call path.
 This means that once the Local channel has established the call between the
 destination and Asterisk, the Local channel will get out of the way and let
@@ -390,44 +406,40 @@
 Local channel in the call path, along with any channel variables, or other
 channel specific information.
 
-For example, if we were calling a Local channel from the Dial() application, we
-could change:
-
-\begin{verbatim}
-Dial(Local/201 at devices)
-\end{verbatim}
-
-...into the following line:
-
-\begin{verbatim}
-Dial(Local/201 at devices/n)
+In order to make this behave as we expect (limiting the call), we would change:
+
+\begin{verbatim}
+[internal]
+exten => 4,1,Dial(Local/2 at services)
+\end{verbatim}
+
+...into the following:
+
+\begin{verbatim}
+[internal]
+exten => 4,1,Dial(Local/2 at services/n)
 \end{verbatim}
 
 By adding /n to the end, our Local channel will now stay in the call path and
 not go away.
 
-Lets take a look at an example that demonstrates when the use of the /n 
-directive is necessary. If we spawn a Local channel which then performs another
-Dial() to a SIP channel, but we use the L() option (which is used to limit the
-amount of time a call can be active, along with warning tones when the time is
-nearly up), it will be associated with the Local channel, which is then
-optimized out of the call path, and thus won't perform as expected.
-
-Here is an overview of our call flow, and the information associated with the
-channels:
+Why does adding the /n option all of a suddon make the 'L' option work? First
+we need to show an overview of the call flow that doesn't work properly, and
+discuss the information associated with the channels:
 
 \begin{enumerate}
   \item SIP device PHONE\_A calls Asterisk via a SIP INVITE
-  \item Asterisk accepts the INVITE and then starts processing dialplan logic
+  \item Asterisk accepts the INVITE and then starts processing dialplan logic in the [internal] context
   \item Our dialplan calls Dial(Local/2 at services) -- notice no /n
-  \item The Local channel then executes dialplan at extension 2 within the services context
-  \item Extension 2 within [services] then performs another Dial() to a SIP channel with the line:  Dial(SIP/PHONE\_B,,L(60000:450000:15000))
-  \item The call is then placed to SIP/PHONE\_B which then answers the call.
-  \item The Local channel containing the information for tracking the time allowance of the call is then optimized out of the call path, losing all information about when to terminate the call.
-  \item SIP/PHONE\_A and SIP/PHONE\_B then continue talking indefinitely.  
+  \item The Local channel then executes dialplan at extension 2 within the [services] context
+  \item Extension 2 within [services] then performs Dial() to PHONE_B with the line:  Dial(SIP/PHONE\_B,,L(60000:45000:15000))
+  \item SIP/PHONE\_B then answers the call
+  \item Even though the L option was given when dialing the SIP device, the L information is stored in the channel that is doing the Dial() which is the Local channel, and not the endpoint SIP channel.
+  \item The Local channel in the middle, containing the information for tracking the time allowance of the call, is then optimized out of the call path, losing all information about when to terminate the call.
+  \item SIP/PHONE\_A and SIP/PHONE\_B then continue talking indefinitely.
 \end{enumerate}
 
-Now, if we were to modify our dialplan at step three (3) then we would force the
+Now, if we were to add /n to our dialplan at step three (3) then we would force the
 Local channel to stay in the call path, and the L() option associated with the
 Dial() from the Local channel would remain, and our warning sounds and timing
 would work as expected.
@@ -435,14 +447,20 @@
 There are two workarounds for the above described scenario:
 
 \begin{enumerate}
-\item Use Dial(Local/2 at services/n) to cause the Local channel to remain in the call
-path so that the L() option used inside the Local channel is not discarded
-when optimization is performed.
-\item Place the L() option outside of the Local channel so that when it is
-optimized out of the call path, the information required to make L() work is
-associated with the outside channel. For example: 
-\begin{verbatim}
-   Dial(Local/2 at services,,L(60000:45000:15000))
+\item Use what we just described, Dial(Local/2 at services/n) to cause the Local
+channel to remain in the call path so that the L() option used inside the
+Local channel is not discarded when optimization is performed.
+\item Place the L() option at the outermost part of the path so that when the middle
+is optimized out of the call path, the information required to make L() work
+is associated with the outside channel. The L information will then be stored
+on the calling channel, which is PHONE\_A. For example:
+
+\begin{verbatim}
+[services]
+exten => 2,1,Dial(SIP/PHONE_B)
+
+[internal]
+exten => 4,1,Dial(Local/2 at services,,L(60000:45000:15000));
 \end{verbatim}
 \end{enumerate}
 




More information about the svn-commits mailing list