[svn-commits] dvossel: branch dvossel/generic_aoc r257855 - in /team/dvossel/generic_aoc: ....

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Apr 19 13:55:17 CDT 2010


Author: dvossel
Date: Mon Apr 19 13:55:15 2010
New Revision: 257855

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=257855
Log:
branch merge update

Modified:
    team/dvossel/generic_aoc/   (props changed)
    team/dvossel/generic_aoc/funcs/func_srv.c
    team/dvossel/generic_aoc/main/features.c

Propchange: team/dvossel/generic_aoc/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Apr 19 13:55:15 2010
@@ -1,1 +1,1 @@
-/trunk:1-257772
+/trunk:1-257854

Modified: team/dvossel/generic_aoc/funcs/func_srv.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/funcs/func_srv.c?view=diff&rev=257855&r1=257854&r2=257855
==============================================================================
--- team/dvossel/generic_aoc/funcs/func_srv.c (original)
+++ team/dvossel/generic_aoc/funcs/func_srv.c Mon Apr 19 13:55:15 2010
@@ -125,6 +125,8 @@
 
 static int srv_query_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 {
+	struct ast_datastore *datastore;
+
 	if (!chan) {
 		ast_log(LOG_WARNING, "%s cannot be used without a channel\n", cmd);
 		return -1;
@@ -134,7 +136,19 @@
 		ast_log(LOG_WARNING, "%s requires a service as an argument\n", cmd);
 		return -1;
 	}
-
+	
+	/* If they already called SRVQUERY for this service once,
+	 * we need to kill the old datastore.
+	 */
+	ast_channel_lock(chan);
+	datastore = ast_channel_datastore_find(chan, &srv_result_datastore_info, data);
+	ast_channel_unlock(chan);
+
+	if (datastore) {
+		ast_channel_datastore_remove(chan, datastore);
+		ast_datastore_free(datastore);
+	}
+	
 	if (!srv_datastore_setup(data, chan)) {
 		return -1;
 	}

Modified: team/dvossel/generic_aoc/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/main/features.c?view=diff&rev=257855&r1=257854&r2=257855
==============================================================================
--- team/dvossel/generic_aoc/main/features.c (original)
+++ team/dvossel/generic_aoc/main/features.c Mon Apr 19 13:55:15 2010
@@ -2950,8 +2950,8 @@
 	struct ast_option_header *aoh;
 	struct ast_cdr *bridge_cdr = NULL;
 	struct ast_cdr *orig_peer_cdr = NULL;
-	struct ast_cdr *chan_cdr = pick_unlocked_cdr(chan->cdr); /* the proper chan cdr, if there are forked cdrs */
-	struct ast_cdr *peer_cdr = pick_unlocked_cdr(peer->cdr); /* the proper chan cdr, if there are forked cdrs */
+	struct ast_cdr *chan_cdr = chan->cdr; /* the proper chan cdr, if there are forked cdrs */
+	struct ast_cdr *peer_cdr = peer->cdr; /* the proper chan cdr, if there are forked cdrs */
 	struct ast_cdr *new_chan_cdr = NULL; /* the proper chan cdr, if there are forked cdrs */
 	struct ast_cdr *new_peer_cdr = NULL; /* the proper chan cdr, if there are forked cdrs */
 
@@ -3028,6 +3028,10 @@
 			ast_set_flag(chan_cdr, AST_CDR_FLAG_MAIN);
 			ast_cdr_update(chan);
 			bridge_cdr = ast_cdr_dup_unique_swap(chan_cdr);
+			/* rip any forked CDR's off of the chan_cdr and attach
+			 * them to the bridge_cdr instead */
+			bridge_cdr->next = chan_cdr->next;
+			chan_cdr->next = NULL;
 			ast_copy_string(bridge_cdr->lastapp, S_OR(chan->appl, ""), sizeof(bridge_cdr->lastapp));
 			ast_copy_string(bridge_cdr->lastdata, S_OR(chan->data, ""), sizeof(bridge_cdr->lastdata));
 			if (peer_cdr && !ast_strlen_zero(peer_cdr->userfield)) {
@@ -3074,11 +3078,11 @@
 		   tvcmp check to the if below */
 
 		if (peer_cdr && !ast_tvzero(peer_cdr->answer) && ast_tvcmp(peer_cdr->answer, bridge_cdr->start) >= 0) {
-			bridge_cdr->answer = peer_cdr->answer;
-			bridge_cdr->disposition = peer_cdr->disposition;
+			ast_cdr_setanswer(bridge_cdr, peer_cdr->answer);
+			ast_cdr_setdisposition(bridge_cdr, peer_cdr->disposition);
 			if (chan_cdr) {
-				chan_cdr->answer = peer_cdr->answer;
-				chan_cdr->disposition = peer_cdr->disposition;
+				ast_cdr_setanswer(chan_cdr, peer_cdr->answer);
+				ast_cdr_setdisposition(chan_cdr, peer_cdr->disposition);
 			}
 		} else {
 			ast_cdr_answer(bridge_cdr);




More information about the svn-commits mailing list