14 thoughts on “Screencast: Adhearsion and Trixbox CE”
Thanks for this, it’s really helpful.
Here are two problems I encountered and how they were resolved. Might be useful to someone else who has similar issues.
The trixbox VPS I’m using has 512MB RAM, no swap partition, and no way of creating one. This meant that when compiling Ruby, the VPS ran out of memory and aborted the compilation. I ended up filing a support ticket with my VPS company and they temporarily increased the RAM to 768MB for 24 hours so that I could finish compiling it.
Also, after installing adhearsion through rvm, the ahn executable could not be found when I ran ‘ahn create myapp’.
Adding the following line to ~/.bash_profile did the trick:
alias ahn=’/usr/local/rvm/gems/ruby-1.9.2-p180/gems/adhearsion-1.0.1/bin/ahn’
Hi Brian, glad you found this helpful! Regarding “ahn” not being in the path, that is supposed to be managed by rvm. Sometimes, if you don’t source the rvm script properly, some of the environment variables do not get set up fully. You might try logging out and logging back in (assuming you updated .bashrc to source rvm) or you can just source rvm manually: `source “/usr/local/rvm/scripts/rvm”` See the rvm docs here for more information: http://rvm.beginrescueend.com/rvm/install/ (look in the section “Post Install”).
Thanks Ben, you were right, the rvm script wasn’t being sourced properly. I think this is because my trixbox instance already a ~/.bash_profile which meant the ~/.profile was being ignored.
The procedure for installing on Elastix is identical to the one for Trixbox because both systems are based around FreePBX. You can even use the same install script I mention in this screencast. Give it a shot and let us know how it works for you.
Thank you very much, I tried it last night and it worked perfectly. I will start learning Adhearsion from time to time when I have free time. Anyway, is the simon game written in Ruby? I ask this question to know which languange should I need to also to learn. I am new to programming and want to know what languange should I need to learn for me to write an adhearsion program. Again thanks.
I’m glad to hear it is working for you. Yes, the Simon game is written in Ruby, as are all Adhearsion applications. The best way to get started learning to write telephony apps with Adhearsion is to take a look at the examples listed on our website: http://adhearsion.com/examples. The Adhearsion Wiki is also a good resource.
Thanks Ben, So with that being said I need to know how the ruby syntax works. Question, Let’s say I have done a Ruby program eg. mytestapp (pardon me, I still don’t know the ruby extension) how can I call it on the adhearsion dialplan. And also how can I set my adhearsion apps to automatically start when my Elastix box reboot or restart? I am very excited to learn lots of thing with Ruby and Adhearsion.
Today I did install the Cepstral TTS and it works great and tested the menu example in adhearsion website. Is there a book that I can read to fully grasp this.
Hi Ben, I am tying to do a simple program written in Ruby. Here is what I want to accomplish.
1. user input the extension and get that input, assigned it to a variable “myvar”
2. check to see if myvar is a valid extension.
I have created 2 extension on FreePBX (200 and 201), my problem is that I don’t know what variable name is holding the 200 and 201 or Are all the extension that I created on FreePBX goes to a database if so, What is the name of the database and how can I access it. That is why I can’t validate if “myvar” is a valid extension. Pardon me for bothering you again and I don’t know if I can ask question like this on your blog. Thanks.
The Adhearsion community is probably a better forum. Check out the mailing list at http://groups.google.com/group/adhearsion or the IRC channel on irc.freenode.net #adhearsion.
Thanks for this, it’s really helpful.
Here are two problems I encountered and how they were resolved. Might be useful to someone else who has similar issues.
The trixbox VPS I’m using has 512MB RAM, no swap partition, and no way of creating one. This meant that when compiling Ruby, the VPS ran out of memory and aborted the compilation. I ended up filing a support ticket with my VPS company and they temporarily increased the RAM to 768MB for 24 hours so that I could finish compiling it.
Also, after installing adhearsion through rvm, the ahn executable could not be found when I ran ‘ahn create myapp’.
Adding the following line to ~/.bash_profile did the trick:
alias ahn=’/usr/local/rvm/gems/ruby-1.9.2-p180/gems/adhearsion-1.0.1/bin/ahn’
Hi Brian, glad you found this helpful! Regarding “ahn” not being in the path, that is supposed to be managed by rvm. Sometimes, if you don’t source the rvm script properly, some of the environment variables do not get set up fully. You might try logging out and logging back in (assuming you updated .bashrc to source rvm) or you can just source rvm manually: `source “/usr/local/rvm/scripts/rvm”` See the rvm docs here for more information: http://rvm.beginrescueend.com/rvm/install/ (look in the section “Post Install”).
Thanks Ben, you were right, the rvm script wasn’t being sourced properly. I think this is because my trixbox instance already a ~/.bash_profile which meant the ~/.profile was being ignored.
Thanks much. Very helpful. Appreciate it.
thanks for Screencast. Wating for next Screencast.
Great blog, and screencast.
One tip: on vim you can use 😡 to save and quit instead of :wq
Thanks! Regarding :x, thanks for the tip. I was aware of it, but having used :wq as long as I can remember old habits die hard.
Hi Ben can you also do a screencast on how to install Adhearsion on Elastix.
Thanks.
Hey Rey,
The procedure for installing on Elastix is identical to the one for Trixbox because both systems are based around FreePBX. You can even use the same install script I mention in this screencast. Give it a shot and let us know how it works for you.
Hi Ben,
Thank you very much, I tried it last night and it worked perfectly. I will start learning Adhearsion from time to time when I have free time. Anyway, is the simon game written in Ruby? I ask this question to know which languange should I need to also to learn. I am new to programming and want to know what languange should I need to learn for me to write an adhearsion program. Again thanks.
I’m glad to hear it is working for you. Yes, the Simon game is written in Ruby, as are all Adhearsion applications. The best way to get started learning to write telephony apps with Adhearsion is to take a look at the examples listed on our website: http://adhearsion.com/examples. The Adhearsion Wiki is also a good resource.
Thanks Ben, So with that being said I need to know how the ruby syntax works. Question, Let’s say I have done a Ruby program eg. mytestapp (pardon me, I still don’t know the ruby extension) how can I call it on the adhearsion dialplan. And also how can I set my adhearsion apps to automatically start when my Elastix box reboot or restart? I am very excited to learn lots of thing with Ruby and Adhearsion.
Today I did install the Cepstral TTS and it works great and tested the menu example in adhearsion website. Is there a book that I can read to fully grasp this.
Thanks and Regards to all the Adhearsion Team.
Hi Ben, I am tying to do a simple program written in Ruby. Here is what I want to accomplish.
1. user input the extension and get that input, assigned it to a variable “myvar”
2. check to see if myvar is a valid extension.
I have created 2 extension on FreePBX (200 and 201), my problem is that I don’t know what variable name is holding the 200 and 201 or Are all the extension that I created on FreePBX goes to a database if so, What is the name of the database and how can I access it. That is why I can’t validate if “myvar” is a valid extension. Pardon me for bothering you again and I don’t know if I can ask question like this on your blog. Thanks.
Hi Rey,
The Adhearsion community is probably a better forum. Check out the mailing list at http://groups.google.com/group/adhearsion or the IRC channel on irc.freenode.net #adhearsion.