[Asterisk-cvs] asterisk/channels chan_local.c,1.28,1.29
markster at lists.digium.com
markster at lists.digium.com
Tue Jun 22 01:08:57 CDT 2004
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv17088/channels
Modified Files:
chan_local.c
Log Message:
Can't check outbound without having lock (bug #1886)
Index: chan_local.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_local.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- chan_local.c 9 Jun 2004 01:45:07 -0000 1.28
+++ chan_local.c 22 Jun 2004 04:54:52 -0000 1.29
@@ -121,9 +121,10 @@
static int local_answer(struct ast_channel *ast)
{
struct local_pvt *p = ast->pvt->pvt;
- int isoutbound = IS_OUTBOUND(ast, p);
+ int isoutbound;
int res = -1;
ast_mutex_lock(&p->lock);
+ isoutbound = IS_OUTBOUND(ast, p);
if (isoutbound) {
/* Pass along answer since somebody answered us */
struct ast_frame answer = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER };
@@ -174,11 +175,12 @@
{
struct local_pvt *p = ast->pvt->pvt;
int res = -1;
- int isoutbound = IS_OUTBOUND(ast, p);
+ int isoutbound;
/* Just queue for delivery to the other side */
ast_mutex_lock(&p->lock);
+ isoutbound = IS_OUTBOUND(ast, p);
res = local_queue_frame(p, isoutbound, f, ast);
check_bridge(p, isoutbound);
ast_mutex_unlock(&p->lock);
@@ -207,9 +209,10 @@
struct local_pvt *p = ast->pvt->pvt;
int res = -1;
struct ast_frame f = { AST_FRAME_CONTROL, };
- int isoutbound = IS_OUTBOUND(ast, p);
+ int isoutbound;
/* Queue up a frame representing the indication as a control frame */
ast_mutex_lock(&p->lock);
+ isoutbound = IS_OUTBOUND(ast, p);
f.subclass = condition;
res = local_queue_frame(p, isoutbound, &f, ast);
ast_mutex_unlock(&p->lock);
@@ -221,8 +224,9 @@
struct local_pvt *p = ast->pvt->pvt;
int res = -1;
struct ast_frame f = { AST_FRAME_DTMF, };
- int isoutbound = IS_OUTBOUND(ast, p);
+ int isoutbound;
ast_mutex_lock(&p->lock);
+ isoutbound = IS_OUTBOUND(ast, p);
f.subclass = digit;
res = local_queue_frame(p, isoutbound, &f, ast);
ast_mutex_unlock(&p->lock);
@@ -282,12 +286,13 @@
static int local_hangup(struct ast_channel *ast)
{
struct local_pvt *p = ast->pvt->pvt;
- int isoutbound = IS_OUTBOUND(ast, p);
+ int isoutbound;
struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP };
struct local_pvt *cur, *prev=NULL;
struct ast_channel *ochan = NULL;
int glaredetect;
ast_mutex_lock(&p->lock);
+ isoutbound = IS_OUTBOUND(ast, p);
if (isoutbound) {
p->chan = NULL;
p->launchedpbx = 0;
More information about the svn-commits
mailing list