From bd5352e51f686f95ac55e69036bee97e87cf5bf2 Mon Sep 17 00:00:00 2001 From: russell Date: Tue, 31 Jan 2006 17:57:12 +0000 Subject: [PATCH] remove some more local declarations of null frames git-svn-id: http://svn.digium.com/svn/asterisk/trunk@9004 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_iax2.c | 3 +-- channels/chan_local.c | 4 +--- channels/chan_sip.c | 11 ++++------- channels/chan_zap.c | 3 +-- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 69b235b27..ee167be5c 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -3103,9 +3103,8 @@ static int iax2_setoption(struct ast_channel *c, int option, void *data, int dat static struct ast_frame *iax2_read(struct ast_channel *c) { - static struct ast_frame f = { AST_FRAME_NULL, }; ast_log(LOG_NOTICE, "I should never be called!\n"); - return &f; + return &ast_null_frame; } static int iax2_start_transfer(unsigned short callno0, unsigned short callno1) diff --git a/channels/chan_local.c b/channels/chan_local.c index 98103d4cd..bc082a29a 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -224,9 +224,7 @@ static void check_bridge(struct local_pvt *p, int isoutbound) static struct ast_frame *local_read(struct ast_channel *ast) { - static struct ast_frame null = { AST_FRAME_NULL, }; - - return &null; + return &ast_null_frame; } static int local_write(struct ast_channel *ast, struct ast_frame *f) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 3a1b36b1d..7749919ac 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3758,12 +3758,11 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) 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, }; if (sin.sin_addr.s_addr && !sendonly) { ast_moh_stop(bridgepeer); /* Activate a re-invite */ - ast_queue_frame(p->owner, &af); + ast_queue_frame(p->owner, &ast_null_frame); } else { /* No address for RTP, we're on hold */ @@ -3771,7 +3770,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) if (sendonly) ast_rtp_stop(p->rtp); /* Activate a re-invite */ - ast_queue_frame(p->owner, &af); + ast_queue_frame(p->owner, &ast_null_frame); } } @@ -9618,8 +9617,7 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru #endif ast_queue_control(p->owner, AST_CONTROL_ANSWER); } else { /* RE-invite */ - struct ast_frame af = { AST_FRAME_NULL, }; - ast_queue_frame(p->owner, &af); + ast_queue_frame(p->owner, &ast_null_frame); } } else { /* It's possible we're getting an ACK after we've tried to disconnect @@ -10353,7 +10351,6 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int int res = 1; struct ast_channel *c=NULL; int gotdest; - struct ast_frame af = { AST_FRAME_NULL, }; char *supported; char *required; unsigned int required_profile = 0; @@ -10445,7 +10442,7 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int /* Queue NULL frame to prod ast_rtp_bridge if appropriate */ if (p->owner) - ast_queue_frame(p->owner, &af); + ast_queue_frame(p->owner, &ast_null_frame); /* Initialize the context if it hasn't been already */ if (ast_strlen_zero(p->context)) diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 90f0801a7..fc44bd4f6 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -808,7 +808,6 @@ static void wakeup_sub(struct zt_pvt *p, int a, struct zt_pri *pri) static void wakeup_sub(struct zt_pvt *p, int a, void *pri) #endif { - struct ast_frame null = { AST_FRAME_NULL, }; #ifdef ZAPATA_PRI if (pri) ast_mutex_unlock(&pri->lock); @@ -820,7 +819,7 @@ static void wakeup_sub(struct zt_pvt *p, int a, void *pri) usleep(1); ast_mutex_lock(&p->lock); } else { - ast_queue_frame(p->subs[a].owner, &null); + ast_queue_frame(p->subs[a].owner, &ast_null_frame); ast_mutex_unlock(&p->subs[a].owner->lock); break; }