[asterisk-commits] jdixon: branch jdixon/chan_usbradio-1.4 r155505 - /team/jdixon/chan_usbradio-...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Nov 7 18:21:48 CST 2008


Author: jdixon
Date: Fri Nov  7 18:21:47 2008
New Revision: 155505

URL: http://svn.digium.com/view/asterisk?view=rev&rev=155505
Log:
Add locallist stuff to app_rpt

Modified:
    team/jdixon/chan_usbradio-1.4/dev-temp/app_rpt.c

Modified: team/jdixon/chan_usbradio-1.4/dev-temp/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/jdixon/chan_usbradio-1.4/dev-temp/app_rpt.c?view=diff&rev=155505&r1=155504&r2=155505
==============================================================================
--- team/jdixon/chan_usbradio-1.4/dev-temp/app_rpt.c (original)
+++ team/jdixon/chan_usbradio-1.4/dev-temp/app_rpt.c Fri Nov  7 18:21:47 2008
@@ -22,7 +22,7 @@
 /*! \file
  *
  * \brief Radio Repeater / Remote Base program 
- *  version 0.161 11/6/08 
+ *  version 0.162 11/7/08 
  * 
  * \author Jim Dixon, WB6NIL <jim at lambdatel.com>
  *
@@ -408,7 +408,7 @@
 /*! Stop the tones from playing */
 void ast_playtones_stop(struct ast_channel *chan);
 
-static  char *tdesc = "Radio Repeater / Remote Base  version 0.161  11/6/2008";
+static  char *tdesc = "Radio Repeater / Remote Base  version 0.162  11/7/2008";
 
 static char *app = "Rpt";
 
@@ -783,6 +783,8 @@
 		char *statpost_url;
 		char linkmode[10];
 		char linkmodedynamic[10];
+		char *locallist[16];
+		int nlocallist;
 	} p;
 	struct rpt_link links;
 	int unkeytocttimer;
@@ -887,6 +889,7 @@
 	char newkey;
 	char inpadtest;
 	long rxlingertimer;
+	char localoverride;
 #ifdef OLD_ASTERISK
 	AST_LIST_HEAD(, ast_frame) txq;
 #else
@@ -2641,6 +2644,12 @@
 	val = (char *) ast_variable_retrieve(cfg,this,"irlplinkdynamic");
 	if (val) rpt_vars[n].p.linkmodedynamic[LINKMODE_IRLP] = ast_true(val);
 	else rpt_vars[n].p.linkmodedynamic[LINKMODE_IRLP] = DEFAULT_IRLP_LINK_MODE_DYNAMIC;
+
+	val = (char *) ast_variable_retrieve(cfg,this,"locallist");
+	if (val) {
+		memset(rpt_vars[n].p.locallist,0,sizeof(rpt_vars[n].p.locallist));
+		rpt_vars[n].p.nlocallist = finddelim(val,rpt_vars[n].p.locallist,16);
+	}
 
 	val = (char *) ast_variable_retrieve(cfg,this,"inxlat");
 	if (val) {
@@ -12537,6 +12546,7 @@
 		/* Update external (to links) transmitter PTT state with everything but */
 		/* ID, CT, local messages, and tailmessage telemetry */
 		myrpt->exttx = totx;
+		if (myrpt->localoverride) totx = 1;
 		totx = totx || myrpt->dtmf_local_timer;
 		/* If half or 3/4 duplex, add localtx to external link tx */
 		if (myrpt->p.duplex < 2) myrpt->exttx = myrpt->exttx || myrpt->localtx;
@@ -12610,7 +12620,7 @@
 		if (myrpt->totimer) totx = totx || myrpt->tailtimer;
 		/* If user or links key up or are keyed up over standard ID, switch to talkover ID, if one is defined */
 		/* If tail message, kill the message if someone keys up over it */ 
-		if ((myrpt->keyed || remrx) && ((identqueued && idtalkover) || (tailmessagequeued))) {
+		if ((myrpt->keyed || remrx || myrpt->localoverride) && ((identqueued && idtalkover) || (tailmessagequeued))) {
 			int hasid = 0,hastalkover = 0;
 
 			telem = myrpt->tele.next;
@@ -13295,7 +13305,9 @@
 				int n;
 #endif
 
-				if ((!myrpt->localtx) && (!myrpt->p.linktolink)) {
+				if ((!myrpt->localtx) && (!myrpt->p.linktolink) && 
+				    (!myrpt->localoverride))
+				{
 					memset(f->data,0,f->datalen);
 				}
 
@@ -13372,7 +13384,10 @@
 				}
 				if (f1)
 				{
-					ast_write(myrpt->pchannel,f1);
+					if (myrpt->localoverride)
+						ast_write(myrpt->txpchannel,f1);
+					else
+						ast_write(myrpt->pchannel,f1);
 					ast_frfree(f1);
 				}
 			}
@@ -13422,10 +13437,24 @@
 					{
 						donodelog(myrpt,"RXKEY,MAIN");
 					}
+					myrpt->localoverride = 0;
 					if (f->datalen && f->data)
 					{
 						char *val, busy = 0;
 
+
+						if (myrpt->p.nlocallist)
+						{
+							for(x = 0; x < myrpt->p.nlocallist; x++)
+							{
+								if (!strcasecmp(f->data,myrpt->p.locallist[x]))
+								{
+									myrpt->localoverride = 1;
+									myrpt->keyed = 0;
+									break;
+								}
+							}
+						} 
 						if (debug) ast_log(LOG_NOTICE,"Got PL %s on node %s\n",(char *)f->data,myrpt->name);
 						// ctcss code autopatch initiate
 						if (strstr((char *)f->data,"/M/")&& !myrpt->macropatch)
@@ -13477,6 +13506,7 @@
 						}
 					}
 					myrpt->keyed = 0;
+					myrpt->localoverride = 0;
 					time(&myrpt->lastkeyedtime);
 					myrpt->keyposttimer = KEYPOSTSHORTTIME;
 					if (myrpt->p.archivedir)
@@ -13498,7 +13528,8 @@
 			}
 			if (f->frametype == AST_FRAME_VOICE)
 			{
-				ast_write(myrpt->txpchannel,f);
+				if (!myrpt->localoverride)
+					ast_write(myrpt->txpchannel,f);
 			}
 			if (f->frametype == AST_FRAME_CONTROL)
 			{




More information about the asterisk-commits mailing list