summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjim <jim@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-08-26 16:40:29 +0000
committerjim <jim@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-08-26 16:40:29 +0000
commit7e0441c99f1cae94e43fa75a6c13971079098e0f (patch)
tree3d052c284f203ea9606031f85b4b1c8e932a8b05
parent96700a26a7de67bf928b10e549d2e40ed8e1e257 (diff)
Added RINGBEGIN event (optionally)
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@747 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rwxr-xr-xzaptel.c5
-rwxr-xr-xzaptel.h3
-rwxr-xr-xzconfig.h7
3 files changed, 15 insertions, 0 deletions
diff --git a/zaptel.c b/zaptel.c
index 714fc66..da898c6 100755
--- a/zaptel.c
+++ b/zaptel.c
@@ -5139,6 +5139,11 @@ static void __zt_hooksig_pvt(struct zt_chan *chan, zt_rxsig_t rxsig)
if ((chan->flags & ZT_FLAG_SIGFREEZE)) return;
chan->rxhooksig = rxsig;
+#ifdef RINGBEGIN
+ if ((chan->sig & __ZT_SIG_FXS) && (rxsig == ZT_RXSIG_RING) &&
+ (!chan->ringdebtimer))
+ __qevent(chan,ZT_EVENT_RINGBEGIN);
+#endif
switch(chan->sig) {
case ZT_SIG_EM: /* E and M */
case ZT_SIG_EM_E1:
diff --git a/zaptel.h b/zaptel.h
index a096fc0..bb872e1 100755
--- a/zaptel.h
+++ b/zaptel.h
@@ -804,6 +804,9 @@ struct zt_tone_def { /* Structure for zone programming */
/* Timer event -- ping ready */
#define ZT_EVENT_TIMER_PING 16
+/* Ring Begin event */
+#define ZT_EVENT_RINGBEGIN 18
+
/* Polarity reversal event */
#define ZT_EVENT_POLARITY 17
diff --git a/zconfig.h b/zconfig.h
index 1b4dc9c..b02397c 100755
--- a/zconfig.h
+++ b/zconfig.h
@@ -140,4 +140,11 @@
*/
/* #define EMFLASH */
+/*
+ * Comment out the following if you dont want events to indicate the
+ * beginning of an incomming ring. Most non-asterisk applications will
+ * want this commented out.
+ */
+/* #define RINGBEGIN */
+
#endif