-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
59 lines (46 loc) · 2.29 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Copyright (c) 2010 The Rubyists, LLC (effortless systems) <[email protected]>
# Distributed under the terms of the MIT license.
# The full text can be found in the LICENSE file included with this software
#
TinyCDR is a simple app for pushing FreeSWITCH xml_cdr records into both a
PostgreSQL (or other Sequel-supported db) and CouchDB data store. The Sequel record is just
the basics and the couch record is the exact xml as POSTed by FreeSWITCH's mod_xml_cdr.
This is fresh stuff, very few docs. The web side is a ramaze app, start with
ruby start.rb
and point FreeSWITCH's mod_xml_curl at the url it tells you it's listening on.
To import a single record, use
ruby -r ./app -r 'Call.create_from_xml(File.read("/path/to/the/xml/file.xml"))'
PREREQUISITES
* couchdb
* ruby
* ramaze
* nokogiri
* makura
* sequel
* pg (for postgres, mysql or other adapters may work)
INSTALL
* Check out the source.
* run rake setup, this should get the ruby dependencies
* Get some coffee and a newspaper or your favorite news feed ready
* run rake build_couch
* This is going to take a long time, builds erlang and couch, read your news
* Done with your news? Read the couch intro: http://couchdb.apache.org/docs/intro.html
* Mastered the Intro? Read the couch view api: http://wiki.apache.org/couchdb/HTTP_view_API
* rake build_couch should be done, if couchdb starts you can check it in your browser
at http://localhost:5984/_utils
* Create the tiny_cdr directory in the futon admin interface, do not add any users
or an admin user to couch yet (It's only bound to localhost unless you told it otherwise)
* Create the Sequel database (for postgres, this is createdb tiny_cdr)
* Modify model/init.rb to point to your databases you created
* Test it, with irb -r ./app in the top-level of the source tree
* Let us know if it doesn't work.
* If it does work, you can use
Call.create_from_xml(File.read("/path/to/the/xml/file.xml")) as from above. To import a bunch, use
Dir["/path/to/files/*.xml"].each { |file| Call.create_from_xml(File.read(file)) }
* Now you can start the webserver (thin -R config.ru) and hit http://localhost:7000 to see a report
TODO
* Test Harness
* Reports (Lots of reports!)
* Documentation
SUPPORT
#rubyists on Freenode irc (http://freenode.net)