[asterisk-commits] irroot: branch irroot/patches r335122 - /team/irroot/patches/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 9 15:02:52 CDT 2011


Author: irroot
Date: Fri Sep  9 15:02:49 2011
New Revision: 335122

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=335122
Log:
Patch for RB1402 Included Removed Patch for RB1396

Modified:
    team/irroot/patches/distrotech-10.patch
    team/irroot/patches/distrotech-trunk.patch

Modified: team/irroot/patches/distrotech-10.patch
URL: http://svnview.digium.com/svn/asterisk/team/irroot/patches/distrotech-10.patch?view=diff&rev=335122&r1=335121&r2=335122
==============================================================================
--- team/irroot/patches/distrotech-10.patch (original)
+++ team/irroot/patches/distrotech-10.patch Fri Sep  9 15:02:49 2011
@@ -1,7 +1,7 @@
 Index: channels/chan_sip.c
 ===================================================================
---- channels/chan_sip.c	(.../branches/10)	(revision 334439)
-+++ channels/chan_sip.c	(.../team/irroot/distrotech-customers-10)	(revision 334439)
+--- channels/chan_sip.c	(.../branches/10)	(revision 335063)
++++ channels/chan_sip.c	(.../team/irroot/distrotech-customers-10)	(revision 335063)
 @@ -5489,17 +5489,23 @@
  
  		if (p->rtp && !p->srtp && setup_srtp(&p->srtp) < 0) {
@@ -193,8 +193,8 @@
  
 Index: channels/chan_misdn.c
 ===================================================================
---- channels/chan_misdn.c	(.../branches/10)	(revision 334439)
-+++ channels/chan_misdn.c	(.../team/irroot/distrotech-customers-10)	(revision 334439)
+--- channels/chan_misdn.c	(.../branches/10)	(revision 335063)
++++ channels/chan_misdn.c	(.../team/irroot/distrotech-customers-10)	(revision 335063)
 @@ -7873,64 +7873,63 @@
  		}
  
@@ -308,8 +308,8 @@
  				port = misdn_cfg_get_next_port(port)) {
 Index: channels/sip/include/sip.h
 ===================================================================
---- channels/sip/include/sip.h	(.../branches/10)	(revision 334439)
-+++ channels/sip/include/sip.h	(.../team/irroot/distrotech-customers-10)	(revision 334439)
+--- channels/sip/include/sip.h	(.../branches/10)	(revision 335063)
++++ channels/sip/include/sip.h	(.../team/irroot/distrotech-customers-10)	(revision 335063)
 @@ -353,9 +353,11 @@
  
  
@@ -325,8 +325,8 @@
  
 Index: channels/sip/include/sdp_crypto.h
 ===================================================================
---- channels/sip/include/sdp_crypto.h	(.../branches/10)	(revision 334439)
-+++ channels/sip/include/sdp_crypto.h	(.../team/irroot/distrotech-customers-10)	(revision 334439)
+--- channels/sip/include/sdp_crypto.h	(.../branches/10)	(revision 335063)
++++ channels/sip/include/sdp_crypto.h	(.../team/irroot/distrotech-customers-10)	(revision 335063)
 @@ -31,6 +31,7 @@
  #include <asterisk/rtp_engine.h>
  
@@ -360,8 +360,8 @@
  /*! \brief Return the a_crypto value of the sdp_crypto struct
 Index: channels/sip/include/srtp.h
 ===================================================================
---- channels/sip/include/srtp.h	(.../branches/10)	(revision 334439)
-+++ channels/sip/include/srtp.h	(.../team/irroot/distrotech-customers-10)	(revision 334439)
+--- channels/sip/include/srtp.h	(.../branches/10)	(revision 335063)
++++ channels/sip/include/srtp.h	(.../team/irroot/distrotech-customers-10)	(revision 335063)
 @@ -34,6 +34,8 @@
  #define SRTP_ENCR_OPTIONAL	(1 << 1)	/* SRTP encryption optional */
  #define SRTP_CRYPTO_ENABLE	(1 << 2)
@@ -373,8 +373,8 @@
  struct sip_srtp {
 Index: channels/sip/sdp_crypto.c
 ===================================================================
---- channels/sip/sdp_crypto.c	(.../branches/10)	(revision 334439)
-+++ channels/sip/sdp_crypto.c	(.../team/irroot/distrotech-customers-10)	(revision 334439)
+--- channels/sip/sdp_crypto.c	(.../branches/10)	(revision 335063)
++++ channels/sip/sdp_crypto.c	(.../team/irroot/distrotech-customers-10)	(revision 335063)
 @@ -32,6 +32,7 @@
  #include "asterisk/options.h"
  #include "asterisk/utils.h"
@@ -425,8 +425,8 @@
  
 Index: channels/chan_local.c
 ===================================================================
---- channels/chan_local.c	(.../branches/10)	(revision 334439)
-+++ channels/chan_local.c	(.../team/irroot/distrotech-customers-10)	(revision 334439)
+--- channels/chan_local.c	(.../branches/10)	(revision 335063)
++++ channels/chan_local.c	(.../team/irroot/distrotech-customers-10)	(revision 335063)
 @@ -587,6 +587,7 @@
  static int local_write(struct ast_channel *ast, struct ast_frame *f)
  {
@@ -458,8 +458,8 @@
  	if (!ast_test_flag(p, LOCAL_ALREADY_MASQED)) {
 Index: configure.ac
 ===================================================================
---- configure.ac	(.../branches/10)	(revision 334439)
-+++ configure.ac	(.../team/irroot/distrotech-customers-10)	(revision 334439)
+--- configure.ac	(.../branches/10)	(revision 335063)
++++ configure.ac	(.../team/irroot/distrotech-customers-10)	(revision 335063)
 @@ -1721,7 +1721,7 @@
     AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
     AST_C_DEFINE_CHECK([MISDN_FAC_RESULT], [Fac_RESULT], [mISDNuser/suppserv.h])
@@ -469,97 +469,10 @@
     AC_CHECK_MEMBER([Q931_info_t.redirect_dn], [], [PBX_MISDN=0], [#include <mISDNuser/mISDNlib.h>])
  fi
  
-Index: apps/app_readexten.c
-===================================================================
---- apps/app_readexten.c	(.../branches/10)	(revision 334439)
-+++ apps/app_readexten.c	(.../team/irroot/distrotech-customers-10)	(revision 334439)
-@@ -96,24 +96,6 @@
- 			</variablelist>
- 		</description>
- 	</application>
--	<function name="VALID_EXTEN" language="en_US">
--		<synopsis>
--			Determine whether an extension exists or not.
--		</synopsis>
--		<syntax>
--			<parameter name="context">
--				<para>Defaults to the current context</para>
--			</parameter>
--			<parameter name="extension" required="true" />
--			<parameter name="priority">
--				<para>Priority defaults to <literal>1</literal>.</para>
--			</parameter>
--		</syntax>
--		<description>
--			<para>Returns a true value if the indicated <replaceable>context</replaceable>,
--			<replaceable>extension</replaceable>, and <replaceable>priority</replaceable> exist.</para>
--		</description>
--	</function>
-  ***/
- 
- enum readexten_option_flags {
-@@ -280,57 +262,15 @@
- 	return status[0] == 'H' ? -1 : 0;
- }
- 
--static int acf_isexten_exec(struct ast_channel *chan, const char *cmd, char *parse, char *buffer, size_t buflen)
--{
--	int priority_int;
--	AST_DECLARE_APP_ARGS(args,
--		AST_APP_ARG(context);
--		AST_APP_ARG(extension);
--		AST_APP_ARG(priority);
--	);
--
--	AST_STANDARD_APP_ARGS(args, parse);
--
--	if (ast_strlen_zero(args.context))
--		args.context = chan->context;
--
--	if (ast_strlen_zero(args.extension)) {
--		ast_log(LOG_WARNING, "Syntax: VALID_EXTEN([<context>],<extension>[,<priority>]) - missing argument <extension>!\n");
--		return -1;
--	}
--
--	if (ast_strlen_zero(args.priority))
--		priority_int = 1;
--	else
--		priority_int = atoi(args.priority);
--
--	if (ast_exists_extension(chan, args.context, args.extension, priority_int,
--		S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
--	    ast_copy_string(buffer, "1", buflen);
--	} else {
--	    ast_copy_string(buffer, "0", buflen);
--	}
--
--	return 0;
--}
--
--static struct ast_custom_function acf_isexten = {
--	.name = "VALID_EXTEN",
--	.read = acf_isexten_exec,
--};
--
- static int unload_module(void)
- {
- 	int res = ast_unregister_application(app);
--	res |= ast_custom_function_unregister(&acf_isexten);
--
- 	return res;	
- }
- 
- static int load_module(void)
- {
- 	int res = ast_register_application_xml(app, readexten_exec);
--	res |= ast_custom_function_register(&acf_isexten);
- 	return res;
- }
- 
 Index: apps/app_queue.c
 ===================================================================
---- apps/app_queue.c	(.../branches/10)	(revision 334439)
-+++ apps/app_queue.c	(.../team/irroot/distrotech-customers-10)	(revision 334439)
+--- apps/app_queue.c	(.../branches/10)	(revision 335063)
++++ apps/app_queue.c	(.../team/irroot/distrotech-customers-10)	(revision 335063)
 @@ -952,6 +952,9 @@
  /*! \brief queues.conf [general] option */
  static int negative_penalty_invalid = 0;
@@ -634,9 +547,34 @@
  			ao2_unlink(q->members, m);
  			q->membercount--;
  		}
-@@ -4091,6 +4109,7 @@
- 	struct ao2_iterator queue_iter;	
- 	
+@@ -2964,9 +2982,8 @@
+ 	struct member *mem;
+ 	int found = 0;
+ 	struct ao2_iterator queue_iter;
+-	
+-	/* q's lock and rq's lock already set by try_calling()
+-	 * to solve deadlock */
++
++	ao2_lock(queues);
+ 	queue_iter = ao2_iterator_init(queues, 0);
+ 	while ((q = ao2_t_iterator_next(&queue_iter, "Iterate through queues"))) {
+ 		if (q == rq) { /* don't check myself, could deadlock */
+@@ -2991,6 +3008,7 @@
+ 		}
+ 	}
+ 	ao2_iterator_destroy(&queue_iter);
++	ao2_unlock(queues);
+ 	return found;
+ }
+ 
+@@ -4088,9 +4106,10 @@
+ 
+ 	struct member *mem;
+ 	struct call_queue *qtmp;
+-	struct ao2_iterator queue_iter;	
+-	
++	struct ao2_iterator queue_iter;
++
  	if (shared_lastcall) {
 +		ao2_lock(queues);
  		queue_iter = ao2_iterator_init(queues, 0);
@@ -650,20 +588,69 @@
  	} else {
  		ao2_lock(q);
  		time(&member->lastcall);
-@@ -4654,9 +4674,10 @@
- 	orig = to;
+@@ -4430,7 +4450,6 @@
+ 	struct ao2_iterator memi;
+ 	struct ast_datastore *datastore, *transfer_ds;
+ 	struct queue_end_bridge *queue_end_bridge = NULL;
+-	const int need_weight = use_weight;
+ 
+ 	ast_channel_lock(qe->chan);
+ 	datastore = ast_channel_datastore_find(qe->chan, &dialed_interface_info, NULL);
+@@ -4514,8 +4533,6 @@
+ 	}
+ 
+ 	/* Hold the lock while we setup the outgoing calls */
+-	if (need_weight)
+-		ao2_lock(queues);
+ 	ao2_lock(qe->parent);
+ 	ast_debug(1, "%s is trying to call a queue member.\n",
+ 							qe->chan->name);
+@@ -4534,8 +4551,6 @@
+ 			ao2_ref(cur, -1);
+ 			ao2_unlock(qe->parent);
+ 			ao2_iterator_destroy(&memi);
+-			if (need_weight)
+-				ao2_unlock(queues);
+ 			goto out;
+ 		}
+ 		if (!datastore) {
+@@ -4543,8 +4558,6 @@
+ 				ao2_ref(cur, -1);
+ 				ao2_unlock(qe->parent);
+ 				ao2_iterator_destroy(&memi);
+-				if (need_weight)
+-					ao2_unlock(queues);
+ 				callattempt_free(tmp);
+ 				goto out;
+ 			}
+@@ -4553,8 +4566,6 @@
+ 				ao2_ref(cur, -1);
+ 				ao2_unlock(&qe->parent);
+ 				ao2_iterator_destroy(&memi);
+-				if (need_weight)
+-					ao2_unlock(queues);
+ 				callattempt_free(tmp);
+ 				goto out;
+ 			}
+@@ -4591,8 +4602,6 @@
+ 				ao2_ref(cur, -1);
+ 				ao2_unlock(qe->parent);
+ 				ao2_iterator_destroy(&memi);
+-				if (need_weight)
+-					ao2_unlock(queues);
+ 				callattempt_free(tmp);
+ 				goto out;
+ 			}
+@@ -4655,8 +4664,6 @@
  	++qe->pending;
  	ao2_unlock(qe->parent);
-+	if (need_weight) {
-+		ao2_unlock(queues);
-+	}
  	ring_one(qe, outgoing, &numbusies);
 -	if (need_weight)
 -		ao2_unlock(queues);
  	lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies, ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT), forwardsallowed, update_connectedline);
  	/* The ast_channel_datastore_remove() function could fail here if the
  	 * datastore was moved to another channel during a masquerade. If this is
-@@ -5082,8 +5103,26 @@
+@@ -5082,8 +5089,26 @@
  		qe->handled++;
  		ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "CONNECT", "%ld|%s|%ld", (long) time(NULL) - qe->start, peer->uniqueid,
  													(long)(orig - to > 0 ? (orig - to) / 1000 : 0));
@@ -692,7 +679,7 @@
  		if (qe->parent->eventwhencalled)
  			manager_event(EVENT_FLAG_AGENT, "AgentConnect",
  					"Queue: %s\r\n"
-@@ -5329,13 +5368,14 @@
+@@ -5329,13 +5354,14 @@
  				"Queue: %s\r\n"
  				"Location: %s\r\n"
  				"MemberName: %s\r\n"
@@ -708,7 +695,7 @@
  				"dynamic",
  				new_member->penalty, new_member->calls, (int) new_member->lastcall,
  				new_member->status, new_member->paused);
-@@ -5691,6 +5731,8 @@
+@@ -5691,6 +5717,8 @@
  {
  	int res=-1;
  	char *parse, *temppos = NULL;
@@ -717,7 +704,7 @@
  	AST_DECLARE_APP_ARGS(args,
  		AST_APP_ARG(queuename);
  		AST_APP_ARG(interface);
-@@ -5716,9 +5758,17 @@
+@@ -5716,9 +5744,17 @@
  
  	ast_debug(1, "queue: %s, member: %s\n", args.queuename, args.interface);
  
@@ -736,7 +723,7 @@
  		ast_log(LOG_NOTICE, "Removed interface '%s' from queue '%s'\n", args.interface, args.queuename);
  		pbx_builtin_setvar_helper(chan, "RQMSTATUS", "REMOVED");
  		res = 0;
-@@ -5783,7 +5833,11 @@
+@@ -5783,7 +5819,11 @@
  
  	switch (add_to_queue(args.queuename, args.interface, args.membername, penalty, 0, queue_persistent_members, args.state_interface)) {
  	case RES_OKAY:
@@ -749,7 +736,7 @@
  		ast_log(LOG_NOTICE, "Added interface '%s' to queue '%s'\n", args.interface, args.queuename);
  		pbx_builtin_setvar_helper(chan, "AQMSTATUS", "ADDED");
  		res = 0;
-@@ -5799,7 +5853,7 @@
+@@ -5799,7 +5839,7 @@
  		res = 0;
  		break;
  	case RES_OUTOFMEMORY:
@@ -758,7 +745,7 @@
  		break;
  	}
  
-@@ -6713,6 +6767,9 @@
+@@ -6713,6 +6753,9 @@
  	negative_penalty_invalid = 0;
  	if ((general_val = ast_variable_retrieve(cfg, "general", "negative_penalty_invalid")))
  		negative_penalty_invalid = ast_true(general_val);
@@ -768,7 +755,7 @@
  }
  
  /*! \brief reload information pertaining to a single member
-@@ -7160,7 +7217,11 @@
+@@ -7160,7 +7203,11 @@
  			while ((mem = ao2_iterator_next(&mem_iter))) {
  				ast_str_set(&out, 0, "      %s", mem->membername);
  				if (strcasecmp(mem->membername, mem->interface)) {
@@ -781,7 +768,7 @@
  				}
  				if (mem->penalty)
  					ast_str_append(&out, 0, " with penalty %d", mem->penalty);
-@@ -7428,6 +7489,7 @@
+@@ -7428,6 +7475,7 @@
  						"Queue: %s\r\n"
  						"Name: %s\r\n"
  						"Location: %s\r\n"
@@ -789,7 +776,7 @@
  						"Membership: %s\r\n"
  						"Penalty: %d\r\n"
  						"CallsTaken: %d\r\n"
-@@ -7436,7 +7498,7 @@
+@@ -7436,7 +7484,7 @@
  						"Paused: %d\r\n"
  						"%s"
  						"\r\n",
@@ -798,7 +785,7 @@
  						mem->penalty, mem->calls, (int)mem->lastcall, mem->status, mem->paused, idText);
  				}
  				ao2_ref(mem, -1);
-@@ -7512,7 +7574,11 @@
+@@ -7512,7 +7560,11 @@
  
  	switch (add_to_queue(queuename, interface, membername, penalty, paused, queue_persistent_members, state_interface)) {
  	case RES_OKAY:
@@ -811,7 +798,7 @@
  		astman_send_ack(s, m, "Added interface to queue");
  		break;
  	case RES_EXISTS:
-@@ -7532,6 +7598,7 @@
+@@ -7532,6 +7584,7 @@
  static int manager_remove_queue_member(struct mansession *s, const struct message *m)
  {
  	const char *queuename, *interface;
@@ -819,7 +806,7 @@
  
  	queuename = astman_get_header(m, "Queue");
  	interface = astman_get_header(m, "Interface");
-@@ -7541,9 +7608,17 @@
+@@ -7541,9 +7594,17 @@
  		return 0;
  	}
  
@@ -838,7 +825,7 @@
  		astman_send_ack(s, m, "Removed interface from queue");
  		break;
  	case RES_EXISTS:
-@@ -7765,7 +7840,11 @@
+@@ -7765,7 +7826,11 @@
  
  	switch (add_to_queue(queuename, interface, membername, penalty, 0, queue_persistent_members, state_interface)) {
  	case RES_OKAY:
@@ -851,7 +838,7 @@
  		ast_cli(a->fd, "Added interface '%s' to queue '%s'\n", interface, queuename);
  		return CLI_SUCCESS;
  	case RES_EXISTS:
-@@ -7833,11 +7912,12 @@
+@@ -7833,11 +7898,12 @@
  static char *handle_queue_remove_member(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
  {
  	const char *queuename, *interface;
@@ -865,7 +852,7 @@
  			"Usage: queue remove member <channel> from <queue>\n"
  			"       Remove a specific channel from a queue.\n";
  		return NULL;
-@@ -7854,10 +7934,18 @@
+@@ -7854,10 +7920,18 @@
  	queuename = a->argv[5];
  	interface = a->argv[3];
  
@@ -886,7 +873,7 @@
  		return CLI_SUCCESS;
  	case RES_EXISTS:
  		ast_cli(a->fd, "Unable to remove interface '%s' from queue '%s': Not there\n", interface, queuename);
-@@ -8580,6 +8668,26 @@
+@@ -8580,6 +8654,26 @@
  	return 0;
  }
  
@@ -915,9 +902,9 @@
  		.unload = unload_module,
 Index: CHANGES
 ===================================================================
---- CHANGES	(.../branches/10)	(revision 334439)
-+++ CHANGES	(.../team/irroot/distrotech-customers-10)	(revision 334439)
-@@ -183,6 +183,8 @@
+--- CHANGES	(.../branches/10)	(revision 335063)
++++ CHANGES	(.../team/irroot/distrotech-customers-10)	(revision 335063)
+@@ -184,6 +184,8 @@
  SIP Changes
  -----------
   * Add T38 support for REJECTED state where T.38 Negotiation is explicitly rejected.
@@ -928,8 +915,8 @@
  -------------
 Index: Makefile
 ===================================================================
---- Makefile	(.../branches/10)	(revision 334439)
-+++ Makefile	(.../team/irroot/distrotech-customers-10)	(revision 334439)
+--- Makefile	(.../branches/10)	(revision 335063)
++++ Makefile	(.../team/irroot/distrotech-customers-10)	(revision 335063)
 @@ -127,7 +127,7 @@
  # Asterisk.conf is located in ASTETCDIR or by using the -C flag
  # when starting Asterisk
@@ -939,108 +926,10 @@
  AGI_DIR=$(ASTDATADIR)/agi-bin
  
  # If you use Apache, you may determine by a grep 'DocumentRoot' of your httpd.conf file
-Index: funcs/func_dialplan.c
-===================================================================
---- funcs/func_dialplan.c	(.../branches/10)	(revision 334439)
-+++ funcs/func_dialplan.c	(.../team/irroot/distrotech-customers-10)	(revision 334439)
-@@ -51,7 +51,24 @@
- 			<para>This function returns <literal>1</literal> if the target exits. Otherwise, it returns <literal>0</literal>.</para>
- 		</description>
- 	</function>
--
-+	<function name="VALID_EXTEN" language="en_US">
-+		<synopsis>
-+			Determine whether an extension exists or not.
-+		</synopsis>
-+		<syntax>
-+			<parameter name="context">
-+				<para>Defaults to the current context</para>
-+			</parameter>
-+			<parameter name="extension" required="true" />
-+			<parameter name="priority">
-+				<para>Priority defaults to <literal>1</literal>.</para>
-+			</parameter>
-+		</syntax>
-+		<description>
-+			<para>Returns a true value if the indicated <replaceable>context</replaceable>,
-+			<replaceable>extension</replaceable>, and <replaceable>priority</replaceable> exist.</para>
-+		</description>
-+	</function>
-  ***/
- 
- static int isexten_function_read(struct ast_channel *chan, const char *cmd, char *data, 
-@@ -106,20 +123,65 @@
- 	return 0;
- }
- 
-+static int acf_isexten_exec(struct ast_channel *chan, const char *cmd, char *parse, char *buffer, size_t buflen)
-+{
-+	int priority_int;
-+	AST_DECLARE_APP_ARGS(args,
-+		AST_APP_ARG(context);
-+		AST_APP_ARG(extension);
-+		AST_APP_ARG(priority);
-+	);
-+
-+	AST_STANDARD_APP_ARGS(args, parse);
-+
-+	if (ast_strlen_zero(args.context)) {
-+		args.context = chan->context;
-+	}
-+
-+	if (ast_strlen_zero(args.extension)) {
-+		ast_log(LOG_WARNING, "Syntax: VALID_EXTEN([<context>],<extension>[,<priority>]) - missing argument <extension>!\n");
-+		return -1;
-+	}
-+
-+	if (ast_strlen_zero(args.priority)) {
-+		priority_int = 1;
-+	} else {
-+		priority_int = atoi(args.priority);
-+	}
-+
-+	if (ast_exists_extension(chan, args.context, args.extension, priority_int,
-+		S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
-+	    ast_copy_string(buffer, "1", buflen);
-+	} else {
-+	    ast_copy_string(buffer, "0", buflen);
-+	}
-+
-+	return 0;
-+}
-+
- static struct ast_custom_function isexten_function = {
- 	.name = "DIALPLAN_EXISTS",
- 	.read = isexten_function_read,
- 	.read_max = 2,
- };
- 
-+static struct ast_custom_function acf_isexten = {
-+	.name = "VALID_EXTEN",
-+	.read = acf_isexten_exec,
-+};
-+
- static int unload_module(void)
- {
--	return ast_custom_function_unregister(&isexten_function);
-+	int res = ast_custom_function_unregister(&isexten_function);
-+	res |= ast_custom_function_unregister(&acf_isexten);
-+	return res;
- }
- 
- static int load_module(void)
- {
--	return ast_custom_function_register(&isexten_function);
-+	int res = ast_custom_function_register(&isexten_function);
-+	res |= ast_custom_function_register(&acf_isexten);
-+	return res;
- }
- 
- AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Dialplan Context/Extension/Priority Checking Functions");
 Index: main/channel.c
 ===================================================================
---- main/channel.c	(.../branches/10)	(revision 334439)
-+++ main/channel.c	(.../team/irroot/distrotech-customers-10)	(revision 334439)
+--- main/channel.c	(.../branches/10)	(revision 335063)
++++ main/channel.c	(.../team/irroot/distrotech-customers-10)	(revision 335063)
 @@ -4964,6 +4964,11 @@
  			apply_plc(chan, fr);
  		}
@@ -1082,8 +971,8 @@
  		int to;
 Index: configs/sip.conf.sample
 ===================================================================
---- configs/sip.conf.sample	(.../branches/10)	(revision 334439)
-+++ configs/sip.conf.sample	(.../team/irroot/distrotech-customers-10)	(revision 334439)
+--- configs/sip.conf.sample	(.../branches/10)	(revision 335063)
++++ configs/sip.conf.sample	(.../team/irroot/distrotech-customers-10)	(revision 335063)
 @@ -901,6 +901,9 @@
  ;encryption=no                  ; Whether to offer SRTP encrypted media (and only SRTP encrypted media)
                                  ; on outgoing calls to a peer. Calls will fail with HANGUPCAUSE=58 if
@@ -1096,8 +985,8 @@
  ; For additional information on ARA, the Asterisk Realtime Architecture,
 Index: configs/queues.conf.sample
 ===================================================================
---- configs/queues.conf.sample	(.../branches/10)	(revision 334439)
-+++ configs/queues.conf.sample	(.../team/irroot/distrotech-customers-10)	(revision 334439)
+--- configs/queues.conf.sample	(.../branches/10)	(revision 335063)
++++ configs/queues.conf.sample	(.../team/irroot/distrotech-customers-10)	(revision 335063)
 @@ -65,6 +65,12 @@
  ;
  ;negative_penalty_invalid = no
@@ -1113,8 +1002,8 @@
  ; A sample call queue
 Index: res/res_fax.c
 ===================================================================
---- res/res_fax.c	(.../branches/10)	(revision 334439)
-+++ res/res_fax.c	(.../team/irroot/distrotech-customers-10)	(revision 334439)
+--- res/res_fax.c	(.../branches/10)	(revision 335063)
++++ res/res_fax.c	(.../team/irroot/distrotech-customers-10)	(revision 335063)
 @@ -225,10 +225,33 @@
  			<ref type="application">SendFax</ref>
  		</see-also>
@@ -1374,8 +1263,8 @@
  	return res;
 Index: contrib/scripts/safe_asterisk
 ===================================================================
---- contrib/scripts/safe_asterisk	(.../branches/10)	(revision 334439)
-+++ contrib/scripts/safe_asterisk	(.../team/irroot/distrotech-customers-10)	(revision 334439)
+--- contrib/scripts/safe_asterisk	(.../branches/10)	(revision 335063)
++++ contrib/scripts/safe_asterisk	(.../team/irroot/distrotech-customers-10)	(revision 335063)
 @@ -6,14 +6,14 @@
  ASTVARLOGDIR=__ASTERISK_LOG_DIR__
  
@@ -1415,10 +1304,8 @@
 
 Property changes on: .
 ___________________________________________________________________
-Added: automerge
-   + *
 Added: svnmerge-integrated
-   + /branches/10:1-334438
+   + /branches/10:1-335060
 Added: automerge-email
    + gregory at distrotech.co.za
 

Modified: team/irroot/patches/distrotech-trunk.patch
URL: http://svnview.digium.com/svn/asterisk/team/irroot/patches/distrotech-trunk.patch?view=diff&rev=335122&r1=335121&r2=335122
==============================================================================
--- team/irroot/patches/distrotech-trunk.patch (original)
+++ team/irroot/patches/distrotech-trunk.patch Fri Sep  9 15:02:49 2011
@@ -1,7 +1,7 @@
 Index: channels/chan_sip.c
 ===================================================================
---- channels/chan_sip.c	(.../trunk)	(revision 334442)
-+++ channels/chan_sip.c	(.../team/irroot/distrotech-customers-trunk)	(revision 334442)
+--- channels/chan_sip.c	(.../trunk)	(revision 335063)
++++ channels/chan_sip.c	(.../team/irroot/distrotech-customers-trunk)	(revision 335063)
 @@ -5489,17 +5489,23 @@
  
  		if (p->rtp && !p->srtp && setup_srtp(&p->srtp) < 0) {
@@ -193,8 +193,8 @@
  
 Index: channels/chan_misdn.c
 ===================================================================
---- channels/chan_misdn.c	(.../trunk)	(revision 334442)
-+++ channels/chan_misdn.c	(.../team/irroot/distrotech-customers-trunk)	(revision 334442)
+--- channels/chan_misdn.c	(.../trunk)	(revision 335063)
++++ channels/chan_misdn.c	(.../team/irroot/distrotech-customers-trunk)	(revision 335063)
 @@ -7873,64 +7873,63 @@
  		}
  
@@ -308,8 +308,8 @@
  				port = misdn_cfg_get_next_port(port)) {
 Index: channels/sip/include/sip.h
 ===================================================================
---- channels/sip/include/sip.h	(.../trunk)	(revision 334442)
-+++ channels/sip/include/sip.h	(.../team/irroot/distrotech-customers-trunk)	(revision 334442)
+--- channels/sip/include/sip.h	(.../trunk)	(revision 335063)
++++ channels/sip/include/sip.h	(.../team/irroot/distrotech-customers-trunk)	(revision 335063)
 @@ -353,9 +353,11 @@
  
  
@@ -325,8 +325,8 @@
  
 Index: channels/sip/include/sdp_crypto.h
 ===================================================================
---- channels/sip/include/sdp_crypto.h	(.../trunk)	(revision 334442)
-+++ channels/sip/include/sdp_crypto.h	(.../team/irroot/distrotech-customers-trunk)	(revision 334442)
+--- channels/sip/include/sdp_crypto.h	(.../trunk)	(revision 335063)
++++ channels/sip/include/sdp_crypto.h	(.../team/irroot/distrotech-customers-trunk)	(revision 335063)
 @@ -31,6 +31,7 @@
  #include <asterisk/rtp_engine.h>
  
@@ -360,8 +360,8 @@
  /*! \brief Return the a_crypto value of the sdp_crypto struct
 Index: channels/sip/include/srtp.h
 ===================================================================
---- channels/sip/include/srtp.h	(.../trunk)	(revision 334442)
-+++ channels/sip/include/srtp.h	(.../team/irroot/distrotech-customers-trunk)	(revision 334442)
+--- channels/sip/include/srtp.h	(.../trunk)	(revision 335063)
++++ channels/sip/include/srtp.h	(.../team/irroot/distrotech-customers-trunk)	(revision 335063)
 @@ -34,6 +34,8 @@
  #define SRTP_ENCR_OPTIONAL	(1 << 1)	/* SRTP encryption optional */
  #define SRTP_CRYPTO_ENABLE	(1 << 2)
@@ -373,8 +373,8 @@
  struct sip_srtp {
 Index: channels/sip/sdp_crypto.c
 ===================================================================
---- channels/sip/sdp_crypto.c	(.../trunk)	(revision 334442)
-+++ channels/sip/sdp_crypto.c	(.../team/irroot/distrotech-customers-trunk)	(revision 334442)
+--- channels/sip/sdp_crypto.c	(.../trunk)	(revision 335063)
++++ channels/sip/sdp_crypto.c	(.../team/irroot/distrotech-customers-trunk)	(revision 335063)
 @@ -32,6 +32,7 @@
  #include "asterisk/options.h"
  #include "asterisk/utils.h"
@@ -425,8 +425,8 @@
  
 Index: channels/chan_local.c
 ===================================================================
---- channels/chan_local.c	(.../trunk)	(revision 334442)
-+++ channels/chan_local.c	(.../team/irroot/distrotech-customers-trunk)	(revision 334442)
+--- channels/chan_local.c	(.../trunk)	(revision 335063)
++++ channels/chan_local.c	(.../team/irroot/distrotech-customers-trunk)	(revision 335063)
 @@ -588,6 +588,7 @@
  static int local_write(struct ast_channel *ast, struct ast_frame *f)
  {
@@ -458,8 +458,8 @@
  	if (!ast_test_flag(p, LOCAL_ALREADY_MASQED)) {
 Index: configure.ac
 ===================================================================
---- configure.ac	(.../trunk)	(revision 334442)
-+++ configure.ac	(.../team/irroot/distrotech-customers-trunk)	(revision 334442)
+--- configure.ac	(.../trunk)	(revision 335063)
++++ configure.ac	(.../team/irroot/distrotech-customers-trunk)	(revision 335063)
 @@ -1721,7 +1721,7 @@
     AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
     AST_C_DEFINE_CHECK([MISDN_FAC_RESULT], [Fac_RESULT], [mISDNuser/suppserv.h])
@@ -469,100 +469,38 @@
     AC_CHECK_MEMBER([Q931_info_t.redirect_dn], [], [PBX_MISDN=0], [#include <mISDNuser/mISDNlib.h>])
  fi
  
-Index: apps/app_readexten.c
-===================================================================
---- apps/app_readexten.c	(.../trunk)	(revision 334442)
-+++ apps/app_readexten.c	(.../team/irroot/distrotech-customers-trunk)	(revision 334442)
-@@ -96,24 +96,6 @@
- 			</variablelist>
- 		</description>
- 	</application>
--	<function name="VALID_EXTEN" language="en_US">
--		<synopsis>
--			Determine whether an extension exists or not.
--		</synopsis>
--		<syntax>
--			<parameter name="context">
--				<para>Defaults to the current context</para>
--			</parameter>
--			<parameter name="extension" required="true" />
--			<parameter name="priority">
--				<para>Priority defaults to <literal>1</literal>.</para>
--			</parameter>
--		</syntax>
--		<description>
--			<para>Returns a true value if the indicated <replaceable>context</replaceable>,
--			<replaceable>extension</replaceable>, and <replaceable>priority</replaceable> exist.</para>
--		</description>
--	</function>
-  ***/
- 
- enum readexten_option_flags {
-@@ -280,57 +262,15 @@
- 	return status[0] == 'H' ? -1 : 0;
+Index: apps/app_queue.c
+===================================================================
+--- apps/app_queue.c	(.../trunk)	(revision 335063)
++++ apps/app_queue.c	(.../team/irroot/distrotech-customers-trunk)	(revision 335063)
+@@ -2982,9 +2982,8 @@
+ 	struct member *mem;
+ 	int found = 0;
+ 	struct ao2_iterator queue_iter;
+-	
+-	/* q's lock and rq's lock already set by try_calling()
+-	 * to solve deadlock */
++
++	ao2_lock(queues);
+ 	queue_iter = ao2_iterator_init(queues, 0);
+ 	while ((q = ao2_t_iterator_next(&queue_iter, "Iterate through queues"))) {
+ 		if (q == rq) { /* don't check myself, could deadlock */
+@@ -3009,6 +3008,7 @@
+ 		}
+ 	}
+ 	ao2_iterator_destroy(&queue_iter);
++	ao2_unlock(queues);
+ 	return found;
  }
  
--static int acf_isexten_exec(struct ast_channel *chan, const char *cmd, char *parse, char *buffer, size_t buflen)
--{
--	int priority_int;
--	AST_DECLARE_APP_ARGS(args,
--		AST_APP_ARG(context);
--		AST_APP_ARG(extension);
--		AST_APP_ARG(priority);
--	);
--
--	AST_STANDARD_APP_ARGS(args, parse);
--
--	if (ast_strlen_zero(args.context))
--		args.context = chan->context;
--
--	if (ast_strlen_zero(args.extension)) {
--		ast_log(LOG_WARNING, "Syntax: VALID_EXTEN([<context>],<extension>[,<priority>]) - missing argument <extension>!\n");
--		return -1;
--	}
--
--	if (ast_strlen_zero(args.priority))
--		priority_int = 1;
--	else
--		priority_int = atoi(args.priority);
--
--	if (ast_exists_extension(chan, args.context, args.extension, priority_int,
--		S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
--	    ast_copy_string(buffer, "1", buflen);
--	} else {
--	    ast_copy_string(buffer, "0", buflen);
--	}
--
--	return 0;
--}
--
--static struct ast_custom_function acf_isexten = {
--	.name = "VALID_EXTEN",
--	.read = acf_isexten_exec,
--};
--
- static int unload_module(void)
- {
- 	int res = ast_unregister_application(app);
--	res |= ast_custom_function_unregister(&acf_isexten);
--
- 	return res;	
- }
- 
- static int load_module(void)
- {
- 	int res = ast_register_application_xml(app, readexten_exec);
--	res |= ast_custom_function_register(&acf_isexten);
- 	return res;
- }
- 
-Index: apps/app_queue.c
-===================================================================
---- apps/app_queue.c	(.../trunk)	(revision 334442)
-+++ apps/app_queue.c	(.../team/irroot/distrotech-customers-trunk)	(revision 334442)
-@@ -4109,6 +4109,7 @@
- 	struct ao2_iterator queue_iter;	
- 	
+@@ -4106,9 +4106,10 @@
+ 
+ 	struct member *mem;
+ 	struct call_queue *qtmp;
+-	struct ao2_iterator queue_iter;	
+-	
++	struct ao2_iterator queue_iter;
++
  	if (shared_lastcall) {
 +		ao2_lock(queues);
  		queue_iter = ao2_iterator_init(queues, 0);
@@ -576,20 +514,69 @@
  	} else {
  		ao2_lock(q);
  		time(&member->lastcall);
-@@ -4672,9 +4674,10 @@
- 	orig = to;
+@@ -4448,7 +4450,6 @@
+ 	struct ao2_iterator memi;
+ 	struct ast_datastore *datastore, *transfer_ds;
+ 	struct queue_end_bridge *queue_end_bridge = NULL;
+-	const int need_weight = use_weight;
+ 
+ 	ast_channel_lock(qe->chan);
+ 	datastore = ast_channel_datastore_find(qe->chan, &dialed_interface_info, NULL);
+@@ -4532,8 +4533,6 @@
+ 	}
+ 
+ 	/* Hold the lock while we setup the outgoing calls */
+-	if (need_weight)
+-		ao2_lock(queues);
+ 	ao2_lock(qe->parent);
+ 	ast_debug(1, "%s is trying to call a queue member.\n",
+ 							qe->chan->name);
+@@ -4552,8 +4551,6 @@
+ 			ao2_ref(cur, -1);
+ 			ao2_unlock(qe->parent);
+ 			ao2_iterator_destroy(&memi);
+-			if (need_weight)
+-				ao2_unlock(queues);
+ 			goto out;
+ 		}
+ 		if (!datastore) {
+@@ -4561,8 +4558,6 @@
+ 				ao2_ref(cur, -1);
+ 				ao2_unlock(qe->parent);
+ 				ao2_iterator_destroy(&memi);
+-				if (need_weight)
+-					ao2_unlock(queues);
+ 				callattempt_free(tmp);
+ 				goto out;
+ 			}
+@@ -4571,8 +4566,6 @@
+ 				ao2_ref(cur, -1);
+ 				ao2_unlock(&qe->parent);
+ 				ao2_iterator_destroy(&memi);
+-				if (need_weight)
+-					ao2_unlock(queues);
+ 				callattempt_free(tmp);
+ 				goto out;
+ 			}
+@@ -4609,8 +4602,6 @@
+ 				ao2_ref(cur, -1);
+ 				ao2_unlock(qe->parent);
+ 				ao2_iterator_destroy(&memi);
+-				if (need_weight)
+-					ao2_unlock(queues);
+ 				callattempt_free(tmp);
+ 				goto out;
+ 			}
+@@ -4673,8 +4664,6 @@
  	++qe->pending;
  	ao2_unlock(qe->parent);
-+	if (need_weight) {
-+		ao2_unlock(queues);
-+	}
  	ring_one(qe, outgoing, &numbusies);
 -	if (need_weight)
 -		ao2_unlock(queues);
  	lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies, ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT), forwardsallowed, update_connectedline);
  	/* The ast_channel_datastore_remove() function could fail here if the
  	 * datastore was moved to another channel during a masquerade. If this is
-@@ -5100,8 +5103,26 @@
+@@ -5100,8 +5089,26 @@
  		qe->handled++;
  		ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "CONNECT", "%ld|%s|%ld", (long) time(NULL) - qe->start, peer->uniqueid,
  													(long)(orig - to > 0 ? (orig - to) / 1000 : 0));
@@ -620,9 +607,9 @@
  					"Queue: %s\r\n"
 Index: CHANGES
 ===================================================================
---- CHANGES	(.../trunk)	(revision 334442)
-+++ CHANGES	(.../team/irroot/distrotech-customers-trunk)	(revision 334442)
-@@ -205,6 +205,8 @@
+--- CHANGES	(.../trunk)	(revision 335063)
++++ CHANGES	(.../team/irroot/distrotech-customers-trunk)	(revision 335063)
+@@ -213,6 +213,8 @@
  SIP Changes
  -----------
   * Add T38 support for REJECTED state where T.38 Negotiation is explicitly rejected.
@@ -633,8 +620,8 @@
  -------------
 Index: Makefile
 ===================================================================
---- Makefile	(.../trunk)	(revision 334442)
-+++ Makefile	(.../team/irroot/distrotech-customers-trunk)	(revision 334442)
+--- Makefile	(.../trunk)	(revision 335063)
++++ Makefile	(.../team/irroot/distrotech-customers-trunk)	(revision 335063)
 @@ -127,7 +127,7 @@
  # Asterisk.conf is located in ASTETCDIR or by using the -C flag
  # when starting Asterisk
@@ -644,108 +631,10 @@
  AGI_DIR=$(ASTDATADIR)/agi-bin
  
  # If you use Apache, you may determine by a grep 'DocumentRoot' of your httpd.conf file
-Index: funcs/func_dialplan.c
-===================================================================
---- funcs/func_dialplan.c	(.../trunk)	(revision 334442)
-+++ funcs/func_dialplan.c	(.../team/irroot/distrotech-customers-trunk)	(revision 334442)
-@@ -51,7 +51,24 @@
- 			<para>This function returns <literal>1</literal> if the target exits. Otherwise, it returns <literal>0</literal>.</para>
- 		</description>
- 	</function>
--
-+	<function name="VALID_EXTEN" language="en_US">
-+		<synopsis>
-+			Determine whether an extension exists or not.
-+		</synopsis>
-+		<syntax>
-+			<parameter name="context">
-+				<para>Defaults to the current context</para>
-+			</parameter>
-+			<parameter name="extension" required="true" />
-+			<parameter name="priority">
-+				<para>Priority defaults to <literal>1</literal>.</para>
-+			</parameter>
-+		</syntax>
-+		<description>
-+			<para>Returns a true value if the indicated <replaceable>context</replaceable>,
-+			<replaceable>extension</replaceable>, and <replaceable>priority</replaceable> exist.</para>
-+		</description>
-+	</function>
-  ***/
- 
- static int isexten_function_read(struct ast_channel *chan, const char *cmd, char *data, 
-@@ -106,20 +123,65 @@
- 	return 0;
- }
- 
-+static int acf_isexten_exec(struct ast_channel *chan, const char *cmd, char *parse, char *buffer, size_t buflen)
-+{
-+	int priority_int;
-+	AST_DECLARE_APP_ARGS(args,
-+		AST_APP_ARG(context);
-+		AST_APP_ARG(extension);
-+		AST_APP_ARG(priority);
-+	);
-+
-+	AST_STANDARD_APP_ARGS(args, parse);
-+
-+	if (ast_strlen_zero(args.context)) {
-+		args.context = chan->context;
-+	}
-+
-+	if (ast_strlen_zero(args.extension)) {
-+		ast_log(LOG_WARNING, "Syntax: VALID_EXTEN([<context>],<extension>[,<priority>]) - missing argument <extension>!\n");
-+		return -1;
-+	}
-+
-+	if (ast_strlen_zero(args.priority)) {
-+		priority_int = 1;
-+	} else {
-+		priority_int = atoi(args.priority);
-+	}
-+
-+	if (ast_exists_extension(chan, args.context, args.extension, priority_int,
-+		S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
-+	    ast_copy_string(buffer, "1", buflen);
-+	} else {
-+	    ast_copy_string(buffer, "0", buflen);
-+	}
-+
-+	return 0;
-+}
-+
- static struct ast_custom_function isexten_function = {
- 	.name = "DIALPLAN_EXISTS",
- 	.read = isexten_function_read,
- 	.read_max = 2,
- };
- 
-+static struct ast_custom_function acf_isexten = {
-+	.name = "VALID_EXTEN",
-+	.read = acf_isexten_exec,
-+};
-+
- static int unload_module(void)
- {
--	return ast_custom_function_unregister(&isexten_function);
-+	int res = ast_custom_function_unregister(&isexten_function);
-+	res |= ast_custom_function_unregister(&acf_isexten);
-+	return res;
- }
- 
- static int load_module(void)
- {
--	return ast_custom_function_register(&isexten_function);
-+	int res = ast_custom_function_register(&isexten_function);
-+	res |= ast_custom_function_register(&acf_isexten);
-+	return res;
- }
- 
- AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Dialplan Context/Extension/Priority Checking Functions");
 Index: main/channel.c
 ===================================================================
---- main/channel.c	(.../trunk)	(revision 334442)
-+++ main/channel.c	(.../team/irroot/distrotech-customers-trunk)	(revision 334442)
+--- main/channel.c	(.../trunk)	(revision 335063)
++++ main/channel.c	(.../team/irroot/distrotech-customers-trunk)	(revision 335063)
 @@ -4964,6 +4964,11 @@
  			apply_plc(chan, fr);
  		}
@@ -787,8 +676,8 @@
  		int to;
 Index: configs/sip.conf.sample
 ===================================================================
---- configs/sip.conf.sample	(.../trunk)	(revision 334442)
-+++ configs/sip.conf.sample	(.../team/irroot/distrotech-customers-trunk)	(revision 334442)
+--- configs/sip.conf.sample	(.../trunk)	(revision 335063)
++++ configs/sip.conf.sample	(.../team/irroot/distrotech-customers-trunk)	(revision 335063)
 @@ -901,6 +901,9 @@
  ;encryption=no                  ; Whether to offer SRTP encrypted media (and only SRTP encrypted media)
                                  ; on outgoing calls to a peer. Calls will fail with HANGUPCAUSE=58 if
@@ -801,8 +690,8 @@
  ; For additional information on ARA, the Asterisk Realtime Architecture,
 Index: res/res_fax.c
 ===================================================================
---- res/res_fax.c	(.../trunk)	(revision 334442)
-+++ res/res_fax.c	(.../team/irroot/distrotech-customers-trunk)	(revision 334442)
+--- res/res_fax.c	(.../trunk)	(revision 335063)
++++ res/res_fax.c	(.../team/irroot/distrotech-customers-trunk)	(revision 335063)
 @@ -225,10 +225,33 @@
  			<ref type="application">SendFax</ref>
  		</see-also>
@@ -1062,8 +951,8 @@
  	return res;
 Index: contrib/scripts/safe_asterisk
 ===================================================================
---- contrib/scripts/safe_asterisk	(.../trunk)	(revision 334442)
-+++ contrib/scripts/safe_asterisk	(.../team/irroot/distrotech-customers-trunk)	(revision 334442)
+--- contrib/scripts/safe_asterisk	(.../trunk)	(revision 335063)

[... 17 lines stripped ...]



More information about the asterisk-commits mailing list