Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv6816

Modified Files:
        rtp.c 
Log Message:
allow DTMF timeout to be configurable (issue #5160)


Index: rtp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/rtp.c,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -d -r1.151 -r1.152
--- rtp.c       24 Oct 2005 20:12:05 -0000      1.151
+++ rtp.c       1 Nov 2005 00:06:43 -0000       1.152
@@ -58,7 +58,9 @@
 
 #define RTP_MTU                1200
 
-static int dtmftimeout = 3000; /* 3000 samples */
+#define DEFAULT_DTMF_TIMEOUT 3000 /* samples */
+
+static int dtmftimeout = DEFAULT_DTMF_TIMEOUT;
 
 static int rtpstart = 0;
 static int rtpend = 0;
@@ -1813,6 +1815,7 @@
 
        rtpstart = 5000;
        rtpend = 31000;
+       dtmftimeout = DEFAULT_DTMF_TIMEOUT;
        cfg = ast_config_load("rtp.conf");
        if (cfg) {
                if ((s = ast_variable_retrieve(cfg, "general", "rtpstart"))) {
@@ -1840,6 +1843,14 @@
                                ast_log(LOG_WARNING, "Disabling RTP checksums 
is not supported on this operating system!\n");
 #endif
                }
+               if ((s = ast_variable_retrieve(cfg, "general", "dtmftimeout"))) 
{
+                       dtmftimeout = atoi(s);
+                       if ((dtmftimeout < 0) || (dtmftimeout > 20000)) {
+                               ast_log(LOG_WARNING, "DTMF timeout of '%d' 
outside range, using default of '%d' instead\n",
+                                       dtmftimeout, DEFAULT_DTMF_TIMEOUT);
+                               dtmftimeout = DEFAULT_DTMF_TIMEOUT;
+                       };
+               }
                ast_config_destroy(cfg);
        }
        if (rtpstart >= rtpend) {

_______________________________________________
Asterisk-Cvs mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-cvs

Reply via email to