asterisk-vcard-cid

This is a script to extract data from vCard files and insert it into Asterisk in a format that Asterisk can use to re-write Caller-ID information for incoming calls. It should work with vCards from any source, but it’s tested with vCards from ab2vcard, a tool I wrote for extracting vCards from OS X’s Address Book via cron.

Requirements

This tool is written in Ruby. It’s been tested with both Ruby 1.6.8 and Ruby 1.8.1.

Installation

Just copy the ‘vcardcid.rb’ file to somewhere in your path.

Usage

By default, vcardcid will look for .vcf files in the current directory and print caller ID database lines to standard out. The current version of vcardcid only works when there is only one vCard per .vcf file; its behavior with multiple-card files is untested.

vcardcid takes 5 options:

Examples

To extract all vCards from the ‘Home CallerID’ group and automatically insert them into Asterisk, using the Subversion tree in ~/svn/addresses, do this:

# vcardcid --directory=~/svn/addresses --group='Home CallerID' \
    --subversion --asterisk

To extract vCards and insert them into the ‘blacklist’ database for use with the LookupBlacklist application:

# vcardcid --directory=~/svn/addresses --group='Home Blacklist' \
    --subversion --database=blacklist --asterisk

To print all numbers from all cards in the current directory:

# vcardcid

To-Do

Things to do:

Downloads

The author’s Subversion tree for this project is available at http://svn.scottstuff.net/public/asterisk-vcard-cid/trunk. Tarballs for specific releases can be found at http://svn.scottstuff.net/public/asterisk-vcard-cid/download/.

Change History

Here’s what’s happened over time: