|
|
|
@ -451,8 +451,9 @@ static int local_answer(struct ast_channel *ast)
|
|
|
|
|
int isoutbound;
|
|
|
|
|
int res = -1;
|
|
|
|
|
|
|
|
|
|
if (!p)
|
|
|
|
|
if (!p) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ao2_lock(p);
|
|
|
|
|
ao2_ref(p, 1);
|
|
|
|
@ -619,8 +620,9 @@ static int local_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
|
|
|
|
|
{
|
|
|
|
|
struct local_pvt *p = newchan->tech_pvt;
|
|
|
|
|
|
|
|
|
|
if (!p)
|
|
|
|
|
if (!p) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ao2_lock(p);
|
|
|
|
|
|
|
|
|
@ -629,10 +631,11 @@ static int local_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
|
|
|
|
|
ao2_unlock(p);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
if (p->owner == oldchan)
|
|
|
|
|
if (p->owner == oldchan) {
|
|
|
|
|
p->owner = newchan;
|
|
|
|
|
else
|
|
|
|
|
} else {
|
|
|
|
|
p->chan = newchan;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Do not let a masquerade cause a Local channel to be bridged to itself! */
|
|
|
|
|
if (!ast_check_hangup(newchan) && ((p->owner && p->owner->_bridge == p->chan) || (p->chan && p->chan->_bridge == p->owner))) {
|
|
|
|
@ -653,8 +656,9 @@ static int local_indicate(struct ast_channel *ast, int condition, const void *da
|
|
|
|
|
struct ast_frame f = { AST_FRAME_CONTROL, };
|
|
|
|
|
int isoutbound;
|
|
|
|
|
|
|
|
|
|
if (!p)
|
|
|
|
|
if (!p) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ao2_ref(p, 1); /* ref for local_queue_frame */
|
|
|
|
|
|
|
|
|
@ -1218,8 +1222,9 @@ static char *locals_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (a->argc != 3)
|
|
|
|
|
if (a->argc != 3) {
|
|
|
|
|
return CLI_SHOWUSAGE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ao2_container_count(locals) == 0) {
|
|
|
|
|
ast_cli(a->fd, "No local channels in use\n");
|
|
|
|
|