[Asterisk-cvs] asterisk/res res_features.c,1.3,1.4

markster at lists.digium.com markster at lists.digium.com
Sat Jul 31 21:52:12 CDT 2004


Update of /usr/cvsroot/asterisk/res
In directory localhost.localdomain:/tmp/cvs-serv9457/res

Modified Files:
	res_features.c 
Log Message:
Merge gryn's transfer digit timeout patch (bug #2184)


Index: res_features.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_features.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- res_features.c	28 Jul 2004 19:25:14 -0000	1.3
+++ res_features.c	1 Aug 2004 01:38:15 -0000	1.4
@@ -38,6 +38,7 @@
 #include <netinet/in.h>
 
 #define DEFAULT_PARK_TIME 45000
+#define DEFAULT_TRANSFER_DIGIT_TIMEOUT 3000
 
 static char *parkedcall = "ParkedCall";
 
@@ -58,6 +59,8 @@
 /* Last available extension for parking */
 static int parking_stop = 750;
 
+static int transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT;
+
 /* Registrar for operations */
 static char *registrar = "res_parking";
 
@@ -342,7 +345,7 @@
 				}
 				res = 0;
 				while(strlen(newext) < sizeof(newext) - 1) {
-					res = ast_waitfordigit(transferer, 3000);
+					res = ast_waitfordigit(transferer, transferdigittimeout);
 					if (res < 1) 
 						break;
 					if (res == '#')
@@ -728,6 +731,12 @@
 					parking_start = start;
 					parking_stop = end;
 				}
+			} else if(!strcasecmp(var->name, "transferdigittimeout")) {
+				if ((sscanf(var->value, "%d", &transferdigittimeout) != 1) || (transferdigittimeout < 1)) {
+					ast_log(LOG_WARNING, "%s is not a valid transferdigittimeout\n", var->value);
+					transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT;
+				} else
+					transferdigittimeout = transferdigittimeout * 1000;
 			}
 			var = var->next;
 		}




More information about the svn-commits mailing list