[Freeswitch-users] FreeSWITCHer: issue with ObjectSpace

Слюсарев Михаил mik3weider at gmail.com
Thu Jun 23 20:20:48 MSD 2011

Hey, guys

My question is about FreeSWITCHer the Ruby framework handle events
from FreeSWITCH. I know that this is not exactly what you are discuss
here, but I really don't know whith whom to comunicate about this
problem. So, if you have experience in FreeSWITCHer and Ruby and would
like to help, please read futher. Otherwise, sorry for spam.

FreeSWITCHer doesn't sent subscribing messages during of usage of
examples/inbound_socket_events.rb. As I can see in the source, that
happens because subscribe_to_event function is never trigered.

So, the question is why this snippet of code doesn't work as expected?

def self.add_event_hook(event, sub_events = [], &block)
        ObjectSpace.each_object { |e| e.subscribe_to_event(event,
sub_events) if e.class.ancestors.include?(FSR::Listener::Inbound) }
        HOOKS[event] = block

And this is my environment:

# cat /etc/redhat-release
CentOS release 5.6 (Final)

# ruby -v
ruby 1.8.5 (2006-08-25) [i386-linux]

# gem -v

# gem list

*** LOCAL GEMS ***

eventmachine (0.12.10)
freeswitcher (0.6.12)
log4r (1.1.9)

Since it's looks like Ruby configuration issue I don't describe other
installation steps.

More information about the FreeSWITCH-users mailing list