[asterisk-commits] russell: branch 1.4 r75053 - in /branches/1.4: ./ channels/chan_zap.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 13 14:11:26 CDT 2007


Author: russell
Date: Fri Jul 13 14:11:26 2007
New Revision: 75053

URL: http://svn.digium.com/view/asterisk?view=rev&rev=75053
Log:
Merged revisions 75052 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r75052 | russell | 2007-07-13 14:10:00 -0500 (Fri, 13 Jul 2007) | 12 lines

(closes issue #9660)
Reported by: mmacvicar
Patches submitted by: bbryant, russell
Tested by: mmacvicar, marco, arcivanov, jmhunter, explidous

When using a TDM400P (and probably other analog cards) there was a chance that
you could hang up and pick the phone back up where it has been long enough to
be not considered a flash hook, but too soon such that the device reports that
it is busy and the person on the phone will only hear silence.  This patch
makes chan_zap more tolerant of this and gives the device a couple of seconds 
to succeed so the person on the phone happily gets their dialtone.

........

Modified:
    branches/1.4/   (props changed)
    branches/1.4/channels/chan_zap.c

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: branches/1.4/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_zap.c?view=diff&rev=75053&r1=75052&r2=75053
==============================================================================
--- branches/1.4/channels/chan_zap.c (original)
+++ branches/1.4/channels/chan_zap.c Fri Jul 13 14:11:26 2007
@@ -1607,14 +1607,23 @@
 
 static inline int zt_set_hook(int fd, int hs)
 {
-	int x, res;
+	int x, res, count = 0;
+
 	x = hs;
 	res = ioctl(fd, ZT_HOOK, &x);
-	if (res < 0) 
-	{
+
+	while (res < 0 && count < 20) {
+		usleep(100000); /* 1/10 sec. */
+		x = hs;
+		res = ioctl(fd, ZT_HOOK, &x);
+		count++;
+	}
+
+	if (res < 0) {
 		if (errno == EINPROGRESS) return 0;
 		ast_log(LOG_WARNING, "zt hook failed: %s\n", strerror(errno));
 	}
+
 	return res;
 }
 




More information about the asterisk-commits mailing list