- 浏览: 460050 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
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 1244示例代码 ManagerConnection ... -
asterisk1.6 manager 命令列表
2010-08-20 09:18 1559manager show commands Act ... -
TI技术常见名词解释
2010-08-13 10:20 1798转载于这里 ACD……Automatic ... -
Asterisk 通道变量
2010-08-13 10:18 2024${ACCOUNTCODE}: 用户计费帐号 sip.conf ... -
Elastix 2.0 has been released!
2010-08-10 13:33 1743Elastix 2.0 has been releas ... -
Asterisk通道工具类
2010-07-28 13:58 1698/** * * Asterisk通道工具类 ... -
asterisk dialplan可用函数
2010-07-23 16:25 3714---------------------------- ... -
asterisk-1.6.2.6-2来电显示的bug修复以及asterisk-1.6.2.6-2 rpm重新打包
2010-05-24 11:49 2183asterisk-1.6.2.6-2来电显示的bug修复 ... -
asterisk1.6中通话播放
2010-04-21 20:21 1160Using Call Screening Another ... -
asterisk1.6支持的函数
2010-04-21 20:04 1191Installed Custom Functions:---- ... -
asterisk 中特殊的extension
2010-04-10 20:39 1464Special extensions 特殊的e ... -
Asterisk中实现桥接两个会议
2010-02-03 01:59 2391--------------------------- ... -
chan_dahdi.c 中dahdi_pvt的定义
2010-02-03 01:04 1803static struct dahdi_pvt { ast ... -
Asterisk自动报号优化
2010-01-25 16:37 1694自动报号详细细节见给asterisk添加自动报号功 ... -
Asterisk cmd ChanSpy,extenspy 通道监听与分机监听
2010-01-18 09:16 3857Asterisk cmd ChanSpy ChanS ... -
AST_CAUSE 定义
2009-11-24 13:14 2212文件位置asterisk-1.4.26.2/includ ... -
Asterisk CLI命令
2009-11-05 14:23 4896Asterisk 1.4.0 CLI commands ... -
Asterisk呼入队列分析
2009-10-21 11:42 4457asteriskjava监控打印 ... -
给asterisk添加自动报号功能
2009-09-03 12:00 3049asterisk自动报号 文章代码优化部分请 ... -
asterisk application命令
2009-07-27 13:50 2582常规指令Authenticate:鉴别用户VMAuthen ...
相关推荐
### Asterisk Manager Interface (AMI) 中文文档概览 #### 一、引言 Asterisk Manager Interface (AMI) 是一款强大的工具,它允许开发者通过TCP/IP协议与Asterisk PBX系统进行交互,实现远程管理和监控功能。本文档...
Asterisk Manager API (AMI) 是 Asterisk 通信平台的核心组件之一,它提供了一种机制,使得外部应用程序可以通过网络与 Asterisk PBX 进行交互和控制。AMI 使用基于文本的简单“key: value”协议,允许管理客户端...
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 Manager API (AMI) 是一种用于远程管理和监控 Asterisk PBX 系统的接口。它通过TCP/IP协议提供了一种方式,让管理客户端能够连接到Asterisk实例,发送命令并接收事件。这对于实时追踪PBX的状态、电话客户端...
首先,理解Asterisk-java的基础是熟悉Asterisk的Manager API。Asterisk Manager Interface(AMI)是Asterisk提供的一种HTTP协议,用于远程管理和监控PBX。Asterisk-java通过实现这个接口,允许开发者使用Java语言...
由于提到主要支持Asterisk 1.4版本,这可能意味着代码或指南可能不适用于较新的Asterisk版本,因为API和功能可能会有所更新。 【标签】:“asterisk ami sock proxy” “ami sock proxy”可能指的是一个AMl代理,...
### Asterisk Manager Interface (AMI) 详解 #### 一、概览 Asterisk Manager Interface (简称 AMI),是Asterisk系统中的一个重要组件,它为开发者提供了远程管理和监控Asterisk实例的能力。通过AMI,我们可以实现...
对于我的项目,我需要Asterisk Manager API的低级接口。 我环顾四周,发现 。 虽然这是一个很好的起点,但对于我来说,它有太多的抽象。 这就是为什么我将其版本基于它,然后从根本上对其进行重构的原因。 最后,...
在这个"Asterisk客户端.rar"压缩包中,我们主要关注的是Asterisk的客户端组件以及Asterisk Manager API(AMI)的相关文档。 1. **Asterisk客户端**:Asterisk客户端是指与Asterisk服务器交互的各种应用程序,包括软...
【描述】:“Jami,全称为Java Asterisk Manager接口,是一款用Java编写的开源库,它允许开发者通过Manager接口与Asterisk PBX(Private Branch eXchange)系统进行交互。Asterisk是一款功能强大的开源IP电话服务器...
在使用Asterisk Manager Interface (AMI)时,此命令用于查看已配置的AMI用户,AMl是Asterisk的API,允许远程程序控制Asterisk。 8. **cdr show** 显示呼叫详细记录(Call Detail Records),用于追踪和分析通话...
- `ManagerCommand`:用于向Asterisk发送命令,例如`Originate`命令发起一个呼叫,或者`CoreShowChannels`命令获取所有通道的信息。 - `ActionID`:每个发送的命令都有一个唯一的`ActionID`,通过它可以跟踪命令的...
在Asterisk.NET 1.6.3 版本中,开发者可以期待一些改进和修复,比如性能优化、API稳定性提升以及对Asterisk最新特性的支持。使用这个版本,你能够更加稳定地构建和维护基于.NET的Asterisk应用,同时享受到版本更新...
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.
2. **架构概述**:Asterisk的核心架构包括通道(Channels)、拨号计划(DialPlan)、应用程序(Apps)和管理接口(Manager API)。通道处理实际的通信连接,DialPlan定义了如何处理呼叫,应用程序执行特定的通话操作...
9. **Asterisk Manager API** 除了CLI,Asterisk还提供了Manager API,这是一个基于HTTP的接口,用于远程控制和监控Asterisk系统,常用于开发自定义应用程序和集成。 10. **学习和资源** 对于深入了解Asterisk ...
3. **应用程序接口**:提供了丰富的API,允许开发者编写自定义的应用程序,如IVR(Interactive Voice Response)系统、录音、会议等。 4. **媒体处理**:包括编解码、静音检测、回声消除等功能,确保语音质量。 5....
Asterisk.NET替代产品的开始。 该项目的目标是创建一个管理器连接库,以简化与多个Asterisk服务器的接口。 Asterisk Connection Manager当前是一个非常新的,不完整的文档。