aboutsummaryrefslogtreecommitdiffstats
path: root/main/channel.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-18 23:47:01 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-18 23:47:01 +0000
commitd9d1ed38227d0646eed979a8f12139ae517e5b5f (patch)
treeb5f0bd047d53611a89ec0394a3c4efec497c9365 /main/channel.c
parent8ed70c9fdef986fdc7ff63cc03df87aa1ade4cc1 (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: http://svn.digium.com/svn/asterisk/trunk@103799 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c27
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 {