Skip to content

Instantly share code, notes, and snippets.

View pc-m's full-sized avatar

Pascal Cadotte Michaud pc-m

View GitHub Profile
@pc-m
pc-m / demo.sh
Created April 12, 2022 14:54
Refresh token demo
#!/usr/bin/bash
set -x
trap read debug
USERNAME="<USERNAME>"
PASSWORD="<PASSWORD>"
HOSTNAME="<HOSTNAME>"
CLIENT_ID="demo"
@pc-m
pc-m / kamailio-local.cfg
Created January 13, 2022 20:02
kamailio tests
## config/kamailio-local.cfg
##!define DBURL "postgres://kamailio:mypass@1.1.1.1:5432/kamailiopyfb"
#!define DBURL "postgres://kamailio:proformatique@localhost:5432/kamailio"
#!substdef "!MY_IP_ADDRESS!enp0s3!g"
#!substdef "!MY_IP_ADDRESS_INTERNAL!enp0s3!g"
#!substdef "!MY_IP_ADDRESS_EXTERNAL!enp0s3!g"
port=5060
@pc-m
pc-m / publish_tenant_created.py
Created July 9, 2020 15:24
Publish a tenant created event on Wazo platform
#!/usr/bin/env python3
# This script will re-publish the tenant created event to fix missing directory config
# Example usage:
# ./publish_tenant_created.py <tenant-uuid> <tenant-name>
import sys
import os
from kombu import Connection, Exchange, Producer
@pc-m
pc-m / gist:080b7baaa12ea97f795422d5ef4d18c7
Last active February 24, 2021 17:39
Generate wazo conference rooms
#!/usr/bin/env python3
import os
import sys
from wazo_confd_client import Client
TOKEN = os.getenv('TOKEN')
TENANT_UUID = sys.argv[1]
c = Client('localhost', verify_certificate=False, token=TOKEN)
@pc-m
pc-m / gist:12213afb72aae635323899d7ebfadd6a
Last active January 19, 2021 16:09
Generates wazo-auth email addresses
#!/usr/bin/env python3
# This script need an environment variable TOKEN containing a valid token
# The user_emails file can be generated with the following command
# sudo -u postgres psql -t -AF' ' asterisk -c "select uuid, replace(concat('auto+', firstname, '.', lastname, '@example.com'), ' ', '_') as email from (select uuid, firstname, lastname from auth_user where purpose != 'internal' and firstname is not null and uuid not in (select user_uuid from auth_user_email)) AS foo" > user_emails
import os
from wazo_auth_client import Client
TOKEN = os.getenv('TOKEN')
@pc-m
pc-m / gist:a6d7a1971ce2fb45b26fca45e90d08e0
Last active February 10, 2020 16:15
PJSIP openapi spec
basePath: /1.1
consumes:
- application/json
definitions:
AccessFeature:
properties:
enabled:
type: boolean
feature:
description: The feature to limit the access to
@pc-m
pc-m / displays.md
Last active December 18, 2018 18:53
Configuration des display

Proposition de configuration de display "simplifié?"

POST /displays

{
  "name": "my_display",
  "fields": [
    {"name": "firstname"},
 {"name": "lastname"},
@pc-m
pc-m / gist:f1f3422627c9be52701e02d611a5fc1f
Created April 14, 2018 12:52
Make integration test venv from local git repos
pip install -r <(grep -v github test-requirements.txt)
for r in $(grep github test-requirements.txt | awk -F'/wazo-pbx/' '{ print $2 }' | awk -F'/' '{ print $1 }'); do add2virtualenv ~/dev/xivo/$r; done
@pc-m
pc-m / backlog.md
Last active February 20, 2018 18:17
Backlog multi tenant

Multi tenant backlog

L'idée est de pouvoir avoir plusieurs clients hébergés sur le même Wazo sans "leaker" les informations d'un client à un autre.

Scénarios

Utilisateurs

User:
user_uuid
acl_template_id
Tenant:
tenant_uuid
display_name
Credentials:
id