Code Monkey home page Code Monkey logo

asterisk-voicemail-api's Introduction

Asterisk Voicemail API

Simple REST API for Asterisk Voicemail

Requirements

You should have an Asterisk database with the following tables :

DESCRIBE voicemessages;

+----------------+-------------+------+-----+---------+----------------+
| Field          | Type        | Null | Key | Default | Extra          |
+----------------+-------------+------+-----+---------+----------------+
| id             | int(11)     | NO   | PRI | NULL    | auto_increment |
| msgnum         | int(11)     | NO   |     | 0       |                |
| dir            | varchar(80) | YES  | MUL |         |                |
| context        | varchar(80) | YES  |     |         |                |
| macrocontext   | varchar(80) | YES  |     |         |                |
| callerid       | varchar(40) | YES  |     |         |                |
| origtime       | varchar(40) | YES  |     |         |                |
| duration       | varchar(20) | YES  |     |         |                |
| mailboxuser    | varchar(80) | YES  |     |         |                |
| mailboxcontext | varchar(80) | YES  |     |         |                |
| recording      | longblob    | YES  |     | NULL    |                |
| flag           | varchar(8)  | YES  |     | NULL    |                |
+----------------+-------------+------+-----+---------+----------------+

DESCRIBE vmusers:

+-------------+------------------+------+-----+---------------------+-------+
| Field       | Type             | Null | Key | Default             | Extra |
+-------------+------------------+------+-----+---------------------+-------+
| uniqueid    | int(10) unsigned | NO   |     | 0                   |       |
| customer_id | char(64)         | NO   |     |                     |       |
| context     | varchar(7)       | NO   |     |                     |       |
| mailbox     | char(64)         | NO   |     |                     |       |
| password    | varchar(255)     | YES  |     | NULL                |       |
| fullname    | char(64)         | NO   |     |                     |       |
| email       | char(64)         | NO   |     |                     |       |
| pager       | binary(0)        | YES  |     | NULL                |       |
| stamp       | datetime         | YES  |     | 2008-01-01 00:00:00 |       |
+-------------+------------------+------+-----+---------------------+-------+

Installation

Copy lib/config.rb.sample to lib/config.rb and edit it to match your database configuration.

Start the application

run ruby voicemail_api.rb

The API is accessible at :

http://localhost:4567/voicemails

TODO

  • Add update/destroy support.

  • Possibility to move voicemails from one folder to another.

  • Mark/unmark voicemails as read.

  • better specs

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.