diff options
author | Joshua Colp <jcolp@digium.com> | 2008-02-18 23:47:01 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2008-02-18 23:47:01 +0000 |
commit | e54da94808472d0a35b3bd51f07e2f102210b95e (patch) | |
tree | b5f0bd047d53611a89ec0394a3c4efec497c9365 /main/channel.c | |
parent | 6c3a7a3e516dee84fde9fe8dce2d827a50079574 (diff) |
Add a non-invasive API for application level manipulation of T38 on a channel. This uses control frames (so they can even pass across IAX2) to negotiate T38 and provided a way of getting the current status of T38 using queryoption. This should by no means cause any issues and if it does I will take responsibility for it.
(closes issue #11873)
Reported by: dimas
Patches:
v4-t38-api.patch uploaded by dimas (license 88)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/main/channel.c b/main/channel.c index bbfcfdd4a..197cf1e71 100644 --- a/main/channel.c +++ b/main/channel.c @@ -4481,23 +4481,28 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha /*! \brief Sets an option on a channel */ int ast_channel_setoption(struct ast_channel *chan, int option, void *data, int datalen, int block) { - int res; - - if (chan->tech->setoption) { - res = chan->tech->setoption(chan, option, data, datalen); - if (res < 0) - return res; - } else { + if (!chan->tech->setoption) { errno = ENOSYS; return -1; } - if (block) { - /* XXX Implement blocking -- just wait for our option frame reply, discarding - intermediate packets. XXX */ + + if (block) ast_log(LOG_ERROR, "XXX Blocking not implemented yet XXX\n"); + + return chan->tech->setoption(chan, option, data, datalen); +} + +int ast_channel_queryoption(struct ast_channel *chan, int option, void *data, int *datalen, int block) +{ + if (!chan->tech->queryoption) { + errno = ENOSYS; return -1; } - return 0; + + if (block) + ast_log(LOG_ERROR, "XXX Blocking not implemented yet XXX\n"); + + return chan->tech->queryoption(chan, option, data, datalen); } struct tonepair_def { |