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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 11 17:55:53 CDT 2009


Author: jpeeler
Date: Thu Jun 11 17:55:50 2009
New Revision: 200231

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=200231
Log:
get rid of ununused callback, remove DCHAN_PROVISIONED, enable do_idle_thread, some other stuff

Modified:
    team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c
    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/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c?view=diff&rev=200231&r1=200230&r2=200231
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c Thu Jun 11 17:55:50 2009
@@ -2331,7 +2331,6 @@
 	.unlock_private = my_unlock_private,
 	.new_ast_channel = my_new_pri_ast_channel,
 	.fixup_chans = my_pri_fixup_chans,
-/* jpeeler queue_control ? */
 };
 
 /*!
@@ -7779,7 +7778,6 @@
 	if (transfercapability & AST_TRANS_CAP_DIGITAL)
 		i->digital = 1;
 	/* Assume calls are not idle calls unless we're told differently */
-	/* jpeeler, needed for ss7 only? */
 	i->isidlecall = 0;
 	i->alreadyhungup = 0;
 #endif
@@ -9868,7 +9866,6 @@
 				return 0;
 			}
 			/* jpeeler */
-			//pris[*span].dchanavail[0] |= DCHAN_PROVISIONED;
 			//pris[*span].offset = offset;
 			pris[*span].pri.span = *span + 1;
 		}
@@ -9934,7 +9931,6 @@
 			ospan = span;
 		}
 		pris[ospan].dchannels[y] = channels[y];
-		//pris[ospan].dchanavail[y] |= DCHAN_PROVISIONED;
 		pris[span].pri.span = span + 1;
 		close(fd);
 	}
@@ -13042,8 +13038,6 @@
 	memset(pris, 0, sizeof(pris));
 	for (i = 0; i < NUM_SPANS; i++) {
 		ast_mutex_init(&pris[i].pri.lock);
-		/* jpeeler: may be unnecessary */
-		//pris[i].offset = -1;
 		pris[i].pri.master = AST_PTHREADT_NULL;
 		for (j = 0; j < NUM_DCHANS; j++)
 			pris[i].pri.fds[j] = -1;

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=200231&r1=200230&r2=200231
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.c Thu Jun 11 17:55:50 2009
@@ -50,9 +50,8 @@
 
 static int pri_gendigittimeout = 8000;
 
-#define DCHAN_PROVISIONED (1 << 0)
-#define DCHAN_NOTINALARM  (1 << 1)
-#define DCHAN_UP          (1 << 2)
+#define DCHAN_NOTINALARM  (1 << 0)
+#define DCHAN_UP          (1 << 1)
 
 #define PRI_CHANNEL(p) ((p) & 0xff)
 #define PRI_SPAN(p) (((p) >> 8) & 0xff)
@@ -140,12 +139,6 @@
 		return p->calls->play_tone(p->chan_pvt, tone);
 	else
 		return -1;
-}
-
-static void sig_pri_queue_control(struct sig_pri_chan *p, int subclass)
-{
-	if (p->calls->queue_control)
-		p->calls->queue_control(p->chan_pvt, subclass);
 }
 
 static struct ast_channel * sig_pri_new_ast_channel(struct sig_pri_chan *p, int state, int startpbx, int ulaw, int transfercapability, char *exten)
@@ -290,8 +283,6 @@
 static void pri_queue_control(struct sig_pri_chan *p, int subclass, struct sig_pri_pri *pri)
 {
 	struct ast_frame f = {AST_FRAME_CONTROL, };
-
-	sig_pri_queue_control(p, subclass);
 
 	f.subclass = subclass;
 	pri_queue_frame(p, &f, pri);
@@ -483,7 +474,6 @@
 	return -1;
 }
 
-#ifdef XXX
 static void *do_idle_thread(void *vchan)
 {
 	struct ast_channel *chan = vchan;
@@ -531,7 +521,6 @@
 	ast_hangup(chan);
 	return NULL;
 }
-#endif /* XXX */
 
 static void *pri_ss_thread(void *data)
 {
@@ -648,9 +637,7 @@
 	char plancallingnum[256];
 	char plancallingani[256];
 	char calledtonstr[10];
-#ifdef XXX
 	struct timeval lastidle = { 0, 0 };
-	int cause=0;
 	pthread_t p;
 	struct ast_channel *idle;
 	char idlen[80];
@@ -659,7 +646,6 @@
 	int activeidles;
 	
 	gettimeofday(&lastidle, NULL);
-#endif
 	pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
 
 	if (!ast_strlen_zero(pri->idledial) && !ast_strlen_zero(pri->idleext)) {
@@ -702,7 +688,6 @@
 			}
 		}
 		/* Look for any idle channels if appropriate */
-#ifdef XXX
 		if (doidling && pri_is_up(pri)) {
 			nextidle = -1;
 			haveidles = 0;
@@ -723,12 +708,12 @@
 				if (ast_tvdiff_ms(ast_tvnow(), lastidle) > 1000) {
 					/* Don't create a new idle call more than once per second */
 					snprintf(idlen, sizeof(idlen), "%d/%s", pri->pvts[nextidle]->channel, pri->idledial);
-					idle = dahdi_request(dahdi_chan_name, AST_FORMAT_ULAW, idlen, &cause);
+					idle = sig_pri_request(pri->pvts[nextidle], AST_FORMAT_ULAW);
 					if (idle) {
 						pri->pvts[nextidle]->isidlecall = 1;
 						if (ast_pthread_create_background(&p, NULL, do_idle_thread, idle)) {
 							ast_log(LOG_WARNING, "Unable to start new thread for idle channel '%s'\n", idle->name);
-							ast_hangup(idle); /* jpeeler: pri_hangup? */
+							ast_hangup(idle);
 						}
 					} else
 						ast_log(LOG_WARNING, "Unable to request channel 'DAHDI/%s' for idle call\n", idlen);
@@ -752,7 +737,6 @@
 				}
 			}
 		}
-#endif /* XXX */
 		/* Start with reasonable max */
 		lowest = ast_tv(60, 0);
 		for (i = 0; i < NUM_DCHANS; i++) {
@@ -1377,7 +1361,6 @@
 						sig_pri_lock_private(pri->pvts[chanpos]);
 						ast_log(LOG_DEBUG, "Queuing frame from PRI_EVENT_PROCEEDING on channel %d/%d span %d\n",
 								pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset,pri->span);
-						sig_pri_queue_control(pri->pvts[chanpos], AST_CONTROL_PROCEEDING);
 						pri_queue_frame(pri->pvts[chanpos], &f, pri);
 #ifdef PRI_PROGRESS_MASK
 						if (e->proceeding.progressmask & PRI_PROG_INBAND_AVAILABLE) {
@@ -2432,8 +2415,6 @@
 		return;
 	}
 	s[0] = '\0';
-	if (status & DCHAN_PROVISIONED)
-		strncat(s, "Provisioned, ", len - strlen(s) - 1);
 	if (!(status & DCHAN_NOTINALARM))
 		strncat(s, "In Alarm, ", len - strlen(s) - 1);
 	if (status & DCHAN_UP)

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=200231&r1=200230&r2=200231
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.h (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/sig_pri.h Thu Jun 11 17:55:50 2009
@@ -70,8 +70,6 @@
 
 	/* Note: Called with PRI lock held */
 	void (* const handle_dchan_exception)(struct sig_pri_pri *pri, int index);
-
-	void (* const queue_control)(void *pvt, int subclass);
 };
 
 #define NUM_DCHANS		4	/*!< No more than 4 d-channels */




More information about the asterisk-commits mailing list