remove some more local declarations of null frames
authorRussell Bryant <russell@russellbryant.com>
Tue, 31 Jan 2006 17:57:12 +0000 (17:57 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 31 Jan 2006 17:57:12 +0000 (17:57 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9004 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c
channels/chan_local.c
channels/chan_sip.c
channels/chan_zap.c

index 69b235b..ee167be 100644 (file)
@@ -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)
index 98103d4..bc082a2 100644 (file)
@@ -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)
index 3a1b36b..7749919 100644 (file)
@@ -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))
index 90f0801..fc44bd4 100644 (file)
@@ -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;
                        }