[asterisk-commits] oej: branch oej/rana-manager-debug-1.8 r364160 - in /team/oej/rana-manager-de...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 27 01:57:42 CDT 2012


Author: oej
Date: Fri Apr 27 01:57:27 2012
New Revision: 364160

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=364160
Log:
Reset

Removed:
    team/oej/rana-manager-debug-1.8/apps/app_rpt.c
    team/oej/rana-manager-debug-1.8/apps/rpt_flow.pdf
    team/oej/rana-manager-debug-1.8/channels/chan_usbradio.c
    team/oej/rana-manager-debug-1.8/channels/xpmr/
Modified:
    team/oej/rana-manager-debug-1.8/   (props changed)
    team/oej/rana-manager-debug-1.8/apps/app_celgenuserevent.c
    team/oej/rana-manager-debug-1.8/apps/app_chanspy.c
    team/oej/rana-manager-debug-1.8/apps/app_confbridge.c
    team/oej/rana-manager-debug-1.8/apps/app_dial.c
    team/oej/rana-manager-debug-1.8/apps/app_directed_pickup.c
    team/oej/rana-manager-debug-1.8/apps/app_forkcdr.c
    team/oej/rana-manager-debug-1.8/apps/app_ices.c
    team/oej/rana-manager-debug-1.8/apps/app_jack.c
    team/oej/rana-manager-debug-1.8/apps/app_meetme.c
    team/oej/rana-manager-debug-1.8/apps/app_milliwatt.c
    team/oej/rana-manager-debug-1.8/apps/app_parkandannounce.c
    team/oej/rana-manager-debug-1.8/apps/app_sms.c
    team/oej/rana-manager-debug-1.8/apps/app_stack.c
    team/oej/rana-manager-debug-1.8/apps/app_voicemail.c
    team/oej/rana-manager-debug-1.8/bootstrap.sh
    team/oej/rana-manager-debug-1.8/bridges/bridge_builtin_features.c   (contents, props changed)
    team/oej/rana-manager-debug-1.8/bridges/bridge_multiplexed.c   (props changed)
    team/oej/rana-manager-debug-1.8/build_tools/cflags.xml
    team/oej/rana-manager-debug-1.8/build_tools/embed_modules.xml
    team/oej/rana-manager-debug-1.8/build_tools/menuselect-deps.in
    team/oej/rana-manager-debug-1.8/build_tools/prep_tarball
    team/oej/rana-manager-debug-1.8/channels/chan_agent.c
    team/oej/rana-manager-debug-1.8/channels/chan_dahdi.c
    team/oej/rana-manager-debug-1.8/channels/chan_gtalk.c
    team/oej/rana-manager-debug-1.8/channels/chan_h323.c
    team/oej/rana-manager-debug-1.8/channels/chan_iax2.c
    team/oej/rana-manager-debug-1.8/channels/chan_jingle.c
    team/oej/rana-manager-debug-1.8/channels/chan_mgcp.c
    team/oej/rana-manager-debug-1.8/channels/chan_misdn.c
    team/oej/rana-manager-debug-1.8/channels/chan_sip.c
    team/oej/rana-manager-debug-1.8/channels/chan_skinny.c
    team/oej/rana-manager-debug-1.8/channels/chan_unistim.c
    team/oej/rana-manager-debug-1.8/channels/console_gui.c
    team/oej/rana-manager-debug-1.8/channels/console_video.c
    team/oej/rana-manager-debug-1.8/channels/misdn/isdn_lib.c
    team/oej/rana-manager-debug-1.8/channels/misdn/isdn_msg_parser.c
    team/oej/rana-manager-debug-1.8/channels/sig_analog.c
    team/oej/rana-manager-debug-1.8/channels/sig_analog.h
    team/oej/rana-manager-debug-1.8/channels/sig_pri.c
    team/oej/rana-manager-debug-1.8/channels/sig_pri.h
    team/oej/rana-manager-debug-1.8/channels/sig_ss7.c
    team/oej/rana-manager-debug-1.8/channels/sig_ss7.h
    team/oej/rana-manager-debug-1.8/channels/sip/config_parser.c
    team/oej/rana-manager-debug-1.8/channels/sip/include/dialog.h
    team/oej/rana-manager-debug-1.8/channels/sip/include/reqresp_parser.h
    team/oej/rana-manager-debug-1.8/channels/sip/include/sip.h
    team/oej/rana-manager-debug-1.8/channels/sip/reqresp_parser.c
    team/oej/rana-manager-debug-1.8/channels/sip/sdp_crypto.c
    team/oej/rana-manager-debug-1.8/configure
    team/oej/rana-manager-debug-1.8/configure.ac
    team/oej/rana-manager-debug-1.8/pbx/pbx_config.c
    team/oej/rana-manager-debug-1.8/pbx/pbx_loopback.c
    team/oej/rana-manager-debug-1.8/pbx/pbx_lua.c
    team/oej/rana-manager-debug-1.8/pbx/pbx_realtime.c
    team/oej/rana-manager-debug-1.8/pbx/pbx_spool.c
    team/oej/rana-manager-debug-1.8/tests/test_devicestate.c
    team/oej/rana-manager-debug-1.8/tests/test_event.c
    team/oej/rana-manager-debug-1.8/tests/test_gosub.c
    team/oej/rana-manager-debug-1.8/tests/test_linkedlists.c
    team/oej/rana-manager-debug-1.8/tests/test_netsock2.c
    team/oej/rana-manager-debug-1.8/tests/test_poll.c

Propchange: team/oej/rana-manager-debug-1.8/
------------------------------------------------------------------------------
    automerge = Is-there-life-off-net?

Propchange: team/oej/rana-manager-debug-1.8/
            ('svnmerge-integrated' removed)

Modified: team/oej/rana-manager-debug-1.8/apps/app_celgenuserevent.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/rana-manager-debug-1.8/apps/app_celgenuserevent.c?view=diff&rev=364160&r1=364159&r2=364160
==============================================================================
--- team/oej/rana-manager-debug-1.8/apps/app_celgenuserevent.c (original)
+++ team/oej/rana-manager-debug-1.8/apps/app_celgenuserevent.c Fri Apr 27 01:57:27 2012
@@ -22,6 +22,10 @@
  *
  * \ingroup applications
  */
+
+/*** MODULEINFO
+	<support_level>core</support_level>
+ ***/
 
 #include "asterisk.h"
 

Modified: team/oej/rana-manager-debug-1.8/apps/app_chanspy.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/rana-manager-debug-1.8/apps/app_chanspy.c?view=diff&rev=364160&r1=364159&r2=364160
==============================================================================
--- team/oej/rana-manager-debug-1.8/apps/app_chanspy.c (original)
+++ team/oej/rana-manager-debug-1.8/apps/app_chanspy.c Fri Apr 27 01:57:27 2012
@@ -526,7 +526,8 @@
 
 	/* We now hold the channel lock on spyee */
 
-	if (ast_check_hangup(chan) || ast_check_hangup(spyee_autochan->chan)) {
+	if (ast_check_hangup(chan) || ast_check_hangup(spyee_autochan->chan) ||
+			ast_test_flag(spyee_autochan->chan, AST_FLAG_ZOMBIE)) {
 		return 0;
 	}
 
@@ -543,6 +544,9 @@
 	memset(&csth, 0, sizeof(csth));
 	ast_copy_flags(&csth.flags, flags, AST_FLAGS_ALL);
 
+	/* This is the audiohook which gives us the audio off the channel we are
+	   spying on.
+	*/
 	ast_audiohook_init(&csth.spy_audiohook, AST_AUDIOHOOK_TYPE_SPY, "ChanSpy");
 
 	if (start_spying(spyee_autochan, spyer_name, &csth.spy_audiohook)) {
@@ -550,17 +554,30 @@
 		return 0;
 	}
 
-	ast_audiohook_init(&csth.whisper_audiohook, AST_AUDIOHOOK_TYPE_WHISPER, "ChanSpy");
-	ast_audiohook_init(&csth.bridge_whisper_audiohook, AST_AUDIOHOOK_TYPE_WHISPER, "Chanspy");
-	if (start_spying(spyee_autochan, spyer_name, &csth.whisper_audiohook)) {
-		ast_log(LOG_WARNING, "Unable to attach whisper audiohook to spyee %s. Whisper mode disabled!\n", name);
-	}
-	if ((spyee_bridge_autochan = ast_autochan_setup(ast_bridged_channel(spyee_autochan->chan)))) {
-		ast_channel_lock(spyee_bridge_autochan->chan);
-		if (start_spying(spyee_bridge_autochan, spyer_name, &csth.bridge_whisper_audiohook)) {
-			ast_log(LOG_WARNING, "Unable to attach barge audiohook on spyee %s. Barge mode disabled!\n", name);
-		}
-		ast_channel_unlock(spyee_bridge_autochan->chan);
+	if (ast_test_flag(flags, OPTION_WHISPER | OPTION_BARGE | OPTION_DTMF_SWITCH_MODES)) {
+		/* This audiohook will let us inject audio from our channel into the
+		   channel we are currently spying on.
+		*/
+		ast_audiohook_init(&csth.whisper_audiohook, AST_AUDIOHOOK_TYPE_WHISPER, "ChanSpy");
+
+		if (start_spying(spyee_autochan, spyer_name, &csth.whisper_audiohook)) {
+			ast_log(LOG_WARNING, "Unable to attach whisper audiohook to spyee %s. Whisper mode disabled!\n", name);
+		}
+	}
+
+	if (ast_test_flag(flags, OPTION_BARGE | OPTION_DTMF_SWITCH_MODES)) {
+		/* And this hook lets us inject audio into the channel that the spied on
+		   channel is currently bridged with.
+		*/
+		ast_audiohook_init(&csth.bridge_whisper_audiohook, AST_AUDIOHOOK_TYPE_WHISPER, "Chanspy");
+
+		if ((spyee_bridge_autochan = ast_autochan_setup(ast_bridged_channel(spyee_autochan->chan)))) {
+			ast_channel_lock(spyee_bridge_autochan->chan);
+			if (start_spying(spyee_bridge_autochan, spyer_name, &csth.bridge_whisper_audiohook)) {
+				ast_log(LOG_WARNING, "Unable to attach barge audiohook on spyee %s. Barge mode disabled!\n", name);
+			}
+			ast_channel_unlock(spyee_bridge_autochan->chan);
+		}
 	}
 
 	ast_channel_lock(chan);
@@ -683,15 +700,19 @@
 	ast_clear_flag(chan, AST_FLAG_END_DTMF_ONLY);
 	ast_channel_unlock(chan);
 
-	ast_audiohook_lock(&csth.whisper_audiohook);
-	ast_audiohook_detach(&csth.whisper_audiohook);
-	ast_audiohook_unlock(&csth.whisper_audiohook);
-	ast_audiohook_destroy(&csth.whisper_audiohook);
-	
-	ast_audiohook_lock(&csth.bridge_whisper_audiohook);
-	ast_audiohook_detach(&csth.bridge_whisper_audiohook);
-	ast_audiohook_unlock(&csth.bridge_whisper_audiohook);
-	ast_audiohook_destroy(&csth.bridge_whisper_audiohook);
+	if (ast_test_flag(flags, OPTION_WHISPER | OPTION_BARGE | OPTION_DTMF_SWITCH_MODES)) {
+		ast_audiohook_lock(&csth.whisper_audiohook);
+		ast_audiohook_detach(&csth.whisper_audiohook);
+		ast_audiohook_unlock(&csth.whisper_audiohook);
+		ast_audiohook_destroy(&csth.whisper_audiohook);
+	}
+
+	if (ast_test_flag(flags, OPTION_BARGE | OPTION_DTMF_SWITCH_MODES)) {
+		ast_audiohook_lock(&csth.bridge_whisper_audiohook);
+		ast_audiohook_detach(&csth.bridge_whisper_audiohook);
+		ast_audiohook_unlock(&csth.bridge_whisper_audiohook);
+		ast_audiohook_destroy(&csth.bridge_whisper_audiohook);
+	}
 
 	ast_audiohook_lock(&csth.spy_audiohook);
 	ast_audiohook_detach(&csth.spy_audiohook);
@@ -725,8 +746,10 @@
 	}
 
 	if (!strncmp(next->name, "DAHDI/pseudo", pseudo_len)) {
+		ast_channel_unref(next);
 		goto redo;
 	} else if (next == chan) {
+		ast_channel_unref(next);
 		goto redo;
 	}
 
@@ -805,11 +828,13 @@
 		}
 
 		if (!iter) {
-			return -1;
+			res = -1;
+			goto exit;
 		}
 
 		res = ast_waitfordigit(chan, waitms);
 		if (res < 0) {
+			iter = ast_channel_iterator_destroy(iter);
 			ast_clear_flag(chan, AST_FLAG_SPYING);
 			break;
 		}
@@ -817,10 +842,12 @@
 			char tmp[2];
 			tmp[0] = res;
 			tmp[1] = '\0';
-			if (!ast_goto_if_exists(chan, exitcontext, tmp, 1))
+			if (!ast_goto_if_exists(chan, exitcontext, tmp, 1)) {
+				iter = ast_channel_iterator_destroy(iter);
 				goto exit;
-			else
+			} else {
 				ast_debug(2, "Exit by single digit did not work in chanspy. Extension %s does not exist in context %s\n", tmp, exitcontext);
+			}
 		}
 
 		/* reset for the next loop around, unless overridden later */
@@ -959,10 +986,12 @@
 
 			if (res == -1) {
 				ast_autochan_destroy(autochan);
+				iter = ast_channel_iterator_destroy(iter);
 				goto exit;
 			} else if (res == -2) {
 				res = 0;
 				ast_autochan_destroy(autochan);
+				iter = ast_channel_iterator_destroy(iter);
 				goto exit;
 			} else if (res > 1 && spec) {
 				struct ast_channel *next;
@@ -982,6 +1011,7 @@
 					}
 				}
 			} else if (res == 0 && ast_test_flag(flags, OPTION_EXITONHANGUP)) {
+				iter = ast_channel_iterator_destroy(iter);
 				goto exit;
 			}
 		}
@@ -1047,7 +1077,7 @@
 			if (strchr("0123456789*#", tmp) && tmp != '\0') {
 				user_options.exit = tmp;
 			} else {
-				ast_log(LOG_NOTICE, "Argument for option 'x' must be a valid DTMF digit.");
+				ast_log(LOG_NOTICE, "Argument for option 'x' must be a valid DTMF digit.\n");
 			}
 		}
 
@@ -1056,7 +1086,7 @@
 			if (strchr("0123456789*#", tmp) && tmp != '\0') {
 				user_options.cycle = tmp;
 			} else {
-				ast_log(LOG_NOTICE, "Argument for option 'c' must be a valid DTMF digit.");
+				ast_log(LOG_NOTICE, "Argument for option 'c' must be a valid DTMF digit.\n");
 			}
 		}
 
@@ -1172,7 +1202,7 @@
 			if (strchr("0123456789*#", tmp) && tmp != '\0') {
 				user_options.exit = tmp;
 			} else {
-				ast_log(LOG_NOTICE, "Argument for option 'x' must be a valid DTMF digit.");
+				ast_log(LOG_NOTICE, "Argument for option 'x' must be a valid DTMF digit.\n");
 			}
 		}
 
@@ -1181,7 +1211,7 @@
 			if (strchr("0123456789*#", tmp) && tmp != '\0') {
 				user_options.cycle = tmp;
 			} else {
-				ast_log(LOG_NOTICE, "Argument for option 'c' must be a valid DTMF digit.");
+				ast_log(LOG_NOTICE, "Argument for option 'c' must be a valid DTMF digit.\n");
 			}
 		}
 

Modified: team/oej/rana-manager-debug-1.8/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/rana-manager-debug-1.8/apps/app_confbridge.c?view=diff&rev=364160&r1=364159&r2=364160
==============================================================================
--- team/oej/rana-manager-debug-1.8/apps/app_confbridge.c (original)
+++ team/oej/rana-manager-debug-1.8/apps/app_confbridge.c Fri Apr 27 01:57:27 2012
@@ -86,7 +86,7 @@
                                                 <para>Do not play message when first person enters</para>
                                         </option>
                                         <option name="s">
-                                                <para>Present menu (user or admin) when <literal>*</literal> is received
+                                                <para>Present menu (user or admin) when <literal>#</literal> is received
                                                 (send to menu).</para>
                                         </option>
                                         <option name="w">

Modified: team/oej/rana-manager-debug-1.8/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/rana-manager-debug-1.8/apps/app_dial.c?view=diff&rev=364160&r1=364159&r2=364160
==============================================================================
--- team/oej/rana-manager-debug-1.8/apps/app_dial.c (original)
+++ team/oej/rana-manager-debug-1.8/apps/app_dial.c Fri Apr 27 01:57:27 2012
@@ -203,8 +203,8 @@
 					<para>Asterisk will ignore any forwarding requests it may receive on this dial attempt.</para>
 				</option>
 				<option name="I">
-					<para>Asterisk will ignore any connected line update requests or redirecting party update
-					requests it may receiveon this dial attempt.</para>
+					<para>Asterisk will ignore any connected line update requests or any redirecting party
+					update requests it may receive on this dial attempt.</para>
 				</option>
 				<option name="k">
 					<para>Allow the called party to enable parking of the call by sending
@@ -288,15 +288,14 @@
 							<value name="CONTINUE">
 								Hangup the called party and allow the calling party to continue dialplan execution at the next priority
 							</value>
-							<!-- TODO: Fix this syntax up, once we've figured out how to specify the GOTO syntax -->
-							<value name="GOTO:&lt;context&gt;^&lt;exten&gt;^&lt;priority&gt;">
+							<value name="GOTO:[[&lt;context&gt;^]&lt;exten&gt;^]&lt;priority&gt;">
 								Transfer the call to the specified destination.
 							</value>
 						</variable>
 					</variablelist>
 					<note>
 						<para>You cannot use any additional action post answer options in conjunction
-						with this option. Also, pbx services are not run on the peer (called) channel,
+						with this option. Also, pbx services are run on the peer (called) channel,
 						so you will not be able to set timeouts via the TIMEOUT() function in this macro.</para>
 					</note>
 					<warning><para>Be aware of the limitations that macros have, specifically with regards to use of
@@ -405,16 +404,14 @@
 								Hangup the called party and allow the calling party
 								to continue dialplan execution at the next priority.
 							</value>
-							<!-- TODO: Fix this syntax up, once we've figured out how to specify the GOTO syntax -->
-							<value name="GOTO:&lt;context&gt;^&lt;exten&gt;^&lt;priority&gt;">
-								Transfer the call to the specified priority. Optionally, an extension, or
-								extension and priority can be specified.
+							<value name="GOTO:[[&lt;context&gt;^]&lt;exten&gt;^]&lt;priority&gt;">
+								Transfer the call to the specified destination.
 							</value>
 						</variable>
 					</variablelist>
 					<note>
 						<para>You cannot use any additional action post answer options in conjunction
-						with this option. Also, pbx services are not run on the peer (called) channel,
+						with this option. Also, pbx services are run on the peer (called) channel,
 						so you will not be able to set timeouts via the TIMEOUT() function in this routine.</para>
 					</note>
 				</option>
@@ -476,7 +473,7 @@
 			<para>If the <variable>OUTBOUND_GROUP</variable> variable is set, all peer channels created by this
 			application will be put into that group (as in Set(GROUP()=...).
 			If the <variable>OUTBOUND_GROUP_ONCE</variable> variable is set, all peer channels created by this
-			application will be put into that group (as in Set(GROUP()=...). Unlike OUTBOUND_GROUP,
+			application will be put into that group (as in Set(GROUP()=...). Unlike <variable>OUTBOUND_GROUP</variable>,
 			however, the variable will be unset after use.</para>
 
 			<para>This application sets the following channel variables:</para>
@@ -823,13 +820,21 @@
 /*!
  * helper function for wait_for_answer()
  *
+ * \param o Outgoing call channel list.
+ * \param num Incoming call channel cause accumulation
+ * \param peerflags Dial option flags
+ * \param single_caller_bored From wait_for_answer: single && !caller_entertained
+ * \param to Remaining call timeout time.
+ * \param forced_clid OPT_FORCECLID caller id to send
+ * \param stored_clid Caller id representing the called party if needed
+ *
  * XXX this code is highly suspicious, as it essentially overwrites
  * the outgoing channel without properly deleting it.
  *
- * \todo eventually this function should be intergrated into and replaced by ast_call_forward() 
+ * \todo eventually this function should be intergrated into and replaced by ast_call_forward()
  */
 static void do_forward(struct chanlist *o,
-	struct cause_args *num, struct ast_flags64 *peerflags, int single, int *to,
+	struct cause_args *num, struct ast_flags64 *peerflags, int single_caller_bored, int *to,
 	struct ast_party_id *forced_clid, struct ast_party_id *stored_clid)
 {
 	char tmpchan[256];
@@ -871,8 +876,9 @@
 		/* Setup parameters */
 		c = o->chan = ast_request(tech, in->nativeformats, in, stuff, &cause);
 		if (c) {
-			if (single)
+			if (single_caller_bored) {
 				ast_channel_make_compatible(o->chan, in);
+			}
 			ast_channel_inherit_variables(in, o->chan);
 			ast_channel_datastore_inherit(in, o->chan);
 			/* When a call is forwarded, we don't want to track new interfaces
@@ -893,7 +899,7 @@
 	} else {
 		struct ast_party_redirecting redirecting;
 
-		if (single && CAN_EARLY_BRIDGE(peerflags, c, in)) {
+		if (single_caller_bored && CAN_EARLY_BRIDGE(peerflags, c, in)) {
 			ast_rtp_instance_early_bridge_make_compatible(c, in);
 		}
 
@@ -986,7 +992,7 @@
 			/* Hangup the original channel now, in case we needed it */
 			ast_hangup(original);
 		}
-		if (single) {
+		if (single_caller_bored) {
 			ast_indicate(in, -1);
 		}
 	}
@@ -1015,6 +1021,8 @@
 	struct ast_channel *peer = NULL;
 	/* single is set if only one destination is enabled */
 	int single = outgoing && !outgoing->next;
+	int caller_entertained = outgoing
+		&& ast_test_flag64(outgoing, OPT_MUSICBACK | OPT_RINGBACK);
 #ifdef HAVE_EPOLL
 	struct chanlist *epollo;
 #endif
@@ -1028,7 +1036,7 @@
 	ast_party_connected_line_init(&connected_caller);
 	if (single) {
 		/* Turn off hold music, etc */
-		if (!ast_test_flag64(outgoing, OPT_MUSICBACK | OPT_RINGBACK)) {
+		if (!caller_entertained) {
 			ast_deactivate_generator(in);
 			/* If we are calling a single channel, and not providing ringback or music, */
 			/* then, make them compatible for in-band tone purpose */
@@ -1049,7 +1057,9 @@
 			ast_connected_line_copy_from_caller(&connected_caller, &outgoing->chan->caller);
 			ast_channel_unlock(outgoing->chan);
 			connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-			ast_channel_update_connected_line(in, &connected_caller, NULL);
+			if (ast_channel_connected_line_macro(outgoing->chan, in, &connected_caller, 1, 0)) {
+				ast_channel_update_connected_line(in, &connected_caller, NULL);
+			}
 			ast_party_connected_line_free(&connected_caller);
 		}
 	}
@@ -1113,7 +1123,9 @@
 							ast_connected_line_copy_from_caller(&connected_caller, &c->caller);
 							ast_channel_unlock(c);
 							connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-							ast_channel_update_connected_line(in, &connected_caller, NULL);
+							if (ast_channel_connected_line_macro(c, in, &connected_caller, 1, 0)) {
+								ast_channel_update_connected_line(in, &connected_caller, NULL);
+							}
 							ast_party_connected_line_free(&connected_caller);
 						}
 					}
@@ -1152,7 +1164,8 @@
 					}
 					ast_frfree(f);
 				}
-				do_forward(o, &num, peerflags, single, to, forced_clid, stored_clid);
+				do_forward(o, &num, peerflags, single && !caller_entertained, to,
+					forced_clid, stored_clid);
 				continue;
 			}
 			f = ast_read(winner);
@@ -1167,7 +1180,8 @@
 				handle_cause(in->hangupcause, &num);
 				continue;
 			}
-			if (f->frametype == AST_FRAME_CONTROL) {
+			switch (f->frametype) {
+			case AST_FRAME_CONTROL:
 				switch (f->subclass.integer) {
 				case AST_CONTROL_ANSWER:
 					/* This is our guy if someone answered. */
@@ -1183,7 +1197,9 @@
 								ast_connected_line_copy_from_caller(&connected_caller, &c->caller);
 								ast_channel_unlock(c);
 								connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-								ast_channel_update_connected_line(in, &connected_caller, NULL);
+								if (ast_channel_connected_line_macro(c, in, &connected_caller, 1, 0)) {
+									ast_channel_update_connected_line(in, &connected_caller, NULL);
+								}
 								ast_party_connected_line_free(&connected_caller);
 							}
 						}
@@ -1263,8 +1279,10 @@
 					if (ignore_cc || cc_frame_received || num_ringing == numlines) {
 						ast_verb(3, "%s is ringing\n", c->name);
 						/* Setup early media if appropriate */
-						if (single && CAN_EARLY_BRIDGE(peerflags, in, c))
+						if (single && !caller_entertained
+							&& CAN_EARLY_BRIDGE(peerflags, in, c)) {
 							ast_channel_early_bridge(in, c);
+						}
 						if (!(pa->sentringing) && !ast_test_flag64(outgoing, OPT_MUSICBACK) && ast_strlen_zero(opt_args[OPT_ARG_RINGBACK])) {
 							ast_indicate(in, AST_CONTROL_RINGING);
 							pa->sentringing++;
@@ -1274,8 +1292,10 @@
 				case AST_CONTROL_PROGRESS:
 					ast_verb(3, "%s is making progress passing it to %s\n", c->name, in->name);
 					/* Setup early media if appropriate */
-					if (single && CAN_EARLY_BRIDGE(peerflags, in, c))
+					if (single && !caller_entertained
+						&& CAN_EARLY_BRIDGE(peerflags, in, c)) {
 						ast_channel_early_bridge(in, c);
+					}
 					if (!ast_test_flag64(outgoing, OPT_RINGBACK)) {
 						if (single || (!single && !pa->sentringing)) {
 							ast_indicate(in, AST_CONTROL_PROGRESS);
@@ -1289,12 +1309,14 @@
 					}
 					break;
 				case AST_CONTROL_VIDUPDATE:
-					ast_verb(3, "%s requested a video update, passing it to %s\n", c->name, in->name);
-					ast_indicate(in, AST_CONTROL_VIDUPDATE);
-					break;
 				case AST_CONTROL_SRCUPDATE:
-					ast_verb(3, "%s requested a source update, passing it to %s\n", c->name, in->name);
-					ast_indicate(in, AST_CONTROL_SRCUPDATE);
+				case AST_CONTROL_SRCCHANGE:
+					if (!single || caller_entertained) {
+						break;
+					}
+					ast_verb(3, "%s requested media update control %d, passing it to %s\n",
+						c->name, f->subclass.integer, in->name);
+					ast_indicate(in, f->subclass.integer);
 					break;
 				case AST_CONTROL_CONNECTED_LINE:
 					if (ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
@@ -1337,16 +1359,20 @@
 					break;
 				case AST_CONTROL_PROCEEDING:
 					ast_verb(3, "%s is proceeding passing it to %s\n", c->name, in->name);
-					if (single && CAN_EARLY_BRIDGE(peerflags, in, c))
+					if (single && !caller_entertained
+						&& CAN_EARLY_BRIDGE(peerflags, in, c)) {
 						ast_channel_early_bridge(in, c);
+					}
 					if (!ast_test_flag64(outgoing, OPT_RINGBACK))
 						ast_indicate(in, AST_CONTROL_PROCEEDING);
 					break;
 				case AST_CONTROL_HOLD:
+					/* XXX this should be saved like AST_CONTROL_CONNECTED_LINE for !single || caller_entertained */
 					ast_verb(3, "Call on %s placed on hold\n", c->name);
-					ast_indicate(in, AST_CONTROL_HOLD);
+					ast_indicate_data(in, AST_CONTROL_HOLD, f->data.ptr, f->datalen);
 					break;
 				case AST_CONTROL_UNHOLD:
+					/* XXX this should be saved like AST_CONTROL_CONNECTED_LINE for !single || caller_entertained */
 					ast_verb(3, "Call on %s left from hold\n", c->name);
 					ast_indicate(in, AST_CONTROL_UNHOLD);
 					break;
@@ -1361,7 +1387,7 @@
 					}
 					break;
 				case -1:
-					if (!ast_test_flag64(outgoing, OPT_RINGBACK | OPT_MUSICBACK)) {
+					if (single && !caller_entertained) {
 						ast_verb(3, "%s stopped sounds\n", c->name);
 						ast_indicate(in, -1);
 						pa->sentringing = 0;
@@ -1369,26 +1395,29 @@
 					break;
 				default:
 					ast_debug(1, "Dunno what to do with control type %d\n", f->subclass.integer);
-				}
-			} else if (single) {
-				switch (f->frametype) {
-				case AST_FRAME_VOICE:
-				case AST_FRAME_IMAGE:
-				case AST_FRAME_TEXT:
-					if (!ast_test_flag64(outgoing, OPT_RINGBACK | OPT_MUSICBACK) && ast_write(in, f)) {
-						ast_log(LOG_WARNING, "Unable to write frametype: %d\n",
-							f->frametype);
-					}
-					break;
-				case AST_FRAME_HTML:
-					if (!ast_test_flag64(outgoing, DIAL_NOFORWARDHTML)
-						&& ast_channel_sendhtml(in, f->subclass.integer, f->data.ptr, f->datalen) == -1) {
-						ast_log(LOG_WARNING, "Unable to send URL\n");
-					}
-					break;
-				default:
 					break;
 				}
+				break;
+			case AST_FRAME_VOICE:
+			case AST_FRAME_IMAGE:
+				if (caller_entertained) {
+					break;
+				}
+				/* Fall through */
+			case AST_FRAME_TEXT:
+				if (single && ast_write(in, f)) {
+					ast_log(LOG_WARNING, "Unable to write frametype: %d\n",
+						f->frametype);
+				}
+				break;
+			case AST_FRAME_HTML:
+				if (single && !ast_test_flag64(outgoing, DIAL_NOFORWARDHTML)
+					&& ast_channel_sendhtml(in, f->subclass.integer, f->data.ptr, f->datalen) == -1) {
+					ast_log(LOG_WARNING, "Unable to send URL\n");
+				}
+				break;
+			default:
+				break;
 			}
 			ast_frfree(f);
 		} /* end for */
@@ -1469,6 +1498,15 @@
 					break;
 				case AST_FRAME_VOICE:
 				case AST_FRAME_IMAGE:
+					if (!single || caller_entertained) {
+						/*
+						 * We are calling multiple parties or caller is being
+						 * entertained and has thus not been made compatible.
+						 * No need to check any other called parties.
+						 */
+						goto skip_frame;
+					}
+					/* Fall through */
 				case AST_FRAME_TEXT:
 				case AST_FRAME_DTMF_BEGIN:
 				case AST_FRAME_DTMF_END:
@@ -1480,12 +1518,27 @@
 				case AST_FRAME_CONTROL:
 					switch (f->subclass.integer) {
 					case AST_CONTROL_HOLD:
+						ast_verb(3, "Call on %s placed on hold\n", o->chan->name);
+						ast_indicate_data(o->chan, AST_CONTROL_HOLD, f->data.ptr, f->datalen);
+						break;
 					case AST_CONTROL_UNHOLD:
+						ast_verb(3, "Call on %s left from hold\n", o->chan->name);
+						ast_indicate(o->chan, AST_CONTROL_UNHOLD);
+						break;
 					case AST_CONTROL_VIDUPDATE:
 					case AST_CONTROL_SRCUPDATE:
-						ast_verb(3, "%s requested special control %d, passing it to %s\n",
+					case AST_CONTROL_SRCCHANGE:
+						if (!single || caller_entertained) {
+							/*
+							 * We are calling multiple parties or caller is being
+							 * entertained and has thus not been made compatible.
+							 * No need to check any other called parties.
+							 */
+							goto skip_frame;
+						}
+						ast_verb(3, "%s requested media update control %d, passing it to %s\n",
 							in->name, f->subclass.integer, o->chan->name);
-						ast_indicate_data(o->chan, f->subclass.integer, f->data.ptr, f->datalen);
+						ast_indicate(o->chan, f->subclass.integer);
 						break;
 					case AST_CONTROL_CONNECTED_LINE:
 						if (ast_channel_connected_line_macro(in, o->chan, f, 0, 1)) {
@@ -1498,13 +1551,16 @@
 						}
 						break;
 					default:
-						break;
+						/* We are not going to do anything with this frame. */
+						goto skip_frame;
 					}
 					break;
 				default:
-					break;
+					/* We are not going to do anything with this frame. */
+					goto skip_frame;
 				}
 			}
+skip_frame:;
 			ast_frfree(f);
 		}
 		if (!*to)
@@ -2307,7 +2363,7 @@
 		tc->dialed.transit_network_select = chan->dialed.transit_network_select;
 
 		if (!ast_strlen_zero(chan->accountcode)) {
-			ast_string_field_set(tc, peeraccount, chan->accountcode);
+			ast_string_field_set(tc, accountcode, chan->accountcode);
 		}
 		if (ast_strlen_zero(tc->musicclass))
 			ast_string_field_set(tc, musicclass, chan->musicclass);
@@ -2708,7 +2764,6 @@
 			}
 
 			if (ast_autoservice_stop(chan) < 0) {
-				ast_log(LOG_ERROR, "Could not stop autoservice on calling channel\n");
 				res9 = -1;
 			}
 			

Modified: team/oej/rana-manager-debug-1.8/apps/app_directed_pickup.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/rana-manager-debug-1.8/apps/app_directed_pickup.c?view=diff&rev=364160&r1=364159&r2=364160
==============================================================================
--- team/oej/rana-manager-debug-1.8/apps/app_directed_pickup.c (original)
+++ team/oej/rana-manager-debug-1.8/apps/app_directed_pickup.c Fri Apr 27 01:57:27 2012
@@ -55,25 +55,37 @@
 		<synopsis>
 			Directed extension call pickup.
 		</synopsis>
-		<syntax argsep="&amp;">
-			<parameter name="ext" argsep="@" required="true">
-				<argument name="extension" required="true"/>
-				<argument name="context" />
-			</parameter>
-			<parameter name="ext2" argsep="@" multiple="true">
-				<argument name="extension2" required="true"/>
-				<argument name="context2"/>
+		<syntax>
+			<parameter name="targets" argsep="&amp;">
+				<argument name="extension" argsep="@" required="true">
+					<para>Specification of the pickup target.</para>
+					<argument name="extension" required="true"/>
+					<argument name="context" />
+				</argument>
+				<argument name="extension2" argsep="@" multiple="true">
+					<para>Additional specifications of pickup targets.</para>
+					<argument name="extension2" required="true"/>
+					<argument name="context2"/>
+				</argument>
 			</parameter>
 		</syntax>
 		<description>
-			<para>This application can pickup any ringing channel that is calling
-			the specified <replaceable>extension</replaceable>. If no <replaceable>context</replaceable>
-			is specified, the current context will be used. If you use the special string <literal>PICKUPMARK</literal>
-			for the context parameter, for example 10 at PICKUPMARK, this application
-			tries to find a channel which has defined a <variable>PICKUPMARK</variable>
-			channel variable with the same value as <replaceable>extension</replaceable>
-			(in this example, <literal>10</literal>). When no parameter is specified, the application
-			will pickup a channel matching the pickup group of the active channel.</para>
+			<para>This application can pickup a specified ringing channel.  The channel
+			to pickup can be specified in the following ways.</para>
+			<para>1) If no <replaceable>extension</replaceable> targets are specified,
+			the application will pickup a channel matching the pickup group of the
+			requesting channel.</para>
+			<para>2) If the <replaceable>extension</replaceable> is specified with a
+			<replaceable>context</replaceable> of the special string
+			<literal>PICKUPMARK</literal> (for example 10 at PICKUPMARK), the application
+			will pickup a channel which has defined a channel variable
+			<variable>PICKUPMARK</variable> with the same value as
+			<replaceable>extension</replaceable> (in this example,
+			<literal>10</literal>).</para>
+			<para>3) If the <replaceable>extension</replaceable> is specified
+			with a <replaceable>context</replaceable>, the channel executing at that
+			dialplan location will be picked up.  If no <replaceable>context</replaceable>
+			is specified, the current context will be used.</para>
 		</description>
 	</application>
 	<application name="PickupChan" language="en_US">

Modified: team/oej/rana-manager-debug-1.8/apps/app_forkcdr.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/rana-manager-debug-1.8/apps/app_forkcdr.c?view=diff&rev=364160&r1=364159&r2=364160
==============================================================================
--- team/oej/rana-manager-debug-1.8/apps/app_forkcdr.c (original)
+++ team/oej/rana-manager-debug-1.8/apps/app_forkcdr.c Fri Apr 27 01:57:27 2012
@@ -191,6 +191,14 @@
 	if (!(newcdr = ast_cdr_dup_unique(cdr)))
 		return;
 	
+	/*
+	 * End the original CDR if requested BEFORE appending the new CDR
+	 * otherwise we incorrectly end the new CDR also.
+	 */
+	if (ast_test_flag(&optflags, OPT_ENDCDR)) {
+		ast_cdr_end(cdr);
+	}
+
 	ast_cdr_append(cdr, newcdr);
 
 	if (!ast_test_flag(&optflags, OPT_NORESET))
@@ -218,9 +226,6 @@
 	if (ast_test_flag(&optflags, OPT_RESETDEST))
 		newcdr->dstchannel[0] = 0;
 	
-	if (ast_test_flag(&optflags, OPT_ENDCDR))
-		ast_cdr_end(cdr);
-
 	if (ast_test_flag(&optflags, OPT_ANSLOCK))
 		ast_set_flag(cdr, AST_CDR_FLAG_ANSLOCKED);
 	

Modified: team/oej/rana-manager-debug-1.8/apps/app_ices.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/rana-manager-debug-1.8/apps/app_ices.c?view=diff&rev=364160&r1=364159&r2=364160
==============================================================================
--- team/oej/rana-manager-debug-1.8/apps/app_ices.c (original)
+++ team/oej/rana-manager-debug-1.8/apps/app_ices.c Fri Apr 27 01:57:27 2012
@@ -97,7 +97,7 @@
 	execl(path_BIN "ices2", "ices", filename, SENTINEL);
 	execlp("ices2", "ices", filename, SENTINEL);
 
-	ast_debug(1, "Couldn't find ices version 2, attempting to use ices version 1.");
+	ast_debug(1, "Couldn't find ices version 2, attempting to use ices version 1.\n");
 
 	execl(path_LOCAL "ices", "ices", filename, SENTINEL);
 	execl(path_BIN "ices", "ices", filename, SENTINEL);

Modified: team/oej/rana-manager-debug-1.8/apps/app_jack.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/rana-manager-debug-1.8/apps/app_jack.c?view=diff&rev=364160&r1=364159&r2=364160
==============================================================================
--- team/oej/rana-manager-debug-1.8/apps/app_jack.c (original)
+++ team/oej/rana-manager-debug-1.8/apps/app_jack.c Fri Apr 27 01:57:27 2012
@@ -904,8 +904,14 @@
 return_error:
 	ast_channel_unlock(chan);
 
-	if (jack_data)
+	if (jack_data) {
 		destroy_jack_data(jack_data);
+	}
+
+	if (datastore) {
+		datastore->data = NULL;
+		ast_datastore_free(datastore);
+	}
 
 	return -1;
 }

Modified: team/oej/rana-manager-debug-1.8/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/rana-manager-debug-1.8/apps/app_meetme.c?view=diff&rev=364160&r1=364159&r2=364160
==============================================================================
--- team/oej/rana-manager-debug-1.8/apps/app_meetme.c (original)
+++ team/oej/rana-manager-debug-1.8/apps/app_meetme.c Fri Apr 27 01:57:27 2012
@@ -142,10 +142,13 @@
 					</option>
 					<option name="p" hasparams="optional">
 						<para>Allow user to exit the conference by pressing <literal>#</literal> (default)
-						or any of the defined keys. If keys contain <literal>*</literal> this will override
-						option <literal>s</literal>. The key used is set to channel variable
+						or any of the defined keys.  The key used is set to channel variable
 						<variable>MEETME_EXIT_KEY</variable>.</para>
 						<argument name="keys" required="true" />
+						<note>
+							<para>Option <literal>s</literal> has priority for <literal>*</literal>
+							since it cannot change its activation code.</para>
+						</note>
 					</option>
 					<option name="P">
 						<para>Always prompt for the pin even if it is specified.</para>
@@ -180,6 +183,10 @@
 						<para>Allow user to exit the conference by entering a valid single digit
 						extension <variable>MEETME_EXIT_CONTEXT</variable> or the current context
 						if that variable is not defined.</para>
+						<note>
+							<para>Option <literal>s</literal> has priority for <literal>*</literal>
+							since it cannot change its activation code.</para>
+						</note>
 					</option>
 					<option name="1">
 						<para>Do not play message when first person enters</para>
@@ -214,7 +221,7 @@
 			<para>Enters the user into a specified MeetMe conference.  If the <replaceable>confno</replaceable>
 			is omitted, the user will be prompted to enter one.  User can exit the conference by hangup, or
 			if the <literal>p</literal> option is specified, by pressing <literal>#</literal>.</para>
-			<note><para>The DAHDI kernel modules and at least one hardware driver (or dahdi_dummy)
+			<note><para>The DAHDI kernel modules and a functional DAHDI timing source (see dahdi_test)
 			must be present for conferencing to operate properly. In addition, the chan_dahdi channel driver
 			must be loaded for the <literal>i</literal> and <literal>r</literal> options to operate at
 			all.</para></note>
@@ -3535,7 +3542,10 @@
 					}
 
 					conf_flush(fd, chan);
-				/* Since this option could absorb DTMF meant for the previous (menu), we have to check this one last */
+				/*
+				 * Since options using DTMF could absorb DTMF meant for the
+				 * conference menu, we have to check them after the menu.
+				 */
 				} else if ((f->frametype == AST_FRAME_DTMF) && ast_test_flag64(confflags, CONFFLAG_EXIT_CONTEXT) && ast_exists_extension(chan, exitcontext, dtmfstr, 1, "")) {
 					if (ast_test_flag64(confflags, CONFFLAG_PASS_DTMF)) {
 						conf_queue_dtmf(conf, user, f);
@@ -3647,7 +3657,7 @@
 								}
 								if (musiconhold && mohtempstopped && confsilence > MEETME_DELAYDETECTENDTALK) {
 									mohtempstopped = 0;
-									ast_moh_start(chan, NULL, NULL);
+									conf_start_moh(chan, optargs[OPT_ARG_MOH_CLASS]);
 								}
 							}
 						} else {
@@ -3669,7 +3679,7 @@
 						}
 						if (musiconhold && mohtempstopped && confsilence > MEETME_DELAYDETECTENDTALK) {
 							mohtempstopped = 0;
-							ast_moh_start(chan, NULL, NULL);
+							conf_start_moh(chan, optargs[OPT_ARG_MOH_CLASS]);
 						}
 					}
 				} else {
@@ -3917,8 +3927,12 @@
 			cnf->useropts = ast_strdup(useropts);
 			cnf->adminopts = ast_strdup(adminopts);
 			cnf->bookid = ast_strdup(bookid);
-			cnf->recordingfilename = ast_strdup(recordingfilename);
-			cnf->recordingformat = ast_strdup(recordingformat);
+			if (!ast_strlen_zero(recordingfilename)) {
+				cnf->recordingfilename = ast_strdup(recordingfilename);
+			}
+			if (!ast_strlen_zero(recordingformat)) {
+				cnf->recordingformat = ast_strdup(recordingformat);
+			}
 
 			/* Parse the other options into confflags -- need to do this in two
 			 * steps, because the parse_options routine zeroes the buffer. */
@@ -4332,13 +4346,27 @@
 					res = -1;
 				}
 			} else {
-				/* Check to see if the conference requires a pin
-				 * and we ALWAYS prompt or no pin was provided */
-				if ((!ast_strlen_zero(cnf->pin) ||
+				/* Conference requires a pin for specified access level */
+				int req_pin = !ast_strlen_zero(cnf->pin) ||
 					(!ast_strlen_zero(cnf->pinadmin) &&
-						ast_test_flag64(&confflags, CONFFLAG_ADMIN))) &&
-				    (ast_test_flag64(&confflags, CONFFLAG_ALWAYSPROMPT) ||
-						ast_strlen_zero(args.pin))) {
+						ast_test_flag64(&confflags, CONFFLAG_ADMIN));
+				/* The following logic was derived from a
+				 * 4 variable truth table and defines which
+				 * circumstances are not exempt from pin
+				 * checking.
+				 * If this needs to be modified, write the
+				 * truth table back out from the boolean
+				 * expression AB+A'D+C', change the erroneous
+				 * result, and rederive the expression.
+				 * Variables:
+				 *  A: pin provided?
+				 *  B: always prompt?
+				 *  C: dynamic?
+				 *  D: has users? */
+				int not_exempt = !cnf->isdynamic;
+				not_exempt = not_exempt || (!ast_strlen_zero(args.pin) && ast_test_flag64(&confflags, CONFFLAG_ALWAYSPROMPT));
+				not_exempt = not_exempt || (ast_strlen_zero(args.pin) && cnf->users);
+				if (req_pin && not_exempt) {

[... 14992 lines stripped ...]



More information about the asterisk-commits mailing list