def originate(self, party2dial, dest_ext_app, bgapi=True): if bgapi == True: msg = "bgapi originate %s %s" % (party2dial, dest_ext_app) req = request.BgDialoutRequest() else: msg = "api originate %s %s" % (party2dial, dest_ext_app) req = request.DialoutRequest() self.requestq.put(req) self.transport.write("%s\n\n" % msg) debug(">> %s" % msg) return req.getDeferred()
def confdialout(self, conf_name, sofia_url, bgapi=True): """ Instruct conference to join a particular user via dialout @param conf_name - the name of the conference (arbitrary) @param party2dial - a freeswitch sofia url, eg, sofia/mydomain.com/[email protected] @return - a deferred that will be called back with a string like: Reply-Text: +OK Job-UUID: 4d410a8e-2409-11dc-99bf-a5e17fab9c65 """ if bgapi == True: msg = "bgapi conference %s dial %s" % (conf_name, sofia_url) req = request.BgDialoutRequest() else: msg = "api conference %s dial %s" % (conf_name, sofia_url) req = request.DialoutRequest() self.requestq.put(req) self.transport.write("%s\n\n" % msg) debug(">> %s" % msg) return req.getDeferred()