GithubHelp home page GithubHelp logo

dedayoa / openvox-sms Goto Github PK

View Code? Open in Web Editor NEW

This project forked from antirek/openvox-sms

0.0 1.0 0.0 252 KB

OpenVox VoxStack GSM-gateway sms sender

License: MIT License

JavaScript 100.00%

openvox-sms's Introduction

openvox-sms

OpenVox VoxStack GSM-gateway sms sender

Intro

OpenVox VoxStack GSM-gateway have inside Asterisk PBX (http://www.asterisk.org)

Asterisk have AMI (Asterisk Manager Interface) - telnet for exchange commands and events

Install

npm install openvox-sms --save

Usage

var osms = require('openvox-sms');

var sms = new osms({host: 'localhost'});

sms.on('connect', function () {
	sms.sendSMS({span: 1, number: '89135292926', text: 'hello'}, function (err, response) {
		console.log('Done!');
		sms.close(function(){
			console.log('close');
		});
	});
});

API

var sms = new osms(options)

init osms object

var sms = new osms({         //connect to Asterisk AMI
	host: 'localhost',       //host
	port: 5038,              //port
	username: 'admin',       //username
	password: 'admin',       //password
	});

sms.on(event, callback)

set listener on event from Asterisk in OpenVox VoxStack gsm gateway

sms.on('connect', function () {
	//do something
	});

sms.sendSMS

send SMS via opened connection to Asterisk

auto split long sms to array of csms

all params are required

sms.sendSMS({
	span: 1,                  // span of gsm board OpenVox VoxStack
	number: '89135292926',    // number 
	text: 'hello'             // text can be long, more than 160 for ascii sms and more than 70 for non-ascii sms
	}, callback);             // callback receive one response for short sms or array for long sms

sms.close(callback)

close connection

sms.close(callback);

Tests

npm test

Bugs?

Please, contact me

Links

http://habrahabr.ru/post/205122/

http://mysyura.in.ua/otpravka-shlyuz-openvox/

http://www.openvox.cn/pub/manuals/Release/English/VS-GW1600-20G%20User%20Manual.pdf

http://www.openvox.cn/products/voip-gateways/gsm-gateways/148/vs-gw1600-gsm-series-detail.html

http://openvox.qiniudn.com/pub/misc/GSM%20Gateway/OpenVox%20%20GSM%20Gateway%20HTTP%20Interface_en.pdf

openvox-sms's People

Contributors

antirek avatar

Watchers

James Cloos 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.