adhearsion / punchblock

Telephony middleware library for Ruby
adhearsion.com/punchblock
MIT License
40 stars 34 forks source link

Add support for <started-speaking/> <stopped-speaking/> Rayo events #94

Closed jsgoecke closed 12 years ago

jsgoecke commented 12 years ago

Right now these do not appear to bubble up as PB objects but I do see the XML in the trace. Would be great to have these wrapped in PB objects:


[2012-03-15 16:57:34] TRACE Punchblock::Connection::XMPP: RECEIVING (presence) <presence from="foobar@mwc.voxeolabs.net" to="jason.ahn@voxeolabs.p1.im/admin/callisto.local-76650" id="cb896675-f206-436e-8fca-b060920b16b6">
  <started-speaking xmlns="urn:xmpp:rayo:1" call-id="x0yz4ye-lx7-6ai9njwvw8nsb"/>
</presence>
[2012-03-15 16:57:34] TRACE Punchblock::Connection::XMPP: RECEIVING (presence) <presence from="foobar@mwc.voxeolabs.net" to="jason.ahn@voxeolabs.p1.im/admin/callisto.local-76650" id="c5227796-5db4-4be0-bbf6-5b172c0af468">
  <stopped-speaking xmlns="urn:xmpp:rayo:1" call-id="x0yz4ye-lx7-nnu0yckt0tin"/>
</presence>

So I could do this:

  def monitor_speaker_events
    call.register_event_handler Punchblock::Event::StartSpeaking do |start_speaking_event|
    end

    call.register_event_handler Punchblock::Event::StopSpeaking do |stop_speaking_event|
    end
  end
benlangfeld commented 12 years ago

It should be noted that these events come from a mixer, rather than a call. As such, they will not be routed to an Adhearsion call object, but must be handled globally in the Adhearsion eventing system.