Skip to content

Instantly share code, notes, and snippets.

@sboily
Last active December 8, 2015 14:54
Show Gist options
  • Save sboily/60187bc3e47a47a0df6b to your computer and use it in GitHub Desktop.
Save sboily/60187bc3e47a47a0df6b 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
from xivo import agi
extension = "8000"
context = "default"
c = amid('localhost', verify_certificate=False)
agi = agi.AGI()
a = auth('localhost', username='toto', password='toto', verify_certificate=False)
token_data = a.token.new('xivo_ws')
token = token_data['token']
originate = c.action("Originate", {"Channel": "Local/%s@%s" %(extension, context),
"Context": "fax-loop",
"Priority": "1",
"Exten": "s",
"Async": "true"
},token=token)
a.token.revoke(token)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment