12345678910111213141516171819202122232425262728 |
- #!/usr/bin/python
- # -*- encoding: utf-8 -*-
- import xmlrpclib
- # XML-RPC URL (http_listener_port)
- asteriskServerURL = 'http://127.0.0.1:53263'
- # instantiate server object
- asteriskServer = xmlrpclib.Server(asteriskServerURL)
- try:
- # invoke admin_alert: requires password and message
- res = asteriskServer.region_update({
- 'admin_password': 'c00lstuff',
- 'region' : '[email protected]'
- })
- print res
-
- res = asteriskServer.account_update({
- 'admin_password': 'c00lstuff',
- 'username' : '[email protected]',
- 'password' : '$1$dd02c7c2232759874e1c205587017bed'
- })
- print res
- except Exception, e:
- print e
|