Skip to main content

FreeSwitch Event Handler based in Flask.

Project description

Jaspion

Python module developed to work with ESL (FreeSwitch).

Installation Instructions

You can install the package in two ways:

$ pip install jaspion                           # From pypi
$ pip install https://github.com/Otoru/jaspion  # From source code

Example

This is a simple example:

from jaspion import Jaspion


app = Jaspion(__name__)

@app.handle('sofia::register')
@app.filtrate('from-user', '1000')
@app.haskey('from-host')
def register(event):
    domain = event['from-host']
    username = event['from-user']
    date = event['Event-Date-Local']

    print(f'[{date}] {username}@{domain} - Registred.')

@app.handle('sofia::unregister')
@app.filtrate('from-user', '1000')
@app.haskey('from-host')
def unregister(event):
    domain = event['from-host']
    username = event['from-user']
    date = event['Event-Date-Local']

    print(f'[{date}] {username}@{domain} - Unregistred.')


if __name__ == "__main__":
    app.run('127.0.0.1', 8021, 'ClueCon')

To-Do List

  • Create the decorator to handle events.
  • Create a CLI to run projects.
  • Create filter to request only the marked events.
  • Create the Documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Jaspion-0.2.tar.gz (4.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page