def getServer(dn):
	co, lo, pos = getCoLoPos()
	server = univention.admin.modules.get("asterisk/server")
	univention.admin.modules.init(lo, pos, server)
	obj = server.object(co, lo, None, dn)
	MODULE.error("server dn: %s" % dn)
	obj.open()

	return obj
Beispiel #2
0
def create(serverdn, name):
	co, lo, pos = getCoLoPos()

	server = univention.admin.modules.get("asterisk/server")
	univention.admin.modules.init(lo, pos, server)
	srv = server.object(co, lo, pos, serverdn)
	srv.open()
	if not srv.exists():
		raise Exception, "Invalid serverDN"

	pos.setDn(serverdn)

	music = univention.admin.modules.get("asterisk/music")
	univention.admin.modules.init(lo, pos, music)
	moh = music.object(co, lo, pos, None, srv)
	moh.open()
	moh.info["name"] = name
	moh.create()

	return moh.dn
def create(serverdn, name):
    co, lo, pos = getCoLoPos()

    server = univention.admin.modules.get("asterisk/server")
    univention.admin.modules.init(lo, pos, server)
    srv = server.object(co, lo, pos, serverdn)
    srv.open()
    if not srv.exists():
        raise Exception, "Invalid serverDN"

    pos.setDn(serverdn)

    music = univention.admin.modules.get("asterisk/music")
    univention.admin.modules.init(lo, pos, music)
    moh = music.object(co, lo, pos, None, srv)
    moh.open()
    moh.info["name"] = name
    moh.create()

    return moh.dn