[asterisk-commits] moy: branch moy/dahdi-tap-1.6.2 r220098 - in /team/moy/dahdi-tap-1.6.2: chann...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 24 09:30:39 CDT 2009


Author: moy
Date: Thu Sep 24 09:30:34 2009
New Revision: 220098

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=220098
Log:
add passive=yes|no option in chan_dahdi.conf to enable the monitoring of lines

Modified:
    team/moy/dahdi-tap-1.6.2/channels/chan_dahdi.c
    team/moy/dahdi-tap-1.6.2/configs/chan_dahdi.conf.sample

Modified: team/moy/dahdi-tap-1.6.2/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/moy/dahdi-tap-1.6.2/channels/chan_dahdi.c?view=diff&rev=220098&r1=220097&r2=220098
==============================================================================
--- team/moy/dahdi-tap-1.6.2/channels/chan_dahdi.c (original)
+++ team/moy/dahdi-tap-1.6.2/channels/chan_dahdi.c Thu Sep 24 09:30:34 2009
@@ -553,6 +553,8 @@
 	long resetinterval;						/*!< Interval (in seconds) for resetting unused channels */
 	/*! \brief ISDN signalling type (SIG_PRI, SIG_BRI, SIG_BRI_PTMP, etc...) */
 	int sig;
+	/*! \brief Whether this is a passive PRI (just sniffing/monitoring) */
+	int passive;
 	struct dahdi_pvt *pvts[MAX_CHANNELS];				/*!< Member channel pvt structs */
 	struct dahdi_pvt *crvs;						/*!< Member CRV structs */
 	struct dahdi_pvt *crvend;						/*!< Pointer to end of CRV structs */
@@ -10252,6 +10254,7 @@
 						pris[span].minunused = conf->pri.minunused;
 						pris[span].minidle = conf->pri.minidle;
 						pris[span].overlapdial = conf->pri.overlapdial;
+						pris[span].passive = conf->pri.passive;
 						pris[span].qsigchannelmapping = conf->pri.qsigchannelmapping;
 						pris[span].discardremoteholdretrieval = conf->pri.discardremoteholdretrieval;
 #ifdef HAVE_PRI_INBANDDISCONNECT
@@ -12408,7 +12411,7 @@
 	int peerspan = !(pri->span % 2) ? (pri->span - 1) : (pri->span + 1);
 	struct dahdi_pri *peerpri = pri_find_by_span(peerspan);
 	if (!peerpri) {
-		ast_log(LOG_WARNING, "Ignoring passive PRI event on span %d, no peer span found\n", pri->span);
+		ast_log(LOG_WARNING, "Ignoring passive PRI event on span %d, no peer span found!\n", pri->span);
 		return;
 	}
 	/* XXX TODO: chanpos is calculated for both pri and peerpri, is it needed or will it be always the same chanpos for both? XXX */
@@ -12757,15 +12760,15 @@
 
 					ast_debug(1, "Got event %s (%d) on D-channel for span %d\n", event2str(x), x, pri->span);
 				} else if (fds[which].revents & POLLIN) {
-#ifdef CHAN_DAHDI_NORMAL
-					e = pri_check_event(pri->dchans[which]);
-#else
-					e = pri_read_event(pri->dchans[which]);
-					if (e) {
-						handle_pri_passive_event(pri, e);
-						e = NULL;
+					if (!pri->passive) {
+						e = pri_check_event(pri->dchans[which]);
+					} else {
+						e = pri_read_event(pri->dchans[which]);
+						if (e) {
+							handle_pri_passive_event(pri, e);
+							e = NULL;
+						}
 					}
-#endif
 				}
 				if (e)
 					break;
@@ -16861,6 +16864,8 @@
 				ast_copy_string(confp->pri.idleext, v->value, sizeof(confp->pri.idleext));
 			} else if (!strcasecmp(v->name, "idledial")) {
 				ast_copy_string(confp->pri.idledial, v->value, sizeof(confp->pri.idledial));
+			} else if (!strcasecmp(v->name, "passive")) {
+				confp->pri.passive = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "overlapdial")) {
 				if (ast_true(v->value)) {
 					confp->pri.overlapdial = DAHDI_OVERLAPDIAL_BOTH;

Modified: team/moy/dahdi-tap-1.6.2/configs/chan_dahdi.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/moy/dahdi-tap-1.6.2/configs/chan_dahdi.conf.sample?view=diff&rev=220098&r1=220097&r2=220098
==============================================================================
--- team/moy/dahdi-tap-1.6.2/configs/chan_dahdi.conf.sample (original)
+++ team/moy/dahdi-tap-1.6.2/configs/chan_dahdi.conf.sample Thu Sep 24 09:30:34 2009
@@ -586,7 +586,10 @@
                                                 ; cause the given audio file to
                                                 ; be played upon completion of
                                                 ; an attended transfer.
-
+; Specify whether the channels are passive (just monitoring calls via tapping)
+; default is no, and you should only use this option if you are moniroting another
+; lines via physical tapping.
+; passive=no
 ;
 ; Specify whether the channel should be answered immediately or if the simple
 ; switch should provide dialtone, read digits, etc.




More information about the asterisk-commits mailing list