[asterisk-commits] oej: branch oej/videocaps r47985 - in /team/oej/videocaps: ./ main/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Nov 24 02:27:32 MST 2006


Author: oej
Date: Fri Nov 24 03:27:30 2006
New Revision: 47985

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47985
Log:
Update

Modified:
    team/oej/videocaps/   (props changed)
    team/oej/videocaps/CHANGES
    team/oej/videocaps/main/asterisk.c
    team/oej/videocaps/main/rtp.c

Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Nov 24 03:27:30 2006
@@ -1,1 +1,1 @@
-/trunk:1-47923
+/trunk:1-47956

Modified: team/oej/videocaps/CHANGES
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/CHANGES?view=diff&rev=47985&r1=47984&r2=47985
==============================================================================
--- team/oej/videocaps/CHANGES (original)
+++ team/oej/videocaps/CHANGES Fri Nov 24 03:27:30 2006
@@ -61,3 +61,5 @@
   * CID matching information is now shown when doing 'dialplan show'.
   * app_queue now has a 'loose' option which is almost exactly like 'strict' except it
      does not count paused queue members as unavailable.
+  * Added maxfiles option to options section of asterisk.conf which allows you to specify
+     what Asterisk should set as the maximum number of open files when it loads.

Modified: team/oej/videocaps/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/main/asterisk.c?view=diff&rev=47985&r1=47984&r2=47985
==============================================================================
--- team/oej/videocaps/main/asterisk.c (original)
+++ team/oej/videocaps/main/asterisk.c Fri Nov 24 03:27:30 2006
@@ -1011,6 +1011,29 @@
 	if (n == 0 && option_debug)	
 		printf("Huh?  Child handler, but nobody there?\n");
 	signal(sig, child_handler);
+}
+
+/*! \brief Set maximum open files */
+static void set_ulimit(int value)
+{
+	struct rlimit l = {0, 0};
+	
+	if (value <= 0) {
+		ast_log(LOG_WARNING, "Unable to change max files open to invalid value %i\n",value);
+		return;
+	}
+	
+	l.rlim_cur = value;
+	l.rlim_max = value;
+	
+	if (setrlimit(RLIMIT_NOFILE, &l)) {
+		ast_log(LOG_WARNING, "Unable to disable core size resource limit: %s\n",strerror(errno));
+		return;
+	}
+	
+	ast_log(LOG_NOTICE, "Setting max files open to %d\n",value);
+	
+	return;
 }
 
 /*! \brief Set an X-term or screen title */
@@ -2293,6 +2316,9 @@
 			} else if ((sscanf(v->value, "%lf", &option_maxload) != 1) || (option_maxload < 0.0)) {
 				option_maxload = 0.0;
 			}
+		/* Set the maximum amount of open files */
+		} else if (!strcasecmp(v->name, "maxfiles")) {
+			set_ulimit(atoi(v->value));
 		/* What user to run as */
 		} else if (!strcasecmp(v->name, "runuser")) {
 			ast_copy_string(ast_config_AST_RUN_USER, v->value, sizeof(ast_config_AST_RUN_USER));

Modified: team/oej/videocaps/main/rtp.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/main/rtp.c?view=diff&rev=47985&r1=47984&r2=47985
==============================================================================
--- team/oej/videocaps/main/rtp.c (original)
+++ team/oej/videocaps/main/rtp.c Fri Nov 24 03:27:30 2006
@@ -3019,7 +3019,7 @@
 }
 
 /*! \brief Bridge loop for partial native bridge (packet2packet) */
-static enum ast_bridge_result bridge_p2p_loop(struct ast_channel *c0, struct ast_channel *c1, struct ast_rtp *p0, struct ast_rtp *p1, struct ast_rtp *vp0, struct ast_rtp *vp1, int timeoutms, int flags, struct ast_frame **fo, struct ast_channel **rc, void *pvt0, void *pvt1)
+static enum ast_bridge_result bridge_p2p_loop(struct ast_channel *c0, struct ast_channel *c1, struct ast_rtp *p0, struct ast_rtp *p1, int timeoutms, int flags, struct ast_frame **fo, struct ast_channel **rc, void *pvt0, void *pvt1)
 {
 	struct ast_frame *fr = NULL;
 	struct ast_channel *who = NULL, *other = NULL, *cs[3] = {NULL, };
@@ -3032,12 +3032,6 @@
 	p0->bridged = p1;
 	ast_clear_flag(p1, FLAG_P2P_SENT_MARK);
 	p1->bridged = p0;
-	if (vp0) {
-		ast_clear_flag(vp0, FLAG_P2P_SENT_MARK);
-		vp0->bridged = vp1;
-		ast_clear_flag(vp1, FLAG_P2P_SENT_MARK);
-		vp1->bridged = vp0;
-	}
 
 	/* Activate callback modes if possible */
 	p0_callback = p2p_callback_enable(c0, p0, &p0_iod[0]);
@@ -3099,22 +3093,12 @@
 						p1_callback = p2p_callback_disable(c1, p1, &p1_iod[0]);
 					p0->bridged = NULL;
 					p1->bridged = NULL;
-					if (vp0) {
-						vp0->bridged = NULL;
-						vp1->bridged = NULL;
-					}
 				} else if (fr->subclass == AST_CONTROL_UNHOLD) {
 					/* If we are off hold, then go back to callback mode and P2P bridging */
 					ast_clear_flag(p0, FLAG_P2P_SENT_MARK);
 					p0->bridged = p1;
 					ast_clear_flag(p1, FLAG_P2P_SENT_MARK);
 					p1->bridged = p0;
-					if (vp0) {
-						ast_clear_flag(vp0, FLAG_P2P_SENT_MARK);
-						vp0->bridged = vp1;
-						ast_clear_flag(vp1, FLAG_P2P_SENT_MARK);
-						vp1->bridged = vp0;
-					}
 					p0_callback = p2p_callback_enable(c0, p0, &p0_iod[0]);
 					p1_callback = p2p_callback_enable(c1, p1, &p1_iod[0]);
 				}
@@ -3153,10 +3137,6 @@
 	/* Break out of the direct bridge */
 	p0->bridged = NULL;
 	p1->bridged = NULL;
-	if (vp0) {
-		vp0->bridged = NULL;
-		vp1->bridged = NULL;
-	}
 
 	return res;
 }
@@ -3266,7 +3246,7 @@
 		}
 		if (option_verbose > 2)
 			ast_verbose(VERBOSE_PREFIX_3 "Packet2Packet bridging %s and %s\n", c0->name, c1->name);
-		res = bridge_p2p_loop(c0, c1, p0, p1, vp0, vp1, timeoutms, flags, fo, rc, pvt0, pvt1);
+		res = bridge_p2p_loop(c0, c1, p0, p1, timeoutms, flags, fo, rc, pvt0, pvt1);
 	} else {
 		if (option_verbose > 2) 
 			ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s\n", c0->name, c1->name);



More information about the asterisk-commits mailing list