简体   繁体   English

FreeSWITCH中是否与Asterisk AMI和AGI有相似之处?

[英]Are there parallels to Asterisk AMI and AGI in FreeSWITCH?

Asterisk has Asterisk Manager Interface (AMI) and Asterisk Gateway Interface (AGI) , using which one can trigger PHP scripts at certain events from Asterisk. Asterisk具有Asterisk Manager接口(AMI)Asterisk网关接口(AGI) ,使用它可以在Asterisk的某些事件中触发PHP脚本。 Using the same PHP scripts can also instruct Asterisk what to do next to a call/conference. 使用相同的PHP脚本还可以指示Asterisk在呼叫/会议旁边做什么。 Are there parallels to AMI and AGI in FreeSWITCH? FreeSWITCH中有与AMI和AGI的相似之处吗?

These are good questions. 这些都是好问题。 I just wanted to add a few things to what @dkwiebe said (which is correct, BTW). 我只想在@dkwiebe所说的内容中添加一些内容(这是正确的,BTW)。

The AMI equivalent in FreeSWITCH is the event socket. FreeSWITCH中的AMI等效项是事件套接字。 (Technically it's not the "Event Socket Library" or ESL, which is an abstraction layer for writing programs that use the event socket. I just wanted to make that distinction.) In fact, the FreeSWITCH equivalent of "asterisk -r" is actually an ESL-based program called "fs_cli" - short for FreeSWITCH Command Line Interface. (从技术上讲,它不是“事件套接字库”或ESL,它是用于编写使用事件套接字的程序的抽象层。我只想做出这种区别。)事实上,FreeSWITCH等效于“asterisk -r”实际上是一个名为“fs_cli”的基于ESL的程序 - FreeSWITCH命令行界面的缩写。 The fs_cli program is a great example of what you can accomplish with ESL. fs_cli程序是您使用ESL可以完成的一个很好的例子。

Also, there is no reason that you cannot use an ESL program to do many of the things that can be done with AGI scripts. 此外,没有理由不能使用ESL程序来完成许多可以使用AGI脚本完成的事情。 The ESL "connection object" can "lock on" to a single call leg and control it. ESL“连接对象”可以“锁定”到单个呼叫支路并控制它。 There are examples on the wiki and the forthcoming FreeSWITCH Cookbook will have some recipes on the subject. 维基上有一些例子,即将发布的FreeSWITCH Cookbook将有一些关于这个主题的食谱。 (Full disclosure: I am a co-author of the FreeSWITCH Cookbook.) (完全披露:我是FreeSWITCH Cookbook的合着者。)

Another ESL-related method of controlling calls like AGI is with the fs_ivrd daemon. 控制像AGI这样的调用的另一种与ESL相关的方法是使用fs_ivrd守护进程。 It's less commonly used than ESL but is a nice option for AGI-like scripting. 它不像ESL那么常用,但对于类似AGI的脚本来说是个不错的选择。 See this wiki page for more details. 有关详细信息,请参阅此Wiki页面

Lastly, I would like to mention that Lua is a great choice for doing scripting/logic/etc. 最后,我想提一下Lua是编写脚本/逻辑/等的绝佳选择。 in call control. 在呼叫控制中。 It is simple, light, and easy to learn. 它简单,轻便,易于学习。 In the lab we've seen a few thousand concurrent Lua-controlled calls on an 8-core machine. 在实验室中,我们在8核机器上看到了几千个并发Lua控制的呼叫。 Lua works even in some very demanding environments. Lua甚至在一些非常苛刻的环境中工作。

Feel free to join #freeswitch on irc.freenode.net to discuss your questions with the FreeSWITCH community. 欢迎加入irc.freenode.net上的#freeswitch,与FreeSWITCH社区讨论您的问题。

FreeSWITCH wiki上有一个页面解决了大部分“Asterisk到FreeSWITCH”的问题: Rosetta Stone

AGI are for scripts used durring a call (ie called from dialplan durrign dialplan execution). AGI用于呼叫期间使用的脚本(即从拨号方案durrign拨号方案执行调用)。 Scripts that listen to the AMI and wait for events are standalone. 收听AMI并等待事件的脚本是独立的。 While that latter, can, technically, do the former's job as well, you are much better off keeping them separate. 虽然后者在技术上可以做前者的工作,但你最好还是将它们分开。

@dkwiebe has given the answer on serverfault- https://serverfault.com/a/345513/105376 @dkwiebe在serverfault上给出了答案 - https://serverfault.com/a/345513/105376

For the AMI you're looking for the Event Socket Library . 对于AMI,您正在寻找事件套接字库 There are a few examples available on the mod_event_socket page. mod_event_socket页面上提供了一些示例。

AGI is a little different. AGI有点不同。 You can do things similar in FreeSWITCH but they would recommend using lua . 您可以在FreeSWITCH中执行类似的操作,但他们会建议使用lua I've personally used the FreeSWITCH mod_perl with good results. 我个人使用FreeSWITCH mod_perl效果很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM