[asterisk-commits] seanbright: trunk r117950 - in /trunk: apps/app_rpt.c channels/chan_usbradio.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 22 15:01:34 CDT 2008


Author: seanbright
Date: Thu May 22 15:01:33 2008
New Revision: 117950

URL: http://svn.digium.com/view/asterisk?view=rev&rev=117950
Log:
A couple more places the frame data change was missed.

Modified:
    trunk/apps/app_rpt.c
    trunk/channels/chan_usbradio.c

Modified: trunk/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_rpt.c?view=diff&rev=117950&r1=117949&r2=117950
==============================================================================
--- trunk/apps/app_rpt.c (original)
+++ trunk/apps/app_rpt.c Thu May 22 15:01:33 2008
@@ -1876,7 +1876,7 @@
 	wf.offset = 0;
 	wf.mallocd = 0;
 	wf.datalen = strlen(txt) + 1;
-	wf.data = txt;
+	wf.data.ptr = txt;
 	wf.samples = 0;
 	ast_write(myrpt->txchannel,&wf); 
 	return 0;
@@ -5613,7 +5613,7 @@
 		/* if we found it, write it and were done */
 		if (!strcmp(l->name,myrpt->cmdnode))
 		{
-			wf.data = str;
+			wf.data.ptr = str;
 			if (l->chan) ast_write(l->chan,&wf);
 			return;
 		}
@@ -5623,7 +5623,7 @@
 	/* if not, give it to everyone */
 	while(l != &myrpt->links)
 	{
-		wf.data = str;
+		wf.data.ptr = str;
 		if (l->chan) ast_write(l->chan,&wf);
 		l = l->next;
 	}
@@ -5652,7 +5652,7 @@
 	/* give it to everyone */
 	while(l != &myrpt->links)
 	{
-		wf.data = str;
+		wf.data.ptr = str;
 		if (l->chan) ast_write(l->chan,&wf);
 		l = l->next;
 	}
@@ -5954,7 +5954,7 @@
 				wf.mallocd = 0;
 				wf.datalen = strlen(discstr) + 1;
 				wf.samples = 0;
-				wf.data = discstr;
+				wf.data.ptr = discstr;
 				if (l->chan)
 				{
 					ast_write(l->chan,&wf);
@@ -6069,7 +6069,7 @@
                                 wf.mallocd = 0;
                                 wf.datalen = strlen(discstr) + 1;
                                 wf.samples = 0;
-                                wf.data = discstr;
+                                wf.data.ptr = discstr;
                                 if (l->chan)
                                 {
                                         ast_write(l->chan,&wf);
@@ -6751,7 +6751,7 @@
 				{
 					/* send, but not to src */
 					if (strcmp(l->name,src)) {
-						wf.data = str;
+						wf.data.ptr = str;
 						if (l->chan) ast_write(l->chan,&wf);
 					}
 					return;
@@ -6779,7 +6779,7 @@
 				}
 				/* send, but not to src */
 				if (strcmp(l->name,src)) {
-					wf.data = str;
+					wf.data.ptr = str;
 					if (l->chan) ast_write(l->chan,&wf); 
 				}
 				l = l->next;
@@ -6798,7 +6798,7 @@
 				n = (int)(now - myrpt->lastkeyedtime);
 			}
 			sprintf(tmp1,"K %s %s %d %d",src,myrpt->name,myrpt->keyed,n);
-			wf.data = tmp1;
+			wf.data.ptr = tmp1;
 			wf.datalen = strlen(tmp1) + 1;
 			if (mylink->chan) ast_write(mylink->chan,&wf); 
 			return;
@@ -6876,7 +6876,7 @@
 			{
 				/* send, but not to src */
 				if (strcmp(l->name,src)) {
-					wf.data = str;
+					wf.data.ptr = str;
 					if (l->chan) ast_write(l->chan,&wf);
 				}
 				return;
@@ -6900,7 +6900,7 @@
 			}
 			/* send, but not to src */
 			if (strcmp(l->name,src)) {
-				wf.data = str;
+				wf.data.ptr = str;
 				if (l->chan) ast_write(l->chan,&wf); 
 			}
 			l = l->next;
@@ -11693,7 +11693,7 @@
 				if (l->chan)
 				{
 					lf.datalen = strlen(lstr) + 1;
-					lf.data = lstr;
+					lf.data.ptr = lstr;
 					ast_write(l->chan,&lf);
 					if (debug > 6) ast_log(LOG_NOTICE,
 						"@@@@ node %s sent node string %s to node %s\n",
@@ -12040,7 +12040,7 @@
 #endif
 
 				if ((!myrpt->localtx) && (!myrpt->p.linktolink)) {
-					memset(f->data,0,f->datalen);
+					memset(f->data.ptr,0,f->datalen);
 				}
 
 #ifdef	_MDC_DECODE_H_
@@ -12096,11 +12096,11 @@
 				dtmfed = 0;
 				if (ismuted)
 				{
-					memset(f->data,0,f->datalen);
+					memset(f->data.ptr,0,f->datalen);
 					if (myrpt->lastf1)
-						memset(myrpt->lastf1->data,0,myrpt->lastf1->datalen);
+						memset(myrpt->lastf1->data.ptr,0,myrpt->lastf1->datalen);
 					if (myrpt->lastf2)
-						memset(myrpt->lastf2->data,0,myrpt->lastf2->datalen);
+						memset(myrpt->lastf2->data.ptr,0,myrpt->lastf2->datalen);
 				} 
 				if (f) f2 = ast_frdup(f);
 				else f2 = NULL;
@@ -12110,9 +12110,9 @@
 				if (ismuted)
 				{
 					if (myrpt->lastf1)
-						memset(myrpt->lastf1->data,0,myrpt->lastf1->datalen);
+						memset(myrpt->lastf1->data.ptr,0,myrpt->lastf1->datalen);
 					if (myrpt->lastf2)
-						memset(myrpt->lastf2->data,0,myrpt->lastf2->datalen);
+						memset(myrpt->lastf2->data.ptr,0,myrpt->lastf2->datalen);
 				}
 				if (f1)
 				{
@@ -12124,9 +12124,9 @@
 			else if (f->frametype == AST_FRAME_DTMF_BEGIN)
 			{
 				if (myrpt->lastf1)
-					memset(myrpt->lastf1->data,0,myrpt->lastf1->datalen);
+					memset(myrpt->lastf1->data.ptr,0,myrpt->lastf1->datalen);
 				if (myrpt->lastf2)
-					memset(myrpt->lastf2->data,0,myrpt->lastf2->datalen);
+					memset(myrpt->lastf2->data.ptr,0,myrpt->lastf2->datalen);
 				dtmfed = 1;
 			}
 #endif
@@ -12135,9 +12135,9 @@
 				c = (char) f->subclass; /* get DTMF char */
 				ast_frfree(f);
 				if (myrpt->lastf1)
-					memset(myrpt->lastf1->data,0,myrpt->lastf1->datalen);
+					memset(myrpt->lastf1->data.ptr,0,myrpt->lastf1->datalen);
 				if (myrpt->lastf2)
-					memset(myrpt->lastf2->data,0,myrpt->lastf2->datalen);
+					memset(myrpt->lastf2->data.ptr,0,myrpt->lastf2->datalen);
 				dtmfed = 1;
 				if (!myrpt->keyed) continue;
 				c = func_xlat(myrpt,c,&myrpt->p.inxlat);
@@ -12166,13 +12166,13 @@
 					{
 						donodelog(myrpt,"RXKEY,MAIN");
 					}
-					if (f->datalen && f->data)
+					if (f->datalen && f->data.ptr)
 					{
 						char *val, busy = 0;
 
-						if (debug) ast_log(LOG_NOTICE,"Got PL %s on node %s\n",(char *)f->data,myrpt->name);
+						if (debug) ast_log(LOG_NOTICE,"Got PL %s on node %s\n",(char *)f->data.ptr,myrpt->name);
 						// ctcss code autopatch initiate
-						if (strstr((char *)f->data,"/M/")&& !myrpt->macropatch)
+						if (strstr((char *)f->data.ptr,"/M/")&& !myrpt->macropatch)
 						{
 						    char val[16];
 							strcat(val,"*6");
@@ -12185,16 +12185,16 @@
 							if(!busy){
 								myrpt->macrotimer = MACROTIME;
 								strncat(myrpt->macrobuf,val,MAXMACRO - 1);
-								if (!busy) strcpy(myrpt->lasttone,(char*)f->data);
+								if (!busy) strcpy(myrpt->lasttone,(char*)f->data.ptr);
 							}
 							rpt_mutex_unlock(&myrpt->lock);
 						}
-						else if (strcmp((char *)f->data,myrpt->lasttone))
+						else if (strcmp((char *)f->data.ptr,myrpt->lasttone))
 						{
-							val = (char *) ast_variable_retrieve(myrpt->cfg, myrpt->p.tonemacro, (char *)f->data);
+							val = (char *) ast_variable_retrieve(myrpt->cfg, myrpt->p.tonemacro, (char *)f->data.ptr);
 							if (val) 
 							{
-								if (debug) ast_log(LOG_NOTICE,"Tone %s doing %s on node %s\n",(char *) f->data,val,myrpt->name);
+								if (debug) ast_log(LOG_NOTICE,"Tone %s doing %s on node %s\n",(char *) f->data.ptr,val,myrpt->name);
 								rpt_mutex_lock(&myrpt->lock);
 								if ((MAXMACRO - strlen(myrpt->macrobuf)) < strlen(val)){
 									rpt_mutex_unlock(&myrpt->lock);
@@ -12206,7 +12206,7 @@
 								}
 								rpt_mutex_unlock(&myrpt->lock);
 							}
-						 	if (!busy) strcpy(myrpt->lasttone,(char*)f->data);
+						 	if (!busy) strcpy(myrpt->lasttone,(char*)f->data.ptr);
 						}
 					} else myrpt->lasttone[0] = 0;
 				}
@@ -12300,7 +12300,7 @@
 						    for(;x < myrpt->p.simplexpatchdelay; x++)
 						    {
 								f1 = ast_frdup(f);
-								memset(f1->data,0,f1->datalen);
+								memset(f1->data.ptr,0,f1->datalen);
 								AST_LIST_INSERT_TAIL(&myrpt->txq,f1,frame_list);
 						    }
 						    myfirst = 1;
@@ -12314,7 +12314,7 @@
 						frame_list) x++;
 					if (!x)
 					{
-						memset(f->data,0,f->datalen);
+						memset(f->data.ptr,0,f->datalen);
 					}
 					else
 					{
@@ -12478,7 +12478,7 @@
 					if ((l->phonemode) && (l->phonevox))
 					{
 						n1 = dovox(&l->vox,
-							f->data,f->datalen / 2);
+							f->data.ptr,f->datalen / 2);
 						if (n1 != l->wasvox)
 						{
 							if (debug)ast_log(LOG_DEBUG,"Link Node %s, vox %d\n",l->name,n1);
@@ -12497,7 +12497,7 @@
 							    for(;x < myrpt->p.simplexphonedelay; x++)
 								{
 									f1 = ast_frdup(f);
-									memset(f1->data,0,f1->datalen);
+									memset(f1->data.ptr,0,f1->datalen);
 									AST_LIST_INSERT_TAIL(&l->rxq,
 										f1,frame_list);
 							    }
@@ -12510,7 +12510,7 @@
 						AST_LIST_TRAVERSE(&l->rxq, f1,frame_list) x++;
 						if (!x)
 						{
-							memset(f->data,0,f->datalen);
+							memset(f->data.ptr,0,f->datalen);
 						}
 						else
 						{
@@ -12527,11 +12527,11 @@
 						l->dtmfed = 0;
 						if (ismuted)
 						{
-							memset(f->data,0,f->datalen);
+							memset(f->data.ptr,0,f->datalen);
 							if (l->lastf1)
-								memset(l->lastf1->data,0,l->lastf1->datalen);
+								memset(l->lastf1->data.ptr,0,l->lastf1->datalen);
 							if (l->lastf2)
-								memset(l->lastf2->data,0,l->lastf2->datalen);
+								memset(l->lastf2->data.ptr,0,l->lastf2->datalen);
 						} 
 						if (f) f2 = ast_frdup(f);
 						else f2 = NULL;
@@ -12541,9 +12541,9 @@
 						if (ismuted)
 						{
 							if (l->lastf1)
-								memset(l->lastf1->data,0,l->lastf1->datalen);
+								memset(l->lastf1->data.ptr,0,l->lastf1->datalen);
 							if (l->lastf2)
-								memset(l->lastf2->data,0,l->lastf2->datalen);
+								memset(l->lastf2->data.ptr,0,l->lastf2->datalen);
 						}
 						if (f1)
 						{
@@ -12554,7 +12554,7 @@
 					else
 					{
 						if (!l->lastrx)
-							memset(f->data,0,f->datalen);
+							memset(f->data.ptr,0,f->datalen);
 						ast_write(l->pchan,f);
 					}
 				}
@@ -12562,22 +12562,22 @@
 				else if (f->frametype == AST_FRAME_DTMF_BEGIN)
 				{
 					if (l->lastf1)
-						memset(l->lastf1->data,0,l->lastf1->datalen);
+						memset(l->lastf1->data.ptr,0,l->lastf1->datalen);
 					if (l->lastf2)
-						memset(l->lastf2->data,0,l->lastf2->datalen);
+						memset(l->lastf2->data.ptr,0,l->lastf2->datalen);
 					l->dtmfed = 1;
 				}
 #endif
 				if (f->frametype == AST_FRAME_TEXT)
 				{
-					handle_link_data(myrpt,l,f->data);
+					handle_link_data(myrpt,l,f->data.ptr);
 				}
 				if (f->frametype == AST_FRAME_DTMF)
 				{
 					if (l->lastf1)
-						memset(l->lastf1->data,0,l->lastf1->datalen);
+						memset(l->lastf1->data.ptr,0,l->lastf1->datalen);
 					if (l->lastf2)
-						memset(l->lastf2->data,0,l->lastf2->datalen);
+						memset(l->lastf2->data.ptr,0,l->lastf2->datalen);
 					l->dtmfed = 1;
 					handle_link_phone_dtmf(myrpt,l,f->subclass);
 				}
@@ -12827,7 +12827,7 @@
 			}
 			if (f->frametype == AST_FRAME_VOICE)
 			{
-				n = dovox(&myrpt->vox,f->data,f->datalen / 2);
+				n = dovox(&myrpt->vox,f->data.ptr,f->datalen / 2);
 				if (n != myrpt->wasvox)
 				{
 					if (debug) ast_log(LOG_DEBUG,"Node %s, vox %d\n",myrpt->name,n);
@@ -14343,11 +14343,11 @@
 				dtmfed = 0;
 				if (ismuted)
 				{
-					memset(f->data,0,f->datalen);
+					memset(f->data.ptr,0,f->datalen);
 					if (myrpt->lastf1)
-						memset(myrpt->lastf1->data,0,myrpt->lastf1->datalen);
+						memset(myrpt->lastf1->data.ptr,0,myrpt->lastf1->datalen);
 					if (myrpt->lastf2)
-						memset(myrpt->lastf2->data,0,myrpt->lastf2->datalen);
+						memset(myrpt->lastf2->data.ptr,0,myrpt->lastf2->datalen);
 				} 
 				if (f) f2 = ast_frdup(f);
 				else f2 = NULL;
@@ -14357,9 +14357,9 @@
 				if (ismuted)
 				{
 					if (myrpt->lastf1)
-						memset(myrpt->lastf1->data,0,myrpt->lastf1->datalen);
+						memset(myrpt->lastf1->data.ptr,0,myrpt->lastf1->datalen);
 					if (myrpt->lastf2)
-						memset(myrpt->lastf2->data,0,myrpt->lastf2->datalen);
+						memset(myrpt->lastf2->data.ptr,0,myrpt->lastf2->datalen);
 				}
 				if (f1)
 				{
@@ -14374,18 +14374,18 @@
 			else if (f->frametype == AST_FRAME_DTMF_BEGIN)
 			{
 				if (myrpt->lastf1)
-					memset(myrpt->lastf1->data,0,myrpt->lastf1->datalen);
+					memset(myrpt->lastf1->data.ptr,0,myrpt->lastf1->datalen);
 				if (myrpt->lastf2)
-					memset(myrpt->lastf2->data,0,myrpt->lastf2->datalen);
+					memset(myrpt->lastf2->data.ptr,0,myrpt->lastf2->datalen);
 				dtmfed = 1;
 			}
 #endif
 			if (f->frametype == AST_FRAME_DTMF)
 			{
 				if (myrpt->lastf1)
-					memset(myrpt->lastf1->data,0,myrpt->lastf1->datalen);
+					memset(myrpt->lastf1->data.ptr,0,myrpt->lastf1->datalen);
 				if (myrpt->lastf2)
-					memset(myrpt->lastf2->data,0,myrpt->lastf2->datalen);
+					memset(myrpt->lastf2->data.ptr,0,myrpt->lastf2->datalen);
 				dtmfed = 1;
 				if (handle_remote_phone_dtmf(myrpt,f->subclass,&keyed,phone_mode) == -1)
 				{
@@ -14396,7 +14396,7 @@
 			}
 			if (f->frametype == AST_FRAME_TEXT)
 			{
-				if (handle_remote_data(myrpt,f->data) == -1)
+				if (handle_remote_data(myrpt,f->data.ptr) == -1)
 				{
 					if (debug) printf("@@@@ rpt:Hung Up\n");
 					ast_frfree(f);
@@ -14448,7 +14448,7 @@
 				((myrpt->remote) && (myrpt->remotetx)) ||
 				  ((myrpt->remmode != REM_MODE_FM) &&
 				    notremming))
-					memset(f->data,0,f->datalen); 
+					memset(f->data.ptr,0,f->datalen); 
 				 ast_write(myrpt->pchannel,f);
 			}
 			else if (f->frametype == AST_FRAME_CONTROL)

Modified: trunk/channels/chan_usbradio.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_usbradio.c?view=diff&rev=117950&r1=117949&r2=117950
==============================================================================
--- trunk/channels/chan_usbradio.c (original)
+++ trunk/channels/chan_usbradio.c Thu May 22 15:01:33 2008
@@ -1769,7 +1769,7 @@
 		i16 i, tbuff[f->datalen];
 		for(i=0;i<f->datalen;i+=2)
 		{
-			tbuff[i]= ((i16*)(f->data))[i/2];
+			tbuff[i]= ((i16*)(f->data.ptr))[i/2];
 			tbuff[i+1]= o->txkeyed*M_Q13;
 		}
 		fwrite(tbuff,2,f->datalen,ftxcapraw);
@@ -1779,7 +1779,7 @@
 
 	// maw just take the data from the network and save it for PmrRx processing
 
-	PmrTx(o->pmrChan,(i16*)f->data);
+	PmrTx(o->pmrChan,(i16*)f->data.ptr);
 	
 	return 0;
 }
@@ -2047,7 +2047,7 @@
 		wf.subclass = AST_CONTROL_RADIO_KEY;
 		if(o->rxctcssdecode)  	
         {
-	        wf.data = o->rxctcssfreq;
+	        wf.data.ptr = o->rxctcssfreq;
 	        wf.datalen = strlen(o->rxctcssfreq) + 1;
 			TRACEO(1,("AST_CONTROL_RADIO_KEY text=%s\n",o->rxctcssfreq));
         }
@@ -2062,10 +2062,10 @@
 	f->subclass = AST_FORMAT_SLINEAR;
 	f->samples = FRAME_SIZE;
 	f->datalen = FRAME_SIZE * 2;
-	f->data = o->usbradio_read_buf_8k + AST_FRIENDLY_OFFSET;
+	f->data.ptr = o->usbradio_read_buf_8k + AST_FRIENDLY_OFFSET;
 	if (o->boost != BOOST_SCALE) {	/* scale and clip values */
 		int i, x;
-		int16_t *p = (int16_t *) f->data;
+		int16_t *p = (int16_t *) f->data.ptr;
 		for (i = 0; i < f->samples; i++) {
 			x = (p[i] * o->boost) / BOOST_SCALE;
 			if (x > 32767)




More information about the asterisk-commits mailing list