mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 16:33:34 +00:00
Merged revisions 60846 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r60846 | tilghman | 2007-04-08 21:37:18 -0500 (Sun, 08 Apr 2007) | 2 lines Bug 9505 - If the return value for local_queue_frame is set, then p->lock is no longer valid. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -214,6 +214,7 @@ static int local_answer(struct ast_channel *ast)
|
|||||||
res = local_queue_frame(p, isoutbound, &answer, ast);
|
res = local_queue_frame(p, isoutbound, &answer, ast);
|
||||||
} else
|
} else
|
||||||
ast_log(LOG_WARNING, "Huh? Local is being asked to answer?\n");
|
ast_log(LOG_WARNING, "Huh? Local is being asked to answer?\n");
|
||||||
|
if (!res)
|
||||||
ast_mutex_unlock(&p->lock);
|
ast_mutex_unlock(&p->lock);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -294,6 +295,7 @@ static int local_write(struct ast_channel *ast, struct ast_frame *f)
|
|||||||
ast_log(LOG_DEBUG, "Not posting to queue since already masked on '%s'\n", ast->name);
|
ast_log(LOG_DEBUG, "Not posting to queue since already masked on '%s'\n", ast->name);
|
||||||
res = 0;
|
res = 0;
|
||||||
}
|
}
|
||||||
|
if (!res)
|
||||||
ast_mutex_unlock(&p->lock);
|
ast_mutex_unlock(&p->lock);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -342,7 +344,7 @@ static int local_indicate(struct ast_channel *ast, int condition, const void *da
|
|||||||
f.subclass = condition;
|
f.subclass = condition;
|
||||||
f.data = (void*)data;
|
f.data = (void*)data;
|
||||||
f.datalen = datalen;
|
f.datalen = datalen;
|
||||||
res = local_queue_frame(p, isoutbound, &f, ast);
|
if (!(res = local_queue_frame(p, isoutbound, &f, ast)))
|
||||||
ast_mutex_unlock(&p->lock);
|
ast_mutex_unlock(&p->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -362,7 +364,7 @@ static int local_digit_begin(struct ast_channel *ast, char digit)
|
|||||||
ast_mutex_lock(&p->lock);
|
ast_mutex_lock(&p->lock);
|
||||||
isoutbound = IS_OUTBOUND(ast, p);
|
isoutbound = IS_OUTBOUND(ast, p);
|
||||||
f.subclass = digit;
|
f.subclass = digit;
|
||||||
res = local_queue_frame(p, isoutbound, &f, ast);
|
if (!(res = local_queue_frame(p, isoutbound, &f, ast)))
|
||||||
ast_mutex_unlock(&p->lock);
|
ast_mutex_unlock(&p->lock);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
@@ -382,7 +384,7 @@ static int local_digit_end(struct ast_channel *ast, char digit, unsigned int dur
|
|||||||
isoutbound = IS_OUTBOUND(ast, p);
|
isoutbound = IS_OUTBOUND(ast, p);
|
||||||
f.subclass = digit;
|
f.subclass = digit;
|
||||||
f.len = duration;
|
f.len = duration;
|
||||||
res = local_queue_frame(p, isoutbound, &f, ast);
|
if (!(res = local_queue_frame(p, isoutbound, &f, ast)))
|
||||||
ast_mutex_unlock(&p->lock);
|
ast_mutex_unlock(&p->lock);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
@@ -402,7 +404,7 @@ static int local_sendtext(struct ast_channel *ast, const char *text)
|
|||||||
isoutbound = IS_OUTBOUND(ast, p);
|
isoutbound = IS_OUTBOUND(ast, p);
|
||||||
f.data = (char *) text;
|
f.data = (char *) text;
|
||||||
f.datalen = strlen(text) + 1;
|
f.datalen = strlen(text) + 1;
|
||||||
res = local_queue_frame(p, isoutbound, &f, ast);
|
if (!(res = local_queue_frame(p, isoutbound, &f, ast)))
|
||||||
ast_mutex_unlock(&p->lock);
|
ast_mutex_unlock(&p->lock);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -422,7 +424,7 @@ static int local_sendhtml(struct ast_channel *ast, int subclass, const char *dat
|
|||||||
f.subclass = subclass;
|
f.subclass = subclass;
|
||||||
f.data = (char *)data;
|
f.data = (char *)data;
|
||||||
f.datalen = datalen;
|
f.datalen = datalen;
|
||||||
res = local_queue_frame(p, isoutbound, &f, ast);
|
if (!(res = local_queue_frame(p, isoutbound, &f, ast)))
|
||||||
ast_mutex_unlock(&p->lock);
|
ast_mutex_unlock(&p->lock);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -477,7 +479,7 @@ static int local_hangup(struct ast_channel *ast)
|
|||||||
int isoutbound;
|
int isoutbound;
|
||||||
struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP };
|
struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP };
|
||||||
struct ast_channel *ochan = NULL;
|
struct ast_channel *ochan = NULL;
|
||||||
int glaredetect = 0;
|
int glaredetect = 0, res = 0;
|
||||||
|
|
||||||
if (!p)
|
if (!p)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -524,7 +526,8 @@ static int local_hangup(struct ast_channel *ast)
|
|||||||
/* Need to actually hangup since there is no PBX */
|
/* Need to actually hangup since there is no PBX */
|
||||||
ochan = p->chan;
|
ochan = p->chan;
|
||||||
else
|
else
|
||||||
local_queue_frame(p, isoutbound, &f, NULL);
|
res = local_queue_frame(p, isoutbound, &f, NULL);
|
||||||
|
if (!res)
|
||||||
ast_mutex_unlock(&p->lock);
|
ast_mutex_unlock(&p->lock);
|
||||||
if (ochan)
|
if (ochan)
|
||||||
ast_hangup(ochan);
|
ast_hangup(ochan);
|
||||||
|
Reference in New Issue
Block a user