Git Product home page Git Product logo

smpp2local's Introduction

Setup Remote Server

Install CouchDB

  • Edit /etc/couchdb/local.ini
port = 5900
bind_address = 0.0.0.0
secret = xxxx
[update_notification]
ccsms=/var/lib/couchdb/smpp2local/counell.py
  • Restart CouchDB (comment with ; the last line until rest of config is done)

Create messages DB

Use "Create Database" link on http://REMOTE:5900/_utils to add cc_sms DB.

Install SMPP2Local

  • aptitude install python-couchdb python-cherrypy
  • git clone git://github.com/mvpdev/smpp2local.git smpp2local
  • Edit local_config.py and override server config.

Install cleanup script

ln -s /var/lib/couchdb/smpp2local/cleanup_obsolete.py /etc/cron.daily/

Setup Local Server

Install CouchDB

  • Edit /etc/couchdb/local.ini
port = 5900
bind_address = 127.0.0.1
  • Restart CouchDB

Create messages DB

Use "Create Database" link on http://localhost:5900/_utils to add cc_sms DB.

Setup Replication

curl -X POST http://localhost:5900/_replicate -d '{"source":"http://REMOTE:5900/cc_sms", "target":"cc_sms", "continuous":true}'

curl -X POST http://localhost:5900/_replicate -d '{"source":"cc_sms", "target":"http://REMOTE:5900/cc_sms", "continuous":true}'

WARNING: continuous replication is not stored after CouchDB restart on CouchDB 0.10.

Create test documents and check that you can see both on both servers

curl -X PUT http://localhost:5900/cc_sms/bloup -d '{"title":"Hello, I am from the ground"}'

curl -X PUT http://REMOTE:5900/cc_sms/bloup -d '{"title":"Do not panic, I am from the Internet"}'

Create Permanent Views

Using the "Temporary View" link on http://localhost:5900/_utils, create two different views and save them as permanent:

  • cc/kannel
function(doc) {
  if (doc.direction == 'outgoing' && doc.status == 'created') {
    emit(doc, null);
  }
}
  • cc/rapidsms
function(doc) {
  if (doc.direction == 'incoming' && doc.status == 'created') {
    emit(doc, null);
  }
}
  • cc/processed
function(doc) {
  if (doc.direction && doc.status == 'processed') {
    emit(doc, null);
  }
}

Reproduce on the remote server.

smpp2local's People

Contributors

rgaudin avatar

Stargazers

Jake Watson avatar

Watchers

Matt Berg avatar  avatar Alan Viars avatar Ukang'a Dickson avatar  avatar  avatar Moses Katembu avatar Alexey Vertinsky avatar  avatar Alou avatar  avatar Ibrahima Fadiga avatar Emmanuel Toko avatar Temesgen Gebeyehu avatar 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.