[svn-commits] oej: branch oej/videocaps r135996 - in /team/oej/videocaps: ./ apps/ channels...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Aug 6 04:41:10 CDT 2008


Author: oej
Date: Wed Aug  6 04:41:08 2008
New Revision: 135996

URL: http://svn.digium.com/view/asterisk?view=rev&rev=135996
Log:
Reset, resolve, go

Added:
    team/oej/videocaps/include/asterisk/datastore.h
      - copied unchanged from r135950, trunk/include/asterisk/datastore.h
    team/oej/videocaps/main/datastore.c
      - copied unchanged from r135950, trunk/main/datastore.c
Modified:
    team/oej/videocaps/   (props changed)
    team/oej/videocaps/CHANGES
    team/oej/videocaps/UPGRADE.txt
    team/oej/videocaps/apps/app_chanspy.c
    team/oej/videocaps/apps/app_dial.c
    team/oej/videocaps/apps/app_queue.c
    team/oej/videocaps/apps/app_speech_utils.c
    team/oej/videocaps/apps/app_stack.c
    team/oej/videocaps/channels/chan_iax2.c
    team/oej/videocaps/funcs/func_enum.c
    team/oej/videocaps/funcs/func_global.c
    team/oej/videocaps/funcs/func_lock.c
    team/oej/videocaps/funcs/func_odbc.c
    team/oej/videocaps/funcs/func_speex.c
    team/oej/videocaps/funcs/func_volume.c
    team/oej/videocaps/include/asterisk/abstract_jb.h
    team/oej/videocaps/include/asterisk/cdr.h
    team/oej/videocaps/include/asterisk/channel.h
    team/oej/videocaps/include/asterisk/config.h
    team/oej/videocaps/include/asterisk/manager.h
    team/oej/videocaps/include/asterisk/threadstorage.h
    team/oej/videocaps/include/asterisk/utils.h
    team/oej/videocaps/main/Makefile
    team/oej/videocaps/main/abstract_jb.c
    team/oej/videocaps/main/audiohook.c
    team/oej/videocaps/main/cdr.c
    team/oej/videocaps/main/channel.c
    team/oej/videocaps/main/config.c
    team/oej/videocaps/main/features.c
    team/oej/videocaps/main/fixedjitterbuf.h
    team/oej/videocaps/main/manager.c
    team/oej/videocaps/main/pbx.c
    team/oej/videocaps/main/translate.c
    team/oej/videocaps/pbx/pbx_dundi.c
    team/oej/videocaps/pbx/pbx_lua.c
    team/oej/videocaps/res/res_agi.c
    team/oej/videocaps/res/res_smdi.c

Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
    automerge = http://www.codename-pineapple.org/

Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Aug  6 04:41:08 2008
@@ -1,1 +1,1 @@
-/trunk:1-135672
+/trunk:1-135995

Modified: team/oej/videocaps/CHANGES
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/CHANGES?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/CHANGES (original)
+++ team/oej/videocaps/CHANGES Wed Aug  6 04:41:08 2008
@@ -199,6 +199,10 @@
     Skinny channels only.
   * You can now compile Asterisk against the Hoard Memory Allocator, see doc/hoard.txt
     for more information.
+  * Config file variables may now be appended to, by using the '+=' append
+    operator.  This is most helpful when working with long SQL queries in
+    func_odbc.conf, as the queries no longer need to be specified on a single
+    line.
 
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 1.4.X to Asterisk 1.6.0  -------------

Modified: team/oej/videocaps/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/UPGRADE.txt?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/UPGRADE.txt (original)
+++ team/oej/videocaps/UPGRADE.txt Wed Aug  6 04:41:08 2008
@@ -226,6 +226,13 @@
 * queues.conf: the queue-lessthan sound file option is no longer available, and the
   queue-round-seconds option no longer takes '1' as a valid parameter.
 
+* If you have any third party modules which use a config file variable whose
+  name ends in a '+', please note that the append capability added to this
+  version may now conflict with that variable naming scheme.  An easy
+  workaround is to ensure that a space occurs between the '+' and the '=',
+  to differentiate your variable from the append operator.  This potential
+  conflict is unlikely, but is documented here to be thorough.
+
 Manager:
 
 * Manager has been upgraded to version 1.1 with a lot of changes. 

Modified: team/oej/videocaps/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/apps/app_chanspy.c?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/apps/app_chanspy.c (original)
+++ team/oej/videocaps/apps/app_chanspy.c Wed Aug  6 04:41:08 2008
@@ -560,7 +560,7 @@
 			/* chanspy_ds->chan is NULL after this call */
 			chanspy_ds_destroy(datastore->data);
 			datastore->data = NULL;
-			ast_channel_datastore_free(datastore);
+			ast_datastore_free(datastore);
 		}
 		ast_channel_unlock(chan);
 	}
@@ -576,7 +576,7 @@
 
 	ast_mutex_lock(&chanspy_ds->lock);
 
-	if (!(datastore = ast_channel_datastore_alloc(&chanspy_ds_info, chanspy_ds->unique_id))) {
+	if (!(datastore = ast_datastore_alloc(&chanspy_ds_info, chanspy_ds->unique_id))) {
 		ast_mutex_unlock(&chanspy_ds->lock);
 		chanspy_ds = chanspy_ds_free(chanspy_ds);
 		ast_channel_unlock(chan);

Modified: team/oej/videocaps/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/apps/app_dial.c?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/apps/app_dial.c (original)
+++ team/oej/videocaps/apps/app_dial.c Wed Aug  6 04:41:08 2008
@@ -673,6 +673,10 @@
 					if (!peer) {
 						ast_verb(3, "%s answered %s\n", c->name, in->name);
 						peer = c;
+						if (peer->cdr) {
+							peer->cdr->answer = ast_tvnow();
+							peer->cdr->disposition = AST_CDR_ANSWERED;
+						}
 						ast_copy_flags64(peerflags, o,
 							OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
 							OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
@@ -1360,7 +1364,7 @@
 	ast_copy_flags64(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID | OPT_CALLER_HANGUP | OPT_IGNORE_FORWARDING);
 
 	/* Create datastore for channel dial features for caller */
-	if (!(ds_caller_features = ast_channel_datastore_alloc(&dial_features_info, NULL))) {
+	if (!(ds_caller_features = ast_datastore_alloc(&dial_features_info, NULL))) {
 		ast_log(LOG_WARNING, "Unable to create channel datastore for dial features. Aborting!\n");
 		goto out;
 	}
@@ -1422,7 +1426,7 @@
 		if (datastore)
 			dialed_interfaces = datastore->data;
 		else {
-			if (!(datastore = ast_channel_datastore_alloc(&dialed_interface_info, NULL))) {
+			if (!(datastore = ast_datastore_alloc(&dialed_interface_info, NULL))) {
 				ast_log(LOG_WARNING, "Unable to create channel datastore for dialed interfaces. Aborting!\n");
 				ast_free(tmp);
 				goto out;
@@ -1530,7 +1534,7 @@
 			ast_copy_string(tc->exten, chan->exten, sizeof(tc->exten));
 
 		/* Save callee features */
-		if (!(ds_callee_features = ast_channel_datastore_alloc(&dial_features_info, NULL))) {
+		if (!(ds_callee_features = ast_datastore_alloc(&dial_features_info, NULL))) {
 			ast_log(LOG_WARNING, "Unable to create channel datastore for dial features. Aborting!\n");
 			ast_free(tmp);
 			goto out;
@@ -1632,7 +1636,7 @@
 	 * datastore again, causing a crash
 	 */
 	if (!ast_channel_datastore_remove(chan, datastore))
-		ast_channel_datastore_free(datastore);
+		ast_datastore_free(datastore);
 	if (!peer) {
 		if (result) {
 			res = result;

Modified: team/oej/videocaps/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/apps/app_queue.c?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/apps/app_queue.c (original)
+++ team/oej/videocaps/apps/app_queue.c Wed Aug  6 04:41:08 2008
@@ -3120,7 +3120,7 @@
 	}
 
 	ast_channel_datastore_remove(new_chan, datastore);
-	ast_channel_datastore_free(datastore);
+	ast_datastore_free(datastore);
 }
 
 /*! \brief mechanism to tell if a queue caller was atxferred by a queue member.
@@ -3147,7 +3147,7 @@
 	}
 
 	ast_channel_lock(qe->chan);
-	if (!(ds = ast_channel_datastore_alloc(&queue_transfer_info, NULL))) {
+	if (!(ds = ast_datastore_alloc(&queue_transfer_info, NULL))) {
 		ast_channel_unlock(qe->chan);
 		ast_log(LOG_WARNING, "Unable to create transfer datastore. queue_log will not show attended transfer\n");
 		return;
@@ -3321,7 +3321,7 @@
 			goto out;
 		}
 		if (!datastore) {
-			if (!(datastore = ast_channel_datastore_alloc(&dialed_interface_info, NULL))) {
+			if (!(datastore = ast_datastore_alloc(&dialed_interface_info, NULL))) {
 				ao2_ref(cur, -1);
 				ao2_unlock(qe->parent);
 				if (use_weight)
@@ -3423,7 +3423,7 @@
 	 * datastore again, causing a crash
 	 */
 	if (datastore && !ast_channel_datastore_remove(qe->chan, datastore)) {
-		ast_channel_datastore_free(datastore);
+		ast_datastore_free(datastore);
 	}
 	ao2_lock(qe->parent);
 	if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY) {
@@ -3845,7 +3845,7 @@
 			transfer_ds = ast_channel_datastore_find(qe->chan, &queue_transfer_info, NULL);
 			if (transfer_ds) {
 				ast_channel_datastore_remove(qe->chan, transfer_ds);
-				ast_channel_datastore_free(transfer_ds);
+				ast_datastore_free(transfer_ds);
 			}
 			ast_channel_unlock(qe->chan);
 		}

Modified: team/oej/videocaps/apps/app_speech_utils.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/apps/app_speech_utils.c?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/apps/app_speech_utils.c (original)
+++ team/oej/videocaps/apps/app_speech_utils.c Wed Aug  6 04:41:08 2008
@@ -364,7 +364,7 @@
 		return 0;
 	}
 
-	datastore = ast_channel_datastore_alloc(&speech_datastore, NULL);
+	datastore = ast_datastore_alloc(&speech_datastore, NULL);
 	if (datastore == NULL) {
 		ast_speech_destroy(speech);
 		pbx_builtin_setvar_helper(chan, "ERROR", "1");

Modified: team/oej/videocaps/apps/app_stack.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/apps/app_stack.c?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/apps/app_stack.c (original)
+++ team/oej/videocaps/apps/app_stack.c Wed Aug  6 04:41:08 2008
@@ -242,7 +242,7 @@
 
 	if (!stack_store) {
 		ast_debug(1, "Channel %s has no datastore, so we're allocating one.\n", chan->name);
-		stack_store = ast_channel_datastore_alloc(&stack_info, NULL);
+		stack_store = ast_datastore_alloc(&stack_info, NULL);
 		if (!stack_store) {
 			ast_log(LOG_ERROR, "Unable to allocate new datastore.  Gosub will fail.\n");
 			return -1;
@@ -251,7 +251,7 @@
 		oldlist = ast_calloc(1, sizeof(*oldlist));
 		if (!oldlist) {
 			ast_log(LOG_ERROR, "Unable to allocate datastore list head.  Gosub will fail.\n");
-			ast_channel_datastore_free(stack_store);
+			ast_datastore_free(stack_store);
 			return -1;
 		}
 

Modified: team/oej/videocaps/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/channels/chan_iax2.c?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/channels/chan_iax2.c (original)
+++ team/oej/videocaps/channels/chan_iax2.c Wed Aug  6 04:41:08 2008
@@ -6474,7 +6474,7 @@
 		struct ast_variable *var, *prev = NULL;
 		AST_LIST_HEAD(, ast_var_t) *varlist;
 		varlist = ast_calloc(1, sizeof(*varlist));
-		variablestore = ast_channel_datastore_alloc(&iax2_variable_datastore_info, NULL);
+		variablestore = ast_datastore_alloc(&iax2_variable_datastore_info, NULL);
 		if (variablestore && varlist && p->owner) {
 			variablestore->data = varlist;
 			variablestore->inheritance = DATASTORE_INHERIT_FOREVER;
@@ -6499,7 +6499,7 @@
 			if (p->owner)
 				ast_log(LOG_ERROR, "Memory allocation error while processing IAX2 variables\n");
 			if (variablestore)
-				ast_channel_datastore_free(variablestore);
+				ast_datastore_free(variablestore);
 			if (varlist)
 				ast_free(varlist);
 		}
@@ -7967,7 +7967,7 @@
 	struct ast_var_t *var;
 
 	if (!variablestore) {
-		variablestore = ast_channel_datastore_alloc(&iax2_variable_datastore_info, NULL);
+		variablestore = ast_datastore_alloc(&iax2_variable_datastore_info, NULL);
 		if (!variablestore) {
 			ast_log(LOG_ERROR, "Memory allocation error\n");
 			return -1;
@@ -8362,7 +8362,7 @@
 					struct ast_variable *var, *prev = NULL;
 					AST_LIST_HEAD(, ast_var_t) *varlist;
 					varlist = ast_calloc(1, sizeof(*varlist));
-					variablestore = ast_channel_datastore_alloc(&iax2_variable_datastore_info, NULL);
+					variablestore = ast_datastore_alloc(&iax2_variable_datastore_info, NULL);
 					if (variablestore && varlist) {
 						variablestore->data = varlist;
 						variablestore->inheritance = DATASTORE_INHERIT_FOREVER;
@@ -8386,7 +8386,7 @@
 					} else {
 						ast_log(LOG_ERROR, "Memory allocation error while processing IAX2 variables\n");
 						if (variablestore)
-							ast_channel_datastore_free(variablestore);
+							ast_datastore_free(variablestore);
 						if (varlist)
 							ast_free(varlist);
 					}
@@ -9139,7 +9139,7 @@
 								struct ast_variable *var, *prev = NULL;
 								AST_LIST_HEAD(, ast_var_t) *varlist;
 								varlist = ast_calloc(1, sizeof(*varlist));
-								variablestore = ast_channel_datastore_alloc(&iax2_variable_datastore_info, NULL);
+								variablestore = ast_datastore_alloc(&iax2_variable_datastore_info, NULL);
 								if (variablestore && varlist) {
 									variablestore->data = varlist;
 									variablestore->inheritance = DATASTORE_INHERIT_FOREVER;
@@ -9163,7 +9163,7 @@
 								} else {
 									ast_log(LOG_ERROR, "Memory allocation error while processing IAX2 variables\n");
 									if (variablestore)
-										ast_channel_datastore_free(variablestore);
+										ast_datastore_free(variablestore);
 									if (varlist)
 										ast_free(varlist);
 								}
@@ -9203,7 +9203,7 @@
 							struct ast_variable *var, *prev = NULL;
 							AST_LIST_HEAD(, ast_var_t) *varlist;
 							varlist = ast_calloc(1, sizeof(*varlist));
-							variablestore = ast_channel_datastore_alloc(&iax2_variable_datastore_info, NULL);
+							variablestore = ast_datastore_alloc(&iax2_variable_datastore_info, NULL);
 							if (variablestore && varlist) {
 								variablestore->data = varlist;
 								variablestore->inheritance = DATASTORE_INHERIT_FOREVER;
@@ -9227,7 +9227,7 @@
 							} else {
 								ast_log(LOG_ERROR, "Memory allocation error while processing IAX2 variables\n");
 								if (variablestore)
-									ast_channel_datastore_free(variablestore);
+									ast_datastore_free(variablestore);
 								if (varlist)
 									ast_free(varlist);
 							}
@@ -10573,33 +10573,20 @@
 				if (!ast_strlen_zero(v->value)) {
 					char name2[80];
 					char num2[80];
-					ast_callerid_split(v->value, name2, 80, num2, 80);
+					ast_callerid_split(v->value, name2, sizeof(name2), num2, sizeof(num2));
 					ast_string_field_set(peer, cid_name, name2);
 					ast_string_field_set(peer, cid_num, num2);
-					ast_set_flag(peer, IAX_HASCALLERID);
 				} else {
-					ast_clear_flag(peer, IAX_HASCALLERID);
 					ast_string_field_set(peer, cid_name, "");
 					ast_string_field_set(peer, cid_num, "");
 				}
+				ast_set_flag(peer, IAX_HASCALLERID);
 			} else if (!strcasecmp(v->name, "fullname")) {
-				if (!ast_strlen_zero(v->value)) {
-					ast_string_field_set(peer, cid_name, v->value);
-					ast_set_flag(peer, IAX_HASCALLERID);
-				} else {
-					ast_string_field_set(peer, cid_name, "");
-					if (ast_strlen_zero(peer->cid_num))
-						ast_clear_flag(peer, IAX_HASCALLERID);
-				}
+				ast_string_field_set(peer, cid_name, S_OR(v->value, ""));
+				ast_set_flag(peer, IAX_HASCALLERID);
 			} else if (!strcasecmp(v->name, "cid_number")) {
-				if (!ast_strlen_zero(v->value)) {
-					ast_string_field_set(peer, cid_num, v->value);
-					ast_set_flag(peer, IAX_HASCALLERID);
-				} else {
-					ast_string_field_set(peer, cid_num, "");
-					if (ast_strlen_zero(peer->cid_name))
-						ast_clear_flag(peer, IAX_HASCALLERID);
-				}
+				ast_string_field_set(peer, cid_num, S_OR(v->value, ""));
+				ast_set_flag(peer, IAX_HASCALLERID);
 			} else if (!strcasecmp(v->name, "sendani")) {
 				ast_set2_flag(peer, ast_true(v->value), IAX_SENDANI);	
 			} else if (!strcasecmp(v->name, "inkeys")) {

Modified: team/oej/videocaps/funcs/func_enum.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/funcs/func_enum.c?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/funcs/func_enum.c (original)
+++ team/oej/videocaps/funcs/func_enum.c Wed Aug  6 04:41:08 2008
@@ -189,7 +189,7 @@
 
 	snprintf(buf, len, "%u", erds->id);
 
-	if (!(datastore = ast_channel_datastore_alloc(&enum_result_datastore_info, buf))) {
+	if (!(datastore = ast_datastore_alloc(&enum_result_datastore_info, buf))) {
 		ast_free(erds->context);
 		ast_free(erds);
 		goto finish;

Modified: team/oej/videocaps/funcs/func_global.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/funcs/func_global.c?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/funcs/func_global.c (original)
+++ team/oej/videocaps/funcs/func_global.c Wed Aug  6 04:41:08 2008
@@ -158,7 +158,7 @@
 		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))) {
+		if (!(varstore = ast_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;
@@ -166,7 +166,7 @@
 
 		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_datastore_free(varstore);
 			ast_channel_unlock(chan);
 			return -1;
 		}

Modified: team/oej/videocaps/funcs/func_lock.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/funcs/func_lock.c?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/funcs/func_lock.c (original)
+++ team/oej/videocaps/funcs/func_lock.c Wed Aug  6 04:41:08 2008
@@ -96,7 +96,7 @@
 
 	if (!lock_store) {
 		ast_debug(1, "Channel %s has no lock datastore, so we're allocating one.\n", chan->name);
-		lock_store = ast_channel_datastore_alloc(&lock_info, NULL);
+		lock_store = ast_datastore_alloc(&lock_info, NULL);
 		if (!lock_store) {
 			ast_log(LOG_ERROR, "Unable to allocate new datastore.  No locks will be obtained.\n");
 			return -1;
@@ -105,7 +105,7 @@
 		list = ast_calloc(1, sizeof(*list));
 		if (!list) {
 			ast_log(LOG_ERROR, "Unable to allocate datastore list head.  %sLOCK will fail.\n", try ? "TRY" : "");
-			ast_channel_datastore_free(lock_store);
+			ast_datastore_free(lock_store);
 			return -1;
 		}
 

Modified: team/oej/videocaps/funcs/func_odbc.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/funcs/func_odbc.c?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/funcs/func_odbc.c (original)
+++ team/oej/videocaps/funcs/func_odbc.c Wed Aug  6 04:41:08 2008
@@ -480,7 +480,7 @@
 		struct ast_datastore *odbc_store;
 		uid = ast_atomic_fetchadd_int(&resultcount, +1) + 1;
 		snprintf(buf, len, "%d", uid);
-		odbc_store = ast_channel_datastore_alloc(&odbc_info, buf);
+		odbc_store = ast_datastore_alloc(&odbc_info, buf);
 		if (!odbc_store) {
 			ast_log(LOG_ERROR, "Rows retrieved, but unable to store it in the channel.  Results fail.\n");
 			odbc_datastore_free(resultset);
@@ -550,7 +550,7 @@
 	if (!row) {
 		/* Cleanup datastore */
 		ast_channel_datastore_remove(chan, store);
-		ast_channel_datastore_free(store);
+		ast_datastore_free(store);
 		return -1;
 	}
 	pbx_builtin_setvar_helper(chan, "~ODBCFIELDS~", resultset->names);
@@ -584,7 +584,7 @@
 	if (!store) /* Already freed; no big deal. */
 		return 0;
 	ast_channel_datastore_remove(chan, store);
-	ast_channel_datastore_free(store);
+	ast_datastore_free(store);
 	return 0;
 }
 

Modified: team/oej/videocaps/funcs/func_speex.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/funcs/func_speex.c?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/funcs/func_speex.c (original)
+++ team/oej/videocaps/funcs/func_speex.c Wed Aug  6 04:41:08 2008
@@ -151,12 +151,12 @@
 	if (!(datastore = ast_channel_datastore_find(chan, &speex_datastore, NULL))) {
 		ast_channel_unlock(chan);
 
-		if (!(datastore = ast_channel_datastore_alloc(&speex_datastore, NULL))) {
+		if (!(datastore = ast_datastore_alloc(&speex_datastore, NULL))) {
 			return 0;
 		}
 
 		if (!(si = ast_calloc(1, sizeof(*si)))) {
-			ast_channel_datastore_free(datastore);
+			ast_datastore_free(datastore);
 			return 0;
 		}
 
@@ -177,7 +177,7 @@
 		ast_log(LOG_ERROR, "Invalid argument provided to the %s function\n", cmd);
 
 		if (is_new) {
-			ast_channel_datastore_free(datastore);
+			ast_datastore_free(datastore);
 			return -1;
 		}
 	}
@@ -237,7 +237,7 @@
 			ast_audiohook_detach(&si->audiohook);
 		}
 		
-		ast_channel_datastore_free(datastore);
+		ast_datastore_free(datastore);
 	}
 
 	if (is_new) { 

Modified: team/oej/videocaps/funcs/func_volume.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/funcs/func_volume.c?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/funcs/func_volume.c (original)
+++ team/oej/videocaps/funcs/func_volume.c Wed Aug  6 04:41:08 2008
@@ -106,10 +106,10 @@
 
 	if (!(datastore = ast_channel_datastore_find(chan, &volume_datastore, NULL))) {
 		/* Allocate a new datastore to hold the reference to this volume and audiohook information */
-		if (!(datastore = ast_channel_datastore_alloc(&volume_datastore, NULL)))
+		if (!(datastore = ast_datastore_alloc(&volume_datastore, NULL)))
 			return 0;
 		if (!(vi = ast_calloc(1, sizeof(*vi)))) {
-			ast_channel_datastore_free(datastore);
+			ast_datastore_free(datastore);
 			return 0;
 		}
 		ast_audiohook_init(&vi->audiohook, AST_AUDIOHOOK_TYPE_MANIPULATE, "Volume");

Modified: team/oej/videocaps/include/asterisk/abstract_jb.h
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/include/asterisk/abstract_jb.h?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/include/asterisk/abstract_jb.h (original)
+++ team/oej/videocaps/include/asterisk/abstract_jb.h Wed Aug  6 04:41:08 2008
@@ -212,6 +212,12 @@
  */
 void ast_jb_get_config(const struct ast_channel *chan, struct ast_jb_conf *conf);
 
+/*!
+ * \brief drops all frames from a jitterbuffer and resets it
+ * \param c0 one channel of a bridge
+ * \param c1 the other channel of the bridge
+ */
+void ast_jb_empty_and_reset(struct ast_channel *c0, struct ast_channel *c1);
 
 #if defined(__cplusplus) || defined(c_plusplus)
 }

Modified: team/oej/videocaps/include/asterisk/cdr.h
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/include/asterisk/cdr.h?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/include/asterisk/cdr.h (original)
+++ team/oej/videocaps/include/asterisk/cdr.h Wed Aug  6 04:41:08 2008
@@ -37,7 +37,8 @@
 #define AST_CDR_FLAG_ENABLE			(1 << 7)
 #define AST_CDR_FLAG_ANSLOCKED      (1 << 8)
 #define AST_CDR_FLAG_DONT_TOUCH     (1 << 9)
-#define AST_CDR_FLAG_POST_ENABLE                (1 << 5)
+#define AST_CDR_FLAG_POST_ENABLE    (1 << 10)
+#define AST_CDR_FLAG_DIALED         (1 << 11)
 /*@} */
 
 /*! \name CDR Flags - Disposition */
@@ -111,6 +112,7 @@
 	struct ast_cdr *next;
 };
 
+int ast_cdr_isset_unanswered(void);
 void ast_cdr_getvar(struct ast_cdr *cdr, const char *name, char **ret, char *workspace, int workspacelen, int recur, int raw);
 int ast_cdr_setvar(struct ast_cdr *cdr, const char *name, const char *value, int recur);
 int ast_cdr_serialize_variables(struct ast_cdr *cdr, struct ast_str **buf, char delim, char sep, int recur);

Modified: team/oej/videocaps/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/include/asterisk/channel.h?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/include/asterisk/channel.h (original)
+++ team/oej/videocaps/include/asterisk/channel.h Wed Aug  6 04:41:08 2008
@@ -152,6 +152,7 @@
 #include "asterisk/utils.h"
 #include "asterisk/linkedlists.h"
 #include "asterisk/stringfields.h"
+#include "asterisk/datastore.h"
 
 #define DATASTORE_INHERIT_FOREVER	INT_MAX
 
@@ -186,37 +187,6 @@
 	int (*generate)(struct ast_channel *chan, void *data, int len, int samples);
 	/*! This gets called when DTMF_END frames are read from the channel */
 	void (*digit)(struct ast_channel *chan, char digit);
-};
-
-/*! \brief Structure for a data store type */
-struct ast_datastore_info {
-	const char *type;		/*!< Type of data store */
-	void *(*duplicate)(void *data);	/*!< Duplicate item data (used for inheritance) */
-	void (*destroy)(void *data);	/*!< Destroy function */
-	/*!
-	 * \brief Fix up channel references
-	 *
-	 * \arg data The datastore data
-	 * \arg old_chan The old channel owning the datastore
-	 * \arg new_chan The new channel owning the datastore
-	 *
-	 * This is exactly like the fixup callback of the channel technology interface.
-	 * It allows a datastore to fix any pointers it saved to the owning channel
-	 * in case that the owning channel has changed.  Generally, this would happen
-	 * when the datastore is set to be inherited, and a masquerade occurs.
-	 *
-	 * \return nothing.
-	 */
-	void (*chan_fixup)(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan);
-};
-
-/*! \brief Structure for a channel data store */
-struct ast_datastore {
-	const char *uid;		/*!< Unique data store identifier */
-	void *data;		/*!< Contained data */
-	const struct ast_datastore_info *info;	/*!< Data store type information */
-	unsigned int inheritance;	/*!< Number of levels this item will continue to be inherited */
-	AST_LIST_ENTRY(ast_datastore) entry; /*!< Used for easy linking */
 };
 
 /*! \brief Structure for all kinds of caller ID identifications.
@@ -662,16 +632,24 @@
 };
 
 /*! 
- * \brief Create a channel datastore structure 
- *
  * \note None of the datastore API calls lock the ast_channel they are using.
  *       So, the channel should be locked before calling the functions that
  *       take a channel argument.
  */
-struct ast_datastore *ast_channel_datastore_alloc(const struct ast_datastore_info *info, const char *uid);
-
-/*! \brief Free a channel datastore structure */
-int ast_channel_datastore_free(struct ast_datastore *datastore);
+
+/*! 
+ * \brief Create a channel data store object
+ * \deprecated You should use the ast_datastore_alloc() generic function instead.
+ */
+struct ast_datastore *ast_channel_datastore_alloc(const struct ast_datastore_info *info, const char *uid)
+	__attribute__ ((deprecated));
+
+/*!
+ * \brief Free a channel data store object
+ * \deprecated You should use the ast_datastore_free() generic function instead.
+ */
+int ast_channel_datastore_free(struct ast_datastore *datastore)
+	__attribute__ ((deprecated));
 
 /*! \brief Inherit datastores from a parent to a child. */
 int ast_channel_datastore_inherit(struct ast_channel *from, struct ast_channel *to);
@@ -704,6 +682,9 @@
  *
  * \note The datastore returned from this function must not be used if the
  *       reference to the channel is released.
+ *
+ * \retval pointer to the datastore if found
+ * \retval NULL if not found
  */
 struct ast_datastore *ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid);
 

Modified: team/oej/videocaps/include/asterisk/config.h
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/include/asterisk/config.h?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/include/asterisk/config.h (original)
+++ team/oej/videocaps/include/asterisk/config.h Wed Aug  6 04:41:08 2008
@@ -339,6 +339,15 @@
 void ast_variable_append(struct ast_category *category, struct ast_variable *variable);
 void ast_variable_insert(struct ast_category *category, struct ast_variable *variable, const char *line);
 int ast_variable_delete(struct ast_category *category, const char *variable, const char *match, const char *line);
+
+/*! \brief Update variable value within a config
+ * \param category Category element within the config
+ * \param variable Name of the variable to change
+ * \param value New value of the variable
+ * \param match If set, previous value of the variable (if NULL or zero-length, no matching will be done)
+ * \param object Boolean of whether to make the new variable an object
+ * \return 0 on success or -1 on failure.
+ */
 int ast_variable_update(struct ast_category *category, const char *variable, 
 						const char *value, const char *match, unsigned int object);
 

Modified: team/oej/videocaps/include/asterisk/manager.h
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/include/asterisk/manager.h?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/include/asterisk/manager.h (original)
+++ team/oej/videocaps/include/asterisk/manager.h Wed Aug  6 04:41:08 2008
@@ -21,6 +21,7 @@
 
 #include "asterisk/network.h"
 #include "asterisk/lock.h"
+#include "asterisk/datastore.h"
 
 /*!
  \file
@@ -212,4 +213,29 @@
 /*! \brief Called by Asterisk module functions and the CLI command */
 int reload_manager(void);
 
+/*! 
+ * \brief Add a datastore to a session
+ *
+ * \retval 0 success
+ * \retval non-zero failure
+ */
+
+int astman_datastore_add(struct mansession *s, struct ast_datastore *datastore);
+
+/*! 
+ * \brief Remove a datastore from a session
+ *
+ * \retval 0 success
+ * \retval non-zero failure
+ */
+int astman_datastore_remove(struct mansession *s, struct ast_datastore *datastore);
+
+/*! 
+ * \brief Find a datastore on a session
+ *
+ * \retval pointer to the datastore if found
+ * \retval NULL if not found
+ */
+struct ast_datastore *astman_datastore_find(struct mansession *s, const struct ast_datastore_info *info, const char *uid);
+
 #endif /* _ASTERISK_MANAGER_H */

Modified: team/oej/videocaps/include/asterisk/threadstorage.h
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/include/asterisk/threadstorage.h?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/include/asterisk/threadstorage.h (original)
+++ team/oej/videocaps/include/asterisk/threadstorage.h Wed Aug  6 04:41:08 2008
@@ -199,7 +199,7 @@
 			return NULL;
 		}
 		pthread_setspecific(ts->key, buf);
-		__ast_threadstorage_object_add(buf, init_size, file, function, line);
+		__ast_threadstorage_object_add(ts->key, init_size, file, function, line);
 	}
 
 	return buf;

Modified: team/oej/videocaps/include/asterisk/utils.h
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/include/asterisk/utils.h?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/include/asterisk/utils.h (original)
+++ team/oej/videocaps/include/asterisk/utils.h Wed Aug  6 04:41:08 2008
@@ -591,7 +591,7 @@
 #define ast_realloc(a,b)	realloc(a,b)
 #define ast_strdup(a)		strdup(a)
 #define ast_strndup(a,b)	strndup(a,b)
-#define ast_asprintf(a,b,c)	asprintf(a,b,c)
+#define ast_asprintf(a,b,...)	asprintf(a,b,__VA_ARGS__)
 #define ast_vasprintf(a,b,c)	vasprintf(a,b,c)
 
 #endif /* AST_DEBUG_MALLOC */

Modified: team/oej/videocaps/main/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/main/Makefile?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/main/Makefile (original)
+++ team/oej/videocaps/main/Makefile Wed Aug  6 04:41:08 2008
@@ -27,8 +27,8 @@
 	netsock.o slinfactory.o ast_expr2.o ast_expr2f.o \
 	cryptostub.o sha1.o http.o fixedjitterbuf.o abstract_jb.o \
 	strcompat.o threadstorage.o dial.o event.o adsistub.o audiohook.o \
-	astobj2.o hashtab.o global_datastores.o version.o \
-	features.o taskprocessor.o capability.o timing.o
+	capability.o astobj2.o hashtab.o global_datastores.o version.o \
+	features.o taskprocessor.o timing.o datastore.o
 
 # we need to link in the objects statically, not as a library, because
 # otherwise modules will not have them available if none of the static

Modified: team/oej/videocaps/main/abstract_jb.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/main/abstract_jb.c?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/main/abstract_jb.c (original)
+++ team/oej/videocaps/main/abstract_jb.c Wed Aug  6 04:41:08 2008
@@ -67,7 +67,8 @@
 typedef int (*jb_remove_impl)(void *jb, struct ast_frame **fout);
 /*! \brief Force resynch */
 typedef void (*jb_force_resynch_impl)(void *jb);
-
+/*! \brief Empty and reset jb */
+typedef void (*jb_empty_and_reset_impl)(void *jb);
 
 /*!
  * \brief Jitterbuffer implementation private struct.
@@ -83,6 +84,7 @@
 	jb_next_impl next;
 	jb_remove_impl remove;
 	jb_force_resynch_impl force_resync;
+	jb_empty_and_reset_impl empty_and_reset;
 };
 
 /* Implementation functions */
@@ -95,6 +97,7 @@
 static long jb_next_fixed(void *jb);
 static int jb_remove_fixed(void *jb, struct ast_frame **fout);
 static void jb_force_resynch_fixed(void *jb);
+static void jb_empty_and_reset_fixed(void *jb);
 /* adaptive */
 static void * jb_create_adaptive(struct ast_jb_conf *general_config, long resynch_threshold);
 static void jb_destroy_adaptive(void *jb);
@@ -104,6 +107,7 @@
 static long jb_next_adaptive(void *jb);
 static int jb_remove_adaptive(void *jb, struct ast_frame **fout);
 static void jb_force_resynch_adaptive(void *jb);
+static void jb_empty_and_reset_adaptive(void *jb);
 
 /* Available jb implementations */
 static struct ast_jb_impl avail_impl[] = 
@@ -117,7 +121,8 @@
 		.get = jb_get_fixed,
 		.next = jb_next_fixed,
 		.remove = jb_remove_fixed,
-		.force_resync = jb_force_resynch_fixed
+		.force_resync = jb_force_resynch_fixed,
+		.empty_and_reset = jb_empty_and_reset_fixed,
 	},
 	{
 		.name = "adaptive",
@@ -128,7 +133,8 @@
 		.get = jb_get_adaptive,
 		.next = jb_next_adaptive,
 		.remove = jb_remove_adaptive,
-		.force_resync = jb_force_resynch_adaptive
+		.force_resync = jb_force_resynch_adaptive,
+		.empty_and_reset = jb_empty_and_reset_adaptive,
 	}
 };
 
@@ -223,7 +229,7 @@
 			}
 			ast_set_flag(jb0, JB_TIMEBASE_INITIALIZED);
 		}
-		
+	
 		if (!c0_jb_created) {
 			jb_choose_impl(c0);
 		}
@@ -603,21 +609,36 @@
 	memcpy(conf, &chan->jb.conf, sizeof(*conf));
 }
 
+void ast_jb_empty_and_reset(struct ast_channel *c0, struct ast_channel *c1)
+{
+	struct ast_jb *jb0 = &c0->jb;
+	struct ast_jb *jb1 = &c1->jb;
+	int c0_use_jb = ast_test_flag(jb0, JB_USE);
+	int c0_jb_is_created = ast_test_flag(jb0, JB_CREATED);
+	int c1_use_jb = ast_test_flag(jb1, JB_USE);
+	int c1_jb_is_created = ast_test_flag(jb1, JB_CREATED);
+
+	if (c0_use_jb && c0_jb_is_created && jb0->impl->empty_and_reset) {
+		jb0->impl->empty_and_reset(jb0->jbobj);
+	}
+
+	if (c1_use_jb && c1_jb_is_created && jb1->impl->empty_and_reset) {
+		jb1->impl->empty_and_reset(jb1->jbobj);
+	}
+}
 
 /* Implementation functions */
 
 /* fixed */
-
 static void * jb_create_fixed(struct ast_jb_conf *general_config, long resynch_threshold)
 {
 	struct fixed_jb_conf conf;
-	
+
 	conf.jbsize = general_config->max_size;
 	conf.resync_threshold = resynch_threshold;
-	
+
 	return fixed_jb_new(&conf);
 }
-
 
 static void jb_destroy_fixed(void *jb)
 {
@@ -691,6 +712,15 @@
 	fixed_jb_set_force_resynch(fixedjb);
 }
 
+static void jb_empty_and_reset_fixed(void *jb)
+{
+	struct fixed_jb *fixedjb = jb;
+	struct fixed_jb_frame f;
+
+	while (fixed_jb_remove(fixedjb, &f) == FIXED_JB_OK) {
+		ast_frfree(f.data);
+	}
+}
 
 /* adaptive */
 
@@ -773,3 +803,15 @@
 static void jb_force_resynch_adaptive(void *jb)
 {
 }
+
+static void jb_empty_and_reset_adaptive(void *jb)
+{
+	jitterbuf *adaptivejb = jb;
+	jb_frame f;
+
+	while (jb_getall(adaptivejb, &f) == JB_OK) {
+		ast_frfree(f.data);
+	}
+
+	jb_reset(adaptivejb);
+}

Modified: team/oej/videocaps/main/audiohook.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/main/audiohook.c?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/main/audiohook.c (original)
+++ team/oej/videocaps/main/audiohook.c Wed Aug  6 04:41:08 2008
@@ -843,13 +843,13 @@
 	}
 
 	/* If we are not allowed to create a datastore or if we fail to create a datastore, bail out now as we have nothing for them */
-	if (!create || !(datastore = ast_channel_datastore_alloc(&audiohook_volume_datastore, NULL))) {
+	if (!create || !(datastore = ast_datastore_alloc(&audiohook_volume_datastore, NULL))) {
 		return NULL;
 	}
 
 	/* Create a new audiohook_volume structure to contain our adjustments and audiohook */
 	if (!(audiohook_volume = ast_calloc(1, sizeof(*audiohook_volume)))) {
-		ast_channel_datastore_free(datastore);
+		ast_datastore_free(datastore);
 		return NULL;
 	}
 

Modified: team/oej/videocaps/main/cdr.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/main/cdr.c?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/main/cdr.c (original)
+++ team/oej/videocaps/main/cdr.c Wed Aug  6 04:41:08 2008
@@ -155,6 +155,11 @@
 	}
 	AST_RWLIST_TRAVERSE_SAFE_END;
 	AST_RWLIST_UNLOCK(&be_list);
+}
+
+int ast_cdr_isset_unanswered(void)
+{
+	return unanswered;
 }
 
 /*! Duplicate a CDR record 

Modified: team/oej/videocaps/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/main/channel.c?view=diff&rev=135996&r1=135995&r2=135996
==============================================================================
--- team/oej/videocaps/main/channel.c (original)
+++ team/oej/videocaps/main/channel.c Wed Aug  6 04:41:08 2008
@@ -1117,24 +1117,27 @@
 
 	for (retries = 0; retries < 200; retries++) {
 		int done;
+		/* Reset prev on each retry.  See note below for the reason. */
+		prev = _prev;
 		AST_RWLIST_RDLOCK(&channels);
 		AST_RWLIST_TRAVERSE(&channels, c, chan_list) {
-			prev = _prev;
-			if (prev) {	/* look for next item */
+			if (prev) {	/* look for last item, first, before any evaluation */
 				if (c != prev)	/* not this one */
 					continue;
 				/* found, prepare to return c->next */
 				if ((c = AST_RWLIST_NEXT(c, chan_list)) == NULL) break;
-				/* If prev was the last item on the channel list, then we just
-				 * want to return NULL, instead of trying to deref NULL in the
-				 * next section.
+				/*!\note
+				 * We're done searching through the list for the previous item.

[... 692 lines stripped ...]



More information about the svn-commits mailing list