parent
687af591b8
commit
eb002f080f
|
@ -1,7 +1,7 @@
|
|||
spooldir = @localstatedir@/spool/capisuite
|
||||
pkgsysconfdir = @sysconfdir@/capisuite
|
||||
docdir = @docdir@
|
||||
doc_DATA = COPYING NEWS README
|
||||
doc_DATA = COPYING NEWS README.md
|
||||
EXTRA_DIST = rc.capisuite.in capisuite.cronin cronjob.conf ChangeLog.complete ChangeLog.2003 ChangeLog.2004
|
||||
|
||||
SUBDIRS = src scripts docs
|
||||
|
|
|
@ -236,7 +236,7 @@ top_builddir = @top_builddir@
|
|||
top_srcdir = @top_srcdir@
|
||||
spooldir = @localstatedir@/spool/capisuite
|
||||
pkgsysconfdir = @sysconfdir@/capisuite
|
||||
doc_DATA = COPYING NEWS README
|
||||
doc_DATA = COPYING NEWS README.md
|
||||
EXTRA_DIST = rc.capisuite.in capisuite.cronin cronjob.conf ChangeLog.complete ChangeLog.2003 ChangeLog.2004
|
||||
SUBDIRS = src scripts docs
|
||||
all: config.h
|
||||
|
|
|
@ -102,7 +102,7 @@ def faxIncoming(config, user, call, already_connected):
|
|||
'already_connected' ture if we're already connected (that means we must
|
||||
switch to fax mode)
|
||||
"""
|
||||
# todo: use config.getQueue + _mkdir here
|
||||
# todo: use config.getQueueFiles + _mkdir here
|
||||
receivedQ = fileutils._mkuserdir(user,
|
||||
config.get('GLOBAL', "fax_user_dir"),
|
||||
user, "received")
|
||||
|
@ -240,7 +240,7 @@ def voiceIncoming(config, user, call):
|
|||
if os.access(filename, os.R_OK):
|
||||
os.unlink(filename)
|
||||
call.log("Starting remote inquiry...", 1)
|
||||
remoteInquiry(call, user, config, receivedQ)
|
||||
remoteInquiry(config, user, call, receivedQ)
|
||||
|
||||
except core.CallGoneError:
|
||||
# catch this here to get the cause info in the mail
|
||||
|
@ -281,15 +281,14 @@ def remoteInquiry(config, user, call, receivedQ):
|
|||
'receivedQ' the received queue dir of the user
|
||||
"""
|
||||
try:
|
||||
lock = fileutils._getLock(lockname=os.path.join(receivedQ,
|
||||
'inquiry_lock'),
|
||||
blocking=0)
|
||||
lock = fileutils._getLock(
|
||||
os.path.join(receivedQ, 'inquiry_lock'), blocking=0)
|
||||
except fileutils.LockTakenError:
|
||||
say(config, user, call, "fernabfrage-aktiv.la")
|
||||
return
|
||||
try:
|
||||
# read directory contents
|
||||
messages = capisuite.voice.getQueue(config, user)
|
||||
messages = capisuite.voice.getQueueFiles(config, user)
|
||||
|
||||
# read the number of the message heard last at the last inquiry
|
||||
lastinquiry = capisuite.voice.getInquiryCounter(config, user)
|
||||
|
|
|
@ -30,12 +30,12 @@ def controlname(path):
|
|||
return "%s.txt" % os.path.splitext(path)[0]
|
||||
|
||||
|
||||
def _getLock(lockname_=None, forfile=None, blocking=0):
|
||||
def _getLock(name, forfile=None, blocking=0):
|
||||
if forfile:
|
||||
lockname_ = lockname(forfile)
|
||||
elif not lockname_:
|
||||
raise ValueError, lockname_
|
||||
lockfile = open(lockname_, "w")
|
||||
name = lockname(forfile)
|
||||
elif not name:
|
||||
raise ValueError, "missing lock name"
|
||||
lockfile = open(name, "w")
|
||||
try:
|
||||
if blocking:
|
||||
fcntl.lockf(lockfile, fcntl.LOCK_EX)
|
||||
|
@ -49,8 +49,8 @@ def _getLock(lockname_=None, forfile=None, blocking=0):
|
|||
raise
|
||||
# currently log is only available if running within capisuite
|
||||
if hasattr(core, 'log'):
|
||||
core.log("lock taken %s" % lockname_, 3)
|
||||
return (lockname_, lockfile)
|
||||
core.log("lock taken %s" % name, 3)
|
||||
return (name, lockfile)
|
||||
|
||||
|
||||
def _releaseLock((lockname, lockfile)):
|
||||
|
|
Loading…
Reference in New Issue