diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-10 12:24:11 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-10 12:24:11 +0000 |
commit | 91ad35ce5445a2f9c958968672338869bd4ce8a5 (patch) | |
tree | 503e8c1d20f6c0594ff9ceebe29a789bcc3ebc4b /channel.c | |
parent | 8abb5a32f2e1226a24279c81b71cbd63456aad34 (diff) |
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: http://svn.digium.com/svn/asterisk/trunk@26417 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rw-r--r-- | channel.c | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -2098,6 +2098,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; ast_channel_lock(chan); @@ -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) || |