Merge gryn's transfer digit timeout patch (bug #2184)
authorMark Spencer <markster@digium.com>
Sun, 1 Aug 2004 01:38:15 +0000 (01:38 +0000)
committerMark Spencer <markster@digium.com>
Sun, 1 Aug 2004 01:38:15 +0000 (01:38 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3555 65c4cc65-6c06-0410-ace0-fbb531ad65f3

configs/features.conf.sample
res/res_features.c

index 20eb427..4b0fda5 100755 (executable)
@@ -7,3 +7,4 @@ parkext => 700                          ; What ext. to dial to park
 parkpos => 701-720                     ; What extensions to park calls on
 context => parkedcalls                 ; Which context parked calls are in
 ;parkingtime => 45                     ; Number of seconds a call can be parked for (default is 45 seconds)
 parkpos => 701-720                     ; What extensions to park calls on
 context => parkedcalls                 ; Which context parked calls are in
 ;parkingtime => 45                     ; Number of seconds a call can be parked for (default is 45 seconds)
+;transferdigittimeout => 3     ; Number of seconds to wait between digits when transfering a call
index 2190cd2..f6b4dfc 100755 (executable)
@@ -38,6 +38,7 @@
 #include <netinet/in.h>
 
 #define DEFAULT_PARK_TIME 45000
 #include <netinet/in.h>
 
 #define DEFAULT_PARK_TIME 45000
+#define DEFAULT_TRANSFER_DIGIT_TIMEOUT 3000
 
 static char *parkedcall = "ParkedCall";
 
 
 static char *parkedcall = "ParkedCall";
 
@@ -58,6 +59,8 @@ static int parking_start = 701;
 /* Last available extension for parking */
 static int parking_stop = 750;
 
 /* 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";
 
 /* Registrar for operations */
 static char *registrar = "res_parking";
 
@@ -342,7 +345,7 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
                                }
                                res = 0;
                                while(strlen(newext) < sizeof(newext) - 1) {
                                }
                                res = 0;
                                while(strlen(newext) < sizeof(newext) - 1) {
-                                       res = ast_waitfordigit(transferer, 3000);
+                                       res = ast_waitfordigit(transferer, transferdigittimeout);
                                        if (res < 1) 
                                                break;
                                        if (res == '#')
                                        if (res < 1) 
                                                break;
                                        if (res == '#')
@@ -728,6 +731,12 @@ int load_module(void)
                                        parking_start = start;
                                        parking_stop = end;
                                }
                                        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;
                }
                        }
                        var = var->next;
                }