aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-12-11 20:55:26 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-12-11 20:55:26 +0000
commitf19a371176ba2044958e19d93b88335db11c55b1 (patch)
tree92c5cf4179d3764477d5c143a4df9527c0257a39
parentd10fd7b4040992ed397afc1961fe3536a76d4cd6 (diff)
Properly fix double locking issue, fix wav49 issue
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1855 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xapps/app_voicemail.c3
-rwxr-xr-xchannels/chan_zap.c18
2 files changed, 15 insertions, 6 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index a0bea848b..a7b43a88d 100755
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1928,6 +1928,9 @@ forward_message(struct ast_channel *chan, char *context, char *dir, int curmsg,
strncpy(tmp, fmt, sizeof(tmp));
stringp = tmp;
while((s = strsep(&stringp, "|"))) {
+ /* XXX This is a hack -- we should use build_filename or similar XXX */
+ if (!strcasecmp(s, "wav49"))
+ s = "WAV";
snprintf(sys, sizeof(sys), "cp %s/msg%04d.%s %s/msg%04d.%s\n", dir, curmsg, s, todir, todircount, s);
ast_log(LOG_DEBUG, sys);
system(sys);
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 5f7025097..ff9a48ef4 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -3182,7 +3182,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
-static struct ast_frame *zt_exception(struct ast_channel *ast)
+static struct ast_frame *__zt_exception(struct ast_channel *ast)
{
struct zt_pvt *p = ast->pvt->pvt;
int res;
@@ -3190,7 +3190,6 @@ static struct ast_frame *zt_exception(struct ast_channel *ast)
int index;
struct ast_frame *f;
- ast_mutex_lock(&p->lock);
index = zt_get_index(ast, p, 1);
@@ -3272,7 +3271,6 @@ static struct ast_frame *zt_exception(struct ast_channel *ast)
ast_log(LOG_WARNING, "Don't know how to absorb event %s\n", event2str(res));
}
f = &p->subs[index].f;
- ast_mutex_unlock(&p->lock);
return f;
}
if (!p->radio) ast_log(LOG_DEBUG, "Exception on %d, channel %d\n", ast->fds[0],p->channel);
@@ -3280,10 +3278,18 @@ static struct ast_frame *zt_exception(struct ast_channel *ast)
if (ast != p->owner) {
ast_log(LOG_WARNING, "We're %s, not %s\n", ast->name, p->owner->name);
f = &p->subs[index].f;
- ast_mutex_unlock(&p->lock);
return f;
}
f = zt_handle_event(ast);
+ return f;
+}
+
+struct ast_frame *zt_exception(struct ast_channel *ast)
+{
+ struct zt_pvt *p = ast->pvt->pvt;
+ struct ast_frame *f;
+ ast_mutex_lock(&p->lock);
+ f = __zt_exception(ast);
ast_mutex_unlock(&p->lock);
return f;
}
@@ -3403,7 +3409,7 @@ struct ast_frame *zt_read(struct ast_channel *ast)
ast_mutex_unlock(&p->lock);
return &p->subs[index].f;
} else if (errno == ELAST) {
- f = zt_exception(ast);
+ f = __zt_exception(ast);
} else
ast_log(LOG_WARNING, "zt_rec: %s\n", strerror(errno));
}
@@ -3412,7 +3418,7 @@ struct ast_frame *zt_read(struct ast_channel *ast)
}
if (res != (p->subs[index].linear ? READ_SIZE * 2 : READ_SIZE)) {
ast_log(LOG_DEBUG, "Short read (%d/%d), must be an event...\n", res, p->subs[index].linear ? READ_SIZE * 2 : READ_SIZE);
- f = zt_exception(ast);
+ f = __zt_exception(ast);
ast_mutex_unlock(&p->lock);
return f;
}