Last active
October 6, 2015 17:01
-
-
Save sboily/d9f215973b7d134f6ff8 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 | |
c = amid('localhost', verify_certificate=False) | |
agi = agi.AGI() | |
extension = agi.get_variable("EXTEN_GSM") | |
context = agi.get_variable("CONTEXT_GSM") | |
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment