[asterisk-commits] mnicholson: branch 1.8 r280307 - in /branches/1.8: ./ channels/ main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jul 29 08:56:39 CDT 2010
Author: mnicholson
Date: Thu Jul 29 08:56:35 2010
New Revision: 280307
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=280307
Log:
Merged revisions 280306 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2
........
r280306 | mnicholson | 2010-07-29 08:45:11 -0500 (Thu, 29 Jul 2010) | 2 lines
Implement support for ast_channel_queryoption on local channels. Currently only AST_OPTION_T38_STATE is supported.
........
Additionally, pass AST_CONTROL_T38_PARAMETERS control frames through generic bridges. This change appears to have been unintentionally left out of rev 203699.
Modified:
branches/1.8/ (props changed)
branches/1.8/channels/chan_local.c
branches/1.8/main/channel.c
Propchange: branches/1.8/
------------------------------------------------------------------------------
--- branch-1.6.2-merged (original)
+++ branch-1.6.2-merged Thu Jul 29 08:56:35 2010
@@ -1,1 +1,1 @@
-/branches/1.6.2:1-279056,279207,279501,279561,279597,279609,279657,279784,279849,279946,280089,280160,280193,280229,280231
+/branches/1.6.2:1-279056,279207,279501,279561,279597,279609,279657,279784,279849,279946,280089,280160,280193,280229,280231,280306
Modified: branches/1.8/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_local.c?view=diff&rev=280307&r1=280306&r2=280307
==============================================================================
--- branches/1.8/channels/chan_local.c (original)
+++ branches/1.8/channels/chan_local.c Thu Jul 29 08:56:35 2010
@@ -94,6 +94,7 @@
static int local_sendtext(struct ast_channel *ast, const char *text);
static int local_devicestate(void *data);
static struct ast_channel *local_bridgedchannel(struct ast_channel *chan, struct ast_channel *bridge);
+static int local_queryoption(struct ast_channel *ast, int option, void *data, int *datalen);
/* PBX interface structure for channel registration */
static const struct ast_channel_tech local_tech = {
@@ -116,6 +117,7 @@
.send_text = local_sendtext,
.devicestate = local_devicestate,
.bridged_channel = local_bridgedchannel,
+ .queryoption = local_queryoption,
};
/*! \brief the local pvt structure for all channels
@@ -226,6 +228,58 @@
ast_mutex_unlock(&p->lock);
return bridged;
+}
+
+static int local_queryoption(struct ast_channel *ast, int option, void *data, int *datalen)
+{
+ struct local_pvt *p = ast->tech_pvt;
+ struct ast_channel *chan, *bridged;
+ int res;
+
+ if (!p) {
+ return -1;
+ }
+
+ if (option != AST_OPTION_T38_STATE) {
+ /* AST_OPTION_T38_STATE is the only supported option at this time */
+ return -1;
+ }
+
+ ast_mutex_lock(&p->lock);
+ chan = IS_OUTBOUND(ast, p) ? p->owner : p->chan;
+
+try_again:
+ if (!chan) {
+ ast_mutex_unlock(&p->lock);
+ return -1;
+ }
+
+ if (ast_channel_trylock(chan)) {
+ DEADLOCK_AVOIDANCE(&p->lock);
+ chan = IS_OUTBOUND(ast, p) ? p->owner : p->chan;
+ goto try_again;
+ }
+
+ bridged = ast_bridged_channel(chan);
+ if (!bridged) {
+ /* can't query channel unless we are bridged */
+ ast_mutex_unlock(&p->lock);
+ ast_channel_unlock(chan);
+ return -1;
+ }
+
+ if (ast_channel_trylock(bridged)) {
+ ast_channel_unlock(chan);
+ DEADLOCK_AVOIDANCE(&p->lock);
+ chan = IS_OUTBOUND(ast, p) ? p->owner : p->chan;
+ goto try_again;
+ }
+
+ res = ast_channel_queryoption(bridged, option, data, datalen, 0);
+ ast_mutex_unlock(&p->lock);
+ ast_channel_unlock(chan);
+ ast_channel_unlock(bridged);
+ return res;
}
static int local_queue_frame(struct local_pvt *p, int isoutbound, struct ast_frame *f,
Modified: branches/1.8/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/channel.c?view=diff&rev=280307&r1=280306&r2=280307
==============================================================================
--- branches/1.8/main/channel.c (original)
+++ branches/1.8/main/channel.c Thu Jul 29 08:56:35 2010
@@ -6470,6 +6470,7 @@
case AST_CONTROL_VIDUPDATE:
case AST_CONTROL_SRCUPDATE:
case AST_CONTROL_SRCCHANGE:
+ case AST_CONTROL_T38_PARAMETERS:
ast_indicate_data(other, f->subclass.integer, f->data.ptr, f->datalen);
if (jb_in_use) {
ast_jb_empty_and_reset(c0, c1);
More information about the asterisk-commits
mailing list