]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge Script <automerge@asterisk.org>
Fri, 13 Jul 2007 20:29:46 +0000 (20:29 +0000)
committerAutomerge Script <automerge@asterisk.org>
Fri, 13 Jul 2007 20:29:46 +0000 (20:29 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@75106 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_chanspy.c
channels/chan_zap.c
res/res_musiconhold.c

index 7510c68e94ea42ea6a633532538eaf043ade1083..34db4f7befcd9f68012b93edc0f917f3ec62076a 100644 (file)
@@ -432,6 +432,8 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
                                volfactor = vol;
                        }
        }
+       else 
+               ast_clear_flag(&flags, AST_FLAGS_ALL);
 
        if (recbase) {
                char filename[512];
index e66e171db9b7c78dfab32e2ad0547104a31ae946..695684ce8baa826695e916f13eaa562a33d6b699 100644 (file)
@@ -1726,14 +1726,23 @@ static int restore_gains(struct zt_pvt *p)
 
 static inline int zt_set_hook(int fd, int hs)
 {
-       int x, res;
+       int x, res, count = 0;
+
        x = hs;
        res = ioctl(fd, ZT_HOOK, &x);
-       if (res < 0) 
-       {
+
+       while (res < 0 && count < 20) {
+               usleep(100000); /* 1/10 sec. */
+               x = hs;
+               res = ioctl(fd, ZT_HOOK, &x);
+               count++;
+       }
+
+       if (res < 0) {
                if (errno == EINPROGRESS) return 0;
                ast_log(LOG_WARNING, "zt hook failed: %s\n", strerror(errno));
        }
+
        return res;
 }
 
index efdd90bc4ef64cd94d0b3671230c27b654ee669c..f4e3a81677b399ab1e6e1fe4ddd6caa4b5ceeb40 100644 (file)
@@ -660,8 +660,10 @@ static struct mohdata *mohalloc(struct mohclass *cl)
        flags = fcntl(moh->pipe[1], F_GETFL);
        fcntl(moh->pipe[1], F_SETFL, flags | O_NONBLOCK);
        moh->parent = cl;
+       ast_mutex_lock(&moh_lock);
        moh->next = cl->members;
        cl->members = moh;
+       ast_mutex_unlock(&moh_lock);
        return moh;
 }