Advertisement
Guest User

Untitled

a guest
Jun 9th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. from xivo_auth_client import Client as Auth
  4. from xivo_confd_client import Client as Confd
  5.  
  6. # Please add a web service user with acl confd.#
  7.  
  8. username = "defined"
  9. password = "defined"
  10.  
  11. auth = Auth('127.0.0.1', username=username, password=username, verify_certificate=False)
  12. token_data = auth.token.new('xivo_service', expiration=10)
  13. token = token_data['token']
  14. uuid = token_data['xivo_user_uuid']
  15.  
  16. confd = Confd('localhost', verify_certificate=False, token=token)
  17.  
  18. for line_sip in confd.endpoints_sip.list()['items']:
  19. id = line_sip['id']
  20. value = {'id': id,
  21. 'options': [
  22. ['dtmfmode', 'info']
  23. ]
  24. }
  25.  
  26. print "Update endpoint SIP ", id
  27. confd.endpoints_sip.update(value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement