[asterisk-commits] russell: branch group/asterisk-cpp r168409 - /team/group/asterisk-cpp/main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Jan 10 19:24:34 CST 2009
Author: russell
Date: Sat Jan 10 19:24:34 2009
New Revision: 168409
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168409
Log:
Fix ast_frame constructor usage
Modified:
team/group/asterisk-cpp/main/channel.c
Modified: team/group/asterisk-cpp/main/channel.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/channel.c?view=diff&rev=168409&r1=168408&r2=168409
==============================================================================
--- team/group/asterisk-cpp/main/channel.c (original)
+++ team/group/asterisk-cpp/main/channel.c Sat Jan 10 19:24:34 2009
@@ -1022,8 +1022,8 @@
/*! \brief Queue a hangup frame for channel */
int ast_queue_hangup(struct ast_channel *chan)
{
- struct ast_frame f(AST_FRAME_CONTROL, AST_CONTROL_HANGUP);
- /* Yeah, let's not change a lock-critical value without locking */
+ struct ast_frame f = { AST_FRAME_CONTROL, };
+ f.subclass = AST_CONTROL_HANGUP;
if (!ast_channel_trylock(chan)) {
chan->_softhangup |= AST_SOFTHANGUP_DEV;
ast_channel_unlock(chan);
@@ -1034,7 +1034,9 @@
/*! \brief Queue a hangup frame for channel */
int ast_queue_hangup_with_cause(struct ast_channel *chan, int cause)
{
- struct ast_frame f(AST_FRAME_CONTROL, AST_CONTROL_HANGUP);
+ struct ast_frame f = { AST_FRAME_CONTROL, };
+
+ f.subclass = AST_CONTROL_HANGUP;
if (cause >= 0)
f.data.uint32 = cause;
@@ -1054,7 +1056,9 @@
/*! \brief Queue a control frame */
int ast_queue_control(struct ast_channel *chan, enum ast_control_frame_type control)
{
- struct ast_frame f(AST_FRAME_CONTROL, control);
+ struct ast_frame f = { AST_FRAME_CONTROL, };
+
+ f.subclass = control;
return ast_queue_frame(chan, &f);
}
@@ -1063,8 +1067,9 @@
int ast_queue_control_data(struct ast_channel *chan, enum ast_control_frame_type control,
const void *data, size_t datalen)
{
- struct ast_frame f(AST_FRAME_CONTROL, control);
-
+ struct ast_frame f = { AST_FRAME_CONTROL, };
+
+ f.subclass = control;
f.data.ptr = (void *) data;
f.datalen = datalen;
@@ -3098,8 +3103,9 @@
/* Send an empty audio frame to get things moving */
if (chan->_state != AST_STATE_UP) {
- struct ast_frame a(AST_FRAME_VOICE, chan->rawwriteformat);
+ struct ast_frame a = { AST_FRAME_VOICE, };
ast_debug(1, "Prodding channel '%s'\n", chan->name);
+ a.subclass = chan->rawwriteformat;
a.data.ptr = nothing + AST_FRIENDLY_OFFSET;
a.src = "ast_prod";
if (ast_write(chan, &a))
@@ -5064,7 +5070,12 @@
static int silence_generator_generate(struct ast_channel *chan, void *data, int len, int samples)
{
short buf[samples];
- struct ast_frame frame(AST_FRAME_VOICE, AST_FORMAT_SLINEAR, sizeof(buf), samples, (void *) buf);
+ struct ast_frame frame = { AST_FRAME_VOICE, };
+
+ frame.subclass = AST_FORMAT_SLINEAR;
+ frame.datalen = sizeof(buf);
+ frame.samples = samples;
+ frame.data.ptr = (void *) buf;
memset(buf, 0, sizeof(buf));
More information about the asterisk-commits
mailing list