All pastes #448041 Raw Edit

haagenti

public python v1 · immutable
·published 2007-04-19 13:02 UTC
rendered paste body
def startup(m):    """    m is now the resulting channel, dumb/1 for example.    """    yate.msg("call.answered", {        "id" : m['id'],            # dumb/1        "targetid" : m['targetid'] # sip/whatever    }).enqueue()    yate.msg("chan.masquerade", {        "message" : "chan.attach",        "id" : m['id'],        "source" : "wave/play//some/where/hello.slin",    }).enqueue()def route(m):    """    This call has been setup by a previous call to    yate.onmsg("call.route", ...)    """    guard = lambda m: m == self['targetid']    d = yate.onwatch("chan.startup", guard, self.end)    d.addCallback(startup)    d.addErrback(log.err)    m.ret(True, 'dumb/')