[asterisk-commits] jpeeler: branch jpeeler/asterisk-sigwork-trunk r200586 - /team/jpeeler/asteri...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 15 11:41:08 CDT 2009


Author: jpeeler
Date: Mon Jun 15 11:41:04 2009
New Revision: 200586

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=200586
Log:
remove some remaining analog code unnecessary for sig_pri and some trivial variable renaming

Modified:
    team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h
    team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.c
    team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.h

Modified: team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h?view=diff&rev=200586&r1=200585&r2=200586
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h Mon Jun 15 11:41:04 2009
@@ -248,12 +248,12 @@
 	/* XXX: All variables after this are internal */
 	unsigned int callwaiting:1;
 	unsigned int dialednone:1;
-	unsigned int dialing:1;
+	unsigned int dialing:1;			/*!< TRUE if in the process of dialing digits or sending something */
 	unsigned int dnd:1;
 	unsigned int echobreak:1;
 	unsigned int hidecallerid:1;
 	unsigned int outgoing:1;
-	unsigned int pulsedial:1;			/*!< whether a pulse dial phone is detected */
+	unsigned int pulsedial:1;		/*!< TRUE if a pulsed digit was detected. (Pulse dial phone detected) */
 
 	char callwait_num[AST_MAX_EXTENSION];
 	char callwait_name[AST_MAX_EXTENSION];

Modified: team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.c?view=diff&rev=200586&r1=200585&r2=200586
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.c Mon Jun 15 11:41:04 2009
@@ -44,7 +44,6 @@
 #include "asterisk/features.h"
 
 #include "sig_pri.h"
-#define OLD 0 /* jpeeler */
 
 static int pri_matchdigittimeout = 3000;
 
@@ -424,9 +423,9 @@
 		int why;
 
 		/* check if the channel is out of service */
-		ast_mutex_lock(&pri->pvts[pri->resetpos]->lock);
+		ast_mutex_lock(&pri->pvts[pri->resetpos]->service_lock);
 		snprintf(db_chan_name, sizeof(db_chan_name), "%s/%d:%d", dahdi_db, pri->pvts[pri->resetpos]->pri->span, pri->pvts[pri->resetpos]->channel);
-		ast_mutex_unlock(&pri->pvts[pri->resetpos]->lock);
+		ast_mutex_unlock(&pri->pvts[pri->resetpos]->service_lock);
 
 		/* if so, try next channel */
 		if (!ast_db_get(db_chan_name, SRVST_DBKEY, db_answer, sizeof(db_answer))) {
@@ -884,9 +883,9 @@
 						char db_chan_name[20], db_answer[5], state;
 						int why, skipit = 0;
 						
-						ast_mutex_lock(&pri->pvts[chanpos]->lock);
+						ast_mutex_lock(&pri->pvts[chanpos]->service_lock);
 						snprintf(db_chan_name, sizeof(db_chan_name), "%s/%d:%d", dahdi_db, pri->pvts[chanpos]->pri->span, pri->pvts[chanpos]->channel);
-						ast_mutex_unlock(&pri->pvts[chanpos]->lock);
+						ast_mutex_unlock(&pri->pvts[chanpos]->service_lock);
 
 						if (!ast_db_get(db_chan_name, SRVST_DBKEY, db_answer, sizeof(db_answer))) {
 							sscanf(db_answer, "%c:%d", &state, &why);
@@ -995,9 +994,9 @@
 					char db_chan_name[20], db_answer[5], state;
 					int ch, why = -1;
 
-					ast_mutex_lock(&pri->pvts[chanpos]->lock);
+					ast_mutex_lock(&pri->pvts[chanpos]->service_lock);
 					ch = pri->pvts[chanpos]->channel;
-					ast_mutex_unlock(&pri->pvts[chanpos]->lock);
+					ast_mutex_unlock(&pri->pvts[chanpos]->service_lock);
 					
 					snprintf(db_chan_name, sizeof(db_chan_name), "%s/%d:%d", dahdi_db, pri->pvts[chanpos]->pri->span, ch);
 					if (!ast_db_get(db_chan_name, SRVST_DBKEY, db_answer, sizeof(db_answer))) {
@@ -1261,28 +1260,13 @@
 							PRI_SPAN(e->ringing.channel), PRI_CHANNEL(e->ringing.channel), pri->span);
 					} else {
 						sig_pri_lock_private(pri->pvts[chanpos]);
-#if OLD
-						if (ast_strlen_zero(pri->pvts[chanpos]->dop.dialstr)) {
-#endif
-							sig_pri_set_echocanceller(pri->pvts[chanpos], 1);
-							pri_queue_control(pri->pvts[chanpos], AST_CONTROL_RINGING, pri);
-							pri->pvts[chanpos]->alerting = 1;
-#if OLD
-						} else
-							ast_debug(1, "Deferring ringing notification because of extra digits to dial...\n");
-#endif
+						sig_pri_set_echocanceller(pri->pvts[chanpos], 1);
+						pri_queue_control(pri->pvts[chanpos], AST_CONTROL_RINGING, pri);
+						pri->pvts[chanpos]->alerting = 1;
 #ifdef PRI_PROGRESS_MASK
 						if (e->ringing.progressmask & PRI_PROG_INBAND_AVAILABLE) {
 #else
 						if (e->ringing.progress == 8) {
-#endif
-#if OLD
-							/* Now we can do call progress detection */
-							if (pri->pvts[chanpos]->dsp && pri->pvts[chanpos]->dsp_features) {
-								/* RINGING detection isn't required because we got ALERTING signal */
-								ast_dsp_set_features(pri->pvts[chanpos]->dsp, pri->pvts[chanpos]->dsp_features & ~DSP_PROGRESS_RINGING);
-								pri->pvts[chanpos]->dsp_features = 0;
-							}
 #endif
 						}
 
@@ -1335,19 +1319,11 @@
 #else
 						if (e->proceeding.progress == 8) {
 #endif
-#if OLD
-							/* Now we can do call progress detection */
-							if (pri->pvts[chanpos]->dsp && pri->pvts[chanpos]->dsp_features) {
-								ast_dsp_set_features(pri->pvts[chanpos]->dsp, pri->pvts[chanpos]->dsp_features);
-								pri->pvts[chanpos]->dsp_features = 0;
-							}
-#endif
 							/* Bring voice path up */
 							f.subclass = AST_CONTROL_PROGRESS;
 							pri_queue_frame(pri->pvts[chanpos], &f, pri);
 						}
 						pri->pvts[chanpos]->progress = 1;
-						pri->pvts[chanpos]->dialing = 0;
 						sig_pri_unlock_private(pri->pvts[chanpos]);
 					}
 				}
@@ -1367,19 +1343,11 @@
 #else
 						if (e->proceeding.progress == 8) {
 #endif
-#if OLD
-							/* Now we can do call progress detection */
-							if (pri->pvts[chanpos]->dsp && pri->pvts[chanpos]->dsp_features) {
-								ast_dsp_set_features(pri->pvts[chanpos]->dsp, pri->pvts[chanpos]->dsp_features);
-								pri->pvts[chanpos]->dsp_features = 0;
-							}
-#endif
 							/* Bring voice path up */
 							f.subclass = AST_CONTROL_PROGRESS;
 							pri_queue_frame(pri->pvts[chanpos], &f, pri);
 						}
 						pri->pvts[chanpos]->proceeding = 1;
-						pri->pvts[chanpos]->dialing = 0;
 						sig_pri_unlock_private(pri->pvts[chanpos]);
 					}
 				}
@@ -1417,34 +1385,9 @@
 							PRI_SPAN(e->answer.channel), PRI_CHANNEL(e->answer.channel), pri->span);
 					} else {
 						sig_pri_lock_private(pri->pvts[chanpos]);
-						/* Now we can do call progress detection */
-
-						/* We changed this so it turns on the DSP no matter what... progress or no progress.
-						 * By this time, we need DTMF detection and other features that were previously disabled
-						 * -- Matt F */
-#if OLD
-						if (pri->pvts[chanpos]->dsp && pri->pvts[chanpos]->dsp_features) {
-							ast_dsp_set_features(pri->pvts[chanpos]->dsp, pri->pvts[chanpos]->dsp_features);
-							pri->pvts[chanpos]->dsp_features = 0;
-						}
-						if (!ast_strlen_zero(pri->pvts[chanpos]->dop.dialstr)) {
-							pri->pvts[chanpos]->dialing = 1;
-							/* Send any "w" waited stuff */
-							res = ioctl(pri->pvts[chanpos]->subs[SUB_REAL].dfd, DAHDI_DIAL, &pri->pvts[chanpos]->dop);
-							if (res < 0) {
-								ast_log(LOG_WARNING, "Unable to initiate dialing on trunk channel %d: %s\n", pri->pvts[chanpos]->channel, strerror(errno));
-								pri->pvts[chanpos]->dop.dialstr[0] = '\0';
-							} else 
-								ast_log(LOG_DEBUG, "Sent deferred digit string: %s\n", pri->pvts[chanpos]->dop.dialstr);
-							pri->pvts[chanpos]->dop.dialstr[0] = '\0';
-						} else {
-#endif
-							pri_queue_control(pri->pvts[chanpos], AST_CONTROL_ANSWER, pri);
-							/* Enable echo cancellation if it's not on already */
-							sig_pri_set_echocanceller(pri->pvts[chanpos], 1);
-#if OLD
-						}
-#endif
+						pri_queue_control(pri->pvts[chanpos], AST_CONTROL_ANSWER, pri);
+						/* Enable echo cancellation if it's not on already */
+						sig_pri_set_echocanceller(pri->pvts[chanpos], 1);
 
 #ifdef SUPPORT_USERUSER
 						if (!ast_strlen_zero(e->answer.useruserinfo)) {
@@ -1855,21 +1798,6 @@
 		ast_log(LOG_WARNING, "Number '%s' is shorter than stripmsd (%d)\n", c, p->stripmsd);
 		return -1;
 	}
-#if OLD
-	if (mysig != SIG_FXSKS) {
-		p->dop.op = DAHDI_DIAL_OP_REPLACE;
-		s = strchr(c + p->stripmsd, 'w');
-		if (s) {
-			if (strlen(s) > 1)
-				snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "T%s", s);
-			else
-				p->dop.dialstr[0] = '\0';
-			*s = '\0';
-		} else {
-			p->dop.dialstr[0] = '\0';
-		}
-	}
-#endif
 	if (pri_grab(p, p->pri)) {
 		ast_log(LOG_WARNING, "Failed to grab PRI!\n");
 		return -1;
@@ -2147,7 +2075,6 @@
 				}
 			}
 			p->proceeding = 1;
-			p->dialing = 0;
 		}
 		/* don't continue in ast_indicate */
 		res = 0;
@@ -2229,7 +2156,6 @@
 	/* Send a pri acknowledge */
 	if (!pri_grab(p, p->pri)) {
 		p->proceeding = 1;
-		p->dialing = 0;
 		res = pri_answer(p->pri->pri, p->call, 0, !p->digital);
 		pri_rel(p->pri);
 	} else {

Modified: team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.h?view=diff&rev=200586&r1=200585&r2=200586
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.h (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.h Mon Jun 15 11:41:04 2009
@@ -117,7 +117,6 @@
 	unsigned int priindication_oob:1;
 	unsigned int use_callerid:1;			/*!< Whether or not to use caller id on this channel */
 	unsigned int use_callingpres:1;			/*!< Whether to use the callingpres the calling switch sends */
-	unsigned int dialing:1;					/*!< jpeeler: TRUE if in the process of dialing digits or sending something */
 	char context[AST_MAX_CONTEXT];
 	int channel;					/*!< Channel Number or CRV */
 	char mohinterpret[MAX_MUSICCLASS];
@@ -162,7 +161,7 @@
 
 	struct sig_pri_callback *calls;
 	void *chan_pvt;
-	ast_mutex_t lock;						/*!< Mutex */  /*jpeeler not sure if this is OK */
+	ast_mutex_t service_lock;						/*!< Mutex for service messages */
 };
 
 struct sig_pri_pri {




More information about the asterisk-commits mailing list