[asterisk-commits] mmichelson: branch mmichelson/queue-reset r159097 - in /team/mmichelson/queue...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Nov 25 10:24:00 CST 2008


Author: mmichelson
Date: Tue Nov 25 10:23:59 2008
New Revision: 159097

URL: http://svn.digium.com/view/asterisk?view=rev&rev=159097
Log:
Resolve conflicts and reset automerge


Modified:
    team/mmichelson/queue-reset/   (props changed)
    team/mmichelson/queue-reset/apps/app_queue.c
    team/mmichelson/queue-reset/apps/app_readexten.c
    team/mmichelson/queue-reset/apps/app_rpt.c
    team/mmichelson/queue-reset/channels/chan_console.c
    team/mmichelson/queue-reset/channels/chan_iax2.c
    team/mmichelson/queue-reset/channels/chan_sip.c
    team/mmichelson/queue-reset/channels/chan_usbradio.c
    team/mmichelson/queue-reset/channels/xpmr/xpmr.c
    team/mmichelson/queue-reset/configure
    team/mmichelson/queue-reset/configure.ac
    team/mmichelson/queue-reset/funcs/func_dialgroup.c
    team/mmichelson/queue-reset/include/asterisk/astobj2.h
    team/mmichelson/queue-reset/include/asterisk/autoconfig.h.in
    team/mmichelson/queue-reset/main/astobj2.c
    team/mmichelson/queue-reset/main/config.c
    team/mmichelson/queue-reset/main/features.c
    team/mmichelson/queue-reset/main/manager.c
    team/mmichelson/queue-reset/main/taskprocessor.c
    team/mmichelson/queue-reset/res/res_clialiases.c
    team/mmichelson/queue-reset/res/res_phoneprov.c
    team/mmichelson/queue-reset/res/res_timing_pthread.c
    team/mmichelson/queue-reset/res/res_timing_timerfd.c
    team/mmichelson/queue-reset/utils/hashtest2.c

Propchange: team/mmichelson/queue-reset/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/mmichelson/queue-reset/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/mmichelson/queue-reset/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Nov 25 10:23:59 2008
@@ -1,1 +1,1 @@
-/trunk:1-158940
+/trunk:1-159092

Modified: team/mmichelson/queue-reset/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/queue-reset/apps/app_queue.c?view=diff&rev=159097&r1=159096&r2=159097
==============================================================================
--- team/mmichelson/queue-reset/apps/app_queue.c (original)
+++ team/mmichelson/queue-reset/apps/app_queue.c Tue Nov 25 10:23:59 2008
@@ -860,7 +860,7 @@
 	return ast_str_case_hash(q->name);
 }
 
-static int queue_cmp_cb(void *obj, void *arg, void *data, int flags)
+static int queue_cmp_cb(void *obj, void *arg, int flags)
 {
 	struct call_queue *q = obj, *q2 = arg;
 	return !strcasecmp(q->name, q2->name) ? CMP_MATCH | CMP_STOP : 0;
@@ -1133,7 +1133,7 @@
 	return ret;
 }
 
-static int member_cmp_fn(void *obj1, void *obj2, void *data, int flags)
+static int member_cmp_fn(void *obj1, void *obj2, int flags)
 {
 	struct member *mem1 = obj1, *mem2 = obj2;
 	return strcasecmp(mem1->interface, mem2->interface) ? 0 : CMP_MATCH | CMP_STOP;
@@ -1642,7 +1642,7 @@
 	char tmpbuf[64];	/* Must be longer than the longest queue param name. */
 
 	/* Static queues override realtime. */
-	if ((q = ao2_find(queues, &tmpq, NULL, OBJ_POINTER))) {
+	if ((q = ao2_find(queues, &tmpq, OBJ_POINTER))) {
 		ao2_lock(q);
 		if (!q->realtime) {
 			if (q->dead) {
@@ -1770,7 +1770,7 @@
 	int prev_weight = 0;
 
 	/* Find the queue in the in-core list first. */
-	q = ao2_find(queues, &tmpq, NULL, OBJ_POINTER);
+	q = ao2_find(queues, &tmpq, OBJ_POINTER);
 
 	if (!q || q->realtime) {
 		/*! \note Load from realtime before taking the "queues" container lock, to avoid blocking all
@@ -2245,7 +2245,7 @@
 		}
 		ao2_lock(q);
 		if (q->count && q->members) {
-			if ((mem = ao2_find(q->members, member, NULL, OBJ_POINTER))) {
+			if ((mem = ao2_find(q->members, member, OBJ_POINTER))) {
 				ast_debug(1, "Found matching member %s in queue '%s'\n", mem->interface, q->name);
 				if (q->weight > rq->weight) {
 					ast_debug(1, "Queue '%s' (weight %d, calls %d) is preferred over '%s' (weight %d, calls %d)\n", q->name, q->weight, q->count, rq->name, rq->weight, rq->count);
@@ -3134,7 +3134,7 @@
 		queue_iter = ao2_iterator_init(queues, 0);
 		while ((qtmp = ao2_iterator_next(&queue_iter))) {
 			ao2_lock(qtmp);
-			if ((mem = ao2_find(qtmp->members, member, NULL, OBJ_POINTER))) {
+			if ((mem = ao2_find(qtmp->members, member, OBJ_POINTER))) {
 				time(&mem->lastcall);
 				mem->calls++;
 				mem->lastqueue = q;
@@ -4184,10 +4184,10 @@
 	int res = RES_NOSUCHQUEUE;
 
 	ast_copy_string(tmpmem.interface, interface, sizeof(tmpmem.interface));
-	if ((q = ao2_find(queues, &tmpq, NULL, OBJ_POINTER))) {
+	if ((q = ao2_find(queues, &tmpq, OBJ_POINTER))) {
 		ao2_lock(queues);
 		ao2_lock(q);
-		if ((mem = ao2_find(q->members, &tmpmem, NULL, OBJ_POINTER))) {
+		if ((mem = ao2_find(q->members, &tmpmem, OBJ_POINTER))) {
 			/* XXX future changes should beware of this assumption!! */
 			if (!mem->dynamic) {
 				ao2_ref(mem, -1);
@@ -4412,7 +4412,7 @@
 	};
 	struct member *mem;
 	
-	if ((q = ao2_find(queues, &tmpq, NULL, OBJ_POINTER))) {
+	if ((q = ao2_find(queues, &tmpq, OBJ_POINTER))) {
 		foundqueue = 1;
 		ao2_lock(q);
 		if ((mem = interface_exists(q, interface))) {
@@ -4464,7 +4464,7 @@
 			struct call_queue tmpq = {
 				.name = queue_name,
 			};
-			cur_queue = ao2_find(queues, &tmpq, NULL, OBJ_POINTER);
+			cur_queue = ao2_find(queues, &tmpq, OBJ_POINTER);
 		}	
 
 		if (!cur_queue)
@@ -5088,7 +5088,7 @@
 		return -1;
 	}
 
-	if ((q = ao2_find(queues, &tmpq, NULL, OBJ_POINTER))) {
+	if ((q = ao2_find(queues, &tmpq, OBJ_POINTER))) {
 		ao2_lock(q);
 		if (q->setqueuevar) {
 			sl = 0;
@@ -5229,7 +5229,7 @@
 		return -1;
 	}
 
-	if ((q = ao2_find(queues, &tmpq, NULL, OBJ_POINTER))) {
+	if ((q = ao2_find(queues, &tmpq, OBJ_POINTER))) {
 		ao2_lock(q);
 		count = q->count;
 		ao2_unlock(q);
@@ -5265,7 +5265,7 @@
 		return -1;
 	}
 
-	if ((q = ao2_find(queues, &tmpq, NULL, OBJ_POINTER))) {
+	if ((q = ao2_find(queues, &tmpq, OBJ_POINTER))) {
 		int buflen = 0, count = 0;
 		struct ao2_iterator mem_iter = ao2_iterator_init(q->members, 0);
 
@@ -5511,7 +5511,7 @@
 
 	/* Find the old position in the list */
 	ast_copy_string(tmpmem.interface, interface, sizeof(tmpmem.interface));
-	cur = ao2_find(q->members, &tmpmem, NULL, OBJ_POINTER | OBJ_UNLINK);
+	cur = ao2_find(q->members, &tmpmem, OBJ_POINTER | OBJ_UNLINK);
 	newm = create_queue_member(interface, membername, penalty, cur ? cur->paused : 0, state_interface);
 	ao2_link(q->members, newm);
 	ao2_ref(newm, -1);
@@ -5541,7 +5541,7 @@
 	int prev_weight = 0;
 	struct member *cur;
 	struct ast_variable *var;
-	if (!(q = ao2_find(queues, &tmpq, NULL, OBJ_POINTER))) {
+	if (!(q = ao2_find(queues, &tmpq, OBJ_POINTER))) {
 		if (queue_reload) {
 			/* Make one then */
 			if (!(q = alloc_queue(queuename))) {

Modified: team/mmichelson/queue-reset/apps/app_readexten.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/queue-reset/apps/app_readexten.c?view=diff&rev=159097&r1=159096&r2=159097
==============================================================================
--- team/mmichelson/queue-reset/apps/app_readexten.c (original)
+++ team/mmichelson/queue-reset/apps/app_readexten.c Tue Nov 25 10:23:59 2008
@@ -1,9 +1,8 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 2007 Dave Chappell
- *
- * David Chappell <David.Chappell at trincoll.edu>
+ * Copyright (C) 2007-2008, Trinity College Computing Center
+ * Written by David Chappell <David.Chappell at trincoll.edu>
  *
  * See http://www.asterisk.org for more information about
  * the Asterisk project. Please do not directly contact
@@ -77,10 +76,10 @@
 						A valid extension exists in ${variable}.
 					</value>
 					<value name="TIMEOUT">
-						No extension was entered in the specified time.
+						No extension was entered in the specified time.  Also sets ${variable} to "t".
 					</value>
 					<value name="INVALID">
-						An invalid extension, ${INVALID_EXTEN}, was entered.
+						An invalid extension, ${INVALID_EXTEN}, was entered.  Also sets ${variable} to "i".
 					</value>
 					<value name="SKIP">
 						Line was not up and the option 's' was specified.
@@ -154,7 +153,7 @@
 	AST_STANDARD_APP_ARGS(arglist, argcopy);
 
 	if (ast_strlen_zero(arglist.variable)) {
-		ast_log(LOG_WARNING, "Invalid! Usage: ReadExten(variable[|filename][|context][|options][|timeout])\n\n");
+		ast_log(LOG_WARNING, "Usage: ReadExten(variable[,filename[,context[,options[,timeout]]]])\n");
 		pbx_builtin_setvar_helper(chan, "READEXTENSTATUS", "ERROR");
 		return 0;
 	}
@@ -218,10 +217,12 @@
 			timeout = digit_timeout;
 
 			if (res < 1) {		/* timeout expired or hangup */
-				if (ast_check_hangup(chan))
+				if (ast_check_hangup(chan)) {
 					status = "HANGUP";
-				else
+				} else {
+					pbx_builtin_setvar_helper(chan, arglist.variable, "t");
 					status = "TIMEOUT";
+				}
 				break;
 			} else if (res == '#') {
 				break;
@@ -242,6 +243,7 @@
 			status = "OK";
 		} else {
 			ast_debug(3, "User dialed invalid extension '%s' in context '%s' on %s\n", exten, arglist.context, chan->name);
+			pbx_builtin_setvar_helper(chan, arglist.variable, "i");
 			pbx_builtin_setvar_helper(chan, "INVALID_EXTEN", exten);
 			status = "INVALID";
 		}

Modified: team/mmichelson/queue-reset/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/queue-reset/apps/app_rpt.c?view=diff&rev=159097&r1=159096&r2=159097
==============================================================================
--- team/mmichelson/queue-reset/apps/app_rpt.c (original)
+++ team/mmichelson/queue-reset/apps/app_rpt.c Tue Nov 25 10:23:59 2008
@@ -331,7 +331,9 @@
 #include <sys/time.h>
 #include <sys/file.h>
 #include <sys/ioctl.h>
+#ifdef HAVE_SYS_IO_H
 #include <sys/io.h>
+#endif
 #include <sys/vfs.h>
 #include <math.h>
 #include <dahdi/user.h>
@@ -4483,6 +4485,7 @@
 		{
 			res = set_ic706(myrpt);
 		}
+#ifdef HAVE_IOPERM
 		else if(!strcmp(myrpt->remoterig, remote_rig_rbi)||!strcmp(myrpt->remoterig, remote_rig_ppp16))
 		{
 			if (ioperm(myrpt->p.iobase,1,1) == -1)
@@ -4493,6 +4496,7 @@
 			}
 			else res = setrbi(myrpt);
 		}
+#endif
 		else if(!strcmp(myrpt->remoterig, remote_rig_kenwood))
 		{
 			if (myrpt->iofd >= 0) setdtr(myrpt->iofd,1);
@@ -10756,7 +10760,8 @@
 		rpt_mutex_unlock(&myrpt->lock);
 		usleep(100000);
 		rpt_mutex_lock(&myrpt->lock);
-	}	
+	}
+#ifdef HAVE_IOPERM
 	if ((!strcmp(myrpt->remoterig, remote_rig_rbi)) &&
 	  (ioperm(myrpt->p.iobase,1,1) == -1))
 	{
@@ -10765,6 +10770,7 @@
 		myrpt->rpt_thread = AST_PTHREADT_STOP;
 		pthread_exit(NULL);
 	}
+#endif
 	strncpy(tmpstr,myrpt->rxchanname,sizeof(tmpstr) - 1);
 	tele = strchr(tmpstr,'/');
 	if (!tele)
@@ -13721,6 +13727,7 @@
 		}
 	}
 
+#ifdef HAVE_IOPERM
 	if ( (!strcmp(myrpt->remoterig, remote_rig_rbi)||!strcmp(myrpt->remoterig, remote_rig_ppp16)) &&
 	  (ioperm(myrpt->p.iobase,1,1) == -1))
 	{
@@ -13728,6 +13735,7 @@
 		ast_log(LOG_WARNING, "Can't get io permission on IO port %x hex\n",myrpt->p.iobase);
 		return -1;
 	}
+#endif
 	myrpt->remoteon = 1;
 #ifdef	OLD_ASTERISK
 	LOCAL_USER_ADD(u);

Modified: team/mmichelson/queue-reset/channels/chan_console.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/queue-reset/channels/chan_console.c?view=diff&rev=159097&r1=159096&r2=159097
==============================================================================
--- team/mmichelson/queue-reset/channels/chan_console.c (original)
+++ team/mmichelson/queue-reset/channels/chan_console.c Tue Nov 25 10:23:59 2008
@@ -251,7 +251,7 @@
 		.name = name,
 	};
 
-	return ao2_find(pvts, &tmp_pvt, NULL, OBJ_POINTER);
+	return ao2_find(pvts, &tmp_pvt, OBJ_POINTER);
 }
 
 /*!
@@ -1351,7 +1351,7 @@
 	unref_pvt(pvt);
 }
 
-static int pvt_mark_destroy_cb(void *obj, void *arg, void *data, int flags)
+static int pvt_mark_destroy_cb(void *obj, void *arg, int flags)
 {
 	struct console_pvt *pvt = obj;
 	pvt->destroy = 1;
@@ -1403,7 +1403,7 @@
 		return -1;
 	}
 	
-	ao2_callback(pvts, OBJ_NODATA, pvt_mark_destroy_cb, NULL, NULL);
+	ao2_callback(pvts, OBJ_NODATA, pvt_mark_destroy_cb, NULL);
 
 	ast_mutex_lock(&globals_lock);
 	for (v = ast_variable_browse(cfg, "general"); v; v = v->next)
@@ -1429,7 +1429,7 @@
 	return ast_str_case_hash(pvt->name);
 }
 
-static int pvt_cmp_cb(void *obj, void *arg, void *data, int flags)
+static int pvt_cmp_cb(void *obj, void *arg, int flags)
 {
 	struct console_pvt *pvt = obj, *pvt2 = arg;
 

Modified: team/mmichelson/queue-reset/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/queue-reset/channels/chan_iax2.c?view=diff&rev=159097&r1=159096&r2=159097
==============================================================================
--- team/mmichelson/queue-reset/channels/chan_iax2.c (original)
+++ team/mmichelson/queue-reset/channels/chan_iax2.c Tue Nov 25 10:23:59 2008
@@ -1400,7 +1400,7 @@
 /*!
  * \note The only member of the peer passed here guaranteed to be set is the name field
  */
-static int peer_cmp_cb(void *obj, void *arg, void *data, int flags)
+static int peer_cmp_cb(void *obj, void *arg, int flags)
 {
 	struct iax2_peer *peer = obj, *peer2 = arg;
 
@@ -1420,7 +1420,7 @@
 /*!
  * \note The only member of the user passed here guaranteed to be set is the name field
  */
-static int user_cmp_cb(void *obj, void *arg, void *data, int flags)
+static int user_cmp_cb(void *obj, void *arg, int flags)
 {
 	struct iax2_user *user = obj, *user2 = arg;
 
@@ -1438,7 +1438,7 @@
 		.name = name,
 	};
 
-	peer = ao2_find(peers, &tmp_peer, NULL, OBJ_POINTER);
+	peer = ao2_find(peers, &tmp_peer, OBJ_POINTER);
 
 	/* Now go for realtime if applicable */
 	if(!peer && realtime)
@@ -1512,7 +1512,7 @@
 			.name = pvt->username,
 		};
 
-		user = ao2_find(users, &tmp_user, NULL, OBJ_POINTER);
+		user = ao2_find(users, &tmp_user, OBJ_POINTER);
 		if (user) {
 			ast_atomic_fetchadd_int(&user->curauthreq, -1);
 			user_unref(user);	
@@ -1793,7 +1793,7 @@
 
 			memcpy(&tmp_pvt.addr, sin, sizeof(tmp_pvt.addr));
 
-			if ((pvt = ao2_find(iax_peercallno_pvts, &tmp_pvt, NULL, OBJ_POINTER))) {
+			if ((pvt = ao2_find(iax_peercallno_pvts, &tmp_pvt, OBJ_POINTER))) {
 				if (return_locked) {
 					ast_mutex_lock(&iaxsl[pvt->callno]);
 				}
@@ -5431,7 +5431,7 @@
 			};
 			struct iax2_peer *peer;
 
-			peer = ao2_find(peers, &tmp_peer, NULL, OBJ_POINTER);
+			peer = ao2_find(peers, &tmp_peer, OBJ_POINTER);
 			if (peer) {
 				expire_registry(peer_ref(peer)); /* will release its own reference when done */
 				peer_unref(peer); /* ref from ao2_find() */
@@ -6323,7 +6323,7 @@
 			.name = p->username,	
 		};
 
-		user = ao2_find(users, &tmp_user, NULL, OBJ_POINTER);
+		user = ao2_find(users, &tmp_user, OBJ_POINTER);
 		if (user) {
 			if (user->curauthreq == user->maxauthreq)
 				authreq_restrict = 1;
@@ -6373,7 +6373,7 @@
 		.name = p->username,	
 	};
 
-	user = ao2_find(users, &tmp_user, NULL, OBJ_POINTER);
+	user = ao2_find(users, &tmp_user, OBJ_POINTER);
 	if (user) {
 		if (ast_test_flag(p, IAX_MAXAUTHREQ)) {
 			ast_atomic_fetchadd_int(&user->curauthreq, -1);
@@ -10250,7 +10250,7 @@
 	return 0;
 }
 
-static int iax2_poke_peer_cb(void *obj, void *arg, void *data, int flags)
+static int iax2_poke_peer_cb(void *obj, void *arg, int flags)
 {
 	struct iax2_peer *peer = obj;
 
@@ -10690,7 +10690,7 @@
 	};
 
 	if (!temponly) {
-		peer = ao2_find(peers, &tmp_peer, NULL, OBJ_POINTER);
+		peer = ao2_find(peers, &tmp_peer, OBJ_POINTER);
 		if (peer && !ast_test_flag(peer, IAX_DELME))
 			firstpass = 0;
 	}
@@ -10944,7 +10944,7 @@
 	};
 
 	if (!temponly) {
-		user = ao2_find(users, &tmp_user, NULL, OBJ_POINTER);
+		user = ao2_find(users, &tmp_user, OBJ_POINTER);
 		if (user && !ast_test_flag(user, IAX_DELME))
 			firstpass = 0;
 	}
@@ -11144,7 +11144,7 @@
 	return user;
 }
 
-static int peer_delme_cb(void *obj, void *arg, void *data, int flags)
+static int peer_delme_cb(void *obj, void *arg, int flags)
 {
 	struct iax2_peer *peer = obj;
 
@@ -11153,7 +11153,7 @@
 	return 0;
 }
 
-static int user_delme_cb(void *obj, void *arg, void *data, int flags)
+static int user_delme_cb(void *obj, void *arg, int flags)
 {
 	struct iax2_user *user = obj;
 
@@ -11166,7 +11166,7 @@
 {
 	struct iax2_registry *reg;
 
-	ao2_callback(users, 0, user_delme_cb, NULL, NULL);
+	ao2_callback(users, 0, user_delme_cb, NULL);
 
 	AST_LIST_LOCK(&registrations);
 	while ((reg = AST_LIST_REMOVE_HEAD(&registrations, entry))) {
@@ -11186,7 +11186,7 @@
 	}
 	AST_LIST_UNLOCK(&registrations);
 
-	ao2_callback(peers, 0, peer_delme_cb, NULL, NULL);
+	ao2_callback(peers, 0, peer_delme_cb, NULL);
 }
 
 static void prune_users(void)
@@ -12434,7 +12434,7 @@
 	return __unload_module();
 }
 
-static int peer_set_sock_cb(void *obj, void *arg, void *data, int flags)
+static int peer_set_sock_cb(void *obj, void *arg, int flags)
 {
 	struct iax2_peer *peer = obj;
 
@@ -12451,7 +12451,7 @@
 	return pvt->peercallno;
 }
 
-static int pvt_cmp_cb(void *obj, void *arg, void *data, int flags)
+static int pvt_cmp_cb(void *obj, void *arg, int flags)
 {
 	struct chan_iax2_pvt *pvt = obj, *pvt2 = arg;
 
@@ -12565,8 +12565,8 @@
 		iax2_do_register(reg);
 	AST_LIST_UNLOCK(&registrations);	
 	
-	ao2_callback(peers, 0, peer_set_sock_cb, NULL, NULL);
-	ao2_callback(peers, 0, iax2_poke_peer_cb, NULL, NULL);
+	ao2_callback(peers, 0, peer_set_sock_cb, NULL);
+	ao2_callback(peers, 0, iax2_poke_peer_cb, NULL);
 
 
 	reload_firmware(0);

Modified: team/mmichelson/queue-reset/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/queue-reset/channels/chan_sip.c?view=diff&rev=159097&r1=159096&r2=159097
==============================================================================
--- team/mmichelson/queue-reset/channels/chan_sip.c (original)
+++ team/mmichelson/queue-reset/channels/chan_sip.c Tue Nov 25 10:23:59 2008
@@ -1962,7 +1962,7 @@
 /*!
  * \note The only member of the peer used here is the name field
  */
-static int peer_cmp_cb(void *obj, void *arg, void *data, int flags)
+static int peer_cmp_cb(void *obj, void *arg, int flags)
 {
 	struct sip_peer *peer = obj, *peer2 = arg;
 
@@ -1989,7 +1989,7 @@
 /*!
  * \note the peer's addr struct provides to fields combined to make a key: the sin_addr.s_addr and sin_port fields.
  */
-static int peer_ipcmp_cb(void *obj, void *arg, void *data, int flags)
+static int peer_ipcmp_cb(void *obj, void *arg, int flags)
 {
 	struct sip_peer *peer = obj, *peer2 = arg;
 
@@ -2018,7 +2018,7 @@
 /*!
  * \note The only member of the dialog used here callid string
  */
-static int dialog_cmp_cb(void *obj, void *arg, void *data, int flags)
+static int dialog_cmp_cb(void *obj, void *arg, int flags)
 {
 	struct sip_pvt *pvt = obj, *pvt2 = arg;
 	
@@ -4454,15 +4454,15 @@
 
 	if (peer) {
 		ast_copy_string(tmp_peer.name, peer, sizeof(tmp_peer.name));
-		p = ao2_t_callback(peers, OBJ_POINTER, find_by_name, &tmp_peer, &forcenamematch, "ao2_find in peers table");
+		p = ao2_t_callback_data(peers, OBJ_POINTER, find_by_name, &tmp_peer, &forcenamematch, "ao2_find in peers table");
 	} else if (sin) { /* search by addr? */
 		tmp_peer.addr.sin_addr.s_addr = sin->sin_addr.s_addr;
 		tmp_peer.addr.sin_port = sin->sin_port;
 		tmp_peer.flags[0].flags = 0;
-		p = ao2_t_find(peers_by_ip, &tmp_peer, NULL, OBJ_POINTER, "ao2_find in peers_by_ip table"); /* WAS:  p = ASTOBJ_CONTAINER_FIND_FULL(&peerl, sin, name, sip_addr_hashfunc, 1, sip_addrcmp); */
+		p = ao2_t_find(peers_by_ip, &tmp_peer, OBJ_POINTER, "ao2_find in peers_by_ip table"); /* WAS:  p = ASTOBJ_CONTAINER_FIND_FULL(&peerl, sin, name, sip_addr_hashfunc, 1, sip_addrcmp); */
 		if (!p) {
 			ast_set_flag(&tmp_peer.flags[0], SIP_INSECURE_PORT);
-			p = ao2_t_find(peers_by_ip, &tmp_peer, NULL, OBJ_POINTER, "ao2_find in peers_by_ip table 2"); /* WAS:  p = ASTOBJ_CONTAINER_FIND_FULL(&peerl, sin, name, sip_addr_hashfunc, 1, sip_addrcmp); */
+			p = ao2_t_find(peers_by_ip, &tmp_peer, OBJ_POINTER, "ao2_find in peers_by_ip table 2"); /* WAS:  p = ASTOBJ_CONTAINER_FIND_FULL(&peerl, sin, name, sip_addr_hashfunc, 1, sip_addrcmp); */
 			if (p) {
 				return p;
 			}
@@ -6615,7 +6615,7 @@
  * code to determine whether this is the pvt that we are looking for.
  * Return FALSE if not found, true otherwise. p is unlocked.
  */
-static int find_call_cb(void *__pvt, void *__arg, void *data, int flags)
+static int find_call_cb(void *__pvt, void *__arg, int flags)
 {
 	struct sip_pvt *p = __pvt;
 	struct find_call_cb_arg *arg = __arg;
@@ -6713,7 +6713,7 @@
 		struct sip_pvt tmp_dialog = {
 			.callid = callid,
 		};			
-		sip_pvt_ptr = ao2_t_find(dialogs, &tmp_dialog, NULL, OBJ_POINTER, "ao2_find in dialogs");
+		sip_pvt_ptr = ao2_t_find(dialogs, &tmp_dialog, OBJ_POINTER, "ao2_find in dialogs");
 		if (sip_pvt_ptr) {  /* well, if we don't find it-- what IS in there? */
 			/* Found the call */
 			sip_pvt_lock(sip_pvt_ptr);
@@ -6721,7 +6721,7 @@
 		}
 	} else { /* in pedantic mode! -- do the fancy linear search */
 		ao2_lock(dialogs);
-		p = ao2_t_callback(dialogs, 0 /* single, data */, find_call_cb, &arg, NULL, "pedantic linear search for dialog");
+		p = ao2_t_callback(dialogs, 0 /* single, data */, find_call_cb, &arg, "pedantic linear search for dialog");
 		if (p) {
 			if (sip_pvt_trylock(p)) {
 				ao2_unlock(dialogs);
@@ -12082,7 +12082,7 @@
 
 	/* Search dialogs and find the match */
 	
-	sip_pvt_ptr = ao2_t_find(dialogs, &tmp_dialog, NULL, OBJ_POINTER, "ao2_find of dialog in dialogs table");
+	sip_pvt_ptr = ao2_t_find(dialogs, &tmp_dialog, OBJ_POINTER, "ao2_find of dialog in dialogs table");
 	if (sip_pvt_ptr) {
 		/* Go ahead and lock it (and its owner) before returning */
 		sip_pvt_lock(sip_pvt_ptr);
@@ -13425,7 +13425,7 @@
 #undef FORMAT2
 }
 
-static int peer_dump_func(void *userobj, void *arg, void *data, int flags)
+static int peer_dump_func(void *userobj, void *arg, int flags)
 {
 	struct sip_peer *peer = userobj;
 	int refc = ao2_t_ref(userobj, 0, "");
@@ -13436,7 +13436,7 @@
 	return 0;
 }
 
-static int dialog_dump_func(void *userobj, void *arg, void *data, int flags)
+static int dialog_dump_func(void *userobj, void *arg, int flags)
 {
 	struct sip_pvt *pvt = userobj;
 	int refc = ao2_t_ref(userobj, 0, "");
@@ -13467,11 +13467,11 @@
 	if (a->argc != 3)
 		return CLI_SHOWUSAGE;
 	ast_cli(a->fd, "-= Peer objects: %d static, %d realtime, %d autocreate =-\n\n", speerobjs, rpeerobjs, apeerobjs);
-	ao2_t_callback(peers, OBJ_NODATA, peer_dump_func, &a->fd, NULL, "initiate ao2_callback to dump peers");
+	ao2_t_callback(peers, OBJ_NODATA, peer_dump_func, &a->fd, "initiate ao2_callback to dump peers");
 	ast_cli(a->fd, "-= Registry objects: %d =-\n\n", regobjs);
 	ASTOBJ_CONTAINER_DUMP(a->fd, tmp, sizeof(tmp), &regl);
 	ast_cli(a->fd, "-= Dialog objects:\n\n");
-	ao2_t_callback(dialogs, OBJ_NODATA, dialog_dump_func, &a->fd, NULL, "initiate ao2_callback to dump dialogs");
+	ao2_t_callback(dialogs, OBJ_NODATA, dialog_dump_func, &a->fd, "initiate ao2_callback to dump dialogs");
 	return CLI_SUCCESS;
 }
 /*! \brief Print call group and pickup group */
@@ -13551,7 +13551,7 @@
    to be destroyed, toss it into the queue. Have a separate
    thread do the locking and destruction */
 
-static int dialog_needdestroy(void *dialogobj, void *arg, void *data, int flags) 
+static int dialog_needdestroy(void *dialogobj, void *arg, int flags) 
 {
 	struct sip_pvt *dialog = dialogobj;
 	time_t *t = arg;
@@ -13615,7 +13615,7 @@
 
 /* this func is used with ao2_callback to unlink/delete all marked
    peers */
-static int peer_is_marked(void *peerobj, void *arg, void *data, int flags)
+static int peer_is_marked(void *peerobj, void *arg, int flags)
 {
 	struct sip_peer *peer = peerobj;
 	return peer->the_mark ? CMP_MATCH : 0;
@@ -13722,7 +13722,7 @@
 				unref_peer(pi, "toss iterator peer ptr");
 			}
 			if (pruned) {
-				ao2_t_callback(peers, OBJ_NODATA | OBJ_UNLINK | OBJ_MULTIPLE, peer_is_marked, NULL, NULL,
+				ao2_t_callback(peers, OBJ_NODATA | OBJ_UNLINK | OBJ_MULTIPLE, peer_is_marked, NULL,
 						"initiating callback to remove marked peers");
 				ast_cli(a->fd, "%d peers pruned.\n", pruned);
 			} else
@@ -13732,7 +13732,7 @@
 		if (prunepeer) {
 			struct sip_peer tmp;
 			ast_copy_string(tmp.name, name, sizeof(tmp.name));
-			if ((peer = ao2_t_find(peers, &tmp, NULL, OBJ_POINTER | OBJ_UNLINK, "finding to unlink from peers"))) {
+			if ((peer = ao2_t_find(peers, &tmp, OBJ_POINTER | OBJ_UNLINK, "finding to unlink from peers"))) {
 				if (peer->addr.sin_addr.s_addr) {
 					ao2_t_unlink(peers_by_ip, peer, "unlinking peer from peers_by_ip also");
 				}
@@ -14296,7 +14296,7 @@
 }
 
 /*! \brief Callback for show_chanstats */
-static int show_chanstats_cb(void *__cur, void *__arg, void *data, int flags)
+static int show_chanstats_cb(void *__cur, void *__arg, int flags)
 {
 #define FORMAT2 "%-15.15s  %-11.11s  %-8.8s %-10.10s  %-10.10s (%-2.2s) %-6.6s %-10.10s  %-10.10s ( %%) %-6.6s\n"
 #define FORMAT  "%-15.15s  %-11.11s  %-8.8s %-10.10u%-1.1s %-10.10u (%-2.2u%%) %-6.6u %-10.10u%-1.1s %-10.10u (%-2.2u%%) %-6.6u\n"
@@ -14375,7 +14375,7 @@
 
 	ast_cli(a->fd, FORMAT2, "Peer", "Call ID", "Duration", "Recv: Pack", "Lost", "%", "Jitter", "Send: Pack", "Lost", "Jitter");
 	/* iterate on the container and invoke the callback on each item */
-	ao2_t_callback(dialogs, OBJ_NODATA, show_chanstats_cb, &arg, NULL, "callback to sip show chanstats");
+	ao2_t_callback(dialogs, OBJ_NODATA, show_chanstats_cb, &arg, "callback to sip show chanstats");
 	ast_cli(a->fd, "%d active SIP channel%s\n", arg.numchans, (arg.numchans != 1) ? "s" : ""); 
 	return CLI_SUCCESS;
 }
@@ -14652,7 +14652,7 @@
 #define FORMAT  "%-15.15s  %-10.10s  %-15.15s  %-15.15s  %-3.3s %-3.3s  %-15.15s %-10.10s\n"
 
 /*! \brief callback for show channel|subscription */
-static int show_channels_cb(void *__cur, void *__arg, void *data, int flags)
+static int show_channels_cb(void *__cur, void *__arg, int flags)
 {
 	struct sip_pvt *cur = __cur;
 	struct __show_chan_arg *arg = __arg;
@@ -14724,7 +14724,7 @@
 		ast_cli(arg.fd, FORMAT3, "Peer", "User", "Call ID", "Extension", "Last state", "Type", "Mailbox", "Expiry");
 
 	/* iterate on the container and invoke the callback on each item */
-	ao2_t_callback(dialogs, OBJ_NODATA, show_channels_cb, &arg, NULL, "callback to show channels");
+	ao2_t_callback(dialogs, OBJ_NODATA, show_channels_cb, &arg, "callback to show channels");
 	
 	/* print summary information */
 	ast_cli(arg.fd, "%d active SIP %s%s\n", arg.numchans,
@@ -20653,7 +20653,7 @@
 		   of time since the last time we did it (when MWI is being sent, we can
 		   get back to this point every millisecond or less)
 		*/
-		ao2_t_callback(dialogs, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, dialog_needdestroy, &t, NULL,
+		ao2_t_callback(dialogs, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, dialog_needdestroy, &t,
 				"callback to remove dialogs w/needdestroy");
 
 		/* the old methodology would be to restart the search for dialogs to delete with every 
@@ -21863,7 +21863,7 @@
 		   during reload
 		*/
 		ast_copy_string(tmp_peer.name, name, sizeof(tmp_peer.name));
-		peer = ao2_t_find(peers, &tmp_peer, NULL, OBJ_POINTER | OBJ_UNLINK, "find and unlink peer from peers table");
+		peer = ao2_t_find(peers, &tmp_peer, OBJ_POINTER | OBJ_UNLINK, "find and unlink peer from peers table");
 	}
 	
 	if (peer) {
@@ -22305,7 +22305,7 @@
 	return peer;
 }
 
-static int peer_markall_func(void *device, void *arg, void *data, int flags)
+static int peer_markall_func(void *device, void *arg, int flags)
 {
 	struct sip_peer *peer = device;
 	peer->the_mark = 1;
@@ -22410,7 +22410,7 @@
 		/* Then, actually destroy users and registry */
 		ASTOBJ_CONTAINER_DESTROYALL(&regl, sip_registry_destroy);
 		ast_debug(4, "--------------- Done destroying registry list\n");
-		ao2_t_callback(peers, OBJ_NODATA, peer_markall_func, NULL, NULL, "callback to mark all peers");
+		ao2_t_callback(peers, OBJ_NODATA, peer_markall_func, NULL, "callback to mark all peers");
 	}
 	
 	/* Reset certificate handling for TLS sessions */
@@ -23709,7 +23709,7 @@
 
 	start_poke = time(0);
 	/* Prune peers who still are supposed to be deleted */
-	ao2_t_callback(peers, OBJ_NODATA | OBJ_UNLINK | OBJ_MULTIPLE, peer_is_marked, NULL, NULL,
+	ao2_t_callback(peers, OBJ_NODATA | OBJ_UNLINK | OBJ_MULTIPLE, peer_is_marked, NULL,
 			"callback to remove marked peers");
 	
 	ast_debug(4, "--------------- Done destroying pruned peers\n");

Modified: team/mmichelson/queue-reset/channels/chan_usbradio.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/queue-reset/channels/chan_usbradio.c?view=diff&rev=159097&r1=159096&r2=159097
==============================================================================
--- team/mmichelson/queue-reset/channels/chan_usbradio.c (original)
+++ team/mmichelson/queue-reset/channels/chan_usbradio.c Tue Nov 25 10:23:59 2008
@@ -63,7 +63,9 @@
 #include <math.h>
 #include <string.h>
 #include <unistd.h>
+#ifdef HAVE_SYS_IO_H
 #include <sys/io.h>
+#endif
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <sys/time.h>
@@ -1107,7 +1109,9 @@
 	//printf("kickptt  %i  %i  %i\n",o->txkeyed,o->txchankey,o->txtestkey);
 	if (!o) return;
 	if (!o->pttkick) return;
-	write(o->pttkick[1],&c,1);
+	if (write(o->pttkick[1],&c,1) < 0) {
+		ast_log(LOG_ERROR, "write() failed: %s\n", strerror(errno));
+	}
 }
 /*
 */
@@ -1174,7 +1178,9 @@
 		{
 			char c;
 
-			read(o->pttkick[0],&c,1);
+			if (read(o->pttkick[0],&c,1) < 0) {
+				ast_log(LOG_ERROR, "read() failed: %s\n", strerror(errno));
+			}
 		}
 		if(o->wanteeprom)
 		{
@@ -1779,7 +1785,9 @@
 			tbuff[i]= ((i16*)(f->data.ptr))[i/2];
 			tbuff[i+1]= o->txkeyed*M_Q13;
 		}
-		fwrite(tbuff,2,f->datalen,ftxcapraw);
+		if (fwrite(tbuff,2,f->datalen,ftxcapraw) != f->datalen) {
+			ast_log(LOG_ERROR, "write() failed: %s\n", strerror(errno));
+		}
 		//fwrite(f->data,1,f->datalen,ftxcapraw);
 	}
 	#endif
@@ -1842,7 +1850,9 @@
 		return f;
 
 	#if DEBUG_CAPTURES == 1
-	if (o->b.rxcapraw && frxcapraw) fwrite((o->usbradio_read_buf + AST_FRIENDLY_OFFSET),1,FRAME_SIZE * 2 * 2 * 6,frxcapraw);
+	if ((o->b.rxcapraw && frxcapraw) && (fwrite((o->usbradio_read_buf + AST_FRIENDLY_OFFSET),1,FRAME_SIZE * 2 * 2 * 6,frxcapraw) != FRAME_SIZE * 2 * 2 * 6)) {
+		ast_log(LOG_ERROR, "fwrite() failed: %s\n", strerror(errno));
+	}
 	#endif
 
 	#if 1
@@ -1878,7 +1888,9 @@
 	#endif
 
 	#if DEBUG_CAPTURES == 1	&& XPMR_DEBUG0 == 1
-    if (o->b.txcap2 && ftxcaptrace) fwrite((o->pmrChan->ptxDebug),1,FRAME_SIZE * 2 * 16,ftxcaptrace);
+    if ((o->b.txcap2 && ftxcaptrace) && (fwrite((o->pmrChan->ptxDebug),1,FRAME_SIZE * 2 * 16,ftxcaptrace) != FRAME_SIZE * 2 * 16)) {
+	   ast_log(LOG_ERROR, "fwrite() failed: %s\n", strerror(errno));
+	}
 	#endif
 	
 	// 160 samples * 2 bytes/sample * 2 chan * 6x oversampling to 48KS/s
@@ -1936,7 +1948,9 @@
 	#endif
 
 	#if DEBUG_CAPTURES == 1 && XPMR_DEBUG0 == 1
-    if (frxcaptrace && o->b.rxcap2 && o->pmrChan->b.radioactive) fwrite((o->pmrChan->prxDebug),1,FRAME_SIZE * 2 * 16,frxcaptrace);
+    if ((frxcaptrace && o->b.rxcap2 && o->pmrChan->b.radioactive) && (fwrite((o->pmrChan->prxDebug),1,FRAME_SIZE * 2 * 16,frxcaptrace) != FRAME_SIZE * 2 * 16 )) {
+		ast_log(LOG_ERROR, "fwrite() failed: %s\n", strerror(errno));
+	}
 	#endif
 
 	cd = 0;
@@ -3772,7 +3786,9 @@
 
 		PmrRx(pChan,iBuff,oBuff);
 
-		fwrite((void *)pChan->prxDebug,2,numSamples*numChannels,hOutput);
+		if (fwrite((void *)pChan->prxDebug,2,numSamples*numChannels,hOutput) != numSamples * numChannels) {
+			ast_log(LOG_ERROR, "fwrite() failed: %s\n", strerror(errno));
+		}
 	}
 	pChan->b.txCapture=0;
 	pChan->b.rxCapture=0;

Modified: team/mmichelson/queue-reset/channels/xpmr/xpmr.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/queue-reset/channels/xpmr/xpmr.c?view=diff&rev=159097&r1=159096&r2=159097
==============================================================================
--- team/mmichelson/queue-reset/channels/xpmr/xpmr.c (original)
+++ team/mmichelson/queue-reset/channels/xpmr/xpmr.c Tue Nov 25 10:23:59 2008
@@ -56,7 +56,9 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/ioctl.h>
+#ifdef HAVE_SYS_IO_H
 #include <sys/io.h>
+#endif
 #include <fcntl.h>
 #include <sys/time.h>
 #include <stdlib.h>

Modified: team/mmichelson/queue-reset/configure.ac
URL: http://svn.digium.com/view/asterisk/team/mmichelson/queue-reset/configure.ac?view=diff&rev=159097&r1=159096&r2=159097
==============================================================================
--- team/mmichelson/queue-reset/configure.ac (original)
+++ team/mmichelson/queue-reset/configure.ac Tue Nov 25 10:23:59 2008
@@ -292,7 +292,7 @@
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h utime.h arpa/nameser.h])
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h utime.h arpa/nameser.h sys/io.h])
 
 AC_CHECK_HEADERS([winsock.h winsock2.h])
 
@@ -336,7 +336,7 @@
 AC_FUNC_STRTOD
 AC_FUNC_UTIME_NULL
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([asprintf atexit dup2 endpwent ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf])
+AC_CHECK_FUNCS([asprintf atexit dup2 endpwent ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday ioperm inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf])
 
 AC_CHECK_FUNCS([glob])
 

Modified: team/mmichelson/queue-reset/funcs/func_dialgroup.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/queue-reset/funcs/func_dialgroup.c?view=diff&rev=159097&r1=159096&r2=159097
==============================================================================
--- team/mmichelson/queue-reset/funcs/func_dialgroup.c (original)
+++ team/mmichelson/queue-reset/funcs/func_dialgroup.c Tue Nov 25 10:23:59 2008
@@ -96,7 +96,7 @@
 	return ast_str_hash(g->name);
 }
 
-static int group_cmp_fn(void *obj1, void *name2, void *data, int flags)
+static int group_cmp_fn(void *obj1, void *name2, int flags)
 {
 	struct group *g1 = obj1, *g2 = name2;
 	char *name = name2;
@@ -112,7 +112,7 @@
 	return ast_str_hash(e->name);
 }
 
-static int entry_cmp_fn(void *obj1, void *name2, void *data, int flags)
+static int entry_cmp_fn(void *obj1, void *name2, int flags)
 {
 	struct group_entry *e1 = obj1, *e2 = name2;
 	char *name = name2;
@@ -125,7 +125,7 @@
 static int dialgroup_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 {
 	struct ao2_iterator i;
-	struct group *grhead = ao2_find(group_container, data, NULL, 0);
+	struct group *grhead = ao2_find(group_container, data, 0);
 	struct group_entry *entry;
 	size_t bufused = 0;
 	int trunc_warning = 0;
@@ -206,7 +206,7 @@
 	AST_STANDARD_APP_ARGS(args, data);
 	AST_NONSTANDARD_APP_ARGS(inter, value, '&');
 
-	if (!(grhead = ao2_find(group_container, args.group, NULL, 0))) {
+	if (!(grhead = ao2_find(group_container, args.group, 0))) {
 		/* Create group */
 		grhead = ao2_alloc(sizeof(*grhead), group_destroy);
 		if (!grhead)
@@ -245,7 +245,7 @@
 		}
 	} else if (strncasecmp(args.op, "del", 3) == 0) {
 		for (j = 0; j < inter.argc; j++) {
-			if ((entry = ao2_find(grhead->entries, inter.faces[j], NULL, OBJ_UNLINK))) {
+			if ((entry = ao2_find(grhead->entries, inter.faces[j], OBJ_UNLINK))) {
 				ao2_ref(entry, -1);
 			} else {
 				ast_log(LOG_WARNING, "Interface '%s' not found in dialgroup '%s'\n", inter.faces[j], grhead->name);

Modified: team/mmichelson/queue-reset/include/asterisk/astobj2.h
URL: http://svn.digium.com/view/asterisk/team/mmichelson/queue-reset/include/asterisk/astobj2.h?view=diff&rev=159097&r1=159096&r2=159097
==============================================================================
--- team/mmichelson/queue-reset/include/asterisk/astobj2.h (original)
+++ team/mmichelson/queue-reset/include/asterisk/astobj2.h Tue Nov 25 10:23:59 2008
@@ -597,9 +597,21 @@
  * \param flags flags from ao2_callback()
  *
  * The return values are a combination of enum _cb_results.
- * Callback functions are used to search or manipulate objects in a container,
- */
-typedef int (ao2_callback_fn)(void *obj, void *arg, void *data, int flags);
+ * Callback functions are used to search or manipulate objects in a container.
+ */
+typedef int (ao2_callback_fn)(void *obj, void *arg, int flags);
+
+/*! \brief
+ * Type of a generic callback function
+ * \param obj pointer to the (user-defined part) of an object.
+ * \param arg callback argument from ao2_callback()
+ * \param data arbitrary data from ao2_callback()
+ * \param flags flags from ao2_callback()
+ *
+ * The return values are a combination of enum _cb_results.
+ * Callback functions are used to search or manipulate objects in a container.
+ */
+typedef int (ao2_callback_data_fn)(void *obj, void *arg, void *data, int flags);
 
 /*! \brief a very common callback is one that matches by address. */
 ao2_callback_fn ao2_match_by_addr;
@@ -832,31 +844,60 @@
  * be used to free the additional reference possibly created by this function.
  */
 #ifdef REF_DEBUG
-#define ao2_t_callback(arg1,arg2,arg3,arg4,arg5,arg6) _ao2_callback_debug((arg1), (arg2), (arg3), (arg4), (arg5), (arg6), __FILE__, __LINE__, __PRETTY_FUNCTION__)
-#define ao2_callback(arg1,arg2,arg3,arg4,arg5)        _ao2_callback_debug((arg1), (arg2), (arg3), (arg4), (arg5), "", __FILE__, __LINE__, __PRETTY_FUNCTION__)
-#else
-#define ao2_t_callback(arg1,arg2,arg3,arg4,arg5,arg6) _ao2_callback((arg1), (arg2), (arg3), (arg4), (arg5))
-#define ao2_callback(arg1,arg2,arg3,arg4,arg5)        _ao2_callback((arg1), (arg2), (arg3), (arg4), (arg5))
+#define ao2_t_callback(arg1,arg2,arg3,arg4,arg5) _ao2_callback_debug((arg1), (arg2), (arg3), (arg4), (arg5), __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define ao2_callback(arg1,arg2,arg3,arg4)        _ao2_callback_debug((arg1), (arg2), (arg3), (arg4), "", __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#else
+#define ao2_t_callback(arg1,arg2,arg3,arg4,arg5) _ao2_callback((arg1), (arg2), (arg3), (arg4))
+#define ao2_callback(arg1,arg2,arg3,arg4)        _ao2_callback((arg1), (arg2), (arg3), (arg4))
 #endif
 void *_ao2_callback_debug(struct ao2_container *c, enum search_flags flags,
-						  ao2_callback_fn *cb_fn, void *arg, void *data, char *tag, 
+						  ao2_callback_fn *cb_fn, void *arg, char *tag, 
 						  char *file, int line, const char *funcname);
 void *_ao2_callback(struct ao2_container *c,
 					enum search_flags flags,
-					ao2_callback_fn *cb_fn, void *arg, void *data);
+					ao2_callback_fn *cb_fn, void *arg);
+
+/*! \brief
+ * ao2_callback_data() is a generic function that applies cb_fn() to all objects
+ * in a container.  It is functionally identical to ao2_callback() except that
+ * instead of taking an ao2_callback_fn *, it takes an ao2_callback_data_fn *, and
+ * allows the caller to pass in arbitrary data.
+ *
+ * This call would be used instead of ao2_callback() when the caller needs to pass
+ * OBJ_POINTER as part of the flags argument (which in turn requires passing in a
+ * prototype ao2 object for 'arg') and also needs access to other non-global data
+ * to complete it's comparison or task.
+ *
+ * See the documentation for ao2_callback() for argument descriptions.
+ *
+ * \see ao2_callback()
+ */
+#ifdef REF_DEBUG

[... 694 lines stripped ...]



More information about the asterisk-commits mailing list