[asterisk-commits] pabelanger: branch pabelanger/non-root r266574 - in /team/pabelanger/non-root...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon May 31 18:27:01 CDT 2010


Author: pabelanger
Date: Mon May 31 18:26:52 2010
New Revision: 266574

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=266574
Log:
Merging r262852 through r266522

Added:
    team/pabelanger/non-root/build_tools/sha1sum-sh
      - copied unchanged from r266522, trunk/build_tools/sha1sum-sh
    team/pabelanger/non-root/res/res_calendar_ews.c
      - copied unchanged from r266522, trunk/res/res_calendar_ews.c
Modified:
    team/pabelanger/non-root/   (props changed)
    team/pabelanger/non-root/CHANGES
    team/pabelanger/non-root/CREDITS
    team/pabelanger/non-root/Makefile
    team/pabelanger/non-root/UPGRADE.txt
    team/pabelanger/non-root/addons/chan_ooh323.c
    team/pabelanger/non-root/addons/ooh323c/src/   (props changed)
    team/pabelanger/non-root/addons/ooh323c/src/h323/   (props changed)
    team/pabelanger/non-root/addons/ooh323c/src/oochannels.c
    team/pabelanger/non-root/apps/app_dial.c
    team/pabelanger/non-root/apps/app_directory.c
    team/pabelanger/non-root/apps/app_queue.c
    team/pabelanger/non-root/apps/app_rpt.c
    team/pabelanger/non-root/apps/app_senddtmf.c
    team/pabelanger/non-root/apps/app_speech_utils.c
    team/pabelanger/non-root/apps/app_stack.c
    team/pabelanger/non-root/apps/app_voicemail.c
    team/pabelanger/non-root/autoconf/ast_ext_lib.m4
    team/pabelanger/non-root/build_tools/menuselect-deps.in
    team/pabelanger/non-root/channels/chan_console.c
    team/pabelanger/non-root/channels/chan_dahdi.c
    team/pabelanger/non-root/channels/chan_iax2.c
    team/pabelanger/non-root/channels/chan_local.c
    team/pabelanger/non-root/channels/chan_misdn.c
    team/pabelanger/non-root/channels/chan_sip.c
    team/pabelanger/non-root/channels/h323/ast_h323.cxx
    team/pabelanger/non-root/channels/misdn/chan_misdn_config.h
    team/pabelanger/non-root/channels/misdn/isdn_lib.h
    team/pabelanger/non-root/channels/misdn_config.c
    team/pabelanger/non-root/channels/sip/config_parser.c
    team/pabelanger/non-root/channels/sip/include/sip.h
    team/pabelanger/non-root/configs/calendar.conf.sample
    team/pabelanger/non-root/configs/indications.conf.sample
    team/pabelanger/non-root/configs/logger.conf.sample
    team/pabelanger/non-root/configs/misdn.conf.sample
    team/pabelanger/non-root/configs/res_pgsql.conf.sample
    team/pabelanger/non-root/configs/sip.conf.sample
    team/pabelanger/non-root/configure
    team/pabelanger/non-root/configure.ac
    team/pabelanger/non-root/contrib/init.d/rc.debian.asterisk
    team/pabelanger/non-root/contrib/scripts/live_ast
    team/pabelanger/non-root/doc/manager_1_1.txt
    team/pabelanger/non-root/doc/tex/manager.tex
    team/pabelanger/non-root/funcs/func_callerid.c
    team/pabelanger/non-root/funcs/func_connectedline.c
    team/pabelanger/non-root/funcs/func_env.c
    team/pabelanger/non-root/funcs/func_redirecting.c
    team/pabelanger/non-root/include/asterisk/_private.h
    team/pabelanger/non-root/include/asterisk/autoconfig.h.in
    team/pabelanger/non-root/include/asterisk/channel.h
    team/pabelanger/non-root/include/asterisk/file.h
    team/pabelanger/non-root/include/asterisk/frame.h
    team/pabelanger/non-root/include/asterisk/options.h
    team/pabelanger/non-root/include/asterisk/res_fax.h
    team/pabelanger/non-root/main/app.c
    team/pabelanger/non-root/main/asterisk.c
    team/pabelanger/non-root/main/astobj2.c
    team/pabelanger/non-root/main/autoservice.c
    team/pabelanger/non-root/main/callerid.c
    team/pabelanger/non-root/main/ccss.c
    team/pabelanger/non-root/main/channel.c
    team/pabelanger/non-root/main/cli.c
    team/pabelanger/non-root/main/devicestate.c
    team/pabelanger/non-root/main/dial.c
    team/pabelanger/non-root/main/dsp.c
    team/pabelanger/non-root/main/features.c
    team/pabelanger/non-root/main/loader.c
    team/pabelanger/non-root/main/logger.c
    team/pabelanger/non-root/main/manager.c
    team/pabelanger/non-root/main/pbx.c
    team/pabelanger/non-root/main/rtp_engine.c
    team/pabelanger/non-root/main/stdtime/localtime.c
    team/pabelanger/non-root/main/strings.c
    team/pabelanger/non-root/main/udptl.c
    team/pabelanger/non-root/makeopts.in
    team/pabelanger/non-root/pbx/pbx_lua.c
    team/pabelanger/non-root/pbx/pbx_realtime.c
    team/pabelanger/non-root/pbx/pbx_spool.c
    team/pabelanger/non-root/res/res_calendar.c
    team/pabelanger/non-root/res/res_calendar_caldav.c
    team/pabelanger/non-root/res/res_calendar_exchange.c
    team/pabelanger/non-root/res/res_calendar_icalendar.c
    team/pabelanger/non-root/res/res_config_pgsql.c
    team/pabelanger/non-root/res/res_fax.c
    team/pabelanger/non-root/res/res_fax.exports.in
    team/pabelanger/non-root/res/res_fax_spandsp.c
    team/pabelanger/non-root/res/res_rtp_asterisk.c
    team/pabelanger/non-root/sounds/Makefile
    team/pabelanger/non-root/tests/test_time.c
    team/pabelanger/non-root/utils/extconf.c

Propchange: team/pabelanger/non-root/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/pabelanger/non-root/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/pabelanger/non-root/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon May 31 18:26:52 2010
@@ -1,1 +1,1 @@
-/trunk:1-262827
+/trunk:1-266573

Modified: team/pabelanger/non-root/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/non-root/CHANGES?view=diff&rev=266574&r1=266573&r2=266574
==============================================================================
--- team/pabelanger/non-root/CHANGES (original)
+++ team/pabelanger/non-root/CHANGES Mon May 31 18:26:52 2010
@@ -59,6 +59,8 @@
  * When dialing SIP peers, a new component may be added to the end of the dialstring
    to indicate that a specific remote IP address or host should be used when dialing
    the particular peer. The dialstring format is SIP/peer/exten/host_or_IP.
+ * Added directmediapermit/directmediadeny to limit which peers can send direct media
+   to each other
 
 IAX2 Changes
 -----------
@@ -146,6 +148,7 @@
    user if it exists, otherwise will play the mailbox number.
  * Added custom device states to ConfBridge bridges.  Use 'confbridge:<name>' to
    retrieve state for a particular bridge, where <name> is the conference name
+ * app_directory now allows exiting at any time using the operator or pound key.
 
 Dialplan Functions
 ------------------
@@ -160,15 +163,6 @@
  * CALLERID and CONNECTEDLINE dialplan functions have been extended to
    support ISDN subaddressing.
  * The CHANNEL() function now supports the "name" option.
- * For DAHDI channels, the CHANNEL() dialplan function now
-   supports changing the channel's buffer policy (for the current
-   call only), using this syntax:
-
-   exten => s,n,Set(CHANNEL(buffers)=6,full)
-
-   This would change the channel to the 'full' buffer policy and
-   6 (six) buffers. Possible options for this setting are the same
-   as those in chan_dahdi.conf.
  * For DAHDI channels, the CHANNEL() dialplan function now allows
    the dialplan to request changes in the configuration of the active
    echo canceller on the channel (if any), for the current call only.
@@ -392,8 +386,10 @@
  * A new set of modules were added supporing calendar integration with Asterisk.
    Dialplan functions for reading from and writing to calendars are included,
    as well as the ability to execute dialplan logic upon calendar event notifications.
-   iCalendar, CalDAV, and Exchange Server calendars are supported (Exchange support
-   only tested on Exchange Server 2003 with no support for forms-based authentication).
+   iCalendar, CalDAV, and Exchange Server calendars (via res_calendar_exchange for
+   Exchange Server 2003 with no write or attendee support, and res_calendar_ews for
+   Exchange Server 2007+ with full write and attendee support) are supported (Exchange
+   2003 support does not support forms-based authentication).
 
 Call Completion Supplementary Services for Asterisk
 ---------------------------------------------------
@@ -450,6 +446,8 @@
    of dynamic parkinglots.
  * chan_dahdi now supports reporting alarms over AMI either by channel or span via
    the reportalarms config option.
+ * The Realtime dialplan switch now caches entries for 1 second.  This provides a
+   significant increase in performance (about 3X) for installations using this switchtype.
 
 CLI Changes
 -----------
@@ -463,6 +461,8 @@
    files it was built from.
  * New 'manager show settings' command showing the current settings loaded from
    manager.conf. 
+ * Added 'all' keyword to the CLI command "channel request hangup" so that you can send
+   the channel hangup request to all channels.
 
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 1.6.1 to Asterisk 1.6.2  -------------
@@ -532,6 +532,15 @@
 
 Dialplan Functions
 ------------------
+ * For DAHDI channels, the CHANNEL() dialplan function now
+   supports changing the channel's buffer policy (for the current
+   call only), using this syntax:
+
+   exten => s,n,Set(CHANNEL(buffers)=6,full)
+
+   This would change the channel to the 'full' buffer policy and
+   6 (six) buffers. Possible options for this setting are the same
+   as those in chan_dahdi.conf.
  * Added a new dialplan function, CURLOPT, which permits setting various
    options that may be useful with the CURL dialplan function, such as
    cookies, proxies, connection timeouts, passwords, etc.

Modified: team/pabelanger/non-root/CREDITS
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/non-root/CREDITS?view=diff&rev=266574&r1=266573&r2=266574
==============================================================================
--- team/pabelanger/non-root/CREDITS (original)
+++ team/pabelanger/non-root/CREDITS Mon May 31 18:26:52 2010
@@ -204,6 +204,8 @@
 	countless other improvements, fixes, and good ideas.
 	sean(AT)malleable.com
 
+Jan Kaláb - Calendaring support for Exchange Server 2007+ via Exchange Web Services.
+
 === OTHER CONTRIBUTIONS ===
 John Todd - Monkey sounds and associated teletorture prompt
 Michael Jerris - bug marshaling

Modified: team/pabelanger/non-root/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/non-root/Makefile?view=diff&rev=266574&r1=266573&r2=266574
==============================================================================
--- team/pabelanger/non-root/Makefile (original)
+++ team/pabelanger/non-root/Makefile Mon May 31 18:26:52 2010
@@ -165,6 +165,9 @@
   ASTVARLIBDIR=$(localstatedir)/lib/asterisk
   ASTDBDIR=$(ASTVARLIBDIR)
 endif
+ifneq ($(findstring darwin,$(OSARCH)),)
+  ASTVARRUNDIR=/Library/Application Support/Asterisk/Run
+endif
   ASTKEYDIR=$(ASTVARLIBDIR)
 endif
 ifeq ($(ASTDATADIR),)
@@ -581,7 +584,7 @@
 	$(LN) -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
 	$(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
 	$(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
-	if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
+	if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk -a ! -f /sbin/launchd ]; then \
 		cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/scripts/safe.tmp ; \
 		$(INSTALL) -c -m 755 contrib/scripts/safe.tmp $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ; \
 		rm -f contrib/scripts/safe.tmp ; \

Modified: team/pabelanger/non-root/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/non-root/UPGRADE.txt?view=diff&rev=266574&r1=266573&r2=266574
==============================================================================
--- team/pabelanger/non-root/UPGRADE.txt (original)
+++ team/pabelanger/non-root/UPGRADE.txt Mon May 31 18:26:52 2010
@@ -81,6 +81,9 @@
 * VoiceMailMain and VMAuthenticate, if a '*' is entered in the first position
   of a Mailbox or Password, will, if it exists, jump to the 'a' extension in
   the current dialplan context.
+
+* Environment variables that start with "AST_" are reserved to the system and
+  may no longer be set from the dialplan.
 
 From 1.6.1 to 1.6.2:
 

Modified: team/pabelanger/non-root/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/non-root/addons/chan_ooh323.c?view=diff&rev=266574&r1=266573&r2=266574
==============================================================================
--- team/pabelanger/non-root/addons/chan_ooh323.c (original)
+++ team/pabelanger/non-root/addons/chan_ooh323.c Mon May 31 18:26:52 2010
@@ -1238,11 +1238,13 @@
 	case AST_CONTROL_SRCCHANGE:
 		ast_rtp_instance_change_source(p->rtp);
 		break;
-      case AST_CONTROL_CONNECTED_LINE:
-		if (gH323Debug)
-			ast_log(LOG_DEBUG, "Sending connected line info for %s (%s)\n",
+       	case AST_CONTROL_CONNECTED_LINE:
+		if (!ast_strlen_zero(ast->connected.id.name)) {
+			if (gH323Debug)
+				ast_log(LOG_DEBUG, "Sending connected line info for %s (%s)\n",
 				callToken, ast->connected.id.name);
-		ooSetANI(callToken, ast->connected.id.name);
+			ooSetANI(callToken, ast->connected.id.name);
+		}
 		break;
 
       case AST_CONTROL_T38_PARAMETERS:

Propchange: team/pabelanger/non-root/addons/ooh323c/src/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon May 31 18:26:52 2010
@@ -1,0 +1,1 @@
+*.i

Propchange: team/pabelanger/non-root/addons/ooh323c/src/h323/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon May 31 18:26:52 2010
@@ -1,0 +1,1 @@
+*.i

Modified: team/pabelanger/non-root/addons/ooh323c/src/oochannels.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/non-root/addons/ooh323c/src/oochannels.c?view=diff&rev=266574&r1=266573&r2=266574
==============================================================================
--- team/pabelanger/non-root/addons/ooh323c/src/oochannels.c (original)
+++ team/pabelanger/non-root/addons/ooh323c/src/oochannels.c Mon May 31 18:26:52 2010
@@ -134,7 +134,7 @@
          call->pH245Channel->sock = channelSocket;
          call->h245SessionState = OO_H245SESSION_ACTIVE;
 
-         OOTRACEINFO3("H245 connection creation succesful (%s, %s)\n",
+         OOTRACEINFO3("H245 connection creation successful (%s, %s)\n",
                       call->callType, call->callToken);
 
          /*Start terminal capability exchange and master slave determination */
@@ -300,7 +300,7 @@
       {
          call->pH225Channel->sock = channelSocket;
 
-         OOTRACEINFO3("H2250 transmiter channel creation - succesful "
+         OOTRACEINFO3("H2250 transmiter channel creation - successful "
                       "(%s, %s)\n", call->callType, call->callToken);
 
          /* If multihomed, get ip from socket */

Modified: team/pabelanger/non-root/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/non-root/apps/app_dial.c?view=diff&rev=266574&r1=266573&r2=266574
==============================================================================
--- team/pabelanger/non-root/apps/app_dial.c (original)
+++ team/pabelanger/non-root/apps/app_dial.c Mon May 31 18:26:52 2010
@@ -335,6 +335,10 @@
 					<para>Hang up the call <replaceable>x</replaceable> seconds <emphasis>after</emphasis> the called party has
 					answered the call.</para>
 				</option>
+				<option name="s">
+					<argument name="x" required="true" />
+					<para>Force the outgoing callerid tag parameter to be set to the string <replaceable>x</replaceable></para>
+				</option>
 				<option name="t">
 					<para>Allow the called party to transfer the calling party by sending the
 					DTMF sequence defined in <filename>features.conf</filename>. This setting does not perform policy enforcement on
@@ -383,6 +387,21 @@
 						with this option. Also, pbx services are not 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>
+				<option name="u">
+					<argument name = "x" required="true">
+						<para>Force the outgoing callerid presentation indicator parameter to be set
+						to one of the values passed in <replaceable>x</replaceable>:
+						<literal>allowed_not_screened</literal>
+						<literal>allowed_passed_screen</literal>
+						<literal>allowed_failed_screen</literal>
+						<literal>allowed</literal>
+						<literal>prohib_not_screened</literal>
+						<literal>prohib_passed_screen</literal>
+						<literal>prohib_failed_screen</literal>
+						<literal>prohib</literal>
+						<literal>unavailable</literal></para>
+					</argument>
 				</option>
 				<option name="w">
 					<para>Allow the called party to enable recording of the call by sending
@@ -532,11 +551,13 @@
 
 #define DIAL_STILLGOING      (1 << 31)
 #define DIAL_NOFORWARDHTML   ((uint64_t)1 << 32) /* flags are now 64 bits, so keep it up! */
-#define DIAL_NOCONNECTEDLINE ((uint64_t)1 << 33)
+#define DIAL_CALLERID_ABSENT ((uint64_t)1 << 33) /* TRUE if caller id is not available for connected line. */
 #define OPT_CANCEL_ELSEWHERE ((uint64_t)1 << 34)
 #define OPT_PEER_H           ((uint64_t)1 << 35)
 #define OPT_CALLEE_GO_ON     ((uint64_t)1 << 36)
 #define OPT_CANCEL_TIMEOUT   ((uint64_t)1 << 37)
+#define OPT_FORCE_CID_TAG    ((uint64_t)1 << 38)
+#define OPT_FORCE_CID_PRES   ((uint64_t)1 << 39)
 
 enum {
 	OPT_ARG_ANNOUNCE = 0,
@@ -553,6 +574,8 @@
 	OPT_ARG_OPERMODE,
 	OPT_ARG_SCREEN_NOINTRO,
 	OPT_ARG_FORCECLID,
+	OPT_ARG_FORCE_CID_TAG,
+	OPT_ARG_FORCE_CID_PRES,
 	/* note: this entry _MUST_ be the last one in the enum */
 	OPT_ARG_ARRAY_SIZE,
 };
@@ -586,6 +609,8 @@
 	AST_APP_OPTION_ARG('P', OPT_PRIVACY, OPT_ARG_PRIVACY),
 	AST_APP_OPTION_ARG('r', OPT_RINGBACK, OPT_ARG_RINGBACK),
 	AST_APP_OPTION_ARG('S', OPT_DURATION_STOP, OPT_ARG_DURATION_STOP),
+	AST_APP_OPTION_ARG('s', OPT_FORCE_CID_TAG, OPT_ARG_FORCE_CID_TAG),
+	AST_APP_OPTION_ARG('u', OPT_FORCE_CID_PRES, OPT_ARG_FORCE_CID_PRES),
 	AST_APP_OPTION('t', OPT_CALLEE_TRANSFER),
 	AST_APP_OPTION('T', OPT_CALLER_TRANSFER),
 	AST_APP_OPTION_ARG('U', OPT_CALLEE_GOSUB, OPT_ARG_CALLEE_GOSUB),
@@ -609,7 +634,10 @@
 	struct chanlist *next;
 	struct ast_channel *chan;
 	uint64_t flags;
+	/*! Saved connected party info from an AST_CONTROL_CONNECTED_LINE. */
 	struct ast_party_connected_line connected;
+	/*! TRUE if an AST_CONTROL_CONNECTED_LINE update was saved to the connected element. */
+	unsigned int pending_connected_update:1;
 };
 
 static int detect_disconnect(struct ast_channel *chan, char code, struct ast_str *featurecode);
@@ -633,7 +661,6 @@
 				/* This is for the channel drivers */
 				outgoing->chan->hangupcause = AST_CAUSE_ANSWERED_ELSEWHERE;
 			}
-			ast_party_connected_line_free(&outgoing->connected);
 			ast_hangup(outgoing->chan);
 		}
 		oo = outgoing;
@@ -854,8 +881,20 @@
 			ast_string_field_set(c, accountcode, in->accountcode);
 		}
 		ast_party_connected_line_copy(&c->connected, &original->connected);
-
-		ast_channel_update_redirecting(in, &c->redirecting);
+		/*
+		 * We must unlock c before calling ast_channel_redirecting_macro, because
+		 * we put c into autoservice there. That is pretty much a guaranteed
+		 * deadlock. This is why the handling of c's lock may seem a bit unusual
+		 * here.
+		 */
+		ast_channel_unlock(c);
+		if (ast_channel_redirecting_macro(c, in, &c->redirecting, 1, 0)) {
+			while (ast_channel_trylock(c)) {
+				CHANNEL_DEADLOCK_AVOIDANCE(in);
+			}
+			ast_channel_update_redirecting(in, &c->redirecting);
+			ast_channel_unlock(c);
+		}
 
 		ast_clear_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE);
 		if (ast_test_flag64(peerflags, OPT_CANCEL_TIMEOUT)) {
@@ -863,7 +902,6 @@
 		}
 
 		ast_channel_unlock(in);
-		ast_channel_unlock(c);
 
 		if (ast_call(c, tmpchan, 0)) {
 			ast_log(LOG_NOTICE, "Failed to dial on local channel for call forward to '%s'\n", tmpchan);
@@ -940,7 +978,7 @@
 			ast_channel_make_compatible(outgoing->chan, in);
 		}
 
-		if (!ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE) && !ast_test_flag64(outgoing, DIAL_NOCONNECTEDLINE)) {
+		if (!ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE) && !ast_test_flag64(outgoing, DIAL_CALLERID_ABSENT)) {
 			ast_channel_lock(outgoing->chan);
 			ast_connected_line_copy_from_caller(&connected_caller, &outgoing->chan->cid);
 			ast_channel_unlock(outgoing->chan);
@@ -1000,11 +1038,11 @@
 				if (!peer) {
 					ast_verb(3, "%s answered %s\n", c->name, in->name);
 					if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
-						if (o->connected.id.number) {
+						if (o->pending_connected_update) {
 							if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
 								ast_channel_update_connected_line(in, &o->connected);
 							}
-						} else if (!ast_test_flag64(o, DIAL_NOCONNECTEDLINE)) {
+						} else if (!ast_test_flag64(o, DIAL_CALLERID_ABSENT)) {
 							ast_channel_lock(c);
 							ast_connected_line_copy_from_caller(&connected_caller, &c->cid);
 							ast_channel_unlock(c);
@@ -1062,11 +1100,11 @@
 					if (!peer) {
 						ast_verb(3, "%s answered %s\n", c->name, in->name);
 						if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
-							if (o->connected.id.number) {
+							if (o->pending_connected_update) {
 								if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
 									ast_channel_update_connected_line(in, &o->connected);
 								}
-							} else if (!ast_test_flag64(o, DIAL_NOCONNECTEDLINE)) {
+							} else if (!ast_test_flag64(o, DIAL_CALLERID_ABSENT)) {
 								ast_channel_lock(c);
 								ast_connected_line_copy_from_caller(&connected_caller, &c->cid);
 								ast_channel_unlock(c);
@@ -1183,6 +1221,7 @@
 						ast_connected_line_parse_data(f->data.ptr, f->datalen, &connected);
 						ast_party_connected_line_set(&o->connected, &connected);
 						ast_party_connected_line_free(&connected);
+						o->pending_connected_update = 1;
 					} else {
 						if (ast_channel_connected_line_macro(c, in, f, 1, 1)) {
 							ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);
@@ -1194,7 +1233,9 @@
 						ast_verb(3, "Redirecting update to %s prevented.\n", in->name);
 					} else {
 						ast_verb(3, "%s redirecting info has changed, passing it to %s\n", c->name, in->name);
-						ast_indicate_data(in, AST_CONTROL_REDIRECTING, f->data.ptr, f->datalen);
+						if (ast_channel_redirecting_macro(c, in, f, 1, 1)) {
+							ast_indicate_data(in, AST_CONTROL_REDIRECTING, f->data.ptr, f->datalen);
+						}
 						pa->sentringing = 0;
 					}
 					break;
@@ -1335,6 +1376,10 @@
 					if (ast_channel_connected_line_macro(in, outgoing->chan, f, 0, 1)) {
 						ast_indicate_data(outgoing->chan, f->subclass.integer, f->data.ptr, f->datalen);
 					}
+				} else if (f->subclass.integer == AST_CONTROL_REDIRECTING) {
+					if (ast_channel_redirecting_macro(in, outgoing->chan, f, 0, 1)) {
+						ast_indicate_data(outgoing->chan, f->subclass.integer, f->data.ptr, f->datalen);
+					}
 				}
 			}
 			ast_frfree(f);
@@ -1702,7 +1747,7 @@
 	struct cause_args num = { chan, 0, 0, 0 };
 	int cause;
 	char numsubst[256];
-	char *cid_num = NULL, *cid_name = NULL;
+	char *cid_num = NULL, *cid_name = NULL, *cid_tag = NULL, *cid_pres = NULL;
 
 	struct ast_bridge_config config = { { 0, } };
 	struct timeval calldurationlimit = { 0, };
@@ -1805,6 +1850,10 @@
 
 	if (ast_test_flag64(&opts, OPT_FORCECLID) && !ast_strlen_zero(opt_args[OPT_ARG_FORCECLID]))
 		ast_callerid_parse(opt_args[OPT_ARG_FORCECLID], &cid_name, &cid_num);
+	if (ast_test_flag64(&opts, OPT_FORCE_CID_TAG) && !ast_strlen_zero(opt_args[OPT_ARG_FORCE_CID_TAG]))
+		cid_tag = ast_strdupa(opt_args[OPT_ARG_FORCE_CID_TAG]);
+	if (ast_test_flag64(&opts, OPT_FORCE_CID_PRES) && !ast_strlen_zero(opt_args[OPT_ARG_FORCE_CID_PRES]))
+		cid_pres = ast_strdupa(opt_args[OPT_ARG_FORCE_CID_PRES]);
 	if (ast_test_flag64(&opts, OPT_RESETCDR) && chan->cdr)
 		ast_cdr_reset(chan->cdr, NULL);
 	if (ast_test_flag64(&opts, OPT_PRIVACY) && ast_strlen_zero(opt_args[OPT_ARG_PRIVACY]))
@@ -1872,14 +1921,13 @@
 
 		ast_channel_lock(chan);
 		datastore = ast_channel_datastore_find(chan, &dialed_interface_info, NULL);
-		/* If the incoming channel has previously had connected line information
-		 * set on it (perhaps through the CONNECTED_LINE dialplan function) then
-		 * seed the calllist's connected line information with this previously
-		 * acquired info
+		/*
+		 * Seed the chanlist's connected line information with previously
+		 * acquired connected line info from the incoming channel.  The
+		 * previously acquired connected line info could have been set
+		 * through the CONNECTED_LINE dialplan function.
 		 */
-		if (chan->connected.id.number) {
-			ast_party_connected_line_copy(&tmp->connected, &chan->connected);
-		}
+		ast_party_connected_line_copy(&tmp->connected, &chan->connected);
 		ast_channel_unlock(chan);
 
 		if (datastore)
@@ -1988,16 +2036,25 @@
 			} else if (!ast_strlen_zero(S_OR(chan->macroexten, chan->exten))) {
 				ast_set_callerid(tc, S_OR(chan->macroexten, chan->exten), NULL, NULL);
 			}
-			ast_set_flag64(tmp, DIAL_NOCONNECTEDLINE);
+			ast_set_flag64(tmp, DIAL_CALLERID_ABSENT);
 		}
 
 		if (ast_test_flag64(peerflags, OPT_FORCECLID) && !ast_strlen_zero(opt_args[OPT_ARG_FORCECLID])) {
 			struct ast_party_connected_line connected;
+			int pres;
 
 			ast_party_connected_line_set_init(&connected, &tmp->chan->connected);
 			connected.id.number = cid_num;
 			connected.id.name = cid_name;
-			connected.id.number_presentation = AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN;
+			connected.id.tag = cid_tag;
+			if (cid_pres) {
+				pres = ast_parse_caller_presentation(cid_pres);
+				if (pres >= 0) {
+					connected.id.number_presentation = pres;
+				}
+			} else {
+				connected.id.number_presentation = AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN;
+			}
 			ast_channel_set_connected_line(tmp->chan, &connected);
 		} else {
 			ast_connected_line_copy_from_caller(&tc->connected, &chan->cid);

Modified: team/pabelanger/non-root/apps/app_directory.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/non-root/apps/app_directory.c?view=diff&rev=266574&r1=266573&r2=266574
==============================================================================
--- team/pabelanger/non-root/apps/app_directory.c (original)
+++ team/pabelanger/non-root/apps/app_directory.c Mon May 31 18:26:52 2010
@@ -244,6 +244,19 @@
 	return 0;
 }
 
+static int goto_exten(struct ast_channel *chan, const char *dialcontext, char *ext)
+{
+	if (!ast_goto_if_exists(chan, dialcontext, ext, 1) ||
+		(!ast_strlen_zero(chan->macrocontext) &&
+		!ast_goto_if_exists(chan, chan->macrocontext, ext, 1))) {
+		return 0;
+	} else {
+		ast_log(LOG_WARNING, "Can't find extension '%s' in current context.  "
+			"Not Exiting the Directory!\n", ext);
+		return -1;
+	}
+}
+
 /* play name of mailbox owner.
  * returns:  -1 for bad or missing extension
  *           '1' for selected entry from directory
@@ -324,11 +337,17 @@
 				res = ast_waitfordigit(chan, 3000);
 			ast_stopstream(chan);
 	
-			if (res == '1') { /* Name selected */
+			if (res == '0') { /* operator selected */
+				goto_exten(chan, dialcontext, "o");
+				return '0';
+			} else if (res == '1') { /* Name selected */
 				return select_entry(chan, dialcontext, item, flags) ? -1 : 1;
 			} else if (res == '*') {
 				/* Skip to next match in list */
 				break;
+			} else if (res == '#') {
+				/* Exit reading, continue in dialplan */
+				return res;
 			}
 
 			if (res < 0)
@@ -655,19 +674,6 @@
 			}
 		}
 	} while (reordered);
-}
-
-static int goto_exten(struct ast_channel *chan, const char *dialcontext, char *ext)
-{
-	if (!ast_goto_if_exists(chan, dialcontext, ext, 1) ||
-		(!ast_strlen_zero(chan->macrocontext) &&
-		!ast_goto_if_exists(chan, chan->macrocontext, ext, 1))) {
-		return 0;
-	} else {
-		ast_log(LOG_WARNING, "Can't find extension '%s' in current context.  "
-			"Not Exiting the Directory!\n", ext);
-		return -1;
-	}
 }
 
 static int do_directory(struct ast_channel *chan, struct ast_config *vmcfg, struct ast_config *ucfg, char *context, char *dialcontext, char digit, int digits, struct ast_flags *flags, char *opts[])
@@ -783,6 +789,8 @@
 	dirintro = ast_variable_retrieve(cfg, args.vmcontext, "directoryintro");
 	if (ast_strlen_zero(dirintro))
 		dirintro = ast_variable_retrieve(cfg, "general", "directoryintro");
+	/* the above prompts probably should be modified to include 0 for dialing operator
+	   and # for exiting (continues in dialplan) */
 
 	if (ast_test_flag(&flags, OPT_LISTBYFIRSTNAME) && ast_test_flag(&flags, OPT_LISTBYLASTNAME)) {
 		if (!ast_strlen_zero(opts[OPT_ARG_EITHER])) {

Modified: team/pabelanger/non-root/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/non-root/apps/app_queue.c?view=diff&rev=266574&r1=266573&r2=266574
==============================================================================
--- team/pabelanger/non-root/apps/app_queue.c (original)
+++ team/pabelanger/non-root/apps/app_queue.c Mon May 31 18:26:52 2010
@@ -814,8 +814,12 @@
 	time_t lastcall;
 	struct call_queue *lastqueue;
 	struct member *member;
-	unsigned int update_connectedline:1;
+	/*! Saved connected party info from an AST_CONTROL_CONNECTED_LINE. */
 	struct ast_party_connected_line connected;
+	/*! TRUE if an AST_CONTROL_CONNECTED_LINE update was saved to the connected element. */
+	unsigned int pending_connected_update:1;
+	/*! TRUE if caller id is not available for connected line */
+	unsigned int dial_callerid_absent:1;
 };
 
 
@@ -2342,6 +2346,10 @@
 		return 0;
 	}
 
+	if (!ast_fileexists(filename, NULL, chan->language)) {
+		return 0;
+	}
+
 	ast_stopstream(chan);
 
 	res = ast_streamfile(chan, filename, chan->language);
@@ -2613,6 +2621,24 @@
 	queue_t_unref(q, "Expire copied reference");
 }
 
+/*!
+ * \internal
+ * \brief Destroy the given callattempt structure and free it.
+ * \since 1.8
+ *
+ * \param doomed callattempt structure to destroy.
+ *
+ * \return Nothing
+ */
+static void callattempt_free(struct callattempt *doomed)
+{
+	if (doomed->member) {
+		ao2_ref(doomed->member, -1);
+	}
+	ast_party_connected_line_free(&doomed->connected);
+	ast_free(doomed);
+}
+
 /*! \brief Hang up a list of outgoing calls */
 static void hangupcalls(struct callattempt *outgoing, struct ast_channel *exception, int cancel_answered_elsewhere)
 {
@@ -2628,9 +2654,7 @@
 		}
 		oo = outgoing;
 		outgoing = outgoing->q_next;
-		if (oo->member)
-			ao2_ref(oo->member, -1);
-		ast_free(oo);
+		callattempt_free(oo);
 	}
 }
 
@@ -2870,7 +2894,7 @@
 		} else if (!ast_strlen_zero(S_OR(qe->chan->macroexten, qe->chan->exten))) {
 			ast_set_callerid(tmp->chan, S_OR(qe->chan->macroexten, qe->chan->exten), NULL, NULL); 
 		}
-		tmp->update_connectedline = 0;
+		tmp->dial_callerid_absent = 1;
 	}
 
 	ast_party_redirecting_copy(&tmp->chan->redirecting, &qe->chan->redirecting);
@@ -3188,7 +3212,8 @@
 }
 
 #define AST_MAX_WATCHERS 256
-/*! \brief Wait for a member to answer the call
+/*!
+ * \brief Wait for a member to answer the call
  *
  * \param[in] qe the queue_ent corresponding to the caller in the queue
  * \param[in] outgoing the list of callattempts. Relevant ones will have their chan and stillgoing parameters non-zero
@@ -3197,6 +3222,7 @@
  * \param[in] prebusies number of busy members calculated prior to calling wait_for_answer
  * \param[in] caller_disconnect if the 'H' option is used when calling Queue(), this is used to detect if the caller pressed * to disconnect the call
  * \param[in] forwardsallowed used to detect if we should allow call forwarding, based on the 'i' option to Queue()
+ * \param[in] update_connectedline Allow connected line and redirecting updates to pass through.
  *
  * \todo eventually all call forward logic should be intergerated into and replaced by ast_call_forward()
  */
@@ -3204,6 +3230,7 @@
 {
 	const char *queue = qe->parent->name;
 	struct callattempt *o, *start = NULL, *prev = NULL;
+	int res;
 	int status;
 	int numbusies = prebusies;
 	int numnochan = 0;
@@ -3295,11 +3322,11 @@
 				if (!peer) {
 					ast_verb(3, "%s answered %s\n", ochan_name, inchan_name);
 					if (update_connectedline) {
-						if (o->connected.id.number) {
+						if (o->pending_connected_update) {
 							if (ast_channel_connected_line_macro(o->chan, in, &o->connected, 1, 0)) {
 								ast_channel_update_connected_line(in, &o->connected);
 							}
-						} else if (o->update_connectedline) {
+						} else if (!o->dial_callerid_absent) {
 							ast_channel_lock(o->chan);
 							ast_connected_line_copy_from_caller(&connected_caller, &o->chan->cid);
 							ast_channel_unlock(o->chan);
@@ -3373,7 +3400,21 @@
 						ast_party_caller_copy(&o->chan->cid, &in->cid);
 						ast_party_connected_line_copy(&o->chan->connected, &original->connected);
 
-						ast_channel_update_redirecting(in, &o->chan->redirecting);
+						/*
+						 * We must unlock o->chan before calling
+						 * ast_channel_redirecting_macro, because we put o->chan into
+						 * autoservice there.  That is pretty much a guaranteed
+						 * deadlock.  This is why the handling of o->chan's lock may
+						 * seem a bit unusual here.
+						 */
+						ast_channel_unlock(o->chan);
+						res = ast_channel_redirecting_macro(o->chan, in, &o->chan->redirecting, 1, 0);
+						while (ast_channel_trylock(o->chan)) {
+							CHANNEL_DEADLOCK_AVOIDANCE(in);
+						}
+						if (res) {
+							ast_channel_update_redirecting(in, &o->chan->redirecting);
+						}
 
 						update_connectedline = 1;
 
@@ -3400,11 +3441,11 @@
 							if (!peer) {
 								ast_verb(3, "%s answered %s\n", ochan_name, inchan_name);
 								if (update_connectedline) {
-									if (o->connected.id.number) {
+									if (o->pending_connected_update) {
 										if (ast_channel_connected_line_macro(o->chan, in, &o->connected, 1, 0)) {
 											ast_channel_update_connected_line(in, &o->connected);
 										}
-									} else if (o->update_connectedline) {
+									} else if (!o->dial_callerid_absent) {
 										ast_channel_lock(o->chan);
 										ast_connected_line_copy_from_caller(&connected_caller, &o->chan->cid);
 										ast_channel_unlock(o->chan);
@@ -3475,6 +3516,7 @@
 								ast_connected_line_parse_data(f->data.ptr, f->datalen, &connected);
 								ast_party_connected_line_set(&o->connected, &connected);
 								ast_party_connected_line_free(&connected);
+								o->pending_connected_update = 1;
 							} else {
 								if (ast_channel_connected_line_macro(o->chan, in, f, 1, 1)) {
 									ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);
@@ -3486,7 +3528,9 @@
 								ast_verb(3, "Redirecting update to %s prevented\n", inchan_name);
 							} else {
 								ast_verb(3, "%s redirecting info has changed, passing it to %s\n", ochan_name, inchan_name);
-								ast_indicate_data(in, AST_CONTROL_REDIRECTING, f->data.ptr, f->datalen);
+								if (ast_channel_redirecting_macro(o->chan, in, f, 1, 1)) {
+									ast_indicate_data(in, AST_CONTROL_REDIRECTING, f->data.ptr, f->datalen);
+								}
 							}
 							break;
 						default:
@@ -4183,7 +4227,7 @@
 				ao2_iterator_destroy(&memi);
 				if (need_weight)
 					ao2_unlock(queues);
-				free(tmp);
+				callattempt_free(tmp);
 				goto out;
 			}
 			datastore->inheritance = DATASTORE_INHERIT_FOREVER;
@@ -4193,7 +4237,7 @@
 				ao2_iterator_destroy(&memi);
 				if (need_weight)
 					ao2_unlock(queues);
-				free(tmp);
+				callattempt_free(tmp);
 				goto out;
 			}
 			datastore->data = dialed_interfaces;
@@ -4215,19 +4259,8 @@
 		}
 		AST_LIST_UNLOCK(dialed_interfaces);
 
-		ast_channel_lock(qe->chan);
-		/* If any pre-existing connected line information exists on this
-		 * channel, like from the CONNECTED_LINE dialplan function, use this
-		 * to seed the connected line information. It may, of course, be updated
-		 * during the call
-		 */
-		if (qe->chan->connected.id.number) {
-			ast_party_connected_line_copy(&tmp->connected, &qe->chan->connected);
-		}
-		ast_channel_unlock(qe->chan);
-		
 		if (di) {
-			free(tmp);
+			callattempt_free(tmp);
 			continue;
 		}
 
@@ -4242,7 +4275,7 @@
 				ao2_iterator_destroy(&memi);
 				if (need_weight)
 					ao2_unlock(queues);
-				free(tmp);
+				callattempt_free(tmp);
 				goto out;
 			}
 			strcpy(di->interface, cur->interface);
@@ -4252,11 +4285,20 @@
 			AST_LIST_UNLOCK(dialed_interfaces);
 		}
 
+		ast_channel_lock(qe->chan);
+		/*
+		 * Seed the callattempt's connected line information with previously
+		 * acquired connected line info from the queued channel.  The
+		 * previously acquired connected line info could have been set
+		 * through the CONNECTED_LINE dialplan function.
+		 */
+		ast_party_connected_line_copy(&tmp->connected, &qe->chan->connected);
+		ast_channel_unlock(qe->chan);
+
 		tmp->stillgoing = -1;
-		tmp->member = cur;
+		tmp->member = cur;/* Place the reference for cur into callattempt. */
 		tmp->lastcall = cur->lastcall;
 		tmp->lastqueue = cur->lastqueue;
-		tmp->update_connectedline = 1;
 		ast_copy_string(tmp->interface, cur->interface, sizeof(tmp->interface));
 		/* Special case: If we ring everyone, go ahead and ring them, otherwise
 		   just calculate their metric for the appropriate strategy */
@@ -4270,8 +4312,7 @@
 			if (outgoing->chan && (outgoing->chan->_state == AST_STATE_UP))
 				break;
 		} else {
-			ao2_ref(cur, -1);
-			ast_free(tmp);
+			callattempt_free(tmp);
 		}
 	}
 	ao2_iterator_destroy(&memi);
@@ -4416,7 +4457,6 @@
 				ast_log(LOG_NOTICE, "Caller was about to talk to agent on %s but the caller hungup.\n", peer->name);
 				ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "ABANDON", "%d|%d|%ld", qe->pos, qe->opos, (long) time(NULL) - qe->start);
 				record_abandoned(qe);
-				ast_cdr_noanswer(qe->chan->cdr);
 				ast_hangup(peer);
 				ao2_ref(member, -1);
 				return -1;
@@ -5655,7 +5695,6 @@
 		/* Leave if we have exceeded our queuetimeout */
 		if (qe.expire && (time(NULL) >= qe.expire)) {
 			record_abandoned(&qe);
-			ast_cdr_noanswer(qe.chan->cdr);
 			reason = QUEUE_TIMEOUT;
 			res = 0;
 			ast_queue_log(args.queuename, chan->uniqueid,"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld", 
@@ -5679,7 +5718,6 @@
 		/* Leave if we have exceeded our queuetimeout */
 		if (qe.expire && (time(NULL) >= qe.expire)) {
 			record_abandoned(&qe);
-			ast_cdr_noanswer(qe.chan->cdr);
 			reason = QUEUE_TIMEOUT;
 			res = 0;
 			ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
@@ -5701,7 +5739,6 @@
 			int status = 0;
 			if ((status = get_member_status(qe.parent, qe.max_penalty, qe.min_penalty, qe.parent->leavewhenempty))) {
 				record_abandoned(&qe);
-				ast_cdr_noanswer(qe.chan->cdr);
 				reason = QUEUE_LEAVEEMPTY;
 				ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITEMPTY", "%d|%d|%ld", qe.pos, qe.opos, (long)(time(NULL) - qe.start));
 				res = 0;
@@ -5714,7 +5751,6 @@
 			ast_verb(3, "Exiting on time-out cycle\n");
 			ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
 			record_abandoned(&qe);
-			ast_cdr_noanswer(qe.chan->cdr);
 			reason = QUEUE_TIMEOUT;
 			res = 0;
 			break;
@@ -5724,7 +5760,6 @@
 		/* Leave if we have exceeded our queuetimeout */
 		if (qe.expire && (time(NULL) >= qe.expire)) {
 			record_abandoned(&qe);
-			ast_cdr_noanswer(qe.chan->cdr);
 			reason = QUEUE_TIMEOUT;
 			res = 0;
 			ast_queue_log(qe.parent->name, qe.chan->uniqueid,"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld", qe.pos, qe.opos, (long) time(NULL) - qe.start);
@@ -5753,7 +5788,6 @@
 		if (res < 0) {
 			if (!qe.handled) {

[... 6672 lines stripped ...]



More information about the asterisk-commits mailing list