[svn-commits] murf: branch murf/bug8221 r47978 - in /team/murf/bug8221: ./ apps/ channels/ ...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Thu Nov 23 16:28:10 MST 2006


Author: murf
Date: Thu Nov 23 17:28:09 2006
New Revision: 47978

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47978
Log:
Merged revisions 47880-47881,47893,47898,47912,47923,47933-47935,47945,47957,47960 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r47880 | rizzo | 2006-11-21 04:07:30 -0700 (Tue, 21 Nov 2006) | 8 lines

do not ast_hangup() on a NULL channel.
In the original code this would happen in the case of
	o->forwards >=  AST_MAX_FORWARDS

Likely an 1.2/1.4 isse as well - please someone have a look,
while I am hunting a few more similar panics now.


................
r47881 | rizzo | 2006-11-21 04:53:06 -0700 (Tue, 21 Nov 2006) | 10 lines

better fix for the previous bug.

In general this code needs a deep revision, because the body of
do_forward() deletes/overwrites the output channel without freeing
the resouce in some cases, and without notifying the caller.

Also, on FreeBSD with MALLOC_OPTIONS set i am seeing various panics
(duplicate freee etc.)


................
r47893 | oej | 2006-11-21 08:25:38 -0700 (Tue, 21 Nov 2006) | 2 lines

Treat 101 as 100, not 183 session progress

................
r47898 | file | 2006-11-21 10:34:22 -0700 (Tue, 21 Nov 2006) | 10 lines

Merged revisions 47897 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r47897 | file | 2006-11-21 12:32:27 -0500 (Tue, 21 Nov 2006) | 2 lines

If we have the non standard G726-32 setting turned on we want to return G726-32 to the SDP, not our AAL2 string. (issue #8330 reported by voipgate)

........

................
r47912 | markster | 2006-11-21 22:49:06 -0700 (Tue, 21 Nov 2006) | 2 lines

Restore some sense of security to manager

................
r47923 | oej | 2006-11-22 04:28:12 -0700 (Wed, 22 Nov 2006) | 2 lines

Don't over-deprecate... :-)

................
r47933 | file | 2006-11-22 10:41:07 -0700 (Wed, 22 Nov 2006) | 2 lines

Add support to set the maximum number of files open when Asterisk loads using the 'maxfiles' configuration option. (issue #7499 reported by rkarlsba)

................
r47934 | file | 2006-11-22 10:43:36 -0700 (Wed, 22 Nov 2006) | 2 lines

Need to update the CHANGES file as well for the maxfiles option.

................
r47935 | file | 2006-11-22 10:47:14 -0700 (Wed, 22 Nov 2006) | 2 lines

Clarify a bit more.

................
r47945 | file | 2006-11-22 14:49:11 -0700 (Wed, 22 Nov 2006) | 10 lines

Merged revisions 47944 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r47944 | file | 2006-11-22 16:47:43 -0500 (Wed, 22 Nov 2006) | 2 lines

Video will never reach Packet2Packet bridging and can do more harm then good.

........

................
r47957 | oej | 2006-11-23 03:46:09 -0700 (Thu, 23 Nov 2006) | 2 lines

Document new configuration option.

................
r47960 | oej | 2006-11-23 04:04:25 -0700 (Thu, 23 Nov 2006) | 2 lines

Remove unused memory allocation

................

Modified:
    team/murf/bug8221/   (props changed)
    team/murf/bug8221/CHANGES
    team/murf/bug8221/apps/app_dial.c
    team/murf/bug8221/channels/chan_h323.c
    team/murf/bug8221/channels/chan_sip.c
    team/murf/bug8221/doc/asterisk-conf.txt
    team/murf/bug8221/main/asterisk.c
    team/murf/bug8221/main/manager.c
    team/murf/bug8221/main/rtp.c

Propchange: team/murf/bug8221/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/murf/bug8221/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/murf/bug8221/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Nov 23 17:28:09 2006
@@ -1,1 +1,1 @@
-/trunk:1-47869
+/branches/1.4:1-47483

Modified: team/murf/bug8221/CHANGES
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221/CHANGES?view=diff&rev=47978&r1=47977&r2=47978
==============================================================================
--- team/murf/bug8221/CHANGES (original)
+++ team/murf/bug8221/CHANGES Thu Nov 23 17:28:09 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/murf/bug8221/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221/apps/app_dial.c?view=diff&rev=47978&r1=47977&r2=47978
==============================================================================
--- team/murf/bug8221/apps/app_dial.c (original)
+++ team/murf/bug8221/apps/app_dial.c Thu Nov 23 17:28:09 2006
@@ -419,7 +419,12 @@
 					src->name, dialstatus);
 }	
 
-/* helper function for wait_for_answer() */
+/*!
+ * helper function for wait_for_answer()
+ *
+ * XXX this code is highly suspicious, as it essentially overwrites
+ * the outgoing channel without properly deleting it.
+ */
 static void do_forward(struct dial_localuser *o,
 	struct cause_args *num, struct ast_flags *peerflags, int single)
 {
@@ -504,10 +509,10 @@
 				char cidname[AST_MAX_EXTENSION];
 				ast_set_callerid(c, S_OR(in->macroexten, in->exten), get_cid_name(cidname, sizeof(cidname), in), NULL);
 			}
-		}
-	}
-	/* Hangup the original channel now, in case we needed it */
-	ast_hangup(c);
+			/* Hangup the original channel now, in case we needed it */
+			ast_hangup(c);
+		}
+	}
 }
 
 /* argument used for some functions. */

Modified: team/murf/bug8221/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221/channels/chan_h323.c?view=diff&rev=47978&r1=47977&r2=47978
==============================================================================
--- team/murf/bug8221/channels/chan_h323.c (original)
+++ team/murf/bug8221/channels/chan_h323.c Thu Nov 23 17:28:09 2006
@@ -2754,21 +2754,6 @@
 	h323_tokens_show, "Show all active call tokens",
 	show_tokens_usage };
 
-static struct ast_cli_entry cli_h323_debug_deprecated = {
-	{ "h.323", "debug", NULL },
-	h323_do_debug, "Enable H.323 debug",
-	debug_usage };
-
-static struct ast_cli_entry cli_h323_trace_deprecated = {
-	{ "h.323", "trace", NULL },
-	h323_do_trace, "Enable H.323 Stack Tracing",
-	trace_usage };
-
-static struct ast_cli_entry cli_h323_gk_cycle_deprecated = {
-	{ "h323", "cycle", "gk", NULL },
-	h323_gk_cycle, "Manually re-register with the Gatekeper",
-	show_cycle_usage };
-
 static struct ast_cli_entry cli_h323[] = {
 	{ { "h323", "set", "trace", NULL },
 	h323_do_trace, "Enable H.323 Stack Tracing",

Modified: team/murf/bug8221/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221/channels/chan_sip.c?view=diff&rev=47978&r1=47977&r2=47978
==============================================================================
--- team/murf/bug8221/channels/chan_sip.c (original)
+++ team/murf/bug8221/channels/chan_sip.c Thu Nov 23 17:28:09 2006
@@ -558,7 +558,7 @@
 static int allow_external_domains;	/*!< Accept calls to external SIP domains? */
 static int global_callevents;		/*!< Whether we send manager events or not */
 static int global_t1min;		/*!< T1 roundtrip time minimum */
-static int global_autoframing;          /*!< ?????????? */
+static int global_autoframing;          /*!< Turn autoframing on or off. */
 static enum transfermodes global_allowtransfer;	/*!< SIP Refer restriction scheme */
 
 /*! \brief Codecs that we support by default: */
@@ -11724,7 +11724,7 @@
 	/* RFC3261 says we must treat every 1xx response (but not 100)
 	   that we don't recognize as if it was 183.
 	*/
-	if (resp > 100 && resp < 200 && resp != 180 && resp != 183)
+	if (resp > 100 && resp < 200 && resp!=101 && resp != 180 && resp != 183)
 		resp = 183;
 
  	/* Any response between 100 and 199 is PROCEEDING */
@@ -11738,6 +11738,7 @@
 
 	switch (resp) {
 	case 100:	/* Trying */
+	case 101:	/* Dialog establishment */
 		if (!ast_test_flag(req, SIP_PKT_IGNORE))
 			sip_cancel_destroy(p);
 		check_pendings(p);
@@ -12232,6 +12233,7 @@
 	} else if (ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
 		switch(resp) {
 		case 100:	/* 100 Trying */
+		case 101:	/* 101 Dialog establishment */
 			if (sipmethod == SIP_INVITE) 
 				handle_response_invite(p, resp, rest, req, seqno);
 			break;
@@ -12940,6 +12942,7 @@
 		respcode = atoi(code);
 		switch (respcode) {
 		case 100:	/* Trying: */
+		case 101:	/* dialog establishment */
 			/* Don't do anything yet */
 			break;
 		case 183:	/* Ringing: */
@@ -14546,7 +14549,6 @@
 {
 	/* Called with p->lock held, as well as p->owner->lock if appropriate, keeping things
 	   relatively static */
-	struct sip_request resp;
 	const char *cmd;
 	const char *cseq;
 	const char *useragent;
@@ -14557,9 +14559,6 @@
 	int debug = sip_debug_test_pvt(p);
 	char *e;
 	int error = 0;
-
-	/* Clear out potential response */
-	memset(&resp, 0, sizeof(resp));
 
 	/* Get Method and Cseq */
 	cseq = get_header(req, "Cseq");
@@ -17116,6 +17115,7 @@
 			sip_destroy(iterator->call);
 		}
 		ASTOBJ_UNLOCK(iterator);
+	
 	} while(0));
 
 	/* Then, actually destroy users and registry */

Modified: team/murf/bug8221/doc/asterisk-conf.txt
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221/doc/asterisk-conf.txt?view=diff&rev=47978&r1=47977&r2=47978
==============================================================================
--- team/murf/bug8221/doc/asterisk-conf.txt (original)
+++ team/murf/bug8221/doc/asterisk-conf.txt Thu Nov 23 17:28:09 2006
@@ -69,6 +69,7 @@
 	       	       				; when off, sound files are searched as <path>/<lang>/<file>
 						; when on, sound files are search as <lang>/<path>/<file>
 						; (only affects relative paths for sound files)
+maxlimit = <value>				; Maximum number open files for the Asterisk process
 
 [files]
 ; Changing the following lines may compromise your security

Modified: team/murf/bug8221/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221/main/asterisk.c?view=diff&rev=47978&r1=47977&r2=47978
==============================================================================
--- team/murf/bug8221/main/asterisk.c (original)
+++ team/murf/bug8221/main/asterisk.c Thu Nov 23 17:28:09 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/murf/bug8221/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221/main/manager.c?view=diff&rev=47978&r1=47977&r2=47978
==============================================================================
--- team/murf/bug8221/main/manager.c (original)
+++ team/murf/bug8221/main/manager.c Thu Nov 23 17:28:09 2006
@@ -1981,6 +1981,10 @@
 		return 0;
 	}
 
+	if (!s->authenticated && strcasecmp(action, "Login") && strcasecmp(action, "Logoff") && strcasecmp(action, "Challenge")) {
+		astman_send_error(s, m, "Permission denied");
+		return 0;
+	}
 	/* XXX should we protect the list navigation ? */
 	for (tmp = first_action ; tmp; tmp = tmp->next) {
 		if (!strcasecmp(action, tmp->action)) {

Modified: team/murf/bug8221/main/rtp.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221/main/rtp.c?view=diff&rev=47978&r1=47977&r2=47978
==============================================================================
--- team/murf/bug8221/main/rtp.c (original)
+++ team/murf/bug8221/main/rtp.c Thu Nov 23 17:28:09 2006
@@ -1705,7 +1705,7 @@
 			if (isAstFormat &&
 			    (code == AST_FORMAT_G726_AAL2) &&
 			    (options & AST_RTP_OPT_G726_NONSTANDARD))
-				return "AAL2-G726-32";
+				return "G726-32";
 			else
 				return mimeTypes[i].subtype;
 		}
@@ -2952,7 +2952,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, };
@@ -2965,12 +2965,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]);
@@ -3032,22 +3026,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]);
 				}
@@ -3085,10 +3069,6 @@
 	/* Break out of the direct bridge */
 	p0->bridged = NULL;
 	p1->bridged = NULL;
-	if (vp0) {
-		vp0->bridged = NULL;
-		vp1->bridged = NULL;
-	}
 
 	return res;
 }
@@ -3188,7 +3168,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 svn-commits mailing list