Skip to content

Instantly share code, notes, and snippets.

@wrboyce
Created April 6, 2009 12:17
Show Gist options
  • Save wrboyce/90733 to your computer and use it in GitHub Desktop.
Save wrboyce/90733 to your computer and use it in GitHub Desktop.
Very Simple wrapper for FreeSWITCH's mod_xml-rpc
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