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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 21 01:01:32 CDT 2008


Author: jdixon
Date: Thu Aug 21 01:01:31 2008
New Revision: 139279

URL: http://svn.digium.com/view/asterisk?view=rev&rev=139279
Log:
A few changes to make compatible with chan_echolink as it currently is

Modified:
    team/jdixon/chan_usbradio-1.4/apps/app_rpt.c

Modified: team/jdixon/chan_usbradio-1.4/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/jdixon/chan_usbradio-1.4/apps/app_rpt.c?view=diff&rev=139279&r1=139278&r2=139279
==============================================================================
--- team/jdixon/chan_usbradio-1.4/apps/app_rpt.c (original)
+++ team/jdixon/chan_usbradio-1.4/apps/app_rpt.c Thu Aug 21 01:01:31 2008
@@ -21,7 +21,7 @@
 /*! \file
  *
  * \brief Radio Repeater / Remote Base program 
- *  version 0.123 8/17/08 2055 EDT
+ *  version 0.124 8/20/08 2055 EDT
  * 
  * \author Jim Dixon, WB6NIL <jim at lambdatel.com>
  *
@@ -374,7 +374,7 @@
 /*! Stop the tones from playing */
 void ast_playtones_stop(struct ast_channel *chan);
 
-static  char *tdesc = "Radio Repeater / Remote Base  version 0.123  8/17/2008";
+static  char *tdesc = "Radio Repeater / Remote Base  version 0.124  8/20/2008";
 
 static char *app = "Rpt";
 
@@ -12517,36 +12517,39 @@
 					rpt_mutex_lock(&myrpt->lock);
 					__kickshort(myrpt);
 					rpt_mutex_unlock(&myrpt->lock);
-					if ((!l->disced) && (!l->outbound))
+					if (strncasecmp(l->chan->name,"echolink",8))
 					{
-						if ((l->name[0] == '0') || l->isremote)
-							l->disctime = 1;
-						else
-							l->disctime = DISC_TIME;
-						rpt_mutex_lock(&myrpt->lock);
-						ast_hangup(l->chan);
-						l->chan = 0;
-						break;
-					}
-
-					if (l->retrytimer) 
-					{
-						ast_hangup(l->chan);
-						l->chan = 0;
-						rpt_mutex_lock(&myrpt->lock);
-						break; 
-					}
-					if (l->outbound && (l->retries++ < l->max_retries) && (l->hasconnected))
-					{
-						rpt_mutex_lock(&myrpt->lock);
-						if (l->chan) ast_hangup(l->chan);
-						l->chan = 0;
-						l->hasconnected = 1;
-						l->retrytimer = RETRY_TIMER_MS;
-						l->elaptime = 0;
-						l->connecttime = 0;
-						l->thisconnected = 0;
-						break;
+						if ((!l->disced) && (!l->outbound))
+						{
+							if ((l->name[0] == '0') || l->isremote)
+								l->disctime = 1;
+							else
+								l->disctime = DISC_TIME;
+							rpt_mutex_lock(&myrpt->lock);
+							ast_hangup(l->chan);
+							l->chan = 0;
+							break;
+						}
+	
+						if (l->retrytimer) 
+						{
+							ast_hangup(l->chan);
+							l->chan = 0;
+							rpt_mutex_lock(&myrpt->lock);
+							break; 
+						}
+						if (l->outbound && (l->retries++ < l->max_retries) && (l->hasconnected))
+						{
+							rpt_mutex_lock(&myrpt->lock);
+							if (l->chan) ast_hangup(l->chan);
+							l->chan = 0;
+							l->hasconnected = 1;
+							l->retrytimer = RETRY_TIMER_MS;
+							l->elaptime = 0;
+							l->connecttime = 0;
+							l->thisconnected = 0;
+							break;
+						}
 					}
 					rpt_mutex_lock(&myrpt->lock);
 					/* remove from queue */
@@ -12763,35 +12766,38 @@
 						rpt_mutex_lock(&myrpt->lock);
 						__kickshort(myrpt);
 						rpt_mutex_unlock(&myrpt->lock);
-						if ((!l->outbound) && (!l->disced))
+						if (strncasecmp(l->chan->name,"echolink",8))
 						{
-							if ((l->name[0] == '0') || l->isremote)
-								l->disctime = 1;
-							else
-								l->disctime = DISC_TIME;
-							rpt_mutex_lock(&myrpt->lock);
-							ast_hangup(l->chan);
-							l->chan = 0;
-							break;
-						}
-						if (l->retrytimer) 
-						{
-							if (l->chan) ast_hangup(l->chan);
-							l->chan = 0;
-							rpt_mutex_lock(&myrpt->lock);
-							break;
-						}
-						if (l->outbound && (l->retries++ < l->max_retries) && (l->hasconnected))
-						{
-							rpt_mutex_lock(&myrpt->lock);
-							if (l->chan) ast_hangup(l->chan);
-							l->chan = 0;
-							l->hasconnected = 1;
-							l->elaptime = 0;
-							l->retrytimer = RETRY_TIMER_MS;
-							l->connecttime = 0;
-							l->thisconnected = 0;
-							break;
+							if ((!l->outbound) && (!l->disced))
+							{
+								if ((l->name[0] == '0') || l->isremote)
+									l->disctime = 1;
+								else
+									l->disctime = DISC_TIME;
+								rpt_mutex_lock(&myrpt->lock);
+								ast_hangup(l->chan);
+								l->chan = 0;
+								break;
+							}
+							if (l->retrytimer) 
+							{
+								if (l->chan) ast_hangup(l->chan);
+								l->chan = 0;
+								rpt_mutex_lock(&myrpt->lock);
+								break;
+							}
+							if (l->outbound && (l->retries++ < l->max_retries) && (l->hasconnected))
+							{
+								rpt_mutex_lock(&myrpt->lock);
+								if (l->chan) ast_hangup(l->chan);
+								l->chan = 0;
+								l->hasconnected = 1;
+								l->elaptime = 0;
+								l->retrytimer = RETRY_TIMER_MS;
+								l->connecttime = 0;
+								l->thisconnected = 0;
+								break;
+							}
 						}
 						rpt_mutex_lock(&myrpt->lock);
 						/* remove from queue */
@@ -13400,14 +13406,15 @@
 	{
 #ifdef ALLOW_LOCAL_CHANNELS
 	        /* Check to insure the connection is IAX2 or Local*/
-	        if ( (strncmp(chan->name,"IAX2",4)) && (strncmp(chan->name,"Local",5)) ) {
-	            ast_log(LOG_WARNING, "We only accept links via IAX2 or Local!!\n");
+	        if ( (strncmp(chan->name,"IAX2",4)) && (strncmp(chan->name,"Local",5)) &&
+		  (strncasecmp(chan->name,"echolink",8)) ) {
+	            ast_log(LOG_WARNING, "We only accept links via IAX2, Echolink  or Local!!\n");
 	            return -1;
 	        }
 #else
-		if (strncmp(chan->name,"IAX2",4))
-		{
-			ast_log(LOG_WARNING, "We only accept links via IAX2!!\n");
+		if (strncmp(chan->name,"IAX2",4) && strncasecmp(chan->name,"Echolink",8))
+		{
+			ast_log(LOG_WARNING, "We only accept links via IAX2 or Echolink!!\n");
 			return -1;
 		}
 #endif
@@ -13750,6 +13757,7 @@
 		rpt_mutex_lock(&myrpt->lock);
 		if ((phone_mode == 2) && (!phone_vox)) l->lastrealrx = 1;
 		l->max_retries = MAX_RETRIES;
+/* foop */		l->retries = l->max_retries + 1;
 		/* insert at end of queue */
 		insque((struct qelem *)l,(struct qelem *)myrpt->links.next);
 		__kickshort(myrpt);
@@ -13769,6 +13777,8 @@
 			donodelog(myrpt,str);
 		}
 		if (!phone_mode) send_newkey(chan);
+		if (!strncasecmp(chan->name,"echolink",8))
+			rpt_telemetry(myrpt,CONNECTED,l);
 		return AST_PBX_KEEPALIVE;
 	}
 	/* well, then it is a remote */




More information about the asterisk-commits mailing list