[asterisk-commits] russell: branch russell/chan_console r81461 - in /team/russell/chan_console: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 4 22:28:26 CDT 2007


Author: russell
Date: Tue Sep  4 22:28:26 2007
New Revision: 81461

URL: http://svn.digium.com/view/asterisk?view=rev&rev=81461
Log:
Sync with trunk.  It doesn't look like automerge has been running the past
couple of days.  I just kicked it though so it should start again ...

Modified:
    team/russell/chan_console/   (props changed)
    team/russell/chan_console/apps/app_followme.c
    team/russell/chan_console/channels/chan_iax2.c
    team/russell/chan_console/channels/chan_sip.c
    team/russell/chan_console/configs/extensions.ael.sample
    team/russell/chan_console/configs/followme.conf.sample
    team/russell/chan_console/funcs/func_logic.c
    team/russell/chan_console/include/asterisk/astobj2.h
    team/russell/chan_console/main/astobj2.c
    team/russell/chan_console/main/channel.c
    team/russell/chan_console/main/config.c
    team/russell/chan_console/main/dns.c
    team/russell/chan_console/main/editline/configure
    team/russell/chan_console/main/editline/configure.in
    team/russell/chan_console/main/editline/sys.h

Propchange: team/russell/chan_console/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/russell/chan_console/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Sep  4 22:28:26 2007
@@ -1,1 +1,1 @@
-/trunk:1-81419
+/trunk:1-81460

Modified: team/russell/chan_console/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/apps/app_followme.c?view=diff&rev=81461&r1=81460&r2=81461
==============================================================================
--- team/russell/chan_console/apps/app_followme.c (original)
+++ team/russell/chan_console/apps/app_followme.c Tue Sep  4 22:28:26 2007
@@ -963,12 +963,8 @@
 		if (ast_play_and_record(chan, "vm-rec-name", namerecloc, 5, "sln", &duration, 128, 0, NULL) < 0)
 			goto outrun;
 	
-	/* The following call looks like we're going to playback the file, but we're actually	*/
-	/* just checking to see if we *can* play it. 						*/
-	if (ast_streamfile(chan, namerecloc, chan->language))
+	if (!ast_fileexists(namerecloc, NULL, chan->language))
 		ast_copy_string(namerecloc, "", sizeof(namerecloc));					
-	else
-		ast_stopstream(chan);
 	
 	if (ast_streamfile(chan, targs.plsholdprompt, chan->language))
 		goto outrun;

Modified: team/russell/chan_console/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/channels/chan_iax2.c?view=diff&rev=81461&r1=81460&r2=81461
==============================================================================
--- team/russell/chan_console/channels/chan_iax2.c (original)
+++ team/russell/chan_console/channels/chan_iax2.c Tue Sep  4 22:28:26 2007
@@ -670,10 +670,10 @@
 #else
 #define MAX_PEER_BUCKETS 563
 #endif
-static ao2_container *peers;
+static struct ao2_container *peers;
 
 #define MAX_USER_BUCKETS MAX_PEER_BUCKETS
-static ao2_container *users;
+static struct ao2_container *users;
 
 static AST_LIST_HEAD_STATIC(firmwares, iax_firmware);
 
@@ -1302,7 +1302,7 @@
 {
 	struct iax2_peer *peer = NULL;
 	int res = 0;
-	ao2_iterator i;
+	struct ao2_iterator i;
 
 	i = ao2_iterator_init(peers, 0);
 	while ((peer = ao2_iterator_next(&i))) {
@@ -1886,7 +1886,7 @@
 }
 
 
-static void reload_firmware(void)
+static void reload_firmware(int unload)
 {
 	struct iax_firmware *cur = NULL;
 	DIR *fwd;
@@ -1900,20 +1900,22 @@
 		cur->dead = 1;
 
 	/* Now that we have marked them dead... load new ones */
-	snprintf(dir, sizeof(dir), "%s/firmware/iax", (char *)ast_config_AST_DATA_DIR);
-	fwd = opendir(dir);
-	if (fwd) {
-		while((de = readdir(fwd))) {
-			if (de->d_name[0] != '.') {
-				snprintf(fn, sizeof(fn), "%s/%s", dir, de->d_name);
-				if (!try_firmware(fn)) {
-					ast_verb(2, "Loaded firmware '%s'\n", de->d_name);
+	if (!unload) {
+		snprintf(dir, sizeof(dir), "%s/firmware/iax", (char *)ast_config_AST_DATA_DIR);
+		fwd = opendir(dir);
+		if (fwd) {
+			while((de = readdir(fwd))) {
+				if (de->d_name[0] != '.') {
+					snprintf(fn, sizeof(fn), "%s/%s", dir, de->d_name);
+					if (!try_firmware(fn)) {
+						ast_verb(2, "Loaded firmware '%s'\n", de->d_name);
+					}
 				}
 			}
-		}
-		closedir(fwd);
-	} else 
-		ast_log(LOG_WARNING, "Error opening firmware directory '%s': %s\n", dir, strerror(errno));
+			closedir(fwd);
+		} else 
+			ast_log(LOG_WARNING, "Error opening firmware directory '%s': %s\n", dir, strerror(errno));
+	}
 
 	/* Clean up leftovers */
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&firmwares, cur, list) {
@@ -2425,7 +2427,7 @@
 	struct iax2_peer *peer;
 	char *res = NULL;
 	int wordlen = strlen(word);
-	ao2_iterator i;
+	struct ao2_iterator i;
 
 	/* 0 - iax2; 1 - show; 2 - peer; 3 - <peername> */
 	if (pos != 3)
@@ -3688,7 +3690,7 @@
 {
 	struct iax2_peer *peer;
 	int res = 0;
-	ao2_iterator i;
+	struct ao2_iterator i;
 
 	i = ao2_iterator_init(peers, 0);
 	while ((peer = ao2_iterator_next(&i))) {
@@ -4436,7 +4438,7 @@
 	struct iax2_user *user = NULL;
 	char auth[90];
 	char *pstr = "";
-	ao2_iterator i;
+	struct ao2_iterator i;
 
 	switch (argc) {
 	case 5:
@@ -4494,7 +4496,7 @@
 	int online_peers = 0;
 	int offline_peers = 0;
 	int unmonitored_peers = 0;
-	ao2_iterator i;
+	struct ao2_iterator i;
 
 #define FORMAT2 "%-15.15s  %-15.15s %s  %-15.15s  %-8s  %s %-10s%s"
 #define FORMAT "%-15.15s  %-15.15s %s  %-15.15s  %-5d%s  %s %-10s%s"
@@ -4696,7 +4698,7 @@
 
 	/* 0 - iax2; 1 - unregister; 2 - <peername> */
 	if (pos == 2) {
-		ao2_iterator i = ao2_iterator_init(peers, 0);
+		struct ao2_iterator i = ao2_iterator_init(peers, 0);
 		while ((p = ao2_iterator_next(&i))) {
 			if (!strncasecmp(p->name, word, wordlen) && 
 				++which > state && p->expire > 0) {
@@ -5100,7 +5102,7 @@
 	int bestscore = 0;
 	int gotcapability = 0;
 	struct ast_variable *v = NULL, *tmpvar = NULL;
-	ao2_iterator i;
+	struct ao2_iterator i;
 
 	if (!iaxs[callno])
 		return res;
@@ -5691,7 +5693,7 @@
 		/* Normal password authentication */
 		res = authenticate(p->challenge, override, okey, authmethods, &ied, sin, &p->ecx, &p->dcx);
 	} else {
-		ao2_iterator i = ao2_iterator_init(peers, 0);
+		struct ao2_iterator i = ao2_iterator_init(peers, 0);
 		while ((peer = ao2_iterator_next(&i))) {
 			if ((ast_strlen_zero(p->peer) || !strcmp(p->peer, peer->name)) 
 			    /* No peer specified at our end, or this is the peer */
@@ -9517,20 +9519,16 @@
 						ast_sched_del(sched, peer->expire);
 					peer->expire = -1;
 					ast_clear_flag(peer, IAX_DYNAMIC);
-					if (ast_dnsmgr_lookup(v->value, &peer->addr.sin_addr, &peer->dnsmgr)) {
-						ast_string_field_free_pools(peer);
+					if (ast_dnsmgr_lookup(v->value, &peer->addr.sin_addr, &peer->dnsmgr))
 						return peer_unref(peer);
-					}
 					if (!peer->addr.sin_port)
 						peer->addr.sin_port = htons(IAX_DEFAULT_PORTNO);
 				}
 				if (!maskfound)
 					inet_aton("255.255.255.255", &peer->mask);
 			} else if (!strcasecmp(v->name, "defaultip")) {
-				if (ast_get_ip(&peer->defaddr, v->value)) {
-					ast_string_field_free_pools(peer);
+				if (ast_get_ip(&peer->defaddr, v->value))
 					return peer_unref(peer);
-				}
 			} else if (!strcasecmp(v->name, "sourceaddress")) {
 				peer_set_srcaddr(peer, v->value);
 			} else if (!strcasecmp(v->name, "permit") ||
@@ -9920,7 +9918,7 @@
 static void prune_users(void)
 {
 	struct iax2_user *user;
-	ao2_iterator i;
+	struct ao2_iterator i;
 
 	i = ao2_iterator_init(users, 0);
 	while ((user = ao2_iterator_next(&i))) {
@@ -9934,7 +9932,7 @@
 static void prune_peers(void)
 {
 	struct iax2_peer *peer;
-	ao2_iterator i;
+	struct ao2_iterator i;
 
 	i = ao2_iterator_init(peers, 0);
 	while ((peer = ao2_iterator_next(&i))) {
@@ -10386,7 +10384,7 @@
 		ao2_callback(peers, 0, iax2_poke_peer_cb, NULL);
 	}
 
-	reload_firmware();
+	reload_firmware(0);
 	iax_provision_reload(1);
 
 	return 0;
@@ -11191,6 +11189,7 @@
 	delete_users();
 	iax_provision_unload();
 	sched_context_destroy(sched);
+	reload_firmware(1);
 
 	for (x = 0; x < IAX_MAX_CALLS; x++)
 		ast_mutex_destroy(&iaxsl[x]);
@@ -11321,7 +11320,7 @@
 	ao2_callback(peers, 0, iax2_poke_peer_cb, NULL);
 
 
-	reload_firmware();
+	reload_firmware(0);
 	iax_provision_reload(0);
 
 	return AST_MODULE_LOAD_SUCCESS;

Modified: team/russell/chan_console/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/channels/chan_sip.c?view=diff&rev=81461&r1=81460&r2=81461
==============================================================================
--- team/russell/chan_console/channels/chan_sip.c (original)
+++ team/russell/chan_console/channels/chan_sip.c Tue Sep  4 22:28:26 2007
@@ -9108,11 +9108,11 @@
 	}
 
 	/* Ok, we have a bad username/secret pair */
-	/* Challenge again, and again, and again */
-	transmit_response_with_auth(p, response, req, p->randdata, reliable, respheader, 0);
-	sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
-
-	return AUTH_CHALLENGE_SENT;
+	/* Tell the UAS not to re-send this authentication data, because
+	   it will continue to fail
+	*/
+
+	return AUTH_SECRET_FAILED;
 }
 
 /*! \brief Change onhold state of a peer using a pvt structure */

Modified: team/russell/chan_console/configs/extensions.ael.sample
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/configs/extensions.ael.sample?view=diff&rev=81461&r1=81460&r2=81461
==============================================================================
--- team/russell/chan_console/configs/extensions.ael.sample (original)
+++ team/russell/chan_console/configs/extensions.ael.sample Tue Sep  4 22:28:26 2007
@@ -309,10 +309,10 @@
         Dial(${dev}/${ext},20);
         switch(${DIALSTATUS}) {
         case BUSY:
-                Voicemail(b${ext});
+                Voicemail(${ext},b);
                 break;
         default:
-                Voicemail(u${ext});
+                Voicemail(${ext},u);
         };
         catch a {
                 VoiceMailMain(${ext});
@@ -405,10 +405,10 @@
 //        Dial(${HINT}/5245},20,rtT);                    // Use hint as listed
 //        switch(${DIALSTATUS}) {
 //        case BUSY:
-//                Voicemail(b6245);
+//                Voicemail(6245,b);
 //				return;
 //        default:
-//                Voicemail(u6245);
+//                Voicemail(6245,u);
 //				return;
 //        };
 //       };

Modified: team/russell/chan_console/configs/followme.conf.sample
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/configs/followme.conf.sample?view=diff&rev=81461&r1=81460&r2=81461
==============================================================================
--- team/russell/chan_console/configs/followme.conf.sample (original)
+++ team/russell/chan_console/configs/followme.conf.sample Tue Sep  4 22:28:26 2007
@@ -67,7 +67,7 @@
 ; not to leave their name or the option isn't set for them to do so. Default
 ; is the global default.
 ;
-followme-options-prompt=>followme/followme-options
+followme-options-prompt=>followme/options
 ; The 'Press 1 to accept this call or press 2 to decline it' message prompt.
 ; Default is the global default.
 ;
@@ -75,11 +75,11 @@
 ; The 'Please hold while we try and connect your call' message prompt.
 ; Default is the global default.
 ;
-followme-status-prompt=>followme/followme-status
+followme-status-prompt=>followme/status
 ; The 'The party you're calling isn't at their desk' message prompt.
 ; Default is the global default.
 ;
-followme-sorry-prompt=>followme/followme-sorry  
+followme-sorry-prompt=>followme/sorry  
 ; The 'I'm sorry, but we were unable to locate your party' message prompt. Default
 ; is the global default.
 

Modified: team/russell/chan_console/funcs/func_logic.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/funcs/func_logic.c?view=diff&rev=81461&r1=81460&r2=81461
==============================================================================
--- team/russell/chan_console/funcs/func_logic.c (original)
+++ team/russell/chan_console/funcs/func_logic.c Tue Sep  4 22:28:26 2007
@@ -93,27 +93,30 @@
 static int acf_if(struct ast_channel *chan, const char *cmd, char *data, char *buf,
 		  size_t len)
 {
-	char *expr;
-	char *iftrue;
-	char *iffalse;
-
-	data = ast_strip_quoted(data, "\"", "\"");
-	expr = strsep(&data, "?");
-	iftrue = strsep(&data, ":");
-	iffalse = data;
-
-	if (ast_strlen_zero(expr) || !(iftrue || iffalse)) {
+	AST_DECLARE_APP_ARGS(args1,
+		AST_APP_ARG(expr);
+		AST_APP_ARG(remainder);
+	);
+	AST_DECLARE_APP_ARGS(args2,
+		AST_APP_ARG(iftrue);
+		AST_APP_ARG(iffalse);
+	);
+
+	AST_NONSTANDARD_APP_ARGS(args1, data, '?');
+	AST_NONSTANDARD_APP_ARGS(args2, args1.remainder, ':');
+
+	if (ast_strlen_zero(args1.expr) || !(args2.iftrue || args2.iffalse)) {
 		ast_log(LOG_WARNING, "Syntax IF(<expr>?[<true>][:<false>])\n");
 		return -1;
 	}
 
-	expr = ast_strip(expr);
-	if (iftrue)
-		iftrue = ast_strip_quoted(iftrue, "\"", "\"");
-	if (iffalse)
-		iffalse = ast_strip_quoted(iffalse, "\"", "\"");
-
-	ast_copy_string(buf, pbx_checkcondition(expr) ? (S_OR(iftrue, "")) : (S_OR(iffalse, "")), len);
+	args1.expr = ast_strip(args1.expr);
+	if (args2.iftrue)
+		args2.iftrue = ast_strip(args2.iftrue);
+	if (args2.iffalse)
+		args2.iffalse = ast_strip(args2.iffalse);
+
+	ast_copy_string(buf, pbx_checkcondition(args1.expr) ? (S_OR(args2.iftrue, "")) : (S_OR(args2.iffalse, "")), len);
 
 	return 0;
 }

Modified: team/russell/chan_console/include/asterisk/astobj2.h
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/include/asterisk/astobj2.h?view=diff&rev=81461&r1=81460&r2=81461
==============================================================================
--- team/russell/chan_console/include/asterisk/astobj2.h (original)
+++ team/russell/chan_console/include/asterisk/astobj2.h Tue Sep  4 22:28:26 2007
@@ -87,7 +87,7 @@
     <b>Sample Usage:</b>
     \code
 
-    ao2_container *c;
+    struct ao2_container *c;
 
     c = ao2_container_alloc(MAX_BUCKETS, my_hash_fn, my_cmp_fn);
 
@@ -239,8 +239,8 @@
     iterate on a container
 	this is done with the following sequence
 
-	    ao2_container *c = ... // our container
-	    ao2_iterator i;
+	    struct ao2_container *c = ... // our container
+	    struct ao2_iterator i;
 	    void *o;
 
 	    i = ao2_iterator_init(c, flags);
@@ -320,14 +320,7 @@
 /*!
  * Here start declarations of containers.
  */
-
-/*!
- * This structure contains the total number of buckets 
- * and variable size array of object pointers.
- * It is opaque, defined in astobj2.c, so we only need
- * a type declaration.
- */
-typedef struct __ao2_container ao2_container;
+struct ao2_container;
 
 /*!
  * Allocate and initialize a container 
@@ -343,13 +336,13 @@
  *
  * destructor is set implicitly.
  */
-ao2_container *ao2_container_alloc(const uint n_buckets,
+struct ao2_container *ao2_container_alloc(const uint n_buckets,
 		ao2_hash_fn hash_fn, ao2_callback_fn cmp_fn);
 
 /*!
  * Returns the number of elements in a container.
  */
-int ao2_container_count(ao2_container *c);
+int ao2_container_count(struct ao2_container *c);
 
 /*
  * Here we have functions to manage objects.
@@ -368,8 +361,8 @@
  *
  * \note Remember to set the key before calling this function.
  */
-void *ao2_link(ao2_container *c, void *newobj);
-void *ao2_unlink(ao2_container *c, void *newobj);
+void *ao2_link(struct ao2_container *c, void *newobj);
+void *ao2_unlink(struct ao2_container *c, void *newobj);
 
 /*! \struct Used as return value if the flag OBJ_MULTIPLE is set */
 struct ao2_list {
@@ -425,11 +418,12 @@
  * be used to free the additional reference possibly created by this function.
  */
 /* XXX order of arguments to find */
-void *ao2_find(ao2_container *c, void *arg, enum search_flags flags);
-void *ao2_callback(ao2_container *c,
+void *ao2_find(struct ao2_container *c, void *arg, enum search_flags flags);
+void *ao2_callback(struct ao2_container *c,
 	enum search_flags flags,
 	ao2_callback_fn cb_fn, void *arg);
 
+int ao2_match_by_addr(void *user_data, void *arg, int flags);
 /*!
  *
  *
@@ -464,8 +458,8 @@
  *
  *  \code
  *
- *  ao2_container *c = ... // the container we want to iterate on
- *  ao2_iterator i;
+ *  struct ao2_container *c = ... // the container we want to iterate on
+ *  struct ao2_iterator i;
  *  struct my_obj *o;
  *
  *  i = ao2_iterator_init(c, flags);
@@ -502,9 +496,9 @@
  * A freshly-initialized iterator has bucket=0, version = 0.
  */
 
-struct __ao2_iterator {
+struct ao2_iterator {
 	/*! the container */
-	ao2_container *c;
+	struct ao2_container *c;
 	/*! operation flags */
 	int flags;
 #define	F_AO2I_DONTLOCK	1	/*!< don't lock when iterating */
@@ -516,11 +510,10 @@
 	void *obj;
 	/*! container version when the object was created */
 	uint version;
-};              
-typedef struct __ao2_iterator ao2_iterator;
-
-ao2_iterator ao2_iterator_init(ao2_container *c, int flags);
-
-void *ao2_iterator_next(ao2_iterator *a);
+};
+
+struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags);
+
+void *ao2_iterator_next(struct ao2_iterator *a);
 
 #endif /* _ASTERISK_ASTOBJ2_H */

Modified: team/russell/chan_console/main/astobj2.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/main/astobj2.c?view=diff&rev=81461&r1=81460&r2=81461
==============================================================================
--- team/russell/chan_console/main/astobj2.c (original)
+++ team/russell/chan_console/main/astobj2.c Tue Sep  4 22:28:26 2007
@@ -243,7 +243,7 @@
  * This will be more efficient as we can do the freelist management while
  * we hold the lock (that we need anyways).
  */
-struct __ao2_container {
+struct ao2_container {
 	ao2_hash_fn hash_fn;
 	ao2_callback_fn cmp_fn;
 	int n_buckets;
@@ -272,15 +272,15 @@
 /*
  * A container is just an object, after all!
  */
-ao2_container *
+struct ao2_container *
 ao2_container_alloc(const uint n_buckets, ao2_hash_fn hash_fn,
 		ao2_callback_fn cmp_fn)
 {
 	/* XXX maybe consistency check on arguments ? */
 	/* compute the container size */
-	size_t container_size = sizeof(ao2_container) + n_buckets * sizeof(struct bucket);
-
-	ao2_container *c = ao2_alloc(container_size, container_destruct);
+	size_t container_size = sizeof(struct ao2_container) + n_buckets * sizeof(struct bucket);
+
+	struct ao2_container *c = ao2_alloc(container_size, container_destruct);
 
 	if (!c)
 		return NULL;
@@ -297,7 +297,7 @@
 /*!
  * return the number of elements in the container
  */
-int ao2_container_count(ao2_container *c)
+int ao2_container_count(struct ao2_container *c)
 {
 	return c->elements;
 }
@@ -316,7 +316,7 @@
 /*
  * link an object to a container
  */
-void *ao2_link(ao2_container *c, void *user_data)
+void *ao2_link(struct ao2_container *c, void *user_data)
 {
 	int i;
 	/* create a new list entry */
@@ -349,7 +349,7 @@
 /*!
  * \brief another convenience function is a callback that matches on address
  */
-static int match_by_addr(void *user_data, void *arg, int flags)
+int ao2_match_by_addr(void *user_data, void *arg, int flags)
 {
 	return (user_data == arg) ? (CMP_MATCH | CMP_STOP) : 0;
 }
@@ -358,12 +358,12 @@
  * Unlink an object from the container
  * and destroy the associated * ao2_bucket_list structure.
  */
-void *ao2_unlink(ao2_container *c, void *user_data)
+void *ao2_unlink(struct ao2_container *c, void *user_data)
 {
 	if (INTERNAL_OBJ(user_data) == NULL)	/* safety check on the argument */
 		return NULL;
 
-	ao2_callback(c, OBJ_UNLINK | OBJ_POINTER | OBJ_NODATA, match_by_addr, user_data);
+	ao2_callback(c, OBJ_UNLINK | OBJ_POINTER | OBJ_NODATA, ao2_match_by_addr, user_data);
 
 	return NULL;
 }
@@ -381,7 +381,7 @@
  * \return Is a pointer to an object or to a list of object if OBJ_MULTIPLE is 
  * specified.
  */
-void *ao2_callback(ao2_container *c,
+void *ao2_callback(struct ao2_container *c,
 	const enum search_flags flags,
 	ao2_callback_fn cb_fn, void *arg)
 {
@@ -485,7 +485,7 @@
 /*!
  * the find function just invokes the default callback with some reasonable flags.
  */
-void *ao2_find(ao2_container *c, void *arg, enum search_flags flags)
+void *ao2_find(struct ao2_container *c, void *arg, enum search_flags flags)
 {
 	return ao2_callback(c, flags, c->cmp_fn, arg);
 }
@@ -493,9 +493,9 @@
 /*!
  * initialize an iterator so we start from the first object
  */
-ao2_iterator ao2_iterator_init(ao2_container *c, int flags)
-{
-	ao2_iterator a = {
+struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags)
+{
+	struct ao2_iterator a = {
 		.c = c,
 		.flags = flags
 	};
@@ -506,7 +506,7 @@
 /*
  * move to the next element in the container.
  */
-void * ao2_iterator_next(ao2_iterator *a)
+void * ao2_iterator_next(struct ao2_iterator *a)
 {
 	int lim;
 	struct bucket_list *p = NULL;
@@ -571,7 +571,7 @@
 	
 static void container_destruct(void *_c)
 {
-	ao2_container *c = _c;
+	struct ao2_container *c = _c;
 
 	ao2_callback(c, OBJ_UNLINK, cd_cb, NULL);
 	ast_atomic_fetchadd_int(&ao2.total_containers, -1);
@@ -604,7 +604,7 @@
  */
 static int handle_astobj2_test(int fd, int argc, char *argv[])
 {
-	ao2_container *c1;
+	struct ao2_container *c1;
 	int i, lim;
 	char *obj;
 	static int prof_id = -1;
@@ -642,7 +642,7 @@
 
 	ast_cli(fd, "testing iterators, remove every second object\n");
 	{
-		ao2_iterator ai;
+		struct ao2_iterator ai;
 		int x = 0;
 
 		ai = ao2_iterator_init(c1, 0);

Modified: team/russell/chan_console/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/main/channel.c?view=diff&rev=81461&r1=81460&r2=81461
==============================================================================
--- team/russell/chan_console/main/channel.c (original)
+++ team/russell/chan_console/main/channel.c Tue Sep  4 22:28:26 2007
@@ -1991,11 +1991,13 @@
 
 int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int cmdfd)
 {
-	int begin_digit = 0;
-
 	/* Stop if we're a zombie or need a soft hangup */
 	if (ast_test_flag(c, AST_FLAG_ZOMBIE) || ast_check_hangup(c))
 		return -1;
+
+	/* Only look for the end of DTMF, don't bother with the beginning and don't emulate things */
+	ast_set_flag(c, AST_FLAG_END_DTMF_ONLY);
+
 	/* Wait for a digit, no more than ms milliseconds total. */
 	
 	while (ms) {
@@ -2009,10 +2011,12 @@
 			if (errno == 0 || errno == EINTR)
 				continue;
 			ast_log(LOG_WARNING, "Wait failed (%s)\n", strerror(errno));
+			ast_clear_flag(c, AST_FLAG_END_DTMF_ONLY);
 			return -1;
 		} else if (outfd > -1) {
 			/* The FD we were watching has something waiting */
 			ast_log(LOG_WARNING, "The FD we were waiting for has something waiting. Waitfordigit returning numeric 1\n");
+			ast_clear_flag(c, AST_FLAG_END_DTMF_ONLY);
 			return 1;
 		} else if (rchan) {
 			int res;
@@ -2022,18 +2026,17 @@
 
 			switch (f->frametype) {
 			case AST_FRAME_DTMF_BEGIN:
-				begin_digit = f->subclass;
 				break;
 			case AST_FRAME_DTMF_END:
-				if (begin_digit != f->subclass)
-					break;
 				res = f->subclass;
 				ast_frfree(f);
+				ast_clear_flag(c, AST_FLAG_END_DTMF_ONLY);
 				return res;
 			case AST_FRAME_CONTROL:
 				switch (f->subclass) {
 				case AST_CONTROL_HANGUP:
 					ast_frfree(f);
+					ast_clear_flag(c, AST_FLAG_END_DTMF_ONLY);
 					return -1;
 				case AST_CONTROL_RINGING:
 				case AST_CONTROL_ANSWER:
@@ -2055,6 +2058,9 @@
 			ast_frfree(f);
 		}
 	}
+
+	ast_clear_flag(c, AST_FLAG_END_DTMF_ONLY);
+
 	return 0; /* Time is up */
 }
 

Modified: team/russell/chan_console/main/config.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/main/config.c?view=diff&rev=81461&r1=81460&r2=81461
==============================================================================
--- team/russell/chan_console/main/config.c (original)
+++ team/russell/chan_console/main/config.c Tue Sep  4 22:28:26 2007
@@ -235,12 +235,14 @@
        instances is possible, I'd have
        to create a new master for each instance. */
 	struct ast_config_include *inc;
+	struct stat statbuf;
 	
 	inc = ast_include_find(conf, included_file);
-	if (inc)
-	{
-		inc->inclusion_count++;
-		snprintf(real_included_file_name, real_included_file_name_size, "%s~~%d", included_file, inc->inclusion_count);
+	if (inc) {
+		do {
+			inc->inclusion_count++;
+			snprintf(real_included_file_name, real_included_file_name_size, "%s~~%d", included_file, inc->inclusion_count);
+		} while (stat(real_included_file_name, &statbuf) == 0);
 		ast_log(LOG_WARNING,"'%s', line %d:  Same File included more than once! This data will be saved in %s if saved back to disk.\n", from_file, from_lineno, real_included_file_name);
 	} else
 		*real_included_file_name = 0;
@@ -1133,6 +1135,8 @@
 			continue;
 		}
 		count++;
+		/* If we get to this point, then we're loading regardless */
+		ast_clear_flag(&flags, CONFIG_FLAG_FILEUNCHANGED);
 		ast_debug(1, "Parsing %s\n", fn);
 		ast_verb(2, "Found\n");
 		while (!feof(f)) {

Modified: team/russell/chan_console/main/dns.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/main/dns.c?view=diff&rev=81461&r1=81460&r2=81461
==============================================================================
--- team/russell/chan_console/main/dns.c (original)
+++ team/russell/chan_console/main/dns.c Tue Sep  4 22:28:26 2007
@@ -280,7 +280,7 @@
 			ast_log(LOG_WARNING, "DNS Parse error for %s\n", dname);
 			ret = -1;
 		}
-		else if (ret == 0) {
+		else if (res == 0) {
 			ast_debug(1, "No matches found in DNS for %s\n", dname);
 			ret = 0;
 		}

Modified: team/russell/chan_console/main/editline/configure
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/main/editline/configure?view=diff&rev=81461&r1=81460&r2=81461
==============================================================================
--- team/russell/chan_console/main/editline/configure (original)
+++ team/russell/chan_console/main/editline/configure Tue Sep  4 22:28:26 2007
@@ -1535,118 +1535,6 @@
  
 else
   echo "$ac_t""no" 1>&6
-fi
-done
-
-for ac_func in strlcat
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1527: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1532 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
-CCSRCS="$CCSRCS np/strlcat.c"
-fi
-done
-
-for ac_func in strlcpy
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1583: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1588 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
-CCSRCS="$CCSRCS np/strlcpy.c"
 fi
 done
 

Modified: team/russell/chan_console/main/editline/configure.in
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/main/editline/configure.in?view=diff&rev=81461&r1=81460&r2=81461
==============================================================================
--- team/russell/chan_console/main/editline/configure.in (original)
+++ team/russell/chan_console/main/editline/configure.in Tue Sep  4 22:28:26 2007
@@ -95,8 +95,6 @@
 AC_CHECK_HEADERS(sys/cdefs.h vis.h)
 
 AC_CHECK_FUNCS(issetugid)
-AC_CHECK_FUNCS(strlcat, , CCSRCS="$CCSRCS np/strlcat.c")
-AC_CHECK_FUNCS(strlcpy, , CCSRCS="$CCSRCS np/strlcpy.c")
 AC_CHECK_FUNCS(fgetln, , CCSRCS="$CCSRCS np/fgetln.c")
 AC_CHECK_FUNCS(strvis, , CCSRCS="$CCSRCS np/vis.c")
 AC_CHECK_FUNCS(strunvis, , CCSRCS="$CCSRCS np/unvis.c")

Modified: team/russell/chan_console/main/editline/sys.h
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/main/editline/sys.h?view=diff&rev=81461&r1=81460&r2=81461
==============================================================================
--- team/russell/chan_console/main/editline/sys.h (original)
+++ team/russell/chan_console/main/editline/sys.h Tue Sep  4 22:28:26 2007
@@ -69,16 +69,6 @@
 
 #include <stdio.h>
 
-#ifndef HAVE_STRLCAT
-#define	strlcat libedit_strlcat
-size_t	strlcat(char *dst, const char *src, size_t size);
-#endif
-
-#ifndef HAVE_STRLCPY
-#define	strlcpy libedit_strlcpy
-size_t	strlcpy(char *dst, const char *src, size_t size);
-#endif
-
 #ifndef HAVE_FGETLN
 #define	fgetln libedit_fgetln
 char	*fgetln(FILE *fp, size_t *len);




More information about the asterisk-commits mailing list