Skip to content

Example component for Adhearsion showing how to log events using the event subsystem 'events.rb'

License

Notifications You must be signed in to change notification settings

jsgoecke/event_logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

Example component for Adhearsion showing how to log events using the event subsystem 'events.rb'

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages