[zaptel-commits] markster: branch 1.4 r4141 - /branches/1.4/kernel/zaptel-base.c

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Fri Apr 4 18:12:05 CDT 2008


Author: markster
Date: Fri Apr  4 18:12:04 2008
New Revision: 4141

URL: http://svn.digium.com/view/zaptel?view=rev&rev=4141
Log:
Allow continuous MFR2 transmission continuously

Modified:
    branches/1.4/kernel/zaptel-base.c

Modified: branches/1.4/kernel/zaptel-base.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/kernel/zaptel-base.c?view=diff&rev=4141&r1=4140&r2=4141
==============================================================================
--- branches/1.4/kernel/zaptel-base.c (original)
+++ branches/1.4/kernel/zaptel-base.c Fri Apr  4 18:12:04 2008
@@ -378,6 +378,8 @@
 	struct zt_tone mfr1[15];		/* MFR1 tones for this zone, with desired length */
 	struct zt_tone mfr2_fwd[15];		/* MFR2 FWD tones for this zone, with desired length */
 	struct zt_tone mfr2_rev[15];		/* MFR2 REV tones for this zone, with desired length */
+	struct zt_tone mfr2_fwd_continuous[16];	/* MFR2 FWD tones for this zone, continuous play */
+	struct zt_tone mfr2_rev_continuous[16];	/* MFR2 REV tones for this zone, continuous play */
 };
 
 static struct zt_span *spans[ZT_MAX_SPANS];
@@ -1195,6 +1197,48 @@
 		} else {
 			res = -EINVAL;
 		}
+	} else if (chan->digitmode == DIGIT_MODE_MFR2_FWD) {
+		if ((tone >= ZT_TONE_MFR2_FWD_BASE) && (tone <= ZT_TONE_MFR2_FWD_MAX)) {
+			chan->dialing = 1;
+			res = 0;
+			tone -= ZT_TONE_MFR2_FWD_BASE;
+			if (chan->curzone) {
+				/* Have a tone zone */
+				if (chan->curzone->mfr2_fwd_continuous[tone].tonesamples) {
+					chan->curtone = &chan->curzone->mfr2_fwd_continuous[tone];
+					res = 0;
+				} else {
+					/* Indicate that zone is loaded but no such tone exists */
+					res = -ENOSYS;
+				}
+			} else {
+				/* Note that no tone zone exists at the moment */
+				res = -ENODATA;
+			}
+		} else {
+			res = -EINVAL;
+		}
+	} else if (chan->digitmode == DIGIT_MODE_MFR2_REV) {
+		if ((tone >= ZT_TONE_MFR2_REV_BASE) && (tone <= ZT_TONE_MFR2_REV_MAX)) {
+			chan->dialing = 1;
+			res = 0;
+			tone -= ZT_TONE_MFR2_REV_BASE;
+			if (chan->curzone) {
+				/* Have a tone zone */
+				if (chan->curzone->mfr2_rev_continuous[tone].tonesamples) {
+					chan->curtone = &chan->curzone->mfr2_rev_continuous[tone];
+					res = 0;
+				} else {
+					/* Indicate that zone is loaded but no such tone exists */
+					res = -ENOSYS;
+				}
+			} else {
+				/* Note that no tone zone exists at the moment */
+				res = -ENODATA;
+			}
+		} else {
+			res = -EINVAL;
+		}
 	} else {
 		chan->dialing = 0;
 		res = -EINVAL;
@@ -2797,9 +2841,16 @@
 			t->next = &mfr1_silence;
 			break;
 		case MFR2_FWD_TONE:
+			t->tonesamples = global_dialparams.mfr2_tonelen;
+			t->next = &dtmf_silence;
+			z->mfr2_fwd_continuous[td.tone] = *t;
+			z->mfr2_fwd_continuous[td.tone].next = &z->mfr2_fwd_continuous[td.tone];
+			break;
 		case MFR2_REV_TONE:
 			t->tonesamples = global_dialparams.mfr2_tonelen;
 			t->next = &dtmf_silence;
+			z->mfr2_rev_continuous[td.tone] = *t;
+			z->mfr2_rev_continuous[td.tone].next = &z->mfr2_rev_continuous[td.tone];
 			break;
 		}
 	}




More information about the zaptel-commits mailing list