[asterisk-commits] murf: branch murf/bug11210 r104105 - in /team/murf/bug11210: ./ apps/ channel...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 25 17:22:57 CST 2008


Author: murf
Date: Mon Feb 25 17:22:56 2008
New Revision: 104105

URL: http://svn.digium.com/view/asterisk?view=rev&rev=104105
Log:
Merged revisions 104081,104083,104085,104087-104089,104093,104096-104098 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r104081 | file | 2008-02-25 08:12:48 -0700 (Mon, 25 Feb 2008) | 2 lines

Fix building of trunk. dbpass is always going to exist.

................
r104083 | file | 2008-02-25 08:19:58 -0700 (Mon, 25 Feb 2008) | 14 lines

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

........
r104082 | file | 2008-02-25 11:17:18 -0400 (Mon, 25 Feb 2008) | 6 lines

Due to recent changes tag will no longer be NULL if not present so we have to use ast_strlen_zero to see if it's actually blank.
(closes issue #12061)
Reported by: flefoll
Patches:
      chan_sip.c.br14.patch_pedantic_no_totag uploaded by flefoll (license 244)

........

................
r104085 | file | 2008-02-25 09:18:46 -0700 (Mon, 25 Feb 2008) | 14 lines

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

........
r104084 | file | 2008-02-25 12:16:13 -0400 (Mon, 25 Feb 2008) | 6 lines

If a resubscription comes in for a dialog we no longer know about tell the remote side that the dialog does not exist so they subscribe again using a new dialog.
(closes issue #10727)
Reported by: s0l4rb03
Patches:
      10727-2.diff uploaded by file (license 11)

........

................
r104087 | russell | 2008-02-25 11:38:51 -0700 (Mon, 25 Feb 2008) | 12 lines

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

........
r104086 | russell | 2008-02-25 12:38:10 -0600 (Mon, 25 Feb 2008) | 4 lines

Ensure that the channel doesn't disappear in agent_logoff().  If it does, it
could cause a crash.
(fixes the crash reported in BE-396)

........

................
r104088 | bbryant | 2008-02-25 12:00:16 -0700 (Mon, 25 Feb 2008) | 1 line

Adding more tls configuration details to sip.conf sample, with a list of valid ciphers provided in both files. .. First commit since July, woot
................
r104089 | file | 2008-02-25 12:02:33 -0700 (Mon, 25 Feb 2008) | 2 lines

Instead of outputting a verbose message every so often let's make it a debug message.

................
r104093 | qwell | 2008-02-25 13:50:57 -0700 (Mon, 25 Feb 2008) | 19 lines

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

........
r104092 | qwell | 2008-02-25 14:49:42 -0600 (Mon, 25 Feb 2008) | 11 lines

Allow the use of #include and #exec in situations where the max include depth was only 1.
Specifically, this fixes using #include and #exec in extconfig.conf.

This was basically caused because the config file itself raises the include level to 1.

I opted not to raise the include limit, because recursion here could cause very bizarre behavior.

Pointed out, and tested by jmls

(closes issue #12064)

........

................
r104096 | file | 2008-02-25 14:40:30 -0700 (Mon, 25 Feb 2008) | 14 lines

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

........
r104095 | file | 2008-02-25 17:37:20 -0400 (Mon, 25 Feb 2008) | 6 lines

Make it so a users.conf user creates both a SIP peer and a SIP user. The user will be used for inbound authentication for the device, and peer will be used for placing calls to the device.
(closes issue #9044)
Reported by: queuetue
Patches:
      sip-gui-friend.diff uploaded by qwell (license 4)

........

................
r104097 | tilghman | 2008-02-25 14:53:36 -0700 (Mon, 25 Feb 2008) | 13 lines

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

........
r104094 | tilghman | 2008-02-25 15:31:47 -0600 (Mon, 25 Feb 2008) | 5 lines

If the destination folder is full, don't delete a message when exiting.
(closes issue #12065)
 Reported by: selsky
 Patch by: (myself)

........

................
r104098 | tilghman | 2008-02-25 14:56:19 -0700 (Mon, 25 Feb 2008) | 7 lines

Shared space for variables (instead of letting other channels muck with your own)
(closes issue #11943)
 Reported by: ramonpeek
 Patches: 
       20080208__bug11943__2.diff.txt uploaded by Corydon76 (license 14)
 Tested by: jmls

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

Modified:
    team/murf/bug11210/   (props changed)
    team/murf/bug11210/apps/app_voicemail.c
    team/murf/bug11210/channels/chan_agent.c
    team/murf/bug11210/channels/chan_iax2.c
    team/murf/bug11210/channels/chan_sip.c
    team/murf/bug11210/configs/sip.conf.sample
    team/murf/bug11210/doc/siptls.txt
    team/murf/bug11210/funcs/func_global.c
    team/murf/bug11210/main/config.c

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

Propchange: team/murf/bug11210/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Feb 25 17:22:56 2008
@@ -1,1 +1,1 @@
-/trunk:1-104075
+/trunk:1-104100

Modified: team/murf/bug11210/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/apps/app_voicemail.c?view=diff&rev=104105&r1=104104&r2=104105
==============================================================================
--- team/murf/bug11210/apps/app_voicemail.c (original)
+++ team/murf/bug11210/apps/app_voicemail.c Mon Feb 25 17:22:56 2008
@@ -222,6 +222,7 @@
 #define VM_TEMPGREETWARN (1 << 15)  /*!< Remind user tempgreeting is set */
 #define VM_MOVEHEARD     (1 << 16)  /*!< Move a "heard" message to Old after listening to it */
 #define ERROR_LOCK_PATH  -100
+#define ERROR_MAILBOX_FULL	-200
 
 
 enum {
@@ -3522,7 +3523,7 @@
 	} else {
 		if (x >= vmu->maxmsg) {
 			ast_unlock_path(ddir);
-			return -1;
+			return ERROR_MAILBOX_FULL;
 		}
 	}
 	make_file(sfn, sizeof(sfn), dir, msg);
@@ -5336,8 +5337,9 @@
 		} else if (!strcasecmp(vms->curbox, "INBOX") && vms->heard[x] && ast_test_flag(vmu, VM_MOVEHEARD) && !vms->deleted[x]) { 
 			/* Move to old folder before deleting */ 
 			res = save_to_folder(vmu, vms, x, 1);
-			if (res == ERROR_LOCK_PATH) {
+			if (res == ERROR_LOCK_PATH || res == ERROR_MAILBOX_FULL) {
 				/* If save failed do not delete the message */
+				ast_log(LOG_WARNING, "Save failed.  Not moving message: %s.\n", res == ERROR_LOCK_PATH ? "unable to lock path" : "destination folder full");
 				vms->deleted[x] = 0;
 				vms->heard[x] = 0;
 				--x;

Modified: team/murf/bug11210/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/channels/chan_agent.c?view=diff&rev=104105&r1=104104&r2=104105
==============================================================================
--- team/murf/bug11210/channels/chan_agent.c (original)
+++ team/murf/bug11210/channels/chan_agent.c Mon Feb 25 17:22:56 2008
@@ -1513,10 +1513,29 @@
 			ret = 0;
 			if (p->owner || p->chan) {
 				if (!soft) {
-					if (p->owner)
+					ast_mutex_lock(&p->lock);
+
+					while (p->owner && ast_channel_trylock(p->owner)) {
+						ast_mutex_unlock(&p->lock);
+						usleep(1);
+						ast_mutex_lock(&p->lock);
+					}
+					if (p->owner) {
 						ast_softhangup(p->owner, AST_SOFTHANGUP_EXPLICIT);
-					if (p->chan)
+						ast_channel_unlock(p->owner);
+					}
+
+					while (p->chan && ast_channel_trylock(p->chan)) {
+						ast_mutex_unlock(&p->lock);
+						usleep(1);
+						ast_mutex_lock(&p->lock);
+					}
+					if (p->chan) {
 						ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);
+						ast_channel_unlock(p->chan);
+					}
+
+					ast_mutex_unlock(&p->lock);
 				} else
 					p->deferlogoff = 1;
 			} else {

Modified: team/murf/bug11210/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/channels/chan_iax2.c?view=diff&rev=104105&r1=104104&r2=104105
==============================================================================
--- team/murf/bug11210/channels/chan_iax2.c (original)
+++ team/murf/bug11210/channels/chan_iax2.c Mon Feb 25 17:22:56 2008
@@ -7877,7 +7877,7 @@
 			localooo = jbinfo.frames_ooo;
 			localpackets = jbinfo.frames_in;
 		}
-		ast_verb(3, "JB STATS:%s ping=%d ljitterms=%d ljbdelayms=%d ltotlost=%d lrecentlosspct=%d ldropped=%d looo=%d lrecvd=%d rjitterms=%d rjbdelayms=%d rtotlost=%d rrecentlosspct=%d rdropped=%d rooo=%d rrecvd=%d\n",
+		ast_debug(3, "JB STATS:%s ping=%d ljitterms=%d ljbdelayms=%d ltotlost=%d lrecentlosspct=%d ldropped=%d looo=%d lrecvd=%d rjitterms=%d rjbdelayms=%d rtotlost=%d rrecentlosspct=%d rdropped=%d rooo=%d rrecvd=%d\n",
 			iaxs[callno]->owner->name,
 			iaxs[callno]->pingtime,
 			localjitter,

Modified: team/murf/bug11210/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/channels/chan_sip.c?view=diff&rev=104105&r1=104104&r2=104105
==============================================================================
--- team/murf/bug11210/channels/chan_sip.c (original)
+++ team/murf/bug11210/channels/chan_sip.c Mon Feb 25 17:22:56 2008
@@ -2006,7 +2006,7 @@
 /*--- Device object handling */
 static struct sip_peer *temp_peer(const char *name);
 static struct sip_peer *build_peer(const char *name, struct ast_variable *v, struct ast_variable *alt, int realtime);
-static struct sip_user *build_user(const char *name, struct ast_variable *v, int realtime);
+static struct sip_user *build_user(const char *name, struct ast_variable *v, struct ast_variable *alt, int realtime);
 static int update_call_counter(struct sip_pvt *fup, int event);
 static void sip_destroy_peer(struct sip_peer *peer);
 static void sip_destroy_peer_fn(void *peer);
@@ -3993,7 +3993,7 @@
 		}
 	}
 
-	user = build_user(username, var, !ast_test_flag(&global_flags[1], SIP_PAGE2_RTCACHEFRIENDS));
+	user = build_user(username, var, NULL, !ast_test_flag(&global_flags[1], SIP_PAGE2_RTCACHEFRIENDS));
 	
 	if (!user) {	/* No user found */
 		ast_variables_destroy(var);
@@ -6017,7 +6017,8 @@
  	  	  	found = (!strcmp(p->callid, arg->callid));
 		else
  	  	  	found = (!strcmp(p->callid, arg->callid) &&
-					 (!pedanticsipchecking || !arg->tag || ast_strlen_zero(p->theirtag) || !strcmp(p->theirtag, arg->tag))) ;
+					 (!pedanticsipchecking || ast_strlen_zero(arg->tag) || ast_strlen_zero(p->theirtag) || !strcmp(p->theirtag, arg->tag))) ;
+
 		
 		ast_debug(5, "= %s Their Call ID: %s Their Tag %s Our tag: %s\n", found ? "Found" : "No match", p->callid, p->theirtag, p->tag);
 		
@@ -17886,6 +17887,18 @@
 	}
 
 	if (!req->ignore && !resubscribe) {	/* Set up dialog, new subscription */
+		const char *to = get_header(req, "To");
+		char totag[128];
+
+		/* Check to see if a tag was provided, if so this is actually a resubscription of a dialog we no longer know about */
+		if (!ast_strlen_zero(to) && gettag(req, "To", totag, sizeof(totag))) {
+			if (req->debug)
+				ast_verbose("Received resubscription for a dialog we no longer know about. Telling remote side to subscribe again.\n");
+			transmit_response(p, "481 Subscription does not exist", req);
+			p->needdestroy = 1;
+			return 0;
+		}
+
 		/* Use this as the basis */
 		if (req->debug)
 			ast_verbose("Creating new subscription\n");
@@ -19871,7 +19884,7 @@
 }
 
 /*! \brief Initiate a SIP user structure from configuration (configuration or realtime) */
-static struct sip_user *build_user(const char *name, struct ast_variable *v, int realtime)
+static struct sip_user *build_user(const char *name, struct ast_variable *v, struct ast_variable *alt, int realtime)
 {
 	struct sip_user *user;
 	int format;
@@ -19903,7 +19916,7 @@
 	strcpy(user->language, default_language);
 	strcpy(user->mohinterpret, default_mohinterpret);
 	strcpy(user->mohsuggest, default_mohsuggest);
-	for (; v; v = v->next) {
+	for (; v || ((v = alt) && !(alt=NULL)); v = v->next) {
 		if (handle_common_options(&userflags[0], &mask[0], v))
 			continue;
 		if (!strcasecmp(v->name, "context")) {
@@ -21587,6 +21600,12 @@
 				hassip = ast_variable_retrieve(ucfg, cat, "hassip");
 				registersip = ast_variable_retrieve(ucfg, cat, "registersip");
 				if (ast_true(hassip) || (!hassip && genhassip)) {
+					user = build_user(cat, gen, ast_variable_browse(ucfg, cat), 0);
+					if (user) {
+						ao2_t_link(users, user, "link user into users table");
+						unref_user(user, "Unref the result of build_user. Now, the table link is the only one left.");
+						user_count++;
+					}
 					peer = build_peer(cat, gen, ast_variable_browse(ucfg, cat), 0);
 					if (peer) {
 						ast_device_state_changed("SIP/%s", peer->name);
@@ -21652,7 +21671,7 @@
 				continue;
 			}
 			if (is_user) {
-				user = build_user(cat, ast_variable_browse(cfg, cat), 0);
+				user = build_user(cat, ast_variable_browse(cfg, cat), NULL, 0);
 				if (user) {
 					ao2_t_link(users, user, "link user into users table");
 					unref_user(user, "Unref the result of build_user. Now, the table link is the only one left.");

Modified: team/murf/bug11210/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/configs/sip.conf.sample?view=diff&rev=104105&r1=104104&r2=104105
==============================================================================
--- team/murf/bug11210/configs/sip.conf.sample (original)
+++ team/murf/bug11210/configs/sip.conf.sample Mon Feb 25 17:22:56 2008
@@ -97,6 +97,27 @@
 
 ;tlscertfile=asterisk.pem	; Certificate file (*.pem only) to use for TLS connections 
 			 	; default is to look for "asterisk.pem" in current directory
+
+;tlscafile=</path/to/certificate>
+;	If the server your connecting to uses a self signed certificate
+;	you should have their certificate installed here so the code can 
+;	verify the authenticity of their certificate.
+
+;tlscadir=</path/to/ca/dir>
+;	A directory full of CA certificates.  The files must be named with 
+;	the CA subject name hash value. 
+;	(see man SSL_CTX_load_verify_locations for more info) 
+
+;tlsdontverifyserver=[yes|no]
+;	If set to yes, don't verify the servers certificate when acting as 
+;	a client.  If you don't have the server's CA certificate you can
+;	set this and it will connect without requiring tlscafile to be set.
+;	Default is no.
+
+;tlscipher=<SSL cipher string>
+;	A string specifying which SSL ciphers to use or not use
+;	A list of valid SSL cipher strings can be found at: 
+;		http://www.openssl.org/docs/apps/ciphers.html#CIPHER_STRINGS
 
 srvlookup=yes			; Enable DNS SRV lookups on outbound calls
 				; Note: Asterisk only uses the first host 

Modified: team/murf/bug11210/doc/siptls.txt
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/doc/siptls.txt?view=diff&rev=104105&r1=104104&r2=104105
==============================================================================
--- team/murf/bug11210/doc/siptls.txt (original)
+++ team/murf/bug11210/doc/siptls.txt Mon Feb 25 17:22:56 2008
@@ -47,6 +47,8 @@
 
 tlscipher=<SSL cipher string>
 	A string specifying which SSL ciphers to use or not use
+	A list of valid SSL cipher strings can be found at: 
+		http://www.openssl.org/docs/apps/ciphers.html#CIPHER_STRINGS
 
 
 Sample config

Modified: team/murf/bug11210/funcs/func_global.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/funcs/func_global.c?view=diff&rev=104105&r1=104104&r2=104105
==============================================================================
--- team/murf/bug11210/funcs/func_global.c (original)
+++ team/murf/bug11210/funcs/func_global.c Mon Feb 25 17:22:56 2008
@@ -33,6 +33,27 @@
 
 #include "asterisk/module.h"
 #include "asterisk/pbx.h"
+#include "asterisk/channel.h"
+#include "asterisk/app.h"
+#include "asterisk/manager.h"
+
+static void shared_variable_free(void *data);
+
+static struct ast_datastore_info shared_variable_info = {
+	.type = "SHARED_VARIABLES",
+	.destroy = shared_variable_free,
+};
+
+static void shared_variable_free(void *data)
+{
+	struct varshead *varshead = data;
+	struct ast_var_t *var;
+
+	while ((var = AST_LIST_REMOVE_HEAD(varshead, entries))) {
+		ast_var_delete(var);
+	}
+	ast_free(varshead);
+}
 
 static int global_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 {
@@ -61,11 +82,151 @@
 	.write = global_write,
 };
 
+static int shared_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
+{
+	struct ast_datastore *varstore;
+	struct varshead *varshead;
+	struct ast_var_t *var;
+	AST_DECLARE_APP_ARGS(args,
+		AST_APP_ARG(var);
+		AST_APP_ARG(chan);
+	);
+
+	if (ast_strlen_zero(data)) {
+		ast_log(LOG_WARNING, "SHARED() requires an argument: SHARED(<var>[,<chan>])\n");
+		return -1;
+	}
+
+	AST_STANDARD_APP_ARGS(args, data);
+
+	if (!ast_strlen_zero(args.chan)) {
+		char *prefix = alloca(strlen(args.chan) + 2);
+		sprintf(prefix, "%s-", args.chan);
+		if (!(chan = ast_get_channel_by_name_locked(args.chan)) && !(chan = ast_get_channel_by_name_prefix_locked(prefix, strlen(prefix)))) {
+			ast_log(LOG_ERROR, "Channel '%s' not found!  Variable '%s' will be blank.\n", args.chan, args.var);
+			return -1;
+		}
+	} else
+		ast_channel_lock(chan);
+
+	if (!(varstore = ast_channel_datastore_find(chan, &shared_variable_info, NULL)))
+		return -1;
+	varshead = varstore->data;
+	*buf = '\0';
+
+	/* Protected by the channel lock */
+	AST_LIST_TRAVERSE(varshead, var, entries) {
+		if (!strcmp(args.var, ast_var_name(var))) {
+			ast_copy_string(buf, ast_var_value(var), len);
+			break;
+		}
+	}
+
+	return 0;
+}
+
+static int shared_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
+{
+	struct ast_datastore *varstore;
+	struct varshead *varshead;
+	struct ast_var_t *var;
+	AST_DECLARE_APP_ARGS(args,
+		AST_APP_ARG(var);
+		AST_APP_ARG(chan);
+	);
+
+	if (ast_strlen_zero(data)) {
+		ast_log(LOG_WARNING, "SHARED() requires an argument: SHARED(<var>[,<chan>])\n");
+		return -1;
+	}
+
+	AST_STANDARD_APP_ARGS(args, data);
+
+	if (!ast_strlen_zero(args.chan)) {
+		char *prefix = alloca(strlen(args.chan) + 2);
+		sprintf(prefix, "%s-", args.chan);
+		if (!(chan = ast_get_channel_by_name_locked(args.chan)) && !(chan = ast_get_channel_by_name_prefix_locked(prefix, strlen(prefix)))) {
+			ast_log(LOG_ERROR, "Channel '%s' not found!  Variable '%s' not set to '%s'.\n", args.chan, args.var, value);
+			return -1;
+		}
+	} else
+		ast_channel_lock(chan);
+
+	if (!(varstore = ast_channel_datastore_find(chan, &shared_variable_info, NULL))) {
+		if (!(varstore = ast_channel_datastore_alloc(&shared_variable_info, NULL))) {
+			ast_log(LOG_ERROR, "Unable to allocate new datastore.  Shared variable not set.\n");
+			ast_channel_unlock(chan);
+			return -1;
+		}
+
+		if (!(varshead = ast_calloc(1, sizeof(*varshead)))) {
+			ast_log(LOG_ERROR, "Unable to allocate variable structure.  Shared variable not set.\n");
+			ast_channel_datastore_free(varstore);
+			ast_channel_unlock(chan);
+			return -1;
+		}
+
+		varstore->data = varshead;
+		ast_channel_datastore_add(chan, varstore);
+	}
+	varshead = varstore->data;
+
+	/* Protected by the channel lock */
+	AST_LIST_TRAVERSE(varshead, var, entries) {
+		/* If there's a previous value, remove it */
+		if (!strcmp(args.var, ast_var_name(var))) {
+			AST_LIST_REMOVE(varshead, var, entries);
+			ast_var_delete(var);
+			break;
+		}
+	}
+
+	var = ast_var_assign(args.var, S_OR(value, ""));
+	AST_LIST_INSERT_HEAD(varshead, var, entries);
+	manager_event(EVENT_FLAG_DIALPLAN, "VarSet", 
+		"Channel: %s\r\n"
+		"Variable: SHARED(%s)\r\n"
+		"Value: %s\r\n"
+		"Uniqueid: %s\r\n", 
+		chan ? chan->name : "none", args.var, value, 
+		chan ? chan->uniqueid : "none");
+
+	ast_channel_unlock(chan);
+
+	return 0;
+}
+
+static struct ast_custom_function shared_function = {
+	.name = "SHARED",
+	.synopsis = "Gets or sets the shared variable specified",
+	.syntax = "SHARED(<varname>[,<channel>])",
+	.desc =
+"Implements a shared variable area, in which you may share variables between\n"
+"channels.  If channel is unspecified, defaults to the current channel.  Note\n"
+"that the channel name may be the complete name (i.e. SIP/12-abcd1234) or the\n"
+"prefix only (i.e. SIP/12).\n"
+"\n"
+"The variables used in this space are separate from the general namespace of\n"
+"the channel and thus ${SHARED(foo)} and ${foo} represent two completely\n"
+"different variables, despite sharing the same name.\n"
+"\n"
+"Finally, realize that there is an inherent race between channels operating\n"
+"at the same time, fiddling with each others' internal variables, which is why\n"
+"this special variable namespace exists; it is to remind you that variables in\n"
+"the SHARED namespace may change at any time, without warning.  You should\n"
+"therefore take special care to ensure that when using the SHARED namespace,\n"
+"you retrieve the variable and store it in a regular channel variable before\n"
+"using it in a set of calculations (or you might be surprised by the result).\n",
+	.read = shared_read,
+	.write = shared_write,
+};
+
 static int unload_module(void)
 {
 	int res = 0;
 
 	res |= ast_custom_function_unregister(&global_function);
+	res |= ast_custom_function_unregister(&shared_function);
 
 	return res;
 }
@@ -75,8 +236,9 @@
 	int res = 0;
 
 	res |= ast_custom_function_register(&global_function);
+	res |= ast_custom_function_register(&shared_function);
 
 	return res;
 }
 
-AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Global variable dialplan functions");
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Variable dialplan functions");

Modified: team/murf/bug11210/main/config.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/main/config.c?view=diff&rev=104105&r1=104104&r2=104105
==============================================================================
--- team/murf/bug11210/main/config.c (original)
+++ team/murf/bug11210/main/config.c Mon Feb 25 17:22:56 2008
@@ -1963,7 +1963,8 @@
 	struct ast_config_engine *loader = &text_file_engine;
 	struct ast_config *result; 
 
-	if (cfg->include_level == cfg->max_include_level) {
+	/* The config file itself bumps include_level by 1 */
+	if (cfg->max_include_level > 0 && cfg->include_level == cfg->max_include_level + 1) {
 		ast_log(LOG_WARNING, "Maximum Include level (%d) exceeded\n", cfg->max_include_level);
 		return NULL;
 	}




More information about the asterisk-commits mailing list