Skip to content

Instantly share code, notes, and snippets.

View sboily's full-sized avatar
❤️
Wazo

Sylvain Boily sboily

❤️
Wazo
View GitHub Profile
#!/usr/bin/env bash
usage()
{
echo "WAZO PostgreSQL migrate/install script"
echo "options:"
echo " -h, --host remote PostgreSQL listening hostname or IPv4"
echo " -p, --port remote PostgreSQL listening port [default: 5432]"
echo " -u, --username remote PostgreSQL username [default: asterisk]"
echo " -s, --password remote PostgreSQL password [default: proformatique]"
@sboily
sboily / webrtc
Last active August 11, 2021 22:56
let pc, stream;
const constraints = window.constraints = {
audio: true,
video: true
};
function viewStream() {
const video = document.querySelector('video#localVideo');
video.srcObject = stream;
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2015-2017 The Wazo Authors (see the AUTHORS file)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#!/usr/bin/python3
from wazo_websocketd_client import Client as Websocket
from wazo_auth_client import Client as Auth
username = ''
password = ''
wazo_domain = ''
client_id = ''
@sboily
sboily / group.py
Last active September 11, 2020 22:21
#!/usr/bin/python3
# LICENSE: GPLv3
# This script permit to add an extension member to a group.
import sys
from wazo_auth_client import Client as Auth
from wazo_confd_client import Client as Confd
# Please add a web service user with acl confd.#
# To use ./group.py group_id extension
@sboily
sboily / gist:3f769682146f9c41ae2550579c30ac42
Last active April 24, 2020 14:59
list presences in chatd
apt install wazo-chatd-client-python3
------------------------
#!/usr/bin/python3
from wazo_auth_client import Client as Auth
from wazo_chatd_client import Client as Chatd
import pprint
username = ""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import yaml
import requests
from concurrent.futures import ThreadPoolExecutor
from wazo_auth_client import Client as Auth
from wazo_calld_client import Client as Calld
@sboily
sboily / amqp
Created November 29, 2019 19:40
import argparse
import kombu
import logging
from kombu.mixins import ConsumerMixin
from pprint import pformat
EXCHANGE = kombu.Exchange('xivo', type='topic')
logging.basicConfig(level=logging.INFO, format='%(asctime)s [%(process)d] (%(levelname)s) (%(name)s): %(message)s')
@sboily
sboily / Asterisk Stasis AMQP
Last active August 12, 2019 18:04 — forked from nballas-wazo/Examples
Documentation for Stasis + RabbitMQ Event Forwarding
Dialplan:
-------------------------------------------------
For an application named 'bar'
exten = 6001,1,NoOp()
same = n,Answer()
same = n,Stasis(bar) ; this will generate events which will be forwarded to stasis (websocket or AMQP)
same = n,Hangup()
REST API:
#!/usr/bin/python
from xivo_auth_client import Client as Auth
from wazo_websocketd_client import Client
username = ""
password = ""
host = ""