[asterisk-commits] russell: branch group/vldtmf r40481 - /team/group/vldtmf/channels/chan_zap.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Aug 18 19:35:52 MST 2006


Author: russell
Date: Fri Aug 18 21:35:51 2006
New Revision: 40481

URL: http://svn.digium.com/view/asterisk?rev=40481&view=rev
Log:
minor tweaks to ensure that DTMF still works if the version of zaptel in use
doesn't support the ZT_SENDTONE ioctl

Modified:
    team/group/vldtmf/channels/chan_zap.c

Modified: team/group/vldtmf/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf/channels/chan_zap.c?rev=40481&r1=40480&r2=40481&view=diff
==============================================================================
--- team/group/vldtmf/channels/chan_zap.c (original)
+++ team/group/vldtmf/channels/chan_zap.c Fri Aug 18 21:35:51 2006
@@ -1057,7 +1057,7 @@
 	if ((dtmf = digit_to_dtmfindex(digit)) == -1)
 		goto out;
 
-	if (pvt->pulse) {
+	if (pvt->pulse || ioctl(pvt->subs[SUB_REAL].zfd, ZT_SENDTONE, &dtmf)) {
 		int res;
 		ZT_DIAL_OPERATION zo = {
 			.op = ZT_DIAL_OP_APPEND,
@@ -1069,7 +1069,7 @@
 			ast_log(LOG_WARNING, "Couldn't dial digit %c\n", digit);
 		else
 			pvt->dialing = 1;
-	} else if (!ioctl(pvt->subs[SUB_REAL].zfd, ZT_SENDTONE, &dtmf)) {
+	} else {
 		ast_log(LOG_DEBUG, "Started VLDTMF digit '%c'\n", digit);
 		pvt->dialing = 1;
 		pvt->begindigit = digit;
@@ -1102,10 +1102,12 @@
 		goto out;
 #endif
 
-	ast_log(LOG_DEBUG, "Ending VLDTMF digit '%c'\n", digit);
-	res = ioctl(pvt->subs[SUB_REAL].zfd, ZT_SENDTONE, -1);
-	pvt->dialing = 0;
-	pvt->begindigit = 0;
+	if (pvt->begindigit) {
+		ast_log(LOG_DEBUG, "Ending VLDTMF digit '%c'\n", digit);
+		res = ioctl(pvt->subs[SUB_REAL].zfd, ZT_SENDTONE, -1);
+		pvt->dialing = 0;
+		pvt->begindigit = 0;
+	}
 
 out:
 	ast_mutex_unlock(&pvt->lock);



More information about the asterisk-commits mailing list