1 \subsection{Introduction}
3 chan\_local is a pseudo-channel. Use of this channel simply loops calls back
4 into the dialplan in a different context. Useful for recursive routing.
8 Local/extension@context[/{n|j}]
11 Adding "/n" at the end of the string will make the Local channel not do a
12 native transfer (the "n" stands for "n"o release) upon the remote end answering
13 the line. This is an esoteric, but important feature if you expect the Local
14 channel to handle calls exactly like a normal channel. If you do not have the
15 "no release" feature set, then as soon as the destination (inside of the Local
16 channel) answers the line and one audio frame passes, the variables and dial plan
17 will revert back to that of the original call, and the Local channel will become a
18 zombie and be removed from the active channels list. This is desirable in some
19 circumstances, but can result in unexpected dialplan behavior if you are doing
20 fancy things with variables in your call handling.
22 There is another option that can be used with local channels, which is the "j"
23 option. The "j" option must be used with the "n" option to make sure that the
24 local channel does not get optimized out of the call. This option will enable
25 a jitterbuffer on the local channel. The jitterbuffer will be used to de-jitter
26 audio that it receives from the channel that called the local channel. This is
27 especially in the case of putting chan\_local in between an incoming SIP call
28 and Asterisk applications, so that the incoming audio will be de-jittered.
32 The Local channel construct can be used to establish dialing into any part of
35 Imagine you have a TE410P in your box. You want to do something for which you
36 must use a Dial statement (for instance when dropping files in
37 \path{/var/spool/outgoing}) but you do want to be able to use your dialplans
38 least-cost-routes or other intelligent stuff. What you could do before we had
39 chan\_local was create a cross-link between two ports of the TE410P and then
40 Dial out one port and in the other. This way you could control where the call
43 Of course, this was a nasty hack, and to make it more sensible, chan\_local was
46 The "Local" channel driver allows you to convert an arbitrary extension into a
47 channel. It is used in a variety of places, including agents, etc.
49 This also allows us to hop to contexts like a GoSub routine; See examples below.
54 [inbound] ; here falls all incoming calls
56 exten => s,2,Dial(local/200@internal,30,r)
57 exten => s,3,Playback(sorrynoanswer)
60 [internal] ; here where our phones falls for default
61 exten => 200,1,Dial(sip/blah)
62 exten => 200,102,VoiceMail(${EXTEN}@default)
64 exten => 201,1,Dial(zap/1)
65 exten => 201,102,VoiceMail(${EXTEN}@default)
67 exten => _0.,1,Dial(Zap/g1/${EXTEN:1}) ; outgoing calls with 0+number
73 If you use chan\_local from a call-file and you want to pass channel variables
74 into your context, make sure you append the '/n', because otherwise
75 chan\_local will 'optimize' itself out of the call-path, and the variables will
79 Local/00531234567@pbx becomes Local/00531234567@pbx/n