The Artima Developer Community
Sponsored Link

Python Buzz Forum
Phoney: An Address Book for Asterisk Caller ID

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Aaron Brady

Posts: 576
Nickname: insommeuk
Registered: Aug, 2003

Aaron Brady is lead developer for Crestsource
Phoney: An Address Book for Asterisk Caller ID Posted: Jul 19, 2016 10:15 AM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Aaron Brady.
Original Post: Phoney: An Address Book for Asterisk Caller ID
Feed Title: insom.me.uk
Feed URL: http://feeds2.feedburner.com/insommeuk
Feed Description: Posts related to using Python. Some tricks and tips, observations, hacks, and the Brand New Things.
Latest Python Buzz Posts
Latest Python Buzz Posts by Aaron Brady
Latest Posts From insom.me.uk

Advertisement

For work today I took a long-standing card to hook up our internal Asterisk phone system with some form of Caller ID database. You can make Asterisk use MySQL or fork a Python process using AGI, but I didn’t want any of this to be “in-band”.

In the past I’ve used simple Flask services to provide simplified JSON APIs so I can encapsulate logic in a language that I prefer, and not the scripting or configuration language I’m stuck using (like collectd’s or Asterisk’s).

The result is up on iWeb’s GitHub

The software will receive a POST from Asterisk with the source and destination number, and that POST is expected to return a name to display on the Caller ID as the only body. It also has a very simple Bootstrap GUI for updating the numbers, which shows incoming calls to the office, newest first:

Calls

The little bit of Asterisk scripting required is just this:

exten => _X.,1,Set(CALLERID(name)=${CURL("http://127.0.0.1:5000/numbers/c/${EXTEN}",from=${CALLERID(num)})})

That part after the last comma is verbatim posted as the contents of the request, the from= is required to make it kind-of URL encoded.

None of this really stands up to security scrutiny on the WAN, so it’s all best kept on internal networks, but for a small network or a house, it should work pretty well.

Read: Phoney: An Address Book for Asterisk Caller ID

Topic: Watch This Space Previous Topic   Next Topic Topic: On cookie consent

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use