Git Product home page Git Product logo

asterisk-opencnam's Introduction

asterisk-opencnam

The simplest way to add caller ID name information to your Asterisk-based PBX system.

asterisk-opencnam should work with Asterisk 1.2+. This module requires Asterisk to have curl support built in.

Install

To install asterisk-opencnam, log into your Asterisk server(s) and run:

$ mkdir -p /var/lib/asterisk/modules
$ cd /var/lib/asterisk/modules/
$ git clone git://github.com/telephonyresearch/asterisk-opencnam.git

Then edit your /etc/asterisk/extensions.conf file, and append:

#include </var/lib/asterisk/modules/*/src/*.conf>

To the bottom of the file. This tells Asterisk to dynamically load the asterisk-opencnam module each time Asterisk is started.

If you'd like to update asterisk-opencnam, simply run:

$ cd /var/lib/asterisk/modules/asterisk-opencnam
$ git pull

NOTE: These instructions assume you have Asterisk installed to the normal system path (/var/lib/asterisk), and that you also have Git available on the server(s).

Usage

Now that you've got asterisk-opencnam installed, let's activate it! Since we'll (most likely) want to get each caller's name information as soon as their call comes in, you'll most likely want to modify your Asterisk system's from-pstn context to do the lookup.

Below is an example:

;; /etc/asterisk/extensions.conf

[from-pstn]
exten => _NXXNXXXXXX,1,Gosub(opencnam-set-callerid,s,1)
exten => _NXXNXXXXXX,n,NoOp(This caller's name is: ${CALLERID(name)})
exten => _NXXNXXXXXX,n,Answer()
exten => _NXXNXXXXXX,n,...

The code above will take the incoming caller's 10-digit US phone number, and call the opencnam-set-callerid subroutine which will update the caller ID name information for the call.

If you're an OpenCNAM professional tier user (OpenCNAM's professional tier costs money, but gives you real-time lookups and no throttling) you can specify your account credentials by changing your Gosub line to read:

;; /etc/asterisk/extensions.conf

[from-pstn]
exten => _NXXNXXXXXX,1,Gosub(opencnam-set-callerid,s,1(my-account-sid,my-auth-token))
exten => _NXXNXXXXXX,n,NoOp(This caller's name is: ${CALLERID(name)})
exten => _NXXNXXXXXX,n,Answer()
exten => _NXXNXXXXXX,n,...

Reference

If you've got no idea what I'm talking about, the following links may be helpful:

If you'd like more information on Asterisk, read Asterisk: The Definitive Guide.

Changelog

v1.1: 10-30-2012

- Adding a 5 second CNAM timeout. This prevents calls from hanging if
  anything bad happens (internet dies, OpenCNAM has problems, etc.).
- Fixing a bug where we'd do two CNAM lookups (one anonymously and one paid)
  regardless of the user's settings.

v1.0: 9-22-2012

- First release! Supports OpenCNAM V2 hobbist and professional tiers.

asterisk-opencnam's People

Contributors

randalldegges-okta-2 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.