wiki:projects/synapse

Version 30 (modified by Edwin Eefting, 13 years ago) (diff)

--

Synapse

“Synapses are the connections between neurons in the brain through which nervous impulses pass.”

News

07-10-2010: http://www.internetpapier.nl online for testing.

22-09-2010: The source code also is avaiable via git on http://code.dyne.org/ . Thanks jaromil!

08-03-2012: We're also pushing to github now: https://github.com/psy0rz/Synapse

Introduction

Synapse is an advanced event framework in C++:

  • Modulair plugin system
  • Easy to write modules
  • Easy to send and receive message, while maintaining code readability
  • Session management
  • Build in authentication
  • Fine grained access control on sending and receiving of events
  • Events can be handled by multiple threads if desired (max-threads is adjustable per session and per module)

Architecture diagram

On an abtract level, Synapse tries to split up the Internet application layer into OSI model layers:

  • Modules can send and receive arbitrary data via a clean thin C++ API
  • A module can have 1 or more sessions.
  • The module specifys the event they wish to send and the destination session id.
  • The core keeps track of sessions and knows which module(s) to deliver the message to.
  • The core knows which users are allowed or receive the specified event.
  • Modules don't need to be aware of the node they run on.
  • If the session is running somewhere else, one of the connectors transports it to the correct node.
  • Nodes even can be multiple hops away. (e.g. simple routing of messages)
  • This even allows you to build a high performance, high availability cluster without modifying your application.
  • tcp/json connector:
    • A special module to transparently transport messages to other modules.
    • Incoming message src is mapped to local session.
  • http/json connector:
    • A special module to allow javascript instances in browsers to connect and communicate with each other.

Connector implementation

Because of the unique way Synapse is build, the actual connectors can be implemented as modules as well:

  • Keeps the core code clean.
  • Easier to debug and maintain.
  • All connectors can only be loaded when needed.
  • The TCP/IP connector is both client and server. Once the connection is established this doesn't matter anymore.

Other documentation

Whitepaper/notes (still dutch and messy, but nice drawings ;): http://open.syn3.nl/syn3/trac/default/export/latest/trunk/projects/synapse/docs/synapse.odt

Module documentation: http://open.syn3.nl/syn3/trac/default/browser/trunk/projects/synapse/modules/docs/html

Download

Download:

psy@r3m0t3h0st ~/test $ git clone git://git.dyne.org/synapse.git
Cloning into synapse...
remote: Counting objects: 3179, done.
remote: Compressing objects: 100% (1498/1498), done.
remote: Total 3179 (delta 2272), reused 2281 (delta 1647)
Receiving objects: 100% (3179/3179), 1.70 MiB | 923 KiB/s, done.
Resolving deltas: 100% (2272/2272), done.


Configure/compile:

psy@r3m0t3h0st ~/test $ cd synapse/
psy@r3m0t3h0st ~/test/synapse $ cmake .
...
psy@r3m0t3h0st ~/test/synapse $ make
...

Run paper module:

psy@r3m0t3h0st ~/test/synapse $ ./synapse modules/paper.module/libpaper.so 
psy@psylaptop:~/synapse$ ./synapse modules/paper.module/libpaper.so 
0xf78540 INFO: Loading config file etc/synapse/userman.conf
0xf78540 INFO: Loading module core from: modules/core.module/libcore.so
0xf78540 INFO: Module loading of core complete.
0xf78540 INFO: Synapse core v1.0 starting up...
0xf78540 SEND module_Init FROM 1:core@core TO broadcast (1:core@core ) (empty)
...

Internet paper

Look at http://internetpapier.nl

Create a new drawing and open it in 2 or more browser windows. Let the magic happen.

Automatic asterisk operator panel

This is the first serious project built on top of the synapse platform.

  • Multi server
  • Multi tennant
  • Minimal configuration
  • Auto detection of SIP devices
  • Web based
  • Login is done by calling a special number, so no additional password and user management is neccesary.
  • Tested with configurations generated by:
    • Asterisk_GUI
    • Thirdlane.
    • FreePBX (use AMPEXTENSIONS=deviceanduser in /etc/amportal.conf to be able to set the description)

Used synapse modules:

  • asterisk_ami: Asterisk ami connector: tcp connects to asterisk server and sends/receives raw ami events.
  • asterisk: asterisk call tracking module. translates raw events from asterisk_ami to usefull data.
  • http_json: Build-in webserver for full-duplex events. Serves asterisk.html and sends/receives events to/from browser.
  • conn_json: A connector module to connect two synapse instances to each other via tcp/json.
  • marquee: Module to control our serial marquee.
  • asterisk_marquee: Collects data from asterisk module. Sends marquee texts with call info to marquee modules.

Roadmap

Current version:

  • Tracking of all calls, channels and sip devices.
  • Html panel that shows all sip devices and channels in realtime.
  • Still read-only
  • Authentication by calling a special number from your sip-device
  • Multi tennant support.
  • Better user interface.

Next version:

  • Multiple marquee support.

Future versions:

  • Transfer calls
  • Make calls
  • etc.

Media player

  • Based on libvlc
  • Like Media Player Deamon (MPD) but also for videos.
  • Realtime web interface
  • Easy programmable for remote control via synapse event mapper.
  • Control output on marquee
  • MPD compatible so you can use your favorite MPD client.

Attachments (7)

Download all attachments as: .zip