- 浏览: 417350 次
-
文章分类
- 全部博客 (327)
- Android (114)
- Java (13)
- Java基础 (14)
- Glib (2)
- linux (15)
- extjs (5)
- eclipse (2)
- Asterisk (56)
- MYSQL (6)
- 数据库 (9)
- PHP (7)
- C# (18)
- 杂谈~~ (1)
- web开发前端 (3)
- 网络编程 (2)
- Opensips (2)
- voip (3)
- debian (7)
- openfire (15)
- wordpress (1)
- 版本控制 (1)
- Android 线程服务广播 (1)
- SRTP (2)
- 单片机及ARM等 (3)
- 基础知识 (5)
- asp.net (2)
- 单片机 (1)
- 设计模式及架构 (1)
- 安全 (1)
- Cubieboard 草莓树莓各类派 Android开发板 (1)
- J2EE (2)
- BootStrap (3)
- BootStrap web前端开发 (1)
- web前端开发 (4)
- object-c (1)
- openwrt (8)
- 智能家居 (4)
- Node.js (4)
最新评论
-
xiaoxiecomeon:
你这个程序一存在线程的时间片相互抢占的问题,运行时间长了很可能 ...
Runnable 和 Thread -
dotjar:
我觉得话应该这么说:引用TestThread tt = new ...
Runnable 和 Thread -
dagf113225:
调用TelephonyManager的隐藏API是先参考Fra ...
Android提高第十四篇之探秘TelephonyManager
Asterisk local channels
Local channel
chan_local is a pseudo-channel. Use of this channel simply loops calls back into the dialplan in a different context. Useful for recursive routing; it is able to return to the dialplan after call completion.
Syntax:
Local/extension@context[/n]
Local/extension@context[/nj] (starting with Asterisk 1.6, backport available for 1.4)
Adding "/n" at the end of the string will make the Local channel not do a native transfer (the "n" stands for "n"o release) upon the remote end answering the line. This is an esoteric, but important feature if you expect the Local channel 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 Local channel) answers the line, the variables and dial plan will revert back to that of the original call, and the Local channel will become a zombie and be removed from the active channels list. This is desirable in some circumstances, but can result in unexpected dialplan behavior if you are doing fancy things with variables in your call handling.
Adding "/nj" will apply the the generic jitterbuffer to the Local channel driver; this feature was introduced in Asterisk 1.6, with a backport being available for 1.4 (see link above on how to obtain it from svn). With this jitter buffer and a Local channel now also calls that aren't bridged but 'talk' to an Asterisk application can take advantage of de-jittering - provided the generic jitter buffer (not the older adaptive jitter buffer?) has been enabled in SIP (or MGCP or ...).
Purpose:
The Local channel construct can be used to establish dialling into any part of the dialplan.
Imagine you have a TE410P in your box. You want to do something for which you must use a Dial statement (for instance when dropping files in /var/spool/outgoing) but you do want to be able to use your dialplans least-cost-routes or other intelligent stuff. What you could do before we had chan_local was create a cross-link between two ports of the TE410P and then Dial out one port and in the other. This way you could control where the call was going.
Of course, this was a nasty hack, and to make it more sensible, chan_local was built.
The "Local" channel driver allows you to convert an arbitrary extension into a channel. It is used in a variety of places, including agents, etc.
Here are some examples (primarily using conferencing) where it might be useful:
- Suppose you wanted to build a web GUI for building conferences... You could make your script ask for what number to call and use Local/number@context as the channel in your .call file, and set the conference as the extension to go to.
- Imagine you had a conference going on and you wanted to be able to add someone in sales. You could use Local/salesexten@context as the channel to add to the conference, which would then ring everyone in sales.
- Imagine you wanted to link two conferences together.
- Imagine you wanted to add MusicOnHold to a conference.
- You'd like to use .call files for automated dialling and still want to make sure that a CDR record = log entry gets created
This also allows us to hop to contexts like a GoSub routine; See examples below.
Examples:
[inbound]
; here falls all incoming calls
exten => s,1,Answer
exten => s,2,Dial(local/200@internals,30,r)
exten => s,3,Playback(sorrynoanswer)
exten => s,4,Hangup
[internals]
; 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.
Using the local channel to play music on hold when already answered while waiting for a script that takes a while:
[waitforscript]
exten => s,1,Dial(local/s@somescript,60,m)
[somescript]
exten => s,1,Ringing
exten => s,n,System(' .. something which takes a lot of work ..')
exten => s,n,Answer()
One could create a special music on hold class saying 'please wait while we process your request'. Just remember that the caller may fall into the music on hold loop at any point.
In Manager API or in a call-file, a CDR will not be generated without using the local channel. At its simplest, use these examples to Dial:
For Manager API or in a call-file use the following to specify an outbound call. (the trailing '/n' is important):
Channel: local/PHONENUMBERTOCALL@outbound/n
And in extensions.conf:
[outbound]
exten => _1.,1,Dial(SIP/${EXTEN}@some-outbound-carrier-context)
exten => _1.,2,Congestion
Caveats:
If you use chan_local from a call-file and you want to pass channel variables into your context, make sure you append the '/n', because otherwise chan_local will 'optimize' itself out of the call-path, and the variables will get lost. i.e.
Local/00531234567@pbx becomes Local/00531234567@pbx/n
Local channels don't support state information (see hint) in Asterisk 1.4. For that you either need to use 1.6 or backport of state_interface for 1.4. Then you have to set call-limit for peers, and specify state_interface device when logging in agents. For more information please search for "asterisk queue state" on the asterisk-users mailinglist.
Be aware that your CDR data will become clutter with extra data; you might want to consider using NoCDR() and ResetCDR() to prevent this from happening.
See also
- Asterisk tips forking
- Asterisk cmd DISA
- Local channels and the Manager API
- Asterisk new jitterbuffer: Old adaptive jitter buffer of Asterisk 1.2 vs. new generic fixed-size jitter buffer of Asterisk 1.4
发表评论
-
Configuring an Asterisk server
2013-06-28 09:05 920Configuring an Asterisk server ... -
asterisk ami
2013-06-28 08:56 1412Asterisk Manager Interface主要提供 ... -
Originate Using Asterisk Local Channels
2013-01-24 17:30 1342Whenever you want to place a c ... -
Asterisk 1.8 chan_sip模块代码分析
2013-01-18 16:33 1936和以前版本相比,Asterisk在架构上有了不小的变动,本文 ... -
Asterisk Kernel analysis 2 channel
2013-01-17 17:44 843从内核的角度去分析问题时,弄清楚呼叫流程是非常关键的,只有 ... -
Asterisk Kernel analysis 1
2013-01-17 17:44 856一、内核初始化。 从 main入口。Asterisk ... -
astersik bridge 支持
2013-01-17 17:27 690为支持通话过程中双方按键的接受及处理,asterisk 通过 ... -
Asterisk 之${BRIDGEPEER} 函数说明
2013-01-17 16:38 704${BRIDGEPEER} :个人理解是 获取当前通道类型 ... -
Asterisk拨号函数Dial()详解
2012-12-27 13:33 1699Asterisk的拨号函数/命令是Dial,下面就介绍一 ... -
asterisk中常用函数说明
2012-12-15 11:56 963int ast_strlen_zero(co ... -
什么是1号信令、7号信令和PRI信令?
2012-04-11 14:26 1516按照信令的信道来分类,信令可以分为:随路信令和公共信道信 ... -
FreeSWITCH 与 Asterisk 比较
2012-03-29 15:45 3577VoIP通信,与传统的电话技术相比,不仅仅在于绝对的资费 ... -
Asterisk命令MeetMe详解
2012-03-29 14:44 1015MeetMe 概要 MeetMe ... -
35个最棒的Asterisk免费应用
2012-03-12 14:51 2222Hi, I was looking round o ... -
Asterisk Originate 内部执行流程
2012-03-11 20:34 10111. originate的执行 向客户端发起呼叫,将客 ... -
模拟板卡疑难杂症(转)
2012-03-11 20:34 2253转自:http://sun4love.javaeye.c ... -
Asterisk 通话过程中执行动作(即applicationmap )的使用方法和电话转会议的实现
2012-03-11 20:34 982asterisk在正常通话过程中执行拨号计划中动作是通过 ... -
asterisk feature applicationmap 的caller和callee 的区别
2012-03-11 20:34 1016经过测试,在applicationmap 中定 ... -
asterisk中关于实现会议室meetme的笔记
2012-03-09 11:07 1941一、资料: 1.http: ... -
Asterisk 之${BRIDGEPEER} 函数说明
2012-03-09 11:06 806${BRIDGEPEER} :个人理解是 获取当前通道类型通道 ...
相关推荐
7. Asterisk 的配置文件包括 zapata.conf、zapata-channels.conf、sip.conf 和 extensions.conf 等。 8. 在 Kamailio.cfg 文件中需要配置 switch 语句来管理 Asterisk 的配置。 9. 在 Asterisk 中,需要安装 ...
5. **使用通道(Channels)和拨号计划(Dialplan)**:Asterisk-java提供了对通道和拨号计划的操作,你可以查询现有的通道状态,修改拨号计划,甚至在运行时动态改变Asterisk的行为。 6. **实时监控**:通过...
Asterisk是一款开源的电话交换机软件,它允许用户创建高度自定义的通信系统,包括VoIP(Voice over IP)电话、会议桥、自动呼叫分配(ACD)以及许多其他电信功能。Asterisk的核心设计理念是灵活性和可扩展性,这使得...
- `ManagerCommand`:用于向Asterisk发送命令,例如`Originate`命令发起一个呼叫,或者`CoreShowChannels`命令获取所有通道的信息。 - `ActionID`:每个发送的命令都有一个唯一的`ActionID`,通过它可以跟踪命令的...
在 Asterisk 中,你可以定义多个 context,每个context都可以嵌套另一个,例如default、local和longdistance等。每个context都可以定义一组具体的呼入和呼出电话处理规则,使得Asterisk拨号方案的配置非常灵活和强大...
Asterisk权威指南中文(第3版) Asterisk权威指南(第3版)第15章自动话务员 Asterisk权威指南(第3版)第02章Asterisk体系结构 Asterisk权威指南(第3版)第05章用户设备配置 Asterisk权威指南(第3版)第06章Dialplan基础 ...
Asterisk.NET 1.6.3 是一个专门为.NET开发者设计的开源库,它提供了对Asterisk PBX系统的编程接口,使得用户可以方便地在C#、VB.NET或其他.NET支持的语言中控制和扩展Asterisk功能。这个库是基于Asterisk Manager ...
* zap show channels 查看ZapTel语音卡各个通道 * stop now 立刻停止Asterisk * stop gracefully 温文尔雅滴停止Asterisk * restart now 立刻重启Asterisk * restart gracefully 温文尔雅滴重启Asterisk * database ...
Asterisk是一款强大的开源通信平台,它被广泛用于构建VoIP(Voice over Internet Protocol)电话系统,SIP(Session Initiation Protocol)服务器以及各种通信应用。这个“Asterisk中文文档说明”涵盖了从基础概念到...
Asterisk是一款开源的IP电话系统,用于构建VoIP(Voice over Internet Protocol)通信平台。在本场景中,我们讨论的是Asterisk的16版本安装包,这将引导我们深入理解Asterisk的核心功能、安装流程以及如何进行编译和...
修改sip_general_custom.conf(作为测试,在所有SIP 通道上启用提示语为中文,在实际应用中,可根据需要修改--zapata-channels.conf,sipXXX.conf,IAXXXX.conf...,也可在FreePBX的WEB界面中有language选项的地方修改--...
Asterisk是一款开源的IP电话系统,它允许用户创建自己的通信平台,支持VoIP(Voice over IP)服务,包括电话会议、语音邮件和IVR(Interactive Voice Response)等。中文语音包是为Asterisk系统设计的一个关键组件,...
2. **架构概述**:Asterisk的核心架构包括通道(Channels)、拨号计划(DialPlan)、应用程序(Apps)和管理接口(Manager API)。通道处理实际的通信连接,DialPlan定义了如何处理呼叫,应用程序执行特定的通话操作...
标签“asterisk record”指的是与Asterisk录音相关的配置和功能,它表明文章将围绕如何在Asterisk中设置和实现录音功能。 在提供的部分内容中,提到了几个关键的配置文件和步骤,这些是实现Asterisk录音功能的核心...
Asterisk是一款开源的PBX(Private Branch Exchange)软件,专用于实现VoIP(Voice over IP)通信。在本文中,我们将深入探讨如何利用Asterisk实现视频通讯功能。实现Asterisk视频通讯的关键在于配置sip.conf文件...
Zapata配置文件中,`[trunkgroups]`和`[channels]`部分定义了线路组和通道的属性,如语言、上下文、信号类型等。 通过这些步骤,你可以成功安装和配置Asterisk,从而建立起一个基本的VoIP服务器。不过,Asterisk的...
Asterisk是一个开源的IP电话系统,用于搭建VoIP服务器,提供电话呼叫、语音邮件、会议等通信功能。以下是对Asterisk学习日志中提到的一些关键知识点的详细解释: 1. **Asterisk调试与日志记录**: 在学习Asterisk...
### Asterisk AGI应用详解 #### 一、概述 Asterisk是世界上最流行的开源PBX系统之一,它支持多种通信协议并提供了丰富的功能。在Asterisk中,AGI(Asterisk Gateway Interface)是一种非常重要的接口技术,它允许...
Asterisk是一款开源的IP电话系统,用于构建VoIP网络通信基础设施。它的功能强大,能够支持PBX(Private Branch Exchange)、VoIP网关、呼叫中心和许多其他电信应用。在这个"Asterisk客户端.rar"压缩包中,我们主要...
本文将深入剖析Asterisk的核心概念,包括通道(Channel)、呼叫情景(Call Scenario)、桥接通道(Bridging Channels)以及植入通道(Masquerading Channels),并通过具体代码实例来解释这些概念的应用。...