Skip to content

Instantly share code, notes, and snippets.

@sboily
Last active May 18, 2016 15:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sboily/e3e6b1c2efda85a1255f to your computer and use it in GitHub Desktop.
Save sboily/e3e6b1c2efda85a1255f to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from xivo_auth_client import Client as Auth
from xivo_confd_client import Client as Confd
auth = Auth('127.0.0.1', username='sylvain', password='sylvain', verify_certificate=False)
token_data = auth.token.new('xivo_user', expiration=10)
token = token_data['token']
uuid = token_data['xivo_user_uuid']
confd = Confd('127.0.0.1', port=9486, verify_certificate=False, token=token)
confd.users(uuid).update_service('dnd', {'enabled': True})
print confd.users(uuid).list_services()
confd.users(uuid).update_service('dnd', {'enabled': False})
confd.users(uuid).update_forward('unconditional', {'enabled': True, 'destination': '1234'})
print confd.users(uuid).list_forwards()
confd.users(uuid).update_forward('unconditional', {'enabled': False})
auth.token.revoke(token)
@sboily
Copy link
Author

sboily commented Mar 24, 2016

This script use our REST API on XiVO with our python client. http://github.com/xivo-pbx/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment