Skip to content

Instantly share code, notes, and snippets.

@sboily
Created September 4, 2015 11:57
Show Gist options
  • Save sboily/5e8bf08fdb33ba9d12fd to your computer and use it in GitHub Desktop.
Save sboily/5e8bf08fdb33ba9d12fd to your computer and use it in GitHub Desktop.
#!/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