Coder Social home page Coder Social logo

telma-sms-ussd's Introduction

Description

Very simple application to send USSD from HTTP using Telma Madagascar, Modem (or Phone) and NodeJs.

It uses serial-at node package and could be used in with linux and windows.

Installation

This project is not (yet) a node package so you must clone the repository:

git clone https://github.com/balzacLeGeek/telma-sms-ussd.git

Plug in your modem (+ Telma Madagascar SIM Card) and if you are in Windows, run this command to check the used port

mode

This command should show something like this (The port can be COM1 .... COMXX)

Statut du périphérique COM16:
-----------------------------
    Baud :            115200
    Parité :          None
    Bits de données : 8
    Bits d’arrêt :    1
    Temporisation :   OFF
    XON/XOFF :        OFF
    Protocole CTS :   OFF
    Protocole DSR :   OFF
    Sensibilité DSR : OFF
    Circuit DTR :     OFF
    Circuit RTS :     OFF


Statut du périphérique COM15:
-----------------------------
    Baud :            115200
    Parité :          None
    Bits de données : 8
    Bits d’arrêt :    1
    Temporisation :   OFF
    XON/XOFF :        OFF
    Protocole CTS :   OFF
    Protocole DSR :   OFF
    Sensibilité DSR : OFF
    Circuit DTR :     OFF
    Circuit RTS :     OFF


Statut du périphérique CON:
---------------------------
    Lignes :          1000
    Colonnes :        92
    Vitesse clavier : 31
    Délai clavier :   1
    Page de codes :   850

Configuration

Before running the app, there are some configurations

/config/modem.js

/*
	(string) com: 'COMx' (Windows), '/dev/ttyUSBx' (Linux)
	(array) options: { read_time : 'Max timeout for wait AT Command response' }
*/
module.exports = {
	com : 'COM3',
	option: {
		read_time: 10000
	}
}

/config/account.js

// (4 int) pwd : Your Mvola Password
module.exports = {
	pwd : 'not_set'
}

In case your want to check your Mvola account balance for example, your must provide your Mvola password so change pwd value

Usage

To run the application, just start node serve

npm start

API Routes (Avaible for this version)

Mvola balance

GET method to http://127.0.0.1:1503/api/ussd/check?type=mvola_balance.

Account balance

GET method to http://127.0.0.1:1503/api/ussd/check?type=account_balance.

Forfait balance

GET method to http://127.0.0.1:1503/api/ussd/check?type=forfait_balance.

API Response

Error

{
	"status": "RESPONSE_STATUS",
	"error": {
		"message": "RESPONSE_MESSAGE"
	}
}

Success

{
	"status": "RESPONSE_STATUS",
	"success": {
		"message": "RESPONSE_MESSAGE"
	}
}

@author RAZAFIMANDIMBY Niaina Michaël (balzacLeGeek)

b-project Antananarivo Geek inside Madagascar

[email protected]

telma-sms-ussd's People

Contributors

balzaclegeek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

telma-sms-ussd's Issues

Not able to start

I am not able to start the server and get this error below

[nodemon] watching: .
[nodemon] starting node index.js
/var/www/JS/telma-sms-ussd/node_modules/serial-at/lib/at.js:4
const Readline = Serial.parsers.Readline;
^

TypeError: Cannot read property 'Readline' of undefined
at Object. (/var/www/JS/telma-sms-ussd/node_modules/serial-at/lib/at.js:4:33)

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.