transfer calls
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6063 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
cc5cf12a55
commit
6e02348c36
|
@ -323,7 +323,21 @@ class FreepyDispatcher(LineReceiver):
|
|||
print "sending to fs: %s" % msg
|
||||
self.transport.write("%s\n\n" % msg)
|
||||
return req.getDeferred()
|
||||
|
||||
|
||||
def transfer(self, uuid, dest_ext, legs, bgapi = False):
|
||||
"""
|
||||
transfer <uuid> [-bleg|-both] <dest-exten>
|
||||
"""
|
||||
if bgapi == True:
|
||||
msg = "bgapi transfer %s %s %s" % (uuid, legs, dest_ext)
|
||||
req = request.BgApiRequest()
|
||||
else:
|
||||
msg = "api transfer %s %s %s" % (uuid, legs, dest_ext)
|
||||
req = request.ApiRequest()
|
||||
self.requestq.put(req)
|
||||
print "sending to fs: %s" % msg
|
||||
self.transport.write("%s\n\n" % msg)
|
||||
return req.getDeferred()
|
||||
|
||||
def lineReceived(self, line):
|
||||
if not self.active_request:
|
||||
|
|
|
@ -302,6 +302,17 @@ class FsHelper(ClientFactory):
|
|||
d.addCallback(broadcast_inner)
|
||||
return d
|
||||
|
||||
def transfer(self, uuid, dest_ext, legs="-both", bgapi=True):
|
||||
"""
|
||||
@legs -bleg|-both
|
||||
"""
|
||||
def transfer_inner(ignored):
|
||||
df = self.freepyd.transfer(uuid, dest_ext, legs, bgapi)
|
||||
return df
|
||||
|
||||
d = self.connect()
|
||||
d.addCallback(transfer_inner)
|
||||
return d
|
||||
|
||||
def sofia_profile_restart(self, profile_name, bgapi=True):
|
||||
|
||||
|
|
Loading…
Reference in New Issue