[asterisk-commits] mjordan: branch mjordan/12-cdr-parking r399679 - /team/mjordan/12-cdr-parking...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 24 13:35:57 CDT 2013


Author: mjordan
Date: Tue Sep 24 13:35:55 2013
New Revision: 399679

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=399679
Log:
Fix some various parking problems

This does two things:
(1) It fixes parking problems when displaying the application name. This occurs
    due to the Parked Call message arriving before the Bridge Enter message for
    the parking lot; rather than change the ordering, we now anticipate
    entering the parking lot prior to receiving the Bridge Enter message.
(2) It fixes a FRACK that occurred when a CDR in the dialed pending state that
    was actually originated received a parking bridge enter.



Modified:
    team/mjordan/12-cdr-parking/main/cdr.c

Modified: team/mjordan/12-cdr-parking/main/cdr.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/12-cdr-parking/main/cdr.c?view=diff&rev=399679&r1=399678&r2=399679
==============================================================================
--- team/mjordan/12-cdr-parking/main/cdr.c (original)
+++ team/mjordan/12-cdr-parking/main/cdr.c Tue Sep 24 13:35:55 2013
@@ -1749,8 +1749,12 @@
 
 static int dialed_pending_state_process_parking_bridge_enter(struct cdr_object *cdr, struct ast_bridge_snapshot *bridge, struct ast_channel_snapshot *channel)
 {
-	/* We can't handle this as we have a Party B - ask for a new one */
-	return 1;
+	if (cdr->party_b.snapshot) {
+		/* We can't handle this as we have a Party B - ask for a new one */
+		return 1;
+	}
+	cdr_object_transition_state(cdr, &parked_state_fn_table);
+	return 0;
 }
 
 static int dialed_pending_state_process_dial_begin(struct cdr_object *cdr, struct ast_channel_snapshot *caller, struct ast_channel_snapshot *peer)
@@ -2497,6 +2501,7 @@
 	RAII_VAR(struct cdr_object *, cdr, NULL, ao2_cleanup);
 	RAII_VAR(struct module_config *, mod_cfg,
 			ao2_global_obj_ref(module_configs), ao2_cleanup);
+	int handled = 1;
 	struct cdr_object *it_cdr;
 
 	/* Anything other than getting parked will be handled by other updates */
@@ -2524,7 +2529,18 @@
 
 	for (it_cdr = cdr; it_cdr; it_cdr = it_cdr->next) {
 		if (it_cdr->fn_table->process_parked_channel) {
-			it_cdr->fn_table->process_parked_channel(it_cdr, payload);
+			handled &= it_cdr->fn_table->process_parked_channel(it_cdr, payload);
+		}
+	}
+
+	if (handled) {
+		/* Nothing handled it - we need a new one! */
+		struct cdr_object *new_cdr = cdr_object_create_and_append(cdr);
+		if (new_cdr) {
+			/* This is guaranteed to succeed: the new CDR is created in the
+			 * single state and will be able to handle the parkedcall message
+			 */
+			new_cdr->fn_table->process_parked_channel(new_cdr, payload);
 		}
 	}
 




More information about the asterisk-commits mailing list