mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-18 18:58:22 +00:00
Because of the way chan_local is written we should be extra careful and make sure our callback functions have a tech_pvt. (issue #8275 reported by mflorell)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@47750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -168,6 +168,9 @@ static int local_answer(struct ast_channel *ast)
|
||||
int isoutbound;
|
||||
int res = -1;
|
||||
|
||||
if (!p)
|
||||
return -1;
|
||||
|
||||
ast_mutex_lock(&p->lock);
|
||||
isoutbound = IS_OUTBOUND(ast, p);
|
||||
if (isoutbound) {
|
||||
@@ -245,6 +248,9 @@ static int local_write(struct ast_channel *ast, struct ast_frame *f)
|
||||
int res = -1;
|
||||
int isoutbound;
|
||||
|
||||
if (!p)
|
||||
return -1;
|
||||
|
||||
/* Just queue for delivery to the other side */
|
||||
ast_mutex_lock(&p->lock);
|
||||
isoutbound = IS_OUTBOUND(ast, p);
|
||||
@@ -289,6 +295,9 @@ static int local_indicate(struct ast_channel *ast, int condition)
|
||||
struct ast_frame f = { AST_FRAME_CONTROL, };
|
||||
int isoutbound;
|
||||
|
||||
if (!p)
|
||||
return -1;
|
||||
|
||||
/* Queue up a frame representing the indication as a control frame */
|
||||
ast_mutex_lock(&p->lock);
|
||||
isoutbound = IS_OUTBOUND(ast, p);
|
||||
@@ -305,6 +314,9 @@ static int local_digit(struct ast_channel *ast, char digit)
|
||||
struct ast_frame f = { AST_FRAME_DTMF, };
|
||||
int isoutbound;
|
||||
|
||||
if (!p)
|
||||
return -1;
|
||||
|
||||
ast_mutex_lock(&p->lock);
|
||||
isoutbound = IS_OUTBOUND(ast, p);
|
||||
f.subclass = digit;
|
||||
@@ -320,6 +332,9 @@ static int local_sendhtml(struct ast_channel *ast, int subclass, const char *dat
|
||||
struct ast_frame f = { AST_FRAME_HTML, };
|
||||
int isoutbound;
|
||||
|
||||
if (!p)
|
||||
return -1;
|
||||
|
||||
ast_mutex_lock(&p->lock);
|
||||
isoutbound = IS_OUTBOUND(ast, p);
|
||||
f.subclass = subclass;
|
||||
@@ -338,6 +353,9 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout)
|
||||
int res;
|
||||
struct ast_var_t *varptr = NULL, *new;
|
||||
size_t len, namelen;
|
||||
|
||||
if (!p)
|
||||
return -1;
|
||||
|
||||
ast_mutex_lock(&p->lock);
|
||||
|
||||
@@ -414,6 +432,9 @@ static int local_hangup(struct ast_channel *ast)
|
||||
struct ast_channel *ochan = NULL;
|
||||
int glaredetect;
|
||||
|
||||
if (!p)
|
||||
return -1;
|
||||
|
||||
ast_mutex_lock(&p->lock);
|
||||
isoutbound = IS_OUTBOUND(ast, p);
|
||||
if (isoutbound) {
|
||||
|
Reference in New Issue
Block a user