[zaptel-commits] sruffell: branch sruffell/voicebus r3950 - /team/sruffell/voicebus/kernel/

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Thu Mar 6 14:24:22 CST 2008


Author: sruffell
Date: Thu Mar  6 14:24:21 2008
New Revision: 3950

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3950
Log:
Add some error messages if a request to start a tone comes in when a tone zone
is not loaded / configured.

Modified:
    team/sruffell/voicebus/kernel/zaptel-base.c

Modified: team/sruffell/voicebus/kernel/zaptel-base.c
URL: http://svn.digium.com/view/zaptel/team/sruffell/voicebus/kernel/zaptel-base.c?view=diff&rev=3950&r1=3949&r2=3950
==============================================================================
--- team/sruffell/voicebus/kernel/zaptel-base.c (original)
+++ team/sruffell/voicebus/kernel/zaptel-base.c Thu Mar  6 14:24:21 2008
@@ -3851,6 +3851,12 @@
 		for (s = stack.tdo.dialstr; *s; s++)
 			*s = toupper(*s);
 		spin_lock_irqsave(&chan->lock, flags);
+		if (!chan->curzone) {
+			spin_unlock_irqrestore(&chan->lock, flags);
+			/* The tone zones are loaded by ztcfg from /etc/zaptel.conf */
+			printk(KERN_WARNING "zaptel: Cannot dial until a tone zone is loaded.\n");
+			return -ENODATA;
+		}
 		switch (stack.tdo.op) {
 		case ZT_DIAL_OP_CANCEL:
 			chan->curtone = NULL;
@@ -4723,6 +4729,11 @@
 			case ZT_RING:
 			case ZT_START:
 				spin_lock_irqsave(&chan->lock, flags);
+				if (!chan->curzone) {
+					spin_unlock_irqrestore(&chan->lock, flags);
+					printk(KERN_WARNING "zaptel: Cannot start tone until a tone zone is loaded.\n");
+					return -ENODATA;
+				}
 				if (chan->txstate != ZT_TXSTATE_ONHOOK) {
 					spin_unlock_irqrestore(&chan->lock, flags);
 					return -EBUSY;




More information about the zaptel-commits mailing list