Freeswitcher 0.4.4 Released, and welcome Harry
This is a fairly minor bugfix (thanks diegoviela) to fix the Playback app. The 0.4.4 should be available via gem.
Mostly i'm sorry this blog has been so idle, we've been working hard on FSR, FXC, and related components, but much of it on commercial or proprietary projects. In the coming months we'll be using this knowledge to release applications which enhance the functionality of open source telecom.
Thanks to all the new contributors, and welcome to the core team Harry Vandberg. He's pushed development along while we played end user for a few months, we're happy to have him.
FreeSWITCHeR 0.4.0 released. Now Ruby 1.9.1 compat! 1
Well ok, then.
FreeSWITCHeR 0.4.0, The Ruby framework for FreeSWITCH, has been released!
This release includes many bug fixes, thanks to everyone for the emails and/or stopping by our IRC channel, #rubyists on Freenode.
Keep the bug reports and feature requests coming
Most importantly, this release introduces Ruby 1.9.1 compatibility with FreeSWITCHeR.
Enjoy!
Ruby loves FreeSWITCH! 2
Ruby Freeswitch Application Programming Interface (ESL Alternative)
freeswitcher (FSR) is a ruby library for communicating with FreeSWITCH through its event socket interface. FreeSWITCH ruby integration in the core just doesn’t work with the thread models of either 1.8 or 1.9. On the other hand; FSR, built on ruby eventmachine, can manage more than one instance of FreeSWITCH at a time.
Using the freeswitcher gem, 2 minute tutorial
This program will play a smooth wav file and read the DTMF tones entered by the caller. It simply logs the received digits to the info facility (you should see it on stdout)
require "rubygems"
require "fsr"
require "fsr/outbound"
class GetDigits < FSR::Listener::Outbound
def session_initiated
exten = session.headers[:caller_caller_id]
answer do
read("/path/to/smooth.wav") do |read_var|
FSR::Log.info("Received #{read_var} from #{exten}")
end
end
end
end
FSR.start_oes! GetDigits, :port => 8084, :host => "127.0.0.1"In order to use the above script, add the following in your FreeSWITCH dialplan. You can save it as 00sockettest.xml in conf/dialplan/default/ if you’re using the stock FreeSWITCH configuration.
<include>
<extension name="8084">
<condition field="destination_number" expression="^8084$">
<action application="set" data="continue_on_fail=true" /> <!-- we still need this to continue if bridging times out -->
<action application="set" data="call_timeout=5" />
<action application="socket" data="127.0.0.1:8084 sync full"/>
</condition>
</extension>
</include>Then reloadxml on FreeSWITCH, make sure the GetDigits listener is started, and call 8084 on a phone registered to FreeSWITCH.
This is only the Outbound Event Socket handler for FreeSWITCH in ruby. Other interfaces freeswitcher includes are the Inbound Event Socket handler and a CommandSocket, which allows any api or bgapi command. See the docs for the full scoop.