Skip to content

Instantly share code, notes, and snippets.

@sboily
Last active October 6, 2015 17:01
Show Gist options
  • Save sboily/d9f215973b7d134f6ff8 to your computer and use it in GitHub Desktop.
Save sboily/d9f215973b7d134f6ff8 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
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