Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Example component for Adhearsion showing how to log events using the event subsystem 'events.rb'
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
db
.gitignore
LICENSE
README.textile
Rakefile
database.yml
event_logger.rb
event_logger.yml

README.textile

Event Logger

Description

Example component for Adhearsion showing how to log events using the event subsystem ‘events.rb’. The component currently supports these events with ActiveRecord:

- Newexten
- Newchannel
- Hangup
- Newstate

The schema will need to be adjusted to support all of the events available here. Given the schema-less nature of CouchDB all events are supported.

Example

Place this in the events.rb file of your Adhearsion project:


events.asterisk.manager_interface.each do |event|
  begin
    log_event(event)
  rescue => err
	ahn_log.event_logger.info err
  end
end

Dependencies

  • ActiveRecord v2.2.2+

or

  • CouchRest v0.12.6+

Installation for ActiveRecord

1. In the components directory of your Adhearsion project:

git clone git://github.com/jsgoecke/event_logger.git

2. Add the example code from above to your ~adhearsion-project/events.rb.

3. Modify the ~adhearsion-project/components/event_logger/database.yml * event_logger.yml file for your database settings.

4. From within the directory ~adhearsion-project/components/event_logger/ run:

rake migrate

Then you are off and running!

Installation for CouchDB

1. Install the CouchRest Gem:

sudo gem install jchris-couchrest --source=http://gems.github.com

2. Add the example code from above to your ~adhearsion-project/events.rb.

3. Modify the ~adhearsion-project/components/event_logger/event_logger.yml file for your database settings.

Then you are off and running!

Something went wrong with that request. Please try again.