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.
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
- ActiveRecord v2.2.2+
or
- CouchRest v0.12.6+
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!
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!