mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 02:26:23 +00:00
Merged revisions 47750 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r47750 | file | 2006-11-16 13:26:50 -0500 (Thu, 16 Nov 2006) | 2 lines 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.4@47751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -203,6 +203,9 @@ static int local_answer(struct ast_channel *ast)
|
|||||||
int isoutbound;
|
int isoutbound;
|
||||||
int res = -1;
|
int res = -1;
|
||||||
|
|
||||||
|
if (!p)
|
||||||
|
return -1;
|
||||||
|
|
||||||
ast_mutex_lock(&p->lock);
|
ast_mutex_lock(&p->lock);
|
||||||
isoutbound = IS_OUTBOUND(ast, p);
|
isoutbound = IS_OUTBOUND(ast, p);
|
||||||
if (isoutbound) {
|
if (isoutbound) {
|
||||||
@@ -276,6 +279,9 @@ static int local_write(struct ast_channel *ast, struct ast_frame *f)
|
|||||||
int res = -1;
|
int res = -1;
|
||||||
int isoutbound;
|
int isoutbound;
|
||||||
|
|
||||||
|
if (!p)
|
||||||
|
return -1;
|
||||||
|
|
||||||
/* Just queue for delivery to the other side */
|
/* Just queue for delivery to the other side */
|
||||||
ast_mutex_lock(&p->lock);
|
ast_mutex_lock(&p->lock);
|
||||||
isoutbound = IS_OUTBOUND(ast, p);
|
isoutbound = IS_OUTBOUND(ast, p);
|
||||||
@@ -321,6 +327,9 @@ static int local_indicate(struct ast_channel *ast, int condition, const void *da
|
|||||||
struct ast_frame f = { AST_FRAME_CONTROL, };
|
struct ast_frame f = { AST_FRAME_CONTROL, };
|
||||||
int isoutbound;
|
int isoutbound;
|
||||||
|
|
||||||
|
if (!p)
|
||||||
|
return -1;
|
||||||
|
|
||||||
/* If this is an MOH hold or unhold, do it on the Local channel versus real channel */
|
/* If this is an MOH hold or unhold, do it on the Local channel versus real channel */
|
||||||
if (condition == AST_CONTROL_HOLD) {
|
if (condition == AST_CONTROL_HOLD) {
|
||||||
ast_moh_start(ast, data, NULL);
|
ast_moh_start(ast, data, NULL);
|
||||||
@@ -347,6 +356,9 @@ static int local_digit_begin(struct ast_channel *ast, char digit)
|
|||||||
struct ast_frame f = { AST_FRAME_DTMF_BEGIN, };
|
struct ast_frame f = { AST_FRAME_DTMF_BEGIN, };
|
||||||
int isoutbound;
|
int isoutbound;
|
||||||
|
|
||||||
|
if (!p)
|
||||||
|
return -1;
|
||||||
|
|
||||||
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;
|
||||||
@@ -363,6 +375,9 @@ static int local_digit_end(struct ast_channel *ast, char digit)
|
|||||||
struct ast_frame f = { AST_FRAME_DTMF_END, };
|
struct ast_frame f = { AST_FRAME_DTMF_END, };
|
||||||
int isoutbound;
|
int isoutbound;
|
||||||
|
|
||||||
|
if (!p)
|
||||||
|
return -1;
|
||||||
|
|
||||||
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;
|
||||||
@@ -379,6 +394,9 @@ static int local_sendtext(struct ast_channel *ast, const char *text)
|
|||||||
struct ast_frame f = { AST_FRAME_TEXT, };
|
struct ast_frame f = { AST_FRAME_TEXT, };
|
||||||
int isoutbound;
|
int isoutbound;
|
||||||
|
|
||||||
|
if (!p)
|
||||||
|
return -1;
|
||||||
|
|
||||||
ast_mutex_lock(&p->lock);
|
ast_mutex_lock(&p->lock);
|
||||||
isoutbound = IS_OUTBOUND(ast, p);
|
isoutbound = IS_OUTBOUND(ast, p);
|
||||||
f.data = (char *) text;
|
f.data = (char *) text;
|
||||||
@@ -395,6 +413,9 @@ static int local_sendhtml(struct ast_channel *ast, int subclass, const char *dat
|
|||||||
struct ast_frame f = { AST_FRAME_HTML, };
|
struct ast_frame f = { AST_FRAME_HTML, };
|
||||||
int isoutbound;
|
int isoutbound;
|
||||||
|
|
||||||
|
if (!p)
|
||||||
|
return -1;
|
||||||
|
|
||||||
ast_mutex_lock(&p->lock);
|
ast_mutex_lock(&p->lock);
|
||||||
isoutbound = IS_OUTBOUND(ast, p);
|
isoutbound = IS_OUTBOUND(ast, p);
|
||||||
f.subclass = subclass;
|
f.subclass = subclass;
|
||||||
@@ -413,6 +434,9 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout)
|
|||||||
int res;
|
int res;
|
||||||
struct ast_var_t *varptr = NULL, *new;
|
struct ast_var_t *varptr = NULL, *new;
|
||||||
size_t len, namelen;
|
size_t len, namelen;
|
||||||
|
|
||||||
|
if (!p)
|
||||||
|
return -1;
|
||||||
|
|
||||||
ast_mutex_lock(&p->lock);
|
ast_mutex_lock(&p->lock);
|
||||||
|
|
||||||
@@ -454,6 +478,9 @@ static int local_hangup(struct ast_channel *ast)
|
|||||||
struct ast_channel *ochan = NULL;
|
struct ast_channel *ochan = NULL;
|
||||||
int glaredetect = 0;
|
int glaredetect = 0;
|
||||||
|
|
||||||
|
if (!p)
|
||||||
|
return -1;
|
||||||
|
|
||||||
ast_mutex_lock(&p->lock);
|
ast_mutex_lock(&p->lock);
|
||||||
isoutbound = IS_OUTBOUND(ast, p);
|
isoutbound = IS_OUTBOUND(ast, p);
|
||||||
if (isoutbound) {
|
if (isoutbound) {
|
||||||
|
Reference in New Issue
Block a user