ensure that control frames with payload can be sent to channel drivers via ->indicate()

update iax2_indicate to pass control frame payload to the connected channel
add an API call for sending an indication with payload, and use it for control frames with payload


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@26417 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2006-05-10 12:24:11 +00:00
parent 1904069f71
commit fdcfd6469b
15 changed files with 55 additions and 35 deletions

View File

@@ -2097,6 +2097,11 @@ struct ast_frame *ast_read_noaudio(struct ast_channel *chan)
}
int ast_indicate(struct ast_channel *chan, int condition)
{
return ast_indicate_data(chan, condition, NULL, 0);
}
int ast_indicate_data(struct ast_channel *chan, int condition, const void *data, size_t datalen)
{
int res = -1;
@@ -2107,7 +2112,7 @@ int ast_indicate(struct ast_channel *chan, int condition)
return -1;
}
if (chan->tech->indicate)
res = chan->tech->indicate(chan, condition);
res = chan->tech->indicate(chan, condition, data, datalen);
ast_channel_unlock(chan);
if (!chan->tech->indicate || res) {
/*
@@ -3334,16 +3339,21 @@ static enum ast_bridge_result ast_generic_bridge(struct ast_channel *c0, struct
other = (who == c0) ? c1 : c0; /* the 'other' channel */
if ((f->frametype == AST_FRAME_CONTROL) && !(config->flags & AST_BRIDGE_IGNORE_SIGS)) {
if ((f->subclass == AST_CONTROL_HOLD) || (f->subclass == AST_CONTROL_UNHOLD) ||
(f->subclass == AST_CONTROL_VIDUPDATE)) {
ast_indicate(other, f->subclass);
} else {
switch (f->subclass) {
case AST_CONTROL_HOLD:
case AST_CONTROL_UNHOLD:
case AST_CONTROL_VIDUPDATE:
ast_indicate_data(other, f->subclass, f->data, f->datalen);
break;
default:
*fo = f;
*rc = who;
res = AST_BRIDGE_COMPLETE;
ast_log(LOG_DEBUG, "Got a FRAME_CONTROL (%d) frame on channel %s\n", f->subclass, who->name);
break;
}
if (res == AST_BRIDGE_COMPLETE)
break;
}
if ((f->frametype == AST_FRAME_VOICE) ||
(f->frametype == AST_FRAME_DTMF) ||