No commit activity in last 3 years
No release in over 3 years
This gem actively monitors Asterisk's CDR CSV file (using tail -f) and publishes the latest entry to a SimplePubSub messaging broker.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.4.0, ~> 0.4
 Project Readme

Introducing the Asterisk Call Notifier Gem

require 'asterisk_call_notifier'

AsteriskCallNotifier.new(sps_address: '192.168.4.140').start

The above example monitors Asterisk PBX's CDR CSV file for new entries. The new entry is then published to a SimplePubSub broker using a JSON payload with the default topic of asterisk.

Testing

I dialed a local telephone extension and I observed the SPS message was successfully received.

output:

MESSAGE: asterisk: {"accountcode":"","src":"c7905","dst":"1011",
"dcontet":"my-phones","clid":"c7905","channel":"SIP/c7905-0000009f",
"dstchannel":"SIP/line1-000000a0","lastapp":"Dial","lastdata":"SIP/line1,20",
"start":"2015-10-03 10:52:25","answer":null,"end":"2015-10-03 10:52:28",
"duration":"3","billsec":"0","disposition":"NO ANSWER",
"amaflags":"DOCUMENTATION","astid":"1443869545.162"}

Note: It will monitor all new entries, meaning it can identify calls received, calls made, and calls missed etc.

Resources

Update: 3-Oct-2015 @ 13:54

The Asterisk Call Notifier gem now features on_new_call

require 'asterisk_call_notifier'

acn = AsteriskCallNotifier.new()

def acn.on_new_call(h)
  puts "extension %s called %s at %s" % [h[:src], h[:dst], h[:start]]
end

acn.start

The on_new_call method can now be implemented by the client, allowing them to use their on notifier as well as to control whether a notification needs to be sent and in what format.

output:

extension c7905 called 1011 at 2015-10-03 12:40:12

Resources

asterisk csv cdr notifier callwatcher