`
xiuxiuxiu
  • 浏览: 34817 次
  • 性别: Icon_minigender_1
  • 来自: 上海
最近访客 更多访客>>
社区版块
存档分类
最新评论

Adhearsion初体验

    博客分类:
  • VoIP
阅读更多

原文地址:http://blog.tech4k.com/?p=282

我是偶尔在Asterisk: The Future of Telephony 上看到Adhearsion 的介绍的.以下是摘自Adhearsion 主页http://adhearsion.com/ 的一段对Adhearsion 的定义.

写道
Adhearsion is a new way to write voice-enabled applications. It's not just an API or library — it's a fully-featured framework, the first of its kind, designed for maximal code reuse and intuitiveness. The name "Adhearsion" is a combination of "adhesion" and "hear" because Adhearsion shines best when integrating technologies with voice.
 



简单的说就是基于Asterisk AGI,一套完整的应用于Voice Application的Ruby 框架.VoIP Application + Ruby ,还有什么比这个更适合我呢?二话不说,马上开始试用.
Adhearsion Getting Start


Adhearsion 的主页还是非常的人性化的。不仅提供了完全免费,电话测试系统,使得你建立的Adhearsion 应用可以方便的进行调试运行,还提供了多种Voice客户端的选择,包括Skype, 各种SIP Phones甚至In-browser Phone。按照下面的步骤,你可以轻松的建立你的第一个Adhearsion Application.
Step 1:注册 Adhearsion 帐号
默认会加入Adhearsion 的Mailing List,不算很热闹,偶尔会有一些邮件。Adhearsion 帐号同时也是电话系统的测试帐号,有了它你就可以连接到Adhearsion 提供的SandBox上了.

Step 2:安装Ruby , RubyGems, Adhearsion
Ruby 和Gems的安装就不多说了.安装Adhearsion 也就是一句话的事情.感谢伟大的Ubuntu和RubyGems.

sudo gem install adhearsion
 



Step 3:创建你的第一个 Adhearsion 应用
类似Rails,Adhearsion 会创建一整套基础部件,解决了类似Adhearsion 服务器启动,停止等工作,使得你可以专心在Adhearsion 应用的开发上.

ahn create my_first_app
 



Step 4:启用Sandbox Component
Adhearsion 中有一个Component的概念.Component类似插件的意思,代表了一组功能的集合.所有的Components都放在my_first_app/components目录下.其中Sandbox就是一个包含了连接注册Adhearsion 电话测试系统的Component.

cd my_first_app
ahn enable component sandbox
 



修改my_first_app/components/sandbox/sandbox.yml,按照你在Ahearsion注册的帐号密码修改该文件,这样你无需编写任何代码就可以连接注册到Adhearsion 电话测试系统了.

username: xxxxxxx
password: xxxxxxx
 



Step 5:编写你的 Adhearsion 应用
打开my_first_app/dialplan.rb,添加如下代码:

sandbox {
play "hello-world"
}
 



sandbox 代表的是Asterisk 中规定的context,Adhearsion 测试系统默认的context就是sandbox. play “hello-world” 的意思就是播放”hello-world”的音频.简单的就好像说话一样-.-


Step 6:运行你的 Adhearsion 应用
直接通过ahn命令就可以运行你的Adhearsion 应用了.由于启用了sandbox component,你的应用会先去连接Adhearsion 测试系统进行登录注册,然后启动后台进程监听请求.

ahn start .
 





OK了,这就是Adhearsion 全部需要做得了.测试一下吧.选一款你觉得最酷的soft phone,按照Ahdearsion的提示拨打电话,听到一声清脆的”Hello World”,你的Adhearsion 蹦出一些log信息.看这就爽,你也快来试试看吧.

0
0
分享到:
评论

相关推荐

    adhearsion-asr:将语音识别支持作为插件添加到Adhearsion

    将语音识别支持作为插件添加到Adhearsion。 重写CallController#ask和#menu以将所有识别责任传递给识别器,而不是多次调用它。 特征 来自Adhearsion核心的#ask API,支持数字限制,终止符,超时,内联语法和语法参考...

    adhearsion:用于构建电话应用程序的Ruby框架

    Adhearsion是一个开源语音应用程序开发框架。 Adhearsion用户使用Ruby在框架之上编写应用程序,并调用其代码。 Adhearsion位于较低级别的电话平台(例如 , 或之上,并提供了一个框架,用于与各种资源(例如SQL,...

    sequella:续集的 Adhearsion 插件

    后遗症提供与集成的 Adhearsion 插件配置与所有 Adhearsion 插件一样,输入rake config:show以查看配置选项列表。迁移驻留在目录“db/migrations”中的数据库迁移可以通过 Rake 使用rake sequella:migrate

    docker-freeswitch:FreeSWITCH Docker映像

    FreeSWITCH Docker映像 标签 1.4 :准系统FreeSWITCH 1.4 Docker映像 for_adhearsion :基于1.4带有附加模块,可与一起运行 Docker中心 在Docker Hub上可用的图像

    gosip:公共交换电信网络释放

    Adhearsion 等框架为这种笨拙的机制引入了更多的抽象层。 这些系统运行缓慢,难以管理,并且在许多情况下对于电话应用程序开发人员的需求来说是多余的。 gosip 使您摆脱了 Asterisk,因为您可以将所有内容都放在一...

    somleng-project:Somleng项目网站的资料库

    索姆伦项目什么是Somleng项目? Somleng项目是开源电话工具的集合,可用于构建功能强大的语音应用程序。 该项目的目标是消除构建电话应用程序的...Somleng-Adhearsion 是一个应用程序,可以处理呼出电话的传递和呼入电

Global site tag (gtag.js) - Google Analytics