Created
April 6, 2009 12:17
-
-
Save wrboyce/90733 to your computer and use it in GitHub Desktop.
Very Simple wrapper for FreeSWITCH's mod_xml-rpc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xmlrpclib | |
class FreeSwitchServer(xmlrpclib.Server): | |
""" Very Simple wrapper for FreeSWITCH's mod_xml-rpc """ | |
def __init__(self, user, passwd, host, port=8080): | |
xmlrpclib.Server.__init__(self, 'http://%s:%s@%s:%s' % (user, passwd, host, port)) | |
def __getattr__(self, cmd): | |
def _caller(*args): | |
print ' '.join(args) | |
return xmlrpclib.Server.__getattr__(self, 'freeswitch').api(cmd, ' '.join(args)) | |
return _caller |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment