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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Nov 18 13:49:25 CST 2008


Author: jdixon
Date: Tue Nov 18 13:49:24 2008
New Revision: 157370

URL: http://svn.digium.com/view/asterisk?view=rev&rev=157370
Log:
Fix DTMF cut-thru for * and # on autopatch and fix silly IAX2
problem with autopatch.

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=157370&r1=157369&r2=157370
==============================================================================
--- team/jdixon/chan_usbradio-1.4/dev-temp/app_rpt.c (original)
+++ team/jdixon/chan_usbradio-1.4/dev-temp/app_rpt.c Tue Nov 18 13:49:24 2008
@@ -1,7 +1,11 @@
 /* #define	NEW_ASTERISK */
 /* #define OLD_ASTERISK */
 
+#ifdef	JIM_DEBUG
 #define	rpt_free(p) __ast_free(p,__FILE__,__LINE__,__PRETTY_FUNCTION__)
+#else
+#define	rpt_free(p) ast_free(p)
+#endif
 
 /*
  * Asterisk -- An open source telephony toolkit.
@@ -24,7 +28,7 @@
 /*! \file
  *
  * \brief Radio Repeater / Remote Base program 
- *  version 0.170 11/16/08 
+ *  version 0.171 11/18/08 
  * 
  * \author Jim Dixon, WB6NIL <jim at lambdatel.com>
  *
@@ -410,7 +414,7 @@
 /*! Stop the tones from playing */
 void ast_playtones_stop(struct ast_channel *chan);
 
-static  char *tdesc = "Radio Repeater / Remote Base  version 0.170  11/16/2008";
+static  char *tdesc = "Radio Repeater / Remote Base  version 0.171  11/18/2008";
 
 static char *app = "Rpt";
 
@@ -6265,16 +6269,22 @@
 		}
 		if (myrpt->mydtmf)
 		{
+			struct ast_channel *c;
 			struct ast_frame wf = {AST_FRAME_DTMF, } ;
+
 			wf.subclass = myrpt->mydtmf;
-			rpt_mutex_unlock(&myrpt->lock);
-			ast_queue_frame(mychannel,&wf);
+			c = ast_bridged_channel(mychannel);
+			if (c && c->_state == AST_STATE_UP)
+			{
+				rpt_mutex_unlock(&myrpt->lock);
+				ast_queue_frame(mychannel,&wf);
 #ifdef	NEW_ASTERISK
-			ast_senddigit(genchannel,myrpt->mydtmf,0);
+				ast_senddigit(genchannel,myrpt->mydtmf,0);
 #else
-			ast_senddigit(genchannel,myrpt->mydtmf);
+				ast_senddigit(genchannel,myrpt->mydtmf);
 #endif
-			rpt_mutex_lock(&myrpt->lock);
+				rpt_mutex_lock(&myrpt->lock);
+			}
 			myrpt->mydtmf = 0;
 		}
 		rpt_mutex_unlock(&myrpt->lock);
@@ -7077,7 +7087,7 @@
 	/* if on call, force * into current audio stream */
 	
 	if ((myrpt->callmode == 2) || (myrpt->callmode == 3)){
-		myrpt->mydtmf = myrpt->p.endchar;
+		myrpt->mydtmf = myrpt->p.funcchar;
 	}
 	if (myrpt->callmode){
 		rpt_mutex_unlock(&myrpt->lock);
@@ -8102,6 +8112,13 @@
 				rpt_telemetry(myrpt,COMPLETE,NULL);
 				return;
 			}
+#if 0
+			if ((myrpt->rem_dtmfidx < 0) && 
+			    ((myrpt->callmode == 2) || (myrpt->callmode == 3)))
+			{
+				myrpt->mydtmf = c;
+			}
+#endif
 		}
 	}
 	if (myrpt->cmdnode[0])
@@ -8141,7 +8158,9 @@
 			myrpt->callmode = 4;
 		}
 	}
-	if ((myrpt->callmode == 2) || (myrpt->callmode == 3))
+	if ((c != myrpt->p.funcchar) && (myrpt->rem_dtmfidx < 0) &&
+	  (!myrpt->inpadtest) &&
+	    ((myrpt->callmode == 2) || (myrpt->callmode == 3)))
 	{
 		myrpt->mydtmf = c;
 	}
@@ -11656,10 +11675,17 @@
                         rpt_mutex_unlock(&myrpt->lock);
                         if (myrpt->p.propagate_phonedtmf)
                                do_dtmf_phone(myrpt,NULL,c);
+			if ((myrpt->dtmfidx == -1) &&
+			   ((myrpt->callmode == 2) || (myrpt->callmode == 3)))
+			{
+				myrpt->mydtmf = c;
+			}
 			return;
                 }
 		else
+		{
 			rpt_mutex_unlock(&myrpt->lock);
+		}
 	}
 	rpt_mutex_lock(&myrpt->lock);
 	if (myrpt->cmdnode[0])




More information about the asterisk-commits mailing list