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.
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
Before running the app, there are some configurations
/*
(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
}
}
// (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
To run the application, just start node serve
npm start
GET method to http://127.0.0.1:1503/api/ussd/check?type=mvola_balance
.
GET method to http://127.0.0.1:1503/api/ussd/check?type=account_balance
.
GET method to http://127.0.0.1:1503/api/ussd/check?type=forfait_balance
.
{
"status": "RESPONSE_STATUS",
"error": {
"message": "RESPONSE_MESSAGE"
}
}
{
"status": "RESPONSE_STATUS",
"success": {
"message": "RESPONSE_MESSAGE"
}
}
@author RAZAFIMANDIMBY Niaina Michaël (balzacLeGeek)