Last active
December 8, 2015 14:54
-
-
Save sboily/60187bc3e47a47a0df6b 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 | |
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