- 浏览: 453413 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
a464697691:
楼主厉害,现在可以使用了
Proxool houseKeepingSleepTime bug修正 -
chenpi529:
楼主好牛逼
Proxool houseKeepingSleepTime bug修正 -
huangxinyu_it:
多谢楼主了
Proxool houseKeepingSleepTime bug修正 -
kokorodo:
谢谢了!
zk中文开发手册pdf版(基于3.5.1) -
superscorpio:
public void testImportInContex ...
MVEL2.0控制流
Originate Using Asterisk Local Channels
Whenever you want to place a call between two extensions in the dialplan you have to use Local channels.
The OriginateAction that you use when placing calls through the Manager API requires a channel name for the first leg. Usually your application has no knowledge of the dialplan details, i.e. it does not know which channel is triggered by an extension (maybe it's a SIP hardphone, an IAX device or a link to another Asterisk server). What you want to do is "place a call between number a and number b" and leave the rest to Asterisk.
Local channels act as a proxy to the real channels mapped to an extension. So to place a call from 1310 to 1299 your Originate looks like:
1.
Channel: Local/1310@from-local
2.
Context: from-local
3.
Exten: 1310
4.
Priority: 1
1.
Channel: SIP/1310
2.
Context: from-local
3.
Exten: 1299
4.
Priority: 1
There is an article about Local Channels at voip-info.org that covers the basics.
So that's all very nice and looks straight forward. It becomes more interesting if you have a look at what happens under the hood:
A Local channel actually consists of two channels in Asterisk: Local/XXX,1 and Local/XXX,2. The Local/XXX,2 channel traverses the dialplan starting at the context and extension you provided. In our example this is the extension 1310 in from-local. If you watch the CLI or the events triggered you will see:
1.
Set(_ALERT_INFO=<Bellcore-dr1>)
2.
Macro(localexten|1310|SIP/1310)
3.
Dial(SIP/1310|30|t)
This corresponds to the defintion of 1310 in my dialplan:
01.
[from-local]
02.
exten => 1310,1,Set(_ALERT_INFO=<Bellcore-dr1>)
03.
exten => 1310,n,Macro(localexten,${EXTEN},SIP/${EXTEN})
04.
05.
[macro-localexten]
06.
exten => s,1,Dial(${ARG2},30,t)
07.
exten => s,n,Goto(s-${DIALSTATUS},1)
08.
exten => s-NOANSWER,1,Voicemail(u${ARG1})
09.
exten => s-NOANSWER,n,Hangup
10.
exten => s-BUSY,1,Busy
11.
exten => _s-.,1,Goto(s-NOANSWER,1)
The Dial command triggers an additional channel (SIP/1310). This is the actual channel that is proxied by the Local channel.
The other side of the Local channel, Local/XXX,1, is used for the desination. In our example this is the extension 1299 in from-local. You see similar events for this channel. The actual channel that is triggered for 1299 is an IAX channel to another Asterisk server: IAX2/iax_reucon_net-3.
Now we reach the point where we have four channels set up: The two sides of the Local channel and the two "real" channels SIP/1310 and IAX2/iax_reucon_net. Two channels are now longer needed and will vanish. Before this happens all data of the proxied channel is copied (masqueraded) to Local/XXX,1 so that Local/XXX,1 is renamed to SIP/1310. The "old" SIP/1310 channel is renamed to SIP/1310-0820f718<MASQ> and finally to Local/1310@from-local-1e71,1<ZOMBIE> before it is hung up. Local/XXX,2 is hung up without any renaming.
So in the end you have exactly what you would have expected: Two channels, SIP/1310 and IAX2/iax_reucon_net up and connected.
I have prepared a nice diagram that shows all these steps in detail and helps you understand what happens:
评论
看你输出的日志记录,你使用的应该是asterisk1.6的内核,这个问题也是我最近发现的,
请看我的博文,希望能帮助到你,http://sunflowers.iteye.com/blog/759614
[quote=AMI]
Action: Originate
Channel: Local/1310@from-local
Context: from-local
Exten: 1310
Priority: 1
我用软电话没有试成功,当执行如上 AMI 命令时,首先分机1310振铃 接起来之后又会再振铃再接起 它把 “Local/xxx,1” 和 “Local/xxx,2”这两个通道连接起来了,软电话用的是X-lite3.0免费版。CLI输出完整如下:
[quote=CLI]
-- Executing [1310@from-local:1] Set("Local/1310@from-local-003c;2", "_ALERT_INFO=<Bellcore-dr1>") in new stack
-- Executing [1310@from-local:2] Macro("Local/1310@from-local-003c;2", "localexten,1310,SIP/1310") in new stack
-- Executing [s@macro-localexten:1] Dial("Local/1310@from-local-003c;2", "SIP/1310,30,t") in new stack
== Using SIP RTP CoS mark 5
-- Called 1310
-- SIP/1310-00000002 is ringing
-- SIP/1310-00000002 is ringing
-- SIP/1310-00000002 answered Local/1310@from-local-003c;2
-- Executing [1310@from-local:1] Set("Local/1310@from-local-003c;1", "_ALERT_INFO=<Bellcore-dr1>") in new stack
-- Executing [1310@from-local:2] Macro("Local/1310@from-local-003c;1", "localexten,1310,SIP/1310") in new stack
-- Executing [s@macro-localexten:1] Dial("Local/1310@from-local-003c;1", "SIP/1310,30,t") in new stack
== Using SIP RTP CoS mark 5
-- Called 1310
-- Local/1310@from-local-003c;1 requested special control 20, passing it to SIP/1310-00000003
== Spawn extension (macro-localexten, s, 1) exited non-zero on 'Local/1310@from-local-003c;2' in macro 'localexten'
== Spawn extension (from-local, 1310, 2) exited non-zero on 'Local/1310@from-local-003c;2'
-- SIP/1310-00000003 is ringing
-- SIP/1310-00000003 is ringing
-- SIP/1310-00000002 requested special control 16, passing it to SIP/1310-00000003
-- Music class default requested but no musiconhold loaded.
-- SIP/1310-00000002 requested special control 20, passing it to SIP/1310-00000003
-- SIP/1310-00000003 answered SIP/1310-00000002
== Spawn extension (macro-localexten, s, 1) exited non-zero on 'SIP/1310-00000002' in macro 'localexten'
== Spawn extension (from-local, 1310, 2) exited non-zero on 'SIP/1310-00000002'
发表评论
-
使用 Local Channel呼叫时context 加/n与不加的区别
2010-09-09 16:37 1213示例代码 ManagerConnection ... -
asterisk1.6 manager 命令列表
2010-08-20 09:18 1525manager show commands Act ... -
TI技术常见名词解释
2010-08-13 10:20 1756转载于这里 ACD……Automatic ... -
Asterisk 通道变量
2010-08-13 10:18 1994${ACCOUNTCODE}: 用户计费帐号 sip.conf ... -
Elastix 2.0 has been released!
2010-08-10 13:33 1712Elastix 2.0 has been releas ... -
Asterisk通道工具类
2010-07-28 13:58 1670/** * * Asterisk通道工具类 ... -
asterisk dialplan可用函数
2010-07-23 16:25 3683---------------------------- ... -
asterisk-1.6.2.6-2来电显示的bug修复以及asterisk-1.6.2.6-2 rpm重新打包
2010-05-24 11:49 2146asterisk-1.6.2.6-2来电显示的bug修复 ... -
asterisk1.6中通话播放
2010-04-21 20:21 1126Using Call Screening Another ... -
asterisk1.6支持的函数
2010-04-21 20:04 1155Installed Custom Functions:---- ... -
asterisk 中特殊的extension
2010-04-10 20:39 1409Special extensions 特殊的e ... -
Asterisk中实现桥接两个会议
2010-02-03 01:59 2346--------------------------- ... -
chan_dahdi.c 中dahdi_pvt的定义
2010-02-03 01:04 1765static struct dahdi_pvt { ast ... -
Asterisk自动报号优化
2010-01-25 16:37 1652自动报号详细细节见给asterisk添加自动报号功 ... -
Asterisk cmd ChanSpy,extenspy 通道监听与分机监听
2010-01-18 09:16 3820Asterisk cmd ChanSpy ChanS ... -
AST_CAUSE 定义
2009-11-24 13:14 2169文件位置asterisk-1.4.26.2/includ ... -
Asterisk CLI命令
2009-11-05 14:23 4833Asterisk 1.4.0 CLI commands ... -
Asterisk呼入队列分析
2009-10-21 11:42 4412asteriskjava监控打印 ... -
给asterisk添加自动报号功能
2009-09-03 12:00 3011asterisk自动报号 文章代码优化部分请 ... -
asterisk application命令
2009-07-27 13:50 2552常规指令Authenticate:鉴别用户VMAuthen ...
相关推荐
Asterisk manager API
Asterisk_manager_API(AMI)文档
The Asterisk Manager Interface (AMI) allows a client program to connect to an Asterisk instance and issue commands or read events over a TCP/IP stream. Integrators will find this particularly useful ...
Asterisk控制接口(AMI)允管理客端程序接到一个asterisk实例并且可以通过TCP/IP流发送命令或读取事件。 如果你需要进行Asterisk开发,这个文档会非常有用,并且是中文的。 如果英文好,可以直接在www.voip-info.org...
Asterisk manager API(AMI)文档
对于我的项目,我需要Asterisk Manager API的低级接口。 我环顾四周,发现 。 虽然这是一个很好的起点,但对于我来说,它有太多的抽象。 这就是为什么我将其版本基于它,然后从根本上对其进行重构的原因。 最后,...
通过socket 连接asterisk 并分析asterisk 的Event事件。主要支持asterisk 1.4 版本
Asterisk+manager+Interface(CN).doc
Asterisk客户端和Asterisk manager API(AMI)文档。
Jami,Java Asterisk Mananger接口是Java客户端通过mananger接口连接到星号PBX的库。
libamievent是用C编写的Asterisk Manager Interface的异步事件驱动的客户端库。它使用作为事件循环后端。 使用libamievent,您可以发送AMI命令,还可以订阅对该命令的响应。 到达时,libamievent会调用在预订时指定...
This is a book for anyone who uses Asterisk, but particularly those who already ...external application through the Asterisk Gateway Interface or Asterisk Manager Interface isn’t also possible.
Asterisk.NET替代产品的开始。 该项目的目标是创建一个管理器连接库,以简化与多个Asterisk服务器的接口。 Asterisk Connection Manager当前是一个非常新的,不完整的文档。
这个gem为Asterisk Manager Interface的Ruby或RubyOnRails项目添加了支持 有一个同名的项目,但似乎已停产,所以我决定开始一个新项目 安装 轨道3 添加到您的Gemfile并运行bundle命令进行安装。 gem "ruby-...
Asterisk+manager+API(中文文档).doc Asterisk_manager_API.doc Asterisk_系统及其应用分析.pdf asterisk入门连载.doc asterisk架构.doc Asterisk核心框架.docx Asterisk核心框架.pdf asterisk目录结构.txt 基于...
DAMI支持发送每个动作,并能够处理[AMI API]( https://www.voip-info.org/asterisk-manager-api/中概述的每个事件)。 DAMI将返回给您的数据与Asterisk完全相同,但是对象由数组中的键/值对组成。 例如,采取“ ...
asterisk-java AGI 通过asterisk ami接口,连接asterisk. api,开发自己的呼叫中心
Asterisk 简介 Asterisk 架构 Asterisk程序框图
The Asterisk-Java package consists of a set of Java classes that allow you to... Asterisk-Java supports both interfaces that Asterisk provides for this scenario: The FastAGI protocol and the Manager API.
Asterisk权威指南中文(第3版) Asterisk权威指南(第3版)第15章自动话务员 Asterisk权威指南(第3版)第02章Asterisk体系结构 Asterisk权威指南(第3版)第05章用户设备配置 Asterisk权威指南(第3版)第06章Dialplan基础 ...