You are using an outdated browser which puts all net citizens at risk. As an incentive to upgrade to a current and thus much more secure product (we recommend the free Firefox browser), you won't be able to visit this site in its cute design, but in this rather boring printer-ready version only. Thank you for considering a browser update!

Asterisk, Ruby and Growl

What is this?

Wouldn't it be nice to get an anouncement on your computer when you receive an incoming call on your Asterisk or CallWeaver telephony server? Don't want to fiddle around with app_notify which is cumbersome on the former and not even ported to the latter? Well, Ruby to the rescue!

Installation

You need a couple of gems for this to work. ruby-growl will do the talking to the Growl clients while batphone hooks into Asterisk/CallWeaver:

gem install ruby-growl
gem install batphone

Note: As of today, batphone is not yet available as a gem. However, you can download and install it from here instead.

Asterisk

Create the script /opt/bin/growl_call which must be executable by the user under which Asterisk is running:

#!/usr/bin/env ruby

require 'rubygems' require 'ruby-growl' require 'agi'

agi = AGI.new

message = <<-EOS From: #{agi.env['agi_calleridname']} <#{agi.env['agi_callerid']}> Context: #{agi.env['ogi_context']} Date: #{Time.now.strftime('%Y-%m-%d %H:%m:%S')} EOS

client = Growl.new("{CLIENT}", "CallWeaver", ["incoming call"], nil, '{PASSWORD}') client.notify("incoming call", "Incoming Call", message, 0, true)

Make sure you replace {CLIENT} with the domain name or IP of the Growl client and {PASSWORD} with the password you have set in Growl for remote notifications.

And finally add the following command wherever appropriate in extensions.conf:

CallWeaver

Same as above, but you have to replace all occurrances of agi and AGI with the CallWeaver equivalent ogi and OGI. However, there are two exceptions: require 'agi' and AGI.new must not be renamed.

Growl

Growl itself is only available on Mac OS X. However, there are third-party ports for other platforms:

(Sven Schwyn)

(We are remaking our web presence and therefore comments are temporary disabled.)