[Asterisk-Dev] Local channel (New subject)

Steven Critchfield critch at basesys.com
Sat Jan 17 11:43:43 MST 2004


On Sat, 2004-01-17 at 06:41, Brancaleoni Matteo wrote:
> > Oh, the mysterious local channel again. There's no proper documentation on this
> > anywhere. Could someone please take some time to explain when to use the local
> > channel and how it works, so we could add this to the Wiki and the docs project?
> 
> chan_local is a proxy channel. think about it as a goto with return.
> useful when you want to exec an extension in another context, without
> exiting from current context, so avoiding duplicate actions.
> 
> for example:
> 
> [inbound] ; here falls all incoming calls
> exten => s,1,Answer
> exten => s,2,Dial(local/200 at internals,30,r)
> exten => s,3,Playback(sorrynoanswer)
> exten => s,4,Hangup
> 
> [internal] ; here where our phones falls for default
> exten => 200,1,Dial(sip/blah)
> exten => 200,102,VoiceMail(${EXTEN}@default)
> 
> exten => 201,1,Dial(zap/1)
> exten => 201,102,VoiceMail(${EXTEN}@default)
> 
> exten => _0.,1,Dial(Zap/g1/${EXTEN:1}) ; outgoing calls with 0+number
> 
> so that let me to call a local (internal) extension,
> without:
> * duplicate the dial & voicemail statements
> * don't letting them to dial out, since in internal
>   context I have the possibility to dialout.
> 
> This is a very quick & bad example... others may follow.
> however, think at it as a goto with return.

The reasons here are really bad. The proper way of keeping the call
information in one place while keeping incoming calls from reaching a
part of the dialplan with outside line privledges is to have the
extensions for people be in a different context as the context to dial
out. You then create a new context for your inside lines that includes
the extensions and the outside access. Your inbound callers can also
have access to the same extensions context too without getting the
outside line context. 

I think though that that explained an interesting idea of layering dial
options that I didn't think was possible until now. 




More information about the asterisk-dev mailing list