Created
September 4, 2015 11:57
-
-
Save sboily/5e8bf08fdb33ba9d12fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) | |
results = ami.action('Command', {'command': 'sip show peers'}, token=token) | |
print results | |
auth.token.revoke(token) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment