test-client.py 800 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/python
  2. # -*- encoding: utf-8 -*-
  3. import xmlrpclib
  4. # XML-RPC URL (http_listener_port)
  5. asteriskServerURL = 'http://127.0.0.1:53263'
  6. # instantiate server object
  7. asteriskServer = xmlrpclib.Server(asteriskServerURL)
  8. try:
  9. # invoke admin_alert: requires password and message
  10. res = asteriskServer.region_update({
  11. 'admin_password': 'c00lstuff',
  12. 'region' : '[email protected]'
  13. })
  14. print res
  15. res = asteriskServer.account_update({
  16. 'admin_password': 'c00lstuff',
  17. 'username' : '[email protected]',
  18. 'password' : '$1$dd02c7c2232759874e1c205587017bed'
  19. })
  20. print res
  21. except Exception, e:
  22. print e