Index: channel.c =================================================================== --- channel.c (revision 12476) +++ channel.c (working copy) @@ -277,7 +277,7 @@ void ast_channel_setwhentohangup(struct ast_channel *chan, time_t offset) { time_t myt; - struct ast_frame fr = { AST_FRAME_NULL, }; + struct ast_frame fr = AST_FRAME_NULL_INITIALIZER; time(&myt); if (offset) @@ -1101,7 +1101,7 @@ int ast_softhangup_nolock(struct ast_channel *chan, int cause) { int res = 0; - struct ast_frame f = { AST_FRAME_NULL }; + struct ast_frame f = AST_FRAME_NULL_INITIALIZER; if (option_debug) ast_log(LOG_DEBUG, "Soft-Hanging up channel '%s'\n", chan->name); /* Inform channel driver that we need to be hung up, if it cares */ @@ -1791,10 +1791,8 @@ void *data; int res; #endif - static struct ast_frame null_frame = { - AST_FRAME_NULL, - }; - + static struct ast_frame null_frame = AST_FRAME_NULL_INITIALIZER; + ast_mutex_lock(&chan->lock); if (chan->masq) { if (ast_do_masquerade(chan)) { @@ -2738,7 +2736,7 @@ int ast_channel_masquerade(struct ast_channel *original, struct ast_channel *clone) { - struct ast_frame null = { AST_FRAME_NULL, }; + struct ast_frame null = AST_FRAME_NULL_INITIALIZER; int res = -1; if (original == clone) { @@ -3080,7 +3078,7 @@ ); ast_channel_free(clone); } else { - struct ast_frame null_frame = { AST_FRAME_NULL, }; + struct ast_frame null_frame = AST_FRAME_NULL_INITIALIZER; ast_log(LOG_DEBUG, "Released clone lock on '%s'\n", clone->name); ast_set_flag(clone, AST_FLAG_ZOMBIE); ast_queue_frame(clone, &null_frame); Index: channels/chan_features.c =================================================================== --- channels/chan_features.c (revision 12476) +++ channels/chan_features.c (working copy) @@ -145,7 +145,7 @@ #if 0 static void wakeup_sub(struct feature_pvt *p, int a) { - struct ast_frame null = { AST_FRAME_NULL, }; + struct ast_frame null = AST_FRAME_NULL_INITIALIZER; for (;;) { if (p->subs[a].owner) { if (ast_mutex_trylock(&p->subs[a].owner->lock)) { @@ -240,7 +240,7 @@ static struct ast_frame *features_read(struct ast_channel *ast) { - static struct ast_frame null_frame = { AST_FRAME_NULL, }; + static struct ast_frame null_frame = AST_FRAME_NULL_INITIALIZER; struct feature_pvt *p = ast->tech_pvt; struct ast_frame *f; int x; Index: channels/chan_h323.c =================================================================== --- channels/chan_h323.c (revision 12476) +++ channels/chan_h323.c (working copy) @@ -541,7 +541,7 @@ { /* Retrieve audio/etc from channel. Assumes pvt->lock is already held. */ struct ast_frame *f; - static struct ast_frame null_frame = { AST_FRAME_NULL, }; + static struct ast_frame null_frame = AST_FRAME_NULL_INITIALIZER; /* Only apply it for the first packet, we just need the correct ip/port */ if (pvt->options.nat) { Index: channels/chan_zap.c =================================================================== --- channels/chan_zap.c (revision 12476) +++ channels/chan_zap.c (working copy) @@ -802,7 +802,7 @@ static void wakeup_sub(struct zt_pvt *p, int a, void *pri) #endif { - struct ast_frame null = { AST_FRAME_NULL, }; + struct ast_frame null = AST_FRAME_NULL_INITIALIZER; #ifdef ZAPATA_PRI if (pri) ast_mutex_unlock(&pri->lock); Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 12476) +++ channels/chan_sip.c (working copy) @@ -2936,7 +2936,7 @@ { /* Retrieve audio/etc from channel. Assumes p->lock is already held. */ struct ast_frame *f; - static struct ast_frame null_frame = { AST_FRAME_NULL, }; + static struct ast_frame null_frame = AST_FRAME_NULL_INITIALIZER; if (!p->rtp) { /* We have no RTP allocated for this channel */ @@ -3613,7 +3613,7 @@ if ((bridgepeer=ast_bridged_channel(p->owner))) { /* We have a bridge */ /* Turn on/off music on hold if we are holding/unholding */ - struct ast_frame af = { AST_FRAME_NULL, }; + struct ast_frame af = AST_FRAME_NULL_INITIALIZER; if (sin.sin_addr.s_addr && !sendonly) { ast_moh_stop(bridgepeer); @@ -9498,7 +9498,7 @@ #endif ast_queue_control(p->owner, AST_CONTROL_ANSWER); } else { /* RE-invite */ - struct ast_frame af = { AST_FRAME_NULL, }; + struct ast_frame af = AST_FRAME_NULL_INITIALIZER; ast_queue_frame(p->owner, &af); } } else { @@ -10236,7 +10236,7 @@ int res = 1; struct ast_channel *c=NULL; int gotdest; - struct ast_frame af = { AST_FRAME_NULL, }; + struct ast_frame af = AST_FRAME_NULL_INITIALIZER; char *supported; char *required; unsigned int required_profile = 0; Index: channels/chan_agent.c =================================================================== --- channels/chan_agent.c (revision 12476) +++ channels/chan_agent.c (working copy) @@ -464,7 +464,7 @@ { struct agent_pvt *p = ast->tech_pvt; struct ast_frame *f = NULL; - static struct ast_frame null_frame = { AST_FRAME_NULL, }; + static struct ast_frame null_frame = AST_FRAME_NULL_INITIALIZER; static struct ast_frame answer_frame = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER }; ast_mutex_lock(&p->lock); CHECK_FORMATS(ast, p); @@ -932,7 +932,7 @@ static struct ast_channel *agent_new(struct agent_pvt *p, int state) { struct ast_channel *tmp; - struct ast_frame null_frame = { AST_FRAME_NULL }; + struct ast_frame null_frame = AST_FRAME_NULL_INITIALIZER; #if 0 if (!p->chan) { ast_log(LOG_WARNING, "No channel? :(\n"); Index: channels/chan_iax2.c =================================================================== --- channels/chan_iax2.c (revision 12476) +++ channels/chan_iax2.c (working copy) @@ -3115,7 +3115,7 @@ static struct ast_frame *iax2_read(struct ast_channel *c) { - static struct ast_frame f = { AST_FRAME_NULL, }; + static struct ast_frame f = AST_FRAME_NULL_INITIALIZER; ast_log(LOG_NOTICE, "I should never be called!\n"); return &f; } @@ -6281,7 +6281,7 @@ struct iax_frame fr; struct iax_frame *cur; char iabuf[INET_ADDRSTRLEN]; - struct ast_frame f; + struct ast_frame f = AST_FRAME_NULL_INITIALIZER; struct ast_channel *c; struct iax2_dpcache *dp; struct iax2_peer *peer; Index: channels/chan_mgcp.c =================================================================== --- channels/chan_mgcp.c (revision 12476) +++ channels/chan_mgcp.c (working copy) @@ -1213,7 +1213,7 @@ { /* Retrieve audio/etc from channel. Assumes sub->lock is already held. */ struct ast_frame *f; - static struct ast_frame null_frame = { AST_FRAME_NULL, }; + static struct ast_frame null_frame = AST_FRAME_NULL_INITIALIZER; f = ast_rtp_read(sub->rtp); /* Don't send RFC2833 if we're not supposed to */ Index: channels/chan_vpb.c =================================================================== --- channels/chan_vpb.c (revision 12476) +++ channels/chan_vpb.c (working copy) @@ -2176,7 +2176,7 @@ static struct ast_frame *vpb_read(struct ast_channel *ast) { struct vpb_pvt *p = (struct vpb_pvt *)ast->tech_pvt; - static struct ast_frame f = {AST_FRAME_NULL}; + static struct ast_frame f = AST_FRAME_NULL_INITIALIZER; f.src = (char *)type; ast_log(LOG_NOTICE, "%s: vpb_read: should never be called!\n", p->dev); Index: channels/chan_local.c =================================================================== --- channels/chan_local.c (revision 12476) +++ channels/chan_local.c (working copy) @@ -222,7 +222,7 @@ static struct ast_frame *local_read(struct ast_channel *ast) { - static struct ast_frame null = { AST_FRAME_NULL, }; + static struct ast_frame null = AST_FRAME_NULL_INITIALIZER; return &null; } Index: include/asterisk/frame.h =================================================================== --- include/asterisk/frame.h (revision 12476) +++ include/asterisk/frame.h (working copy) @@ -283,6 +283,8 @@ */ #define AST_OPTION_RXGAIN 6 +#define AST_FRAME_NULL_INITIALIZER { AST_FRAME_NULL, 0, 0, 0, 0, 0, NULL, NULL, { 0, 0 }, NULL, NULL } + struct ast_option_header { /* Always keep in network byte order */ #if __BYTE_ORDER == __BIG_ENDIAN Index: rtp.c =================================================================== --- rtp.c (revision 12476) +++ rtp.c (working copy) @@ -178,7 +178,7 @@ static struct ast_frame *send_dtmf(struct ast_rtp *rtp) { - static struct ast_frame null_frame = { AST_FRAME_NULL, }; + static struct ast_frame null_frame = AST_FRAME_NULL_INITIALIZER; char iabuf[INET_ADDRSTRLEN]; if (ast_tvcmp(ast_tvnow(), rtp->dtmfmute) < 0) { @@ -368,7 +368,7 @@ struct ast_frame *ast_rtcp_read(struct ast_rtp *rtp) { - static struct ast_frame null_frame = { AST_FRAME_NULL, }; + static struct ast_frame null_frame = AST_FRAME_NULL_INITIALIZER; socklen_t len; int hdrlen = 8; int res; @@ -438,7 +438,7 @@ char iabuf[INET_ADDRSTRLEN]; unsigned int timestamp; unsigned int *rtpheader; - static struct ast_frame *f, null_frame = { AST_FRAME_NULL, }; + static struct ast_frame *f, null_frame = AST_FRAME_NULL_INITIALIZER; struct rtpPayloadType rtpPT; len = sizeof(sin);