[svn-commits] branch kpfleming/vldtmf r9011 - in /team/kpfleming/vldtmf: ./ apps/ channels/...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Jan 31 11:29:47 MST 2006


Author: kpfleming
Date: Tue Jan 31 12:29:45 2006
New Revision: 9011

URL: http://svn.digium.com/view/asterisk?rev=9011&view=rev
Log:
fix up merge conflicts, re-enable automerge

Modified:
    team/kpfleming/vldtmf/   (props changed)
    team/kpfleming/vldtmf/apps/app_meetme.c
    team/kpfleming/vldtmf/channel.c
    team/kpfleming/vldtmf/channels/chan_agent.c
    team/kpfleming/vldtmf/channels/chan_features.c
    team/kpfleming/vldtmf/channels/chan_h323.c
    team/kpfleming/vldtmf/channels/chan_iax2.c
    team/kpfleming/vldtmf/channels/chan_local.c
    team/kpfleming/vldtmf/channels/chan_mgcp.c
    team/kpfleming/vldtmf/channels/chan_sip.c
    team/kpfleming/vldtmf/channels/chan_zap.c
    team/kpfleming/vldtmf/frame.c
    team/kpfleming/vldtmf/include/asterisk/frame.h
    team/kpfleming/vldtmf/rtp.c
    team/kpfleming/vldtmf/udptl.c

Propchange: team/kpfleming/vldtmf/
------------------------------------------------------------------------------
    automerge = 1

Propchange: team/kpfleming/vldtmf/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jan 31 12:29:45 2006
@@ -1,1 +1,1 @@
-/trunk:1-8997
+/trunk:1-9010

Modified: team/kpfleming/vldtmf/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/apps/app_meetme.c?rev=9011&r1=9010&r2=9011&view=diff
==============================================================================
--- team/kpfleming/vldtmf/apps/app_meetme.c (original)
+++ team/kpfleming/vldtmf/apps/app_meetme.c Tue Jan 31 12:29:45 2006
@@ -206,7 +206,6 @@
 };
 
 static int admin_exec(struct ast_channel *chan, void *data);
-static struct ast_frame null_frame = { AST_FRAME_NULL, };
 
 static void *recordthread(void *args);
 
@@ -1574,7 +1573,7 @@
 								if (conf->transpath[index]) {
 									conf->transframe[index] = ast_translate(conf->transpath[index], conf->origframe, 0);
 									if (!conf->transframe[index])
-										conf->transframe[index] = &null_frame;
+										conf->transframe[index] = &ast_null_frame;
 								}
 							}
 						}

Modified: team/kpfleming/vldtmf/channel.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/channel.c?rev=9011&r1=9010&r2=9011&view=diff
==============================================================================
--- team/kpfleming/vldtmf/channel.c (original)
+++ team/kpfleming/vldtmf/channel.c Tue Jan 31 12:29:45 2006
@@ -1745,17 +1745,13 @@
 	void *data;
 	int res;
 #endif
-	static struct ast_frame null_frame = {
-		AST_FRAME_NULL,
-	};
-	
 	ast_mutex_lock(&chan->lock);
 	if (chan->masq) {
 		if (ast_do_masquerade(chan)) {
 			ast_log(LOG_WARNING, "Failed to perform masquerade\n");
 			f = NULL;
 		} else
-			f =  &null_frame;
+			f =  &ast_null_frame;
 		ast_mutex_unlock(&chan->lock);
 		return f;
 	}
@@ -1821,8 +1817,7 @@
 				chan->timingdata = NULL;
 				ast_mutex_unlock(&chan->lock);
 			}
-			f =  &null_frame;
-			return f;
+			return &ast_null_frame;
 		} else
 			ast_log(LOG_NOTICE, "No/unknown event '%d' on timer for '%s'?\n", blah, chan->name);
 	} else
@@ -1834,8 +1829,7 @@
 		chan->generatordata = NULL;     /* reset to let ast_write get through */
 		chan->generator->generate(chan, tmp, -1, -1);
 		chan->generatordata = tmp;
-		f = &null_frame;
-		return f;
+		return &ast_null_frame;
 	}
 
 	/* Check for pending read queue */
@@ -1853,7 +1847,7 @@
 				f = chan->tech->exception(chan);
 			else {
 				ast_log(LOG_WARNING, "Exception flag set on '%s', but no exception handler\n", chan->name);
-				f = &null_frame;
+				f = &ast_null_frame;
 			}
 			/* Clear the exception flag */
 			ast_clear_flag(chan, AST_FLAG_EXCEPTION);
@@ -1881,7 +1875,7 @@
 			if (f->subclass == AST_CONTROL_ANSWER) {
 				if (prestate == AST_STATE_UP) {
 					ast_log(LOG_DEBUG, "Dropping duplicate answer!\n");
-					f = &null_frame;
+					f = &ast_null_frame;
 				}
 				/* Answer the CDR */
 				ast_setstate(chan, AST_STATE_UP);
@@ -1891,7 +1885,7 @@
 		case AST_FRAME_DTMF_BEGIN:
 			if (ast_test_flag(chan, AST_FLAG_DEFER_DTMF)) {
 				AST_LIST_INSERT_TAIL(&chan->dtmfq, ast_frdup(f), next);
-				f = &null_frame;
+				f = &ast_null_frame;
 			} else {
 				ast_log(LOG_DTMF, "DTMF begin '%c' received on %s\n", f->subclass, chan->name);
 			}
@@ -1899,9 +1893,9 @@
 		case AST_FRAME_DTMF_END: {
 			struct ast_frame *dtmf;
 
-			if (!(dtmf = ast_frdup(&null_frame))) {
+			if (!(dtmf = ast_frdup(&ast_null_frame))) {
 				ast_log(LOG_WARNING, "Unable to allocate frame!\n");
-				f = &null_frame;
+				f = &ast_null_frame;
 				break;
 			}
 
@@ -1911,7 +1905,7 @@
 			if (ast_test_flag(chan, AST_FLAG_DEFER_DTMF)) {
 				AST_LIST_INSERT_TAIL(&chan->dtmfq, dtmf, next);
 				AST_LIST_INSERT_TAIL(&chan->dtmfq, ast_frdup(f), next);
-				f = &null_frame;
+				f = &ast_null_frame;
 				break;
 			}
 
@@ -1923,7 +1917,7 @@
 		case AST_FRAME_DTMF:
 			if (ast_test_flag(chan, AST_FLAG_DEFER_DTMF)) {
 				AST_LIST_INSERT_TAIL(&chan->dtmfq, ast_frdup(f), next);
-				f = &null_frame;
+				f = &ast_null_frame;
 			} else {
 				ast_log(LOG_DTMF, "DTMF '%c' received on %s\n", f->subclass, chan->name);
 			}
@@ -1931,14 +1925,14 @@
 		case AST_FRAME_VOICE:
 			if (dropaudio) {
 				ast_frfree(f);
-				f = &null_frame;
+				f = &ast_null_frame;
 			} else if (!(f->subclass & chan->nativeformats)) {
 				/* This frame can't be from the current native formats -- drop it on the
 				   floor */
 				ast_log(LOG_NOTICE, "Dropping incompatible voice frame on %s of format %s since our native format has changed to %s\n",
 					chan->name, ast_getformatname(f->subclass), ast_getformatname(chan->nativeformats));
 				ast_frfree(f);
-				f = &null_frame;
+				f = &ast_null_frame;
 			} else {
 				if (chan->spies)
 					queue_frame_to_spies(chan, f, SPY_READ);
@@ -1969,7 +1963,7 @@
 
 				if (chan->readtrans) {
 					if (!(f = ast_translate(chan->readtrans, f, 1)))
-						f = &null_frame;
+						f = &ast_null_frame;
 				}
 
 				/* Run any generator sitting on the channel */
@@ -3131,10 +3125,9 @@
 			);
 		ast_channel_free(clone);
 	} else {
-		struct ast_frame null_frame = { AST_FRAME_NULL, };
 		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);
+		ast_queue_frame(clone, &ast_null_frame);
 		ast_mutex_unlock(&clone->lock);
 	}
 	

Modified: team/kpfleming/vldtmf/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/channels/chan_agent.c?rev=9011&r1=9010&r2=9011&view=diff
==============================================================================
--- team/kpfleming/vldtmf/channels/chan_agent.c (original)
+++ team/kpfleming/vldtmf/channels/chan_agent.c Tue Jan 31 12:29:45 2006
@@ -438,7 +438,6 @@
 {
 	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 answer_frame = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER };
 	const char *status;
 	ast_mutex_lock(&p->lock); 
@@ -448,7 +447,7 @@
 		p->chan->fdno = (ast->fdno == AST_AGENT_FD) ? AST_TIMING_FD : ast->fdno;
 		f = ast_read(p->chan);
 	} else
-		f = &null_frame;
+		f = &ast_null_frame;
 	if (!f) {
 		/* If there's a channel, hang it up (if it's on a callback) make it NULL */
 		if (p->chan) {
@@ -486,7 +485,7 @@
  						ast_verbose(VERBOSE_PREFIX_3 "%s answered, waiting for '#' to acknowledge\n", p->chan->name);
  					/* Don't pass answer along */
  					ast_frfree(f);
- 					f = &null_frame;
+ 					f = &ast_null_frame;
  				} else {
  					p->acknowledged = 1;
  					/* Use the builtin answer frame for the 
@@ -513,7 +512,7 @@
  			/* don't pass voice until the call is acknowledged */
  			if (!p->acknowledged) {
  				ast_frfree(f);
- 				f = &null_frame;
+ 				f = &ast_null_frame;
  			}
  			break;
   		}
@@ -899,7 +898,6 @@
 static struct ast_channel *agent_new(struct agent_pvt *p, int state)
 {
 	struct ast_channel *tmp;
-	struct ast_frame null_frame = { AST_FRAME_NULL };
 #if 0
 	if (!p->chan) {
 		ast_log(LOG_WARNING, "No channel? :(\n");
@@ -950,7 +948,7 @@
 		if( ast_mutex_trylock(&p->app_lock) )
 		{
 			if (p->chan) {
-				ast_queue_frame(p->chan, &null_frame);
+				ast_queue_frame(p->chan, &ast_null_frame);
 				ast_mutex_unlock(&p->lock);	/* For other thread to read the condition. */
 				ast_mutex_lock(&p->app_lock);
 				ast_mutex_lock(&p->lock);

Modified: team/kpfleming/vldtmf/channels/chan_features.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/channels/chan_features.c?rev=9011&r1=9010&r2=9011&view=diff
==============================================================================
--- team/kpfleming/vldtmf/channels/chan_features.c (original)
+++ team/kpfleming/vldtmf/channels/chan_features.c Tue Jan 31 12:29:45 2006
@@ -241,12 +241,11 @@
 
 static struct ast_frame  *features_read(struct ast_channel *ast)
 {
-	static struct ast_frame null_frame = { AST_FRAME_NULL, };
 	struct feature_pvt *p = ast->tech_pvt;
 	struct ast_frame *f;
 	int x;
 	
-	f = &null_frame;
+	f = &ast_null_frame;
 	ast_mutex_lock(&p->lock);
 	x = indexof(p, ast, 0);
 	if (!x && p->subchan) {

Modified: team/kpfleming/vldtmf/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/channels/chan_h323.c?rev=9011&r1=9010&r2=9011&view=diff
==============================================================================
--- team/kpfleming/vldtmf/channels/chan_h323.c (original)
+++ team/kpfleming/vldtmf/channels/chan_h323.c Tue Jan 31 12:29:45 2006
@@ -543,7 +543,6 @@
 {
 	/* Retrieve audio/etc from channel.  Assumes pvt->lock is already held. */
 	struct ast_frame *f;
-	static struct ast_frame null_frame = { AST_FRAME_NULL, };
 
 	/* Only apply it for the first packet, we just need the correct ip/port */
 	if (pvt->options.nat) {
@@ -554,7 +553,7 @@
 	f = ast_rtp_read(pvt->rtp);
 	/* Don't send RFC2833 if we're not supposed to */
 	if (f && (f->frametype == AST_FRAME_DTMF) && !(pvt->options.dtmfmode & H323_DTMF_RFC2833)) {
-		return &null_frame;
+		return &ast_null_frame;
 	}
 	if (pvt->owner) {
 		/* We already hold the channel lock */
@@ -563,7 +562,7 @@
 				/* Try to avoid deadlock */
 				if (ast_mutex_trylock(&pvt->owner->lock)) {
 					ast_log(LOG_NOTICE, "Format changed but channel is locked. Ignoring frame...\n");
-					return &null_frame;
+					return &ast_null_frame;
 				}
 				ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
 				pvt->owner->nativeformats = f->subclass;

Modified: team/kpfleming/vldtmf/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/channels/chan_iax2.c?rev=9011&r1=9010&r2=9011&view=diff
==============================================================================
--- team/kpfleming/vldtmf/channels/chan_iax2.c (original)
+++ team/kpfleming/vldtmf/channels/chan_iax2.c Tue Jan 31 12:29:45 2006
@@ -3103,9 +3103,8 @@
 
 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)

Modified: team/kpfleming/vldtmf/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/channels/chan_local.c?rev=9011&r1=9010&r2=9011&view=diff
==============================================================================
--- team/kpfleming/vldtmf/channels/chan_local.c (original)
+++ team/kpfleming/vldtmf/channels/chan_local.c Tue Jan 31 12:29:45 2006
@@ -226,9 +226,7 @@
 
 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)

Modified: team/kpfleming/vldtmf/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/channels/chan_mgcp.c?rev=9011&r1=9010&r2=9011&view=diff
==============================================================================
--- team/kpfleming/vldtmf/channels/chan_mgcp.c (original)
+++ team/kpfleming/vldtmf/channels/chan_mgcp.c Tue Jan 31 12:29:45 2006
@@ -1219,12 +1219,11 @@
 {
 	/* Retrieve audio/etc from channel.  Assumes sub->lock is already held. */
 	struct ast_frame *f;
-	static struct ast_frame null_frame = { AST_FRAME_NULL, };
 
 	f = ast_rtp_read(sub->rtp);
 	/* Don't send RFC2833 if we're not supposed to */
 	if (f && (f->frametype == AST_FRAME_DTMF) && !(sub->parent->dtmfmode & MGCP_DTMF_RFC2833))
-		return &null_frame;
+		return &ast_null_frame;
 	if (sub->owner) {
 		/* We already hold the channel lock */
 		if (f->frametype == AST_FRAME_VOICE) {

Modified: team/kpfleming/vldtmf/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/channels/chan_sip.c?rev=9011&r1=9010&r2=9011&view=diff
==============================================================================
--- team/kpfleming/vldtmf/channels/chan_sip.c (original)
+++ team/kpfleming/vldtmf/channels/chan_sip.c Tue Jan 31 12:29:45 2006
@@ -3051,11 +3051,10 @@
 {
 	/* Retrieve audio/etc from channel.  Assumes p->lock is already held. */
 	struct ast_frame *f;
-	static struct ast_frame null_frame = { AST_FRAME_NULL, };
 	
 	if (!p->rtp) {
 		/* We have no RTP allocated for this channel */
-		return &null_frame;
+		return &ast_null_frame;
 	}
 
 	switch(ast->fdno) {
@@ -3072,11 +3071,11 @@
 		f = ast_rtcp_read(p->vrtp);	/* RTCP Control Channel for video */
 		break;
 	default:
-		f = &null_frame;
+		f = &ast_null_frame;
 	}
 	/* Don't forward RFC2833 if we're not supposed to */
 	if (f && (f->frametype == AST_FRAME_DTMF) && (ast_test_flag(p, SIP_DTMF) != SIP_DTMF_RFC2833))
-		return &null_frame;
+		return &ast_null_frame;
 
 	if (p->owner) {
 		/* We already hold the channel lock */
@@ -3759,12 +3758,11 @@
 	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 */
 			
@@ -3772,7 +3770,7 @@
 			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);
 		}
 	}
 
@@ -9619,8 +9617,7 @@
 #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
@@ -10354,7 +10351,6 @@
 	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;
@@ -10446,7 +10442,7 @@
 
 		/* 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))

Modified: team/kpfleming/vldtmf/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/channels/chan_zap.c?rev=9011&r1=9010&r2=9011&view=diff
==============================================================================
--- team/kpfleming/vldtmf/channels/chan_zap.c (original)
+++ team/kpfleming/vldtmf/channels/chan_zap.c Tue Jan 31 12:29:45 2006
@@ -808,7 +808,6 @@
 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 @@
 				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;
 			}

Modified: team/kpfleming/vldtmf/frame.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/frame.c?rev=9011&r1=9010&r2=9011&view=diff
==============================================================================
--- team/kpfleming/vldtmf/frame.c (original)
+++ team/kpfleming/vldtmf/frame.c Tue Jan 31 12:29:45 2006
@@ -56,13 +56,6 @@
 #define TYPE_DONTSEND	 0x3
 #define TYPE_MASK	 0x3
 
-struct ast_format_list {
-	int visible;	/*!< Can we see this entry */
-	int bits;	/*!< bitmask value */
-	char *name;	/*!< short name */
-	char *desc;	/*!< Description */
-};
-
 struct ast_smoother {
 	int size;
 	int format;
@@ -79,7 +72,12 @@
 };
 
 /*! \brief Definition of supported media formats (codecs) */
-static struct ast_format_list AST_FORMAT_LIST[] = {
+static struct ast_format_list {
+	int visible;	/*!< Can we see this entry */
+	int bits;	/*!< bitmask value */
+	char *name;	/*!< short name */
+	char *desc;	/*!< Description */
+} AST_FORMAT_LIST[] = {
 	{ 1, AST_FORMAT_G723_1 , "g723" , "G.723.1"},	/*!< codec_g723_1.c */
 	{ 1, AST_FORMAT_GSM, "gsm" , "GSM"},		/*!< codec_gsm.c */
 	{ 1, AST_FORMAT_ULAW, "ulaw", "G.711 u-law" },	/*!< codec_ulaw.c */
@@ -107,6 +105,8 @@
 	{ 0, 0, "nothing", "undefined" },
 	{ 0, AST_FORMAT_MAX_VIDEO, "maxvideo", "Maximum video format" },
 };
+
+struct ast_frame ast_null_frame = { AST_FRAME_NULL, };
 
 void ast_smoother_reset(struct ast_smoother *s, int size)
 {

Modified: team/kpfleming/vldtmf/include/asterisk/frame.h
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/include/asterisk/frame.h?rev=9011&r1=9010&r2=9011&view=diff
==============================================================================
--- team/kpfleming/vldtmf/include/asterisk/frame.h (original)
+++ team/kpfleming/vldtmf/include/asterisk/frame.h Tue Jan 31 12:29:45 2006
@@ -111,6 +111,10 @@
 };
 
 AST_LIST_HEAD_NOLOCK(ast_frame_list, ast_frame);
+
+/*! Queueing a null frame is fairly common, so we declare a global null frame object
+    for this purpose instead of having to declare one on the stack */
+extern struct ast_frame ast_null_frame;
 
 #define AST_FRIENDLY_OFFSET 	64	/*! It's polite for a a new frame to
 					  have this number of bytes for additional

Modified: team/kpfleming/vldtmf/rtp.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/rtp.c?rev=9011&r1=9010&r2=9011&view=diff
==============================================================================
--- team/kpfleming/vldtmf/rtp.c (original)
+++ team/kpfleming/vldtmf/rtp.c Tue Jan 31 12:29:45 2006
@@ -229,7 +229,6 @@
 
 static struct ast_frame *send_dtmf(struct ast_rtp *rtp)
 {
-	static struct ast_frame null_frame = { AST_FRAME_NULL, };
 	char iabuf[INET_ADDRSTRLEN];
 
 	if (ast_tvcmp(ast_tvnow(), rtp->dtmfmute) < 0) {
@@ -237,7 +236,7 @@
 			ast_log(LOG_DEBUG, "Ignore potential DTMF echo from '%s'\n", ast_inet_ntoa(iabuf, sizeof(iabuf), rtp->them.sin_addr));
 		rtp->resp = 0;
 		rtp->dtmfduration = 0;
-		return &null_frame;
+		return &ast_null_frame;
 	}
 	if (option_debug)
 		ast_log(LOG_DEBUG, "Sending dtmf: %d (%c), at %s\n", rtp->resp, rtp->resp, ast_inet_ntoa(iabuf, sizeof(iabuf), rtp->them.sin_addr));
@@ -424,7 +423,6 @@
 
 struct ast_frame *ast_rtcp_read(struct ast_rtp *rtp)
 {
-	static struct ast_frame null_frame = { AST_FRAME_NULL, };
 	socklen_t len;
 	int hdrlen = 8;
 	int res;
@@ -433,7 +431,7 @@
 	char iabuf[INET_ADDRSTRLEN];
 	
 	if (!rtp || !rtp->rtcp)
-		return &null_frame;
+		return &ast_null_frame;
 
 	len = sizeof(sin);
 	
@@ -445,12 +443,12 @@
 			ast_log(LOG_WARNING, "RTP Read error: %s\n", strerror(errno));
 		if (errno == EBADF)
 			CRASH;
-		return &null_frame;
+		return &ast_null_frame;
 	}
 
 	if (res < hdrlen) {
 		ast_log(LOG_WARNING, "RTP Read too short\n");
-		return &null_frame;
+		return &ast_null_frame;
 	}
 
 	if (rtp->nat) {
@@ -464,7 +462,7 @@
 	}
 	if (option_debug)
 		ast_log(LOG_DEBUG, "Got RTCP report of %d bytes\n", res);
-	return &null_frame;
+	return &ast_null_frame;
 }
 
 static void calc_rxstamp(struct timeval *tv, struct ast_rtp *rtp, unsigned int timestamp, int mark)
@@ -488,7 +486,7 @@
 	unsigned int timestamp;
 	char iabuf[INET_ADDRSTRLEN];
 	struct rtp_header *header;
-	static struct ast_frame *f, null_frame = { AST_FRAME_NULL, };
+	static struct ast_frame *f;
 	struct rtpPayloadType rtpPT;
 	
 	len = sizeof(sin);
@@ -502,17 +500,17 @@
 			ast_log(LOG_WARNING, "RTP Read error: %s\n", strerror(errno));
 		if (errno == EBADF)
 			CRASH;
-		return &null_frame;
+		return &ast_null_frame;
 	}
 	if (res < sizeof(*header)) {
 		ast_log(LOG_WARNING, "RTP Read too short\n");
-		return &null_frame;
+		return &ast_null_frame;
 	}
 
 	/* Ignore if the other side hasn't been given an address
 	   yet.  */
 	if (!rtp->them.sin_addr.s_addr || !rtp->them.sin_port)
-		return &null_frame;
+		return &ast_null_frame;
 
 	if (rtp->nat) {
 		/* Send to whoever sent to us */
@@ -533,7 +531,7 @@
 
 	/* Check RTP version */
 	if (header->version != 2)
-		return &null_frame;
+		return &ast_null_frame;
 	
 	/* Get fields */
 	seqno = ntohs(header->sequence);
@@ -554,7 +552,7 @@
 
 		if (res < 1) {
 			ast_log(LOG_WARNING, "RTP Read too short\n");
-			return &null_frame;
+			return &ast_null_frame;
 		}
 	}
 
@@ -566,7 +564,7 @@
 
    	rtpPT = ast_rtp_lookup_pt(rtp, header->payload);
 	if (!rtpPT.isAstFormat) {
-		f = &null_frame;
+		f = &ast_null_frame;
 		switch (rtpPT.code) {
 		case AST_RTP_DTMF:
 			/* This is special in-band data that's not one of our codecs */
@@ -602,7 +600,7 @@
 			ast_log(LOG_NOTICE, "Unknown RTP payload %d received\n", header->payload);
 			break;
 		}
-		return f ? f : &null_frame;
+		return f ? f : &ast_null_frame;
 	}
 
 	rtp->lastrxformat = rtp->f.subclass = rtpPT.code;

Modified: team/kpfleming/vldtmf/udptl.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/vldtmf/udptl.c?rev=9011&r1=9010&r2=9011&view=diff
==============================================================================
--- team/kpfleming/vldtmf/udptl.c (original)
+++ team/kpfleming/vldtmf/udptl.c Tue Jan 31 12:29:45 2006
@@ -640,7 +640,6 @@
 	uint16_t seqno = 0;
 	char iabuf[INET_ADDRSTRLEN];
 	uint16_t *udptlheader;
-	static struct ast_frame null_frame = { AST_FRAME_NULL, };
 
 	len = sizeof(sin);
 	
@@ -657,12 +656,12 @@
 			ast_log(LOG_WARNING, "UDPTL read error: %s\n", strerror(errno));
 		if (errno == EBADF)
 			CRASH;
-		return &null_frame;
+		return &ast_null_frame;
 	}
 
 	/* Ignore if the other side hasn't been given an address yet. */
 	if (!udptl->them.sin_addr.s_addr || !udptl->them.sin_port)
-		return &null_frame;
+		return &ast_null_frame;
 
 	if (udptl->nat) {
 		/* Send to whoever sent to us */



More information about the svn-commits mailing list