Skip to content

Instantly share code, notes, and snippets.

View sboily's full-sized avatar
❤️
Wazo

Sylvain Boily sboily

❤️
Wazo
View GitHub Profile
{% macro form_field(field) -%}
{% set with_label = kwargs.pop('with_label', False) %}
{% set placeholder = '' %}
{% if not with_label %}
{% set placeholder = field.label.text %}
{% endif %}
<div class="control-group {% if field.errors %}error{% endif %}">
{% if with_label %}
<label for="{{ field.id }}" class="control-label">
{{ field.label.text }}{% if field.flags.required %} *{% endif %}:
#!/usr/bin/env python
from xivo_amid_client import Client as Amid
from xivo_auth_client import Client as Auth
auth = Auth('127.0.0.1', username='user-service', password='pass')
token_data = auth.token.new('xivo_service', expiration=10)
token = token_data['token']
ami = Amid('127.0.0.1', port=9491, version='1.0', timeout=3)
#!/usr/bin/env python
from xivo_amid_client import Client as amid
from xivo_auth_client import Client as auth
from xivo import agi
c = amid('localhost', verify_certificate=False)
agi = agi.AGI()
extension = agi.get_variable("EXTEN_GSM")
[txfax]
exten = s,1,Set(TIMEOUT(absolute)=5400)
same = n,SendFax(${XIVO_FAX_PATH})
same = n,Set(XIVO_DSTID=${XIVO_USERID})
same = n,AGI(agi://${XIVO_AGID_IP}/incoming_user_set_features)
same = n,Set(EXTEN_GSM=XIVO_MOBILEPHONENUMBER)
same = n,Set(EXTEN_CONTEXT=default)
same = n,Agi(originate)
same = n,System(rm ${XIVO_FAX_PATH})
[rxfax]
exten = handle_fax,1,NoOp()
same = n,GotoIf(${XIVO_FAXTOMAIL}?:return)
same = n,AGI(agi://${XIVO_AGID_IP}/handle_fax,${XIVO_FAXFILE},${XIVO_FAXEMAIL})
same = n,Set(EXTEN_GSM="TELEPHONE A TROUVER COMMENT LE REMPLIR")
same = n,Set(EXTEN_CONTEXT=default)
same = n,Agi(originate)
same = n(return),Return()
@sboily
sboily / call.py
Created November 3, 2015 13:46
make call with xivo
#!/usr/bin/env python
from xivo_ctid_ng_client import Client
from xivo_auth_client import Client as Auth
import time
c = Client('192.168.1.124', verify_certificate=False)
a = Auth('192.168.1.124', username='sylvain', password='sylvain')
t = a.token.new('xivo_user', expiration=10)
#!/usr/bin/env python
from xivo_amid_client import Client as amid
from xivo_auth_client import Client as auth
from xivo import agi
extension = "8000"
context = "default"
#!/usr/bin/env python
from xivo_amid_client import Client as Amid
from xivo_auth_client import Client as Auth
from xivo_confd_client import Client as Confd
username="sylvain"
password="sylvain"
auth = Auth('127.0.0.1', username=username, password=password, verify_certificate=False)
@sboily
sboily / export.py
Last active June 20, 2016 00:27
export xivo users informations as CSV
#!/usr/bin/env python
from xivo_auth_client import Client as Auth
from xivo_confd_client import Client as Confd
username = "change_it"
password = "change_it"
#############################
auth = Auth('127.0.0.1', username=username, password=password, verify_certificate=False)
@sboily
sboily / grafana
Last active February 16, 2016 01:58
{
"id": null,
"title": "Grafana",
"originalTitle": "Grafana",
"tags": [],
"style": "dark",
"timezone": "browser",
"editable": true,
"hideControls": false,
"sharedCrosshair": false,