Skip to content

Instantly share code, notes, and snippets.

@ryanquinlan
ryanquinlan / events.py
Created August 20, 2019 16:40
Cisco Meeting Server Events Websocket using Python websocket-client
import websocket
# Get auth token via POST to /api/v1/authTokens
# Use returned token to open a websocket connection to wss://host:port/events/v1
# Token is passed as the URL parameter authToken
try:
self.logger.info("Getting auth token ...")
api_conn = api.ApiConnection(self.address, self.username, self.password, port=self.port)
response = api_conn.doPost("authTokens", {})
@ryanquinlan
ryanquinlan / admin.py
Created February 13, 2019 21:08
Spool CMS CDR messages to a SQLite database
from app import app
from flask_admin import Admin
from flask_admin.contrib.peewee import ModelView
admin = Admin(app, name='cdr-admin', template_mode='bootstrap3')
admin.add_view(ModelView(Record, db.session))
app.run(host="0.0.0.0", port=8081)
@ryanquinlan
ryanquinlan / Real CMS HTTP response headers
Last active February 13, 2019 18:40
cms api getting started
HTTP/1.1 200 OK
Date: Wed, 13 Feb 2019 18:21:15 GMT
Server: Apache
X-Frame-Options: DENY
Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Pragma: no-cache
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Type: text/xml
const WebSocket = require('ws');
const util = require('util')
console.log("Starting...")
const ws = new WebSocket('ws://localhost:10000',
{
rejectUnauthorized: false
});