This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=High-performance, schema-free document-oriented database | |
After=network.target | |
[Service] | |
User=mongodb | |
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf | |
[Install] | |
WantedBy=multi-user.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sandbox End Points | |
1. SMS | |
Make a HTTP POST request to https://api.sandbox.africastalking.com/version1/messaging | |
See the Parameters | |
curl -v -H "Accept: application/json" \ | |
-d "username=sandBoxUserName&message=hello test&to=+254711XXXYYY,+254733YYYZZZ" \ | |
-H "Apikey:fb752d3417021812f0961y6c9464832dd1adb1e555c73f1e7c32bcc006488674" \ | |
-X POST http://api.sandbox.africastalking.com/version1/messaging --insecure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//1. Ensure ths code runs only after a POST from AT | |
if(!empty($_POST) && !empty($_POST['phoneNumber'])){ | |
require_once('dbConnector.php'); | |
require_once('AfricasTalkingGateway.php'); | |
require_once('config.php'); | |
//2. receive the POST from AT | |
$sessionId =$_POST['sessionId']; | |
$serviceCode =$_POST['serviceCode']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Receive POST from AT | |
$Sender = $_POST['from']; | |
$to = $_POST['to']; | |
$text = $_POST['text']; | |
$date = $_POST['date']; | |
$id = $_POST['id']; | |
$linkId = $_POST['linkId']; //This works for onDemand subscription products | |
if(!empty($_POST['from'])){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This is a unique ID generated for this call | |
$sessionId = $_POST['sessionId']; | |
$isActive = $_POST['isActive']; | |
if ($isActive == 1) { | |
$callerNumber = $_POST['callerNumber']; | |
// Compose the response | |
$response = '<?xml version="1.0" encoding="UTF-8"?>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
A few things to note about USSD: | |
USSD is session driven. Every request we send you will contain a sessionId, and this will be maintained until that session is completed | |
You will need to let the Mobile Service Provider know whether the session is complete or not. If the session is ongoing, please begin your response with CON. If this is the last response for that session, begin your response with END. | |
If we get a HTTP error response (Code 40X) from your script, or a malformed response (does not begin with CON or END, we will terminate the USSD session gracefully. | |
using visual studio 2013 or Greater | |
go to file > new > project | |
in the projects window choose web under C# | |
select ASP.NET Web Application and name your project as you like |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Pull ubuntu docker image | |
FROM ubuntu:14.04 | |
MAINTAINER [email protected] | |
#Run Update | |
RUN apt-get -y update && apt-get -y update | |
#Install LAMP | |
RUN apt-get -y install apache2 | |
#Mariadb | |
RUN apt-get update \ | |
&&apt-get -y remove --purge mysql* \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//receive the POST from AT on your POST ROUTE | |
$from = $_POST['from']; | |
$to = $_POST['to']; | |
$text = $_POST['text']; | |
$date = $_POST['date']; | |
$id = $_POST['id']; | |
$linkId = $_POST['linkId']; | |
//Respond based on backend events | |
if(!empty($_POST['from'])){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#------------------------------------------------------------------------------ | |
# Name: sbtmkdirs | |
# Version: 1.4 | |
# Purpose: Create an SBT project directory structure with a few simple options. | |
# Author: Alvin Alexander, http://alvinalexander.com | |
# License: Creative Commons Attribution-ShareAlike 2.5 Generic | |
# http://creativecommons.org/licenses/by-sa/2.5/ | |
#------------------------------------------------------------------------------ |