⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 localchannel.tex

📁 asterisk 是一个很有知名度开源软件
💻 TEX
字号:
\subsection{Introduction}chan\_local is a pseudo-channel. Use of this channel simply loops calls backinto the dialplan in a different context. Useful for recursive routing.\subsection{Syntax}\begin{verbatim} Local/extension@context[/{n|j}]\end{verbatim}Adding "/n" at the end of the string will make the Local channel not do anative transfer (the "n" stands for "n"o release) upon the remote end answeringthe line. This is an esoteric, but important feature if you expect the Localchannel to handle calls exactly like a normal channel. If you do not have the"no release" feature set, then as soon as the destination (inside of the Localchannel) answers the line and one audio frame passes, the variables and dial planwill revert back to that of the original call, and the Local channel will become azombie and be removed from the active channels list. This is desirable in somecircumstances, but can result in unexpected dialplan behavior if you are doingfancy things with variables in your call handling.There is another option that can be used with local channels, which is the "j"option.  The "j" option must be used with the "n" option to make sure that thelocal channel does not get optimized out of the call.  This option will enablea jitterbuffer on the local channel.  The jitterbuffer will be used to de-jitteraudio that it receives from the channel that called the local channel.  This isespecially in the case of putting chan\_local in between an incoming SIP calland Asterisk applications, so that the incoming audio will be de-jittered.\subsection{Purpose}The Local channel construct can be used to establish dialing into any part ofthe dialplan.Imagine you have a TE410P in your box. You want to do something for which youmust use a Dial statement (for instance when dropping files in\path{/var/spool/outgoing}) but you do want to be able to use your dialplansleast-cost-routes or other intelligent stuff. What you could do before we hadchan\_local was create a cross-link between two ports of the TE410P and thenDial out one port and in the other. This way you could control where the callwas going.Of course, this was a nasty hack, and to make it more sensible, chan\_local wasbuilt.The "Local" channel driver allows you to convert an arbitrary extension into achannel. It is used in a variety of places, including agents, etc.This also allows us to hop to contexts like a GoSub routine; See examples below.\subsection{Examples}\begin{astlisting}\begin{verbatim}[inbound] ; here falls all incoming callsexten => s,1,Answerexten => s,2,Dial(local/200@internal,30,r)exten => s,3,Playback(sorrynoanswer)exten => s,4,Hangup[internal] ; here where our phones falls for defaultexten => 200,1,Dial(sip/blah)exten => 200,102,VoiceMail(${EXTEN}@default)exten => 201,1,Dial(DAHDI/1)exten => 201,102,VoiceMail(${EXTEN}@default)exten => _0.,1,Dial(DAHDI/g1/${EXTEN:1}) ; outgoing calls with 0+number\end{verbatim}\end{astlisting}\subsection{Caveats}If you use chan\_local from a call-file and you want to pass channel variablesinto your context, make sure you append the '/n', because otherwisechan\_local will 'optimize' itself out of the call-path, and the variables willget lost. i.e.\begin{verbatim} Local/00531234567@pbx becomes Local/00531234567@pbx/n\end{verbatim}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -