Skip to content

RubyFS stops listening after sending an event #6

@bklang

Description

@bklang

I have code that looks like this to respond to MESSAGE_QUERY events from FreeSWITCH and respond by providing Message Waiting Indicator messages:

def self.handle_event(event)
      return unless event.is_a? RubyFS::Event
      case event.event_name
      when "MESSAGE_QUERY"
        begin
          logger.debug "Received message query for #{event.content[:message_account]}"
          mailbox_id, account_id = parse_address event.content[:message_account]
          messages = WebApiClient.get_messages(account_id, mailbox_id) || EMPTY_MAILBOX

          report mailbox_id, account_id, messages
        rescue InvalidMailboxAddress
          logger.error "Received MAILBOX_QUERY for an unrecognized mailbox: #{event.content[:message_account]}"
        end
      end
    end

The first MESSAGE_QUERY received by Adhearsion is properly handled. You can see this in the packet capture here: https://gist.github.com/bklang/37d3b19f430af099718c#file-gistfile1-txt-L27

Lines 27-30 are Adhearsion talking to FreeSWITCH; every other line in that file is FreeSWITCH talking to Adhearsion.

The Adhearsion TRACE logs properly show all IES messages being received up to the point of sending the sendevent message. After that point, no further messages are logged, and the subsequent MESSAGE_QUERY events are ignored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions