[svn-commits] tilghman: branch tilghman/str_substitution r187103 - in /team/tilghman/str_su...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Apr 8 12:30:25 CDT 2009


Author: tilghman
Date: Wed Apr  8 12:30:05 2009
New Revision: 187103

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=187103
Log:
Merged revisions 186444,186447,186461,186525,186537,186563,186566,186620,186624,186653,186687,186720,186799,186833,186837,186842,186899,186928,186953,186957,186985,187036,187046,187050 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r186444 | tilghman | 2009-04-03 14:30:34 -0500 (Fri, 03 Apr 2009) | 14 lines
  
  Merged revisions 186415 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r186415 | tilghman | 2009-04-03 14:06:58 -0500 (Fri, 03 Apr 2009) | 7 lines
    
    Distinguish in a sent email between simple sends and forwards.
    (closes issue #11678)
     Reported by: jamessan
     Patches: 
           20090330__bug11678.diff.txt uploaded by tilghman (license 14)
     Tested by: tilghman, lmadsen
  ........
................
  r186447 | tilghman | 2009-04-03 14:59:55 -0500 (Fri, 03 Apr 2009) | 9 lines
  
  Merged revisions 186445 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r186445 | tilghman | 2009-04-03 14:56:48 -0500 (Fri, 03 Apr 2009) | 2 lines
    
    Found a conflict in the last commit, due to multiple targets
  ........
................
  r186461 | kpfleming | 2009-04-03 15:20:01 -0500 (Fri, 03 Apr 2009) | 11 lines
  
  Merged revisions 186458 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r186458 | kpfleming | 2009-04-03 15:19:20 -0500 (Fri, 03 Apr 2009) | 5 lines
    
    Fix a bug where DAHDI/Zaptel channels would not properly switch formats when requested
    
    Don't offer AST_FORMAT_SLINEAR on DAHDI/Zaptel channels... while it could provide a slight performance benefit, the translation core in Asterisk has some flaws when a channel driver offers multiple raw formats. this fix is much simpler than fixing the translation core to solve that issue (although that will be done later).
  ........
................
  r186525 | mmichelson | 2009-04-03 17:41:46 -0500 (Fri, 03 Apr 2009) | 22 lines
  
  This commit introduces COLP/CONP and Redirecting party information into Asterisk.
  
  The channel drivers which have been most heavily tested with these enhancements are
  chan_sip and chan_misdn. Further work is being done to add Q.SIG support and will be
  introduced in a later commit. chan_skinny has code added to it here, but according
  to user pj, the support on chan_skinny is not working as of now. This will be fixed in
  a later commit.
  
  A special thanks goes out to bugtracker user gareth for getting the ball rolling and
  providing the initial support for this work. Without his initial work on this, this would
  not have been nearly as painless as it was.
  
  This functionality has been tested by Digium's product quality department, as well as a
  customer site running thousands of calls every day. In addition, many many many many bugtracker
  users have tested this, too.
  
  (closes issue #8824)
  Reported by: gareth
  
  Review: http://reviewboard.digium.com/r/201
................
  r186537 | rmudgett | 2009-04-03 19:13:50 -0500 (Fri, 03 Apr 2009) | 1 line
  
  Remove merged branch properties accidentally merged to trunk.
................
  r186563 | file | 2009-04-06 08:23:12 -0500 (Mon, 06 Apr 2009) | 8 lines
  
  Pass the correct value to sizeof when copying address information.
  
  (issue #14827)
  Reported by: pj
  Patches:
        14827.diff uploaded by file (license 11)
  Tested by: pj
................
  r186566 | mmichelson | 2009-04-06 08:57:39 -0500 (Mon, 06 Apr 2009) | 8 lines
  
  Blocked revisions 186565 via svnmerge
  
  ........
    r186565 | mmichelson | 2009-04-06 08:54:41 -0500 (Mon, 06 Apr 2009) | 3 lines
    
    Revert commit 186445 because it causes the build to fail when IMAP_STORAGE is used.
  ........
................
  r186620 | mmichelson | 2009-04-06 11:06:25 -0500 (Mon, 06 Apr 2009) | 3 lines
  
  Silly svn. These files didn't get merged over in the merge of the issue8824 branch.
................
  r186624 | file | 2009-04-06 11:15:30 -0500 (Mon, 06 Apr 2009) | 13 lines
  
  Add support for changing the outbound codec on a SIP call using
  a dialplan variable.
  
  This adds a dialplan variable (SIP_CODEC_OUTBOUND) which controls
  the codec offered for an outgoing SIP call. This is much like the
  SIP_CODEC dialplan variable and has the same restrictions. The codec
  set must be one that is configured for the call.
  
  (closes issue #13243)
  Reported by: samdell3
  Patches:
        13243.diff uploaded by file (license 11)
................
  r186653 | file | 2009-04-06 12:03:07 -0500 (Mon, 06 Apr 2009) | 2 lines
  
  Fix problem when authenticating a non-RTP dialog.
................
  r186687 | file | 2009-04-06 18:11:13 -0500 (Mon, 06 Apr 2009) | 2 lines
  
  Fix a log message getting output when it should not have been.
................
  r186720 | mmichelson | 2009-04-07 15:46:18 -0500 (Tue, 07 Apr 2009) | 12 lines
  
  Merged revisions 186719 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r186719 | mmichelson | 2009-04-07 15:43:49 -0500 (Tue, 07 Apr 2009) | 6 lines
    
    Ensure that \r\n is printed after the ActionID in an OriginateResponse.
    
    (closes issue #14847)
    Reported by: kobaz
  ........
................
  r186799 | tilghman | 2009-04-07 17:23:46 -0500 (Tue, 07 Apr 2009) | 10 lines
  
  Merged revisions 186775 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r186775 | tilghman | 2009-04-07 17:16:50 -0500 (Tue, 07 Apr 2009) | 3 lines
    
    Fix Macro documentation to match current (and intended) behavior.
    (See -dev mailing list)
  ........
................
  r186833 | mmichelson | 2009-04-07 18:50:56 -0500 (Tue, 07 Apr 2009) | 15 lines
  
  Merged revisions 186832 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r186832 | mmichelson | 2009-04-07 18:49:49 -0500 (Tue, 07 Apr 2009) | 8 lines
    
    Set the AST_FEATURE_WARNING_ACTIVE flag when a p2p bridge returns AST_BRIDGE_RETRY.
    
    Without this flag set, warning sounds will not be properly played to either party
    of the bridge.
    
    (closes issue #14845)
    Reported by: adomjan
  ........
................
  r186837 | mmichelson | 2009-04-07 19:01:49 -0500 (Tue, 07 Apr 2009) | 7 lines
  
  Fix bad merge from fix for issue 13867.
  
  (closes issue #14686)
  Reported by: davidw
................
  r186842 | mmichelson | 2009-04-07 19:09:28 -0500 (Tue, 07 Apr 2009) | 14 lines
  
  Merged revisions 186841 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r186841 | mmichelson | 2009-04-07 19:09:04 -0500 (Tue, 07 Apr 2009) | 8 lines
    
    Fix a few typos of the word "frequency."
    
    (closes issue #14842)
    Reported by: jvandal
    Patches:
          frequency-typo.diff uploaded by jvandal (license 413)
  ........
................
  r186899 | tilghman | 2009-04-08 00:06:22 -0500 (Wed, 08 Apr 2009) | 2 lines
  
  Add lastms to the require API call.
................
  r186928 | russell | 2009-04-08 07:35:57 -0500 (Wed, 08 Apr 2009) | 13 lines
  
  Update some comments and resolve potential memory corruption in chan_sip.
  
  While browsing chan_sip the other day, I noticed this dangerous code in
  dialog_needdestroy().  This function is an ao2_callback.  It is absolutely
  _not_ okay to unlock the container from within this function.  It's also not
  clear why it was useful.  Given that it could cause memory corruption, I have
  removed it.
  
  There was also a TODO comment left describing a potential implementation of
  an improvement to the needdestroy handling.  I'm not convinced that what was
  described is the best choice here, so I have briefly described the way that
  this function is used today that could be improved.
................
  r186953 | russell | 2009-04-08 08:24:48 -0500 (Wed, 08 Apr 2009) | 7 lines
  
  Start splitting up miscellaneous doxygen documentation into separate files.
  
  doxyref.h was created to hold miscellaneous documentation that was not specific
  to a part of the code.  This file has grown quite a bit so I decided to start
  splitting parts of it out into new files.  Now, you can drop a new file into
  include/asterisk/doxygen/ and it will be processed by doxygen.
................
  r186957 | russell | 2009-04-08 08:38:27 -0500 (Wed, 08 Apr 2009) | 2 lines
  
  Add some additional notes on release numbering.
................
  r186985 | mmichelson | 2009-04-08 10:27:41 -0500 (Wed, 08 Apr 2009) | 30 lines
  
  Merged revisions 186984 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r186984 | mmichelson | 2009-04-08 10:26:46 -0500 (Wed, 08 Apr 2009) | 24 lines
    
    Make a couple of changes with regards to a new message printed in ast_read().
    
    "ast_read() called with no recorded file descriptor" is a new message added
    after a bug was discovered. Unfortunately, it seems there are a bunch of places
    that potentially make such calls to ast_read() and trigger this error message
    to be displayed. This commit does two things to help to make this message appear
    less.
    
    First, the message has been downgraded to a debug level message if dev mode is
    not enabled. The message means a lot more to developers than it does to end users,
    and so developers should take an effort to be sure to call ast_read only when
    a channel is ready to be read from. However, since this doesn't actually cause an
    error in operation and is not something a user can easily fix, we should not spam
    their console with these messages.
    
    Second, the message has been moved to after the check for any pending masquerades.
    ast_read() being called with no recorded file descriptor should not interfere with
    a masquerade taking place.
    
    This could be seen as a simple way of resolving issue #14723. However, I still want
    to try to clear out the existing ways of triggering this message, since I feel that
    would be a better resolution for the issue.
  ........
................
  r187036 | file | 2009-04-08 11:27:36 -0500 (Wed, 08 Apr 2009) | 2 lines
  
  Turn a warning message into a debug message and do not treat two situations as errors when they are not.
................
  r187046 | mmichelson | 2009-04-08 11:52:20 -0500 (Wed, 08 Apr 2009) | 16 lines
  
  Merged revisions 187045 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r187045 | mmichelson | 2009-04-08 11:52:03 -0500 (Wed, 08 Apr 2009) | 10 lines
    
    Fix a small logical error when loading moh classes.
    
    We were unconditionally incrementing the number of mohclasses
    registered. However, we should actually only increment if the
    call to moh_register was successful.
    
    While this probably has never caused problems, I noticed it
    and decided to fix it anyway.
  ........
................
  r187050 | tilghman | 2009-04-08 12:08:43 -0500 (Wed, 08 Apr 2009) | 7 lines
  
  If the first column is empty, output a delimiter anyway.
  (closes issue #14848)
   Reported by: john8675309
   Patches: 
         20090408__bug14848.diff.txt uploaded by tilghman (license 14)
   Tested by: john8675309
................

Added:
    team/tilghman/str_substitution/funcs/func_connectedline.c
      - copied unchanged from r187050, trunk/funcs/func_connectedline.c
    team/tilghman/str_substitution/funcs/func_redirecting.c
      - copied unchanged from r187050, trunk/funcs/func_redirecting.c
    team/tilghman/str_substitution/include/asterisk/doxygen/
      - copied from r187050, trunk/include/asterisk/doxygen/
    team/tilghman/str_substitution/include/asterisk/doxygen/commits.h
      - copied unchanged from r187050, trunk/include/asterisk/doxygen/commits.h
    team/tilghman/str_substitution/include/asterisk/doxygen/licensing.h
      - copied unchanged from r187050, trunk/include/asterisk/doxygen/licensing.h
    team/tilghman/str_substitution/include/asterisk/doxygen/releases.h
      - copied unchanged from r187050, trunk/include/asterisk/doxygen/releases.h
Modified:
    team/tilghman/str_substitution/   (props changed)
    team/tilghman/str_substitution/CHANGES
    team/tilghman/str_substitution/Makefile
    team/tilghman/str_substitution/apps/app_dial.c
    team/tilghman/str_substitution/apps/app_directed_pickup.c
    team/tilghman/str_substitution/apps/app_macro.c
    team/tilghman/str_substitution/apps/app_queue.c
    team/tilghman/str_substitution/apps/app_voicemail.c
    team/tilghman/str_substitution/channels/chan_agent.c
    team/tilghman/str_substitution/channels/chan_dahdi.c
    team/tilghman/str_substitution/channels/chan_h323.c
    team/tilghman/str_substitution/channels/chan_iax2.c
    team/tilghman/str_substitution/channels/chan_local.c
    team/tilghman/str_substitution/channels/chan_mgcp.c
    team/tilghman/str_substitution/channels/chan_misdn.c
    team/tilghman/str_substitution/channels/chan_phone.c
    team/tilghman/str_substitution/channels/chan_sip.c
    team/tilghman/str_substitution/channels/chan_skinny.c
    team/tilghman/str_substitution/channels/chan_unistim.c
    team/tilghman/str_substitution/channels/misdn/chan_misdn_config.h
    team/tilghman/str_substitution/channels/misdn/isdn_lib.c
    team/tilghman/str_substitution/channels/misdn/isdn_lib.h
    team/tilghman/str_substitution/channels/misdn/isdn_lib_intern.h
    team/tilghman/str_substitution/channels/misdn/isdn_msg_parser.c
    team/tilghman/str_substitution/channels/misdn_config.c
    team/tilghman/str_substitution/configs/misdn.conf.sample
    team/tilghman/str_substitution/configs/sip.conf.sample
    team/tilghman/str_substitution/configs/voicemail.conf.sample
    team/tilghman/str_substitution/contrib/asterisk-ng-doxygen
    team/tilghman/str_substitution/doc/tex/channelvariables.tex
    team/tilghman/str_substitution/formats/format_wav.c
    team/tilghman/str_substitution/formats/format_wav_gsm.c
    team/tilghman/str_substitution/funcs/func_odbc.c
    team/tilghman/str_substitution/include/asterisk/callerid.h
    team/tilghman/str_substitution/include/asterisk/channel.h
    team/tilghman/str_substitution/include/asterisk/doxyref.h
    team/tilghman/str_substitution/include/asterisk/frame.h
    team/tilghman/str_substitution/include/asterisk/rtp_engine.h   (props changed)
    team/tilghman/str_substitution/include/asterisk/stun.h   (props changed)
    team/tilghman/str_substitution/main/asterisk.c
    team/tilghman/str_substitution/main/callerid.c
    team/tilghman/str_substitution/main/channel.c
    team/tilghman/str_substitution/main/dial.c
    team/tilghman/str_substitution/main/features.c
    team/tilghman/str_substitution/main/manager.c
    team/tilghman/str_substitution/main/rtp_engine.c   (contents, props changed)
    team/tilghman/str_substitution/main/stun.c   (contents, props changed)
    team/tilghman/str_substitution/res/res_musiconhold.c
    team/tilghman/str_substitution/res/res_rtp_asterisk.c   (contents, props changed)

Propchange: team/tilghman/str_substitution/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/tilghman/str_substitution/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/tilghman/str_substitution/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/tilghman/str_substitution/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Apr  8 12:30:05 2009
@@ -1,1 +1,1 @@
-/trunk:1-186407
+/trunk:1-187058

Modified: team/tilghman/str_substitution/CHANGES
URL: http://svn.digium.com/svn-view/asterisk/team/tilghman/str_substitution/CHANGES?view=diff&rev=187103&r1=187102&r2=187103
==============================================================================
--- team/tilghman/str_substitution/CHANGES (original)
+++ team/tilghman/str_substitution/CHANGES Wed Apr  8 12:30:05 2009
@@ -7,7 +7,6 @@
 === and the other UPGRADE files for older releases.
 ===
 ======================================================================
-
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 1.6.2 to Asterisk 1.6.3  -------------
 ------------------------------------------------------------------------------
@@ -16,6 +15,9 @@
 -----------
  * Added preferred_codec_only option in sip.conf. This feature limits the joint
    codecs sent in response to an INVITE to the single most preferred codec.
+ * Added SIP_CODEC_OUTBOUND dialplan variable which can be used to set the codec
+   to be used for the outgoing call. It must be one of the codecs configured
+   for the device.
 
 Applications
 ------------
@@ -23,9 +25,46 @@
    present, those values are sent immediatly upon receiving a PROGRESS message
    regardless if the call has been answered or not.
 
-Functions
----------
+Dialplan Functions
+------------------
+ * Added new dialplan functions CONNECTEDLINE and REDIRECTING which permits
+   setting various connected line and redirecting party information.
  * The CHANNEL() function now supports the "name" option.
+
+Queue changes
+-------------
+  * A new option, 'I' has been added to both app_queue and app_dial.
+    By setting this option, Asterisk will not update the caller with
+    connected line changes or redirecting party changes when they occur.
+
+mISDN channel driver (chan_misdn) changes
+----------------------------------------
+  * Added display_connected parameter to misdn.conf to put a display string
+    in the CONNECT message containing the connected name and/or number if
+    the presentation setting permits it.
+  * Added display_setup parameter to misdn.conf to put a display string
+    in the SETUP message containing the caller name and/or number if the
+    presentation setting permits it.
+  * Made misdn.conf parameters localdialplan and cpndialplan take a -1 to
+    indicate the dialplan settings are to be obtained from the asterisk
+    channel.
+  * Made misdn.conf parameter callerid accept the "name" <number> format
+    used by the rest of the system.
+  * Made use the nationalprefix and internationalprefix misdn.conf
+    parameters to prefix any received number from the ISDN link if that
+    number has the corresponding Type-Of-Number.
+  * Added the following new parameters: unknownprefix, netspecificprefix,
+    subscriberprefix, and abbreviatedprefix in misdn.conf to prefix any
+    received number from the ISDN link if that number has the corresponding
+    Type-Of-Number.
+
+
+SIP channel driver (chan_sip) changes
+-------------------------------------------
+  * The sendrpid parameter has been expanded to include the options
+    'rpid' and 'pai'. Setting sendrpid to 'rpid' will cause Remote-Party-ID
+    header to be sent (equivalent to setting sendrpid=yes) and setting
+    sendrpid to 'pai' will cause P-Asserted-Identity header to be sent.
 
 Asterisk Manager Interface
 --------------------------

Modified: team/tilghman/str_substitution/Makefile
URL: http://svn.digium.com/svn-view/asterisk/team/tilghman/str_substitution/Makefile?view=diff&rev=187103&r1=187102&r2=187103
==============================================================================
--- team/tilghman/str_substitution/Makefile (original)
+++ team/tilghman/str_substitution/Makefile Wed Apr  8 12:30:05 2009
@@ -559,8 +559,10 @@
 		chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
 	fi
 	$(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
+	$(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)/doxygen
 	$(INSTALL) -m 644 include/asterisk.h $(DESTDIR)$(includedir)
 	$(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+	$(INSTALL) -m 644 include/asterisk/doxygen/*.h $(DESTDIR)$(ASTHEADERDIR)/doxygen
 	if [ -n "$(OLDHEADERS)" ]; then \
 		rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
 	fi

Modified: team/tilghman/str_substitution/apps/app_dial.c
URL: http://svn.digium.com/svn-view/asterisk/team/tilghman/str_substitution/apps/app_dial.c?view=diff&rev=187103&r1=187102&r2=187103
==============================================================================
--- team/tilghman/str_substitution/apps/app_dial.c (original)
+++ team/tilghman/str_substitution/apps/app_dial.c Wed Apr  8 12:30:05 2009
@@ -156,6 +156,10 @@
 				</option>
 				<option name="i">
 					<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>
 				</option>
 				<option name="k">
 					<para>Allow the called party to enable parking of the call by sending
@@ -382,7 +386,6 @@
 			This application will report normal termination if the originating channel
 			hangs up, or if the call is bridged and either of the parties in the bridge
 			ends the call.</para>
-
 			<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
@@ -464,12 +467,13 @@
 	OPT_GO_ON =             (1 << 5),
 	OPT_CALLEE_HANGUP =     (1 << 6),
 	OPT_CALLER_HANGUP =     (1 << 7),
+	OPT_ORIGINAL_CLID =     (1 << 8),
 	OPT_DURATION_LIMIT =    (1 << 9),
 	OPT_MUSICBACK =         (1 << 10),
 	OPT_CALLEE_MACRO =      (1 << 11),
 	OPT_SCREEN_NOINTRO =    (1 << 12),
-	OPT_SCREEN_NOCLID =     (1 << 13),
-	OPT_ORIGINAL_CLID =     (1 << 14),
+	OPT_SCREEN_NOCALLERID = (1 << 13),
+	OPT_IGNORE_CONNECTEDLINE = (1 << 14),
 	OPT_SCREENING =         (1 << 15),
 	OPT_PRIVACY =           (1 << 16),
 	OPT_RINGBACK =          (1 << 17),
@@ -490,9 +494,10 @@
 
 #define DIAL_STILLGOING      (1 << 31)
 #define DIAL_NOFORWARDHTML   ((uint64_t)1 << 32) /* flags are now 64 bits, so keep it up! */
-#define OPT_CANCEL_ELSEWHERE ((uint64_t)1 << 33)
-#define OPT_PEER_H           ((uint64_t)1 << 34)
-#define OPT_CALLEE_GO_ON     ((uint64_t)1 << 35)
+#define DIAL_NOCONNECTEDLINE ((uint64_t)1 << 33)
+#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)
 
 enum {
 	OPT_ARG_ANNOUNCE = 0,
@@ -524,13 +529,14 @@
 	AST_APP_OPTION('h', OPT_CALLEE_HANGUP),
 	AST_APP_OPTION('H', OPT_CALLER_HANGUP),
 	AST_APP_OPTION('i', OPT_IGNORE_FORWARDING),
+	AST_APP_OPTION('I', OPT_IGNORE_CONNECTEDLINE),
 	AST_APP_OPTION('k', OPT_CALLEE_PARK),
 	AST_APP_OPTION('K', OPT_CALLER_PARK),
 	AST_APP_OPTION_ARG('L', OPT_DURATION_LIMIT, OPT_ARG_DURATION_LIMIT),
 	AST_APP_OPTION_ARG('m', OPT_MUSICBACK, OPT_ARG_MUSICBACK),
 	AST_APP_OPTION_ARG('M', OPT_CALLEE_MACRO, OPT_ARG_CALLEE_MACRO),
 	AST_APP_OPTION('n', OPT_SCREEN_NOINTRO),
-	AST_APP_OPTION('N', OPT_SCREEN_NOCLID),
+	AST_APP_OPTION('N', OPT_SCREEN_NOCALLERID),
 	AST_APP_OPTION('o', OPT_ORIGINAL_CLID),
 	AST_APP_OPTION_ARG('O', OPT_OPERMODE, OPT_ARG_OPERMODE),
 	AST_APP_OPTION('p', OPT_SCREENING),
@@ -558,6 +564,7 @@
 	struct chanlist *next;
 	struct ast_channel *chan;
 	uint64_t flags;
+	struct ast_party_connected_line connected;
 };
 
 static int detect_disconnect(struct ast_channel *chan, char code, struct ast_str *featurecode);
@@ -653,7 +660,6 @@
 	}
 	return 0;
 }
-
 
 static const char *get_cid_name(char *name, int namelen, struct ast_channel *chan)
 {
@@ -702,6 +708,8 @@
 	struct ast_channel *original = o->chan;
 	struct ast_channel *c = o->chan; /* the winner */
 	struct ast_channel *in = num->chan; /* the input channel */
+	struct ast_party_redirecting *apr = &o->chan->redirecting;
+	struct ast_party_connected_line *apc = &o->chan->connected;
 	char *stuff;
 	char *tech;
 	int cause;
@@ -742,30 +750,38 @@
 		handle_cause(cause, num);
 		ast_hangup(original);
 	} else {
-		char *new_cid_num, *new_cid_name;
-		struct ast_channel *src;
-
 		if (single) {
 			ast_rtp_instance_early_bridge_make_compatible(c, in);
 		}
+
+		c->cdrflags = in->cdrflags;
+
+		ast_channel_set_redirecting(c, apr);
+		ast_channel_lock(c);
+		while (ast_channel_trylock(in)) {
+			CHANNEL_DEADLOCK_AVOIDANCE(c);
+		}
+		S_REPLACE(c->cid.cid_rdnis, ast_strdup(S_OR(original->cid.cid_rdnis, S_OR(in->macroexten, in->exten))));
+
+		c->cid.cid_tns = in->cid.cid_tns;
+
 		if (ast_test_flag64(o, OPT_FORCECLID)) {
-			new_cid_num = ast_strdup(S_OR(in->macroexten, in->exten));
-			new_cid_name = NULL; /* XXX no name ? */
-			src = c; /* XXX possible bug in previous code, which used 'winner' ? it may have changed */
+			S_REPLACE(c->cid.cid_num, ast_strdupa(S_OR(in->macroexten, in->exten)));
+			S_REPLACE(c->cid.cid_name, NULL);
+			ast_string_field_set(c, accountcode, c->accountcode);
 		} else {
-			new_cid_num = ast_strdup(in->cid.cid_num);
-			new_cid_name = ast_strdup(in->cid.cid_name);
-			src = in;
-		}
-		ast_string_field_set(c, accountcode, src->accountcode);
-		c->cdrflags = src->cdrflags;
-		S_REPLACE(c->cid.cid_num, new_cid_num);
-		S_REPLACE(c->cid.cid_name, new_cid_name);
-
-		if (in->cid.cid_ani) { /* XXX or maybe unconditional ? */
-			S_REPLACE(c->cid.cid_ani, ast_strdup(in->cid.cid_ani));
-		}
-		S_REPLACE(c->cid.cid_rdnis, ast_strdup(S_OR(in->macroexten, in->exten)));
+			ast_party_caller_copy(&c->cid, &in->cid);
+			ast_string_field_set(c, accountcode, in->accountcode);
+		}
+		ast_party_connected_line_copy(&c->connected, apc);
+
+		S_REPLACE(in->cid.cid_rdnis, ast_strdup(c->cid.cid_rdnis));
+		ast_channel_unlock(in);
+		ast_channel_unlock(c);
+		ast_channel_update_redirecting(in, apr);
+
+		ast_clear_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE);
+
 		if (ast_call(c, tmpchan, 0)) {
 			ast_log(LOG_NOTICE, "Failed to dial on local channel for call forward to '%s'\n", tmpchan);
 			ast_clear_flag64(o, DIAL_STILLGOING);
@@ -775,7 +791,6 @@
 			num->nochan++;
 		} else {
 			senddialevent(in, c, stuff);
-			/* After calling, set callerid to extension */
 			if (!ast_test_flag64(peerflags, OPT_ORIGINAL_CLID)) {
 				char cidname[AST_MAX_EXTENSION] = "";
 				ast_set_callerid(c, S_OR(in->macroexten, in->exten), get_cid_name(cidname, sizeof(cidname), in), NULL);
@@ -808,16 +823,28 @@
 	int orig = *to;
 	struct ast_channel *peer = NULL;
 	/* single is set if only one destination is enabled */
-	int single = outgoing && !outgoing->next && !ast_test_flag64(outgoing, OPT_MUSICBACK | OPT_RINGBACK);
+	int single = outgoing && !outgoing->next;
 #ifdef HAVE_EPOLL
 	struct chanlist *epollo;
 #endif
+	struct ast_party_connected_line connected_caller;
 	struct ast_str *featurecode = ast_str_alloca(FEATURE_MAX_LEN + 1);
 	if (single) {
 		/* Turn off hold music, etc */
-		ast_deactivate_generator(in);
+		if (!ast_test_flag64(outgoing, OPT_MUSICBACK | OPT_RINGBACK))
+			ast_deactivate_generator(in);
+
 		/* If we are calling a single channel, make them compatible for in-band tone purpose */
 		ast_channel_make_compatible(outgoing->chan, in);
+
+		if (!ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE) && !ast_test_flag64(outgoing, DIAL_NOCONNECTEDLINE)) {
+			ast_channel_lock(outgoing->chan);
+			ast_connected_line_copy_from_caller(&connected_caller, &outgoing->chan->cid);
+			ast_channel_unlock(outgoing->chan);
+			connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
+			ast_channel_update_connected_line(in, &connected_caller);
+			ast_party_connected_line_free(&connected_caller);
+		}
 	}
 
 #ifdef HAVE_EPOLL
@@ -864,6 +891,18 @@
 			if (ast_test_flag64(o, DIAL_STILLGOING) && c->_state == AST_STATE_UP) {
 				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) {
+							ast_channel_update_connected_line(in, &o->connected);
+						} else if (!ast_test_flag64(o, DIAL_NOCONNECTEDLINE)) {
+							ast_channel_lock(c);
+							ast_connected_line_copy_from_caller(&connected_caller, &c->cid);
+							ast_channel_unlock(c);
+							connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
+							ast_channel_update_connected_line(in, &connected_caller);
+							ast_party_connected_line_free(&connected_caller);
+						}
+					}
 					peer = c;
 					ast_copy_flags64(peerflags, o,
 						OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
@@ -902,6 +941,18 @@
 					/* This is our guy if someone answered. */
 					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) {
+								ast_channel_update_connected_line(in, &o->connected);
+							} else if (!ast_test_flag64(o, DIAL_NOCONNECTEDLINE)) {
+								ast_channel_lock(c);
+								ast_connected_line_copy_from_caller(&connected_caller, &c->cid);
+								ast_channel_unlock(c);
+								connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
+								ast_channel_update_connected_line(in, &connected_caller);
+								ast_party_connected_line_free(&connected_caller);
+							}
+						}
 						peer = c;
 						if (peer->cdr) {
 							peer->cdr->answer = ast_tvnow();
@@ -970,6 +1021,29 @@
 					ast_verb(3, "%s requested a source update, passing it to %s\n", c->name, in->name);
 					ast_indicate(in, AST_CONTROL_SRCUPDATE);
 					break;
+				case AST_CONTROL_CONNECTED_LINE:
+					if (ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
+						ast_verb(3, "Connected line update to %s prevented.\n", in->name);
+					} else if (!single) {
+						struct ast_party_connected_line connected;
+						ast_verb(3, "%s connected line has changed. Saving it until answer for %s\n", c->name, in->name);
+						ast_party_connected_line_set_init(&connected, &o->connected);
+						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);
+					} else {
+						ast_verb(3, "%s connected line has changed, passing it to %s\n", c->name, in->name);
+						ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);
+					}
+					break;
+				case AST_CONTROL_REDIRECTING:
+					if (ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
+						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);
+					}
+					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))
@@ -1084,7 +1158,9 @@
 				((f->subclass == AST_CONTROL_HOLD) ||
 				(f->subclass == AST_CONTROL_UNHOLD) ||
 				(f->subclass == AST_CONTROL_VIDUPDATE) ||
-				 (f->subclass == AST_CONTROL_SRCUPDATE))) {
+				(f->subclass == AST_CONTROL_SRCUPDATE) ||
+				(f->subclass == AST_CONTROL_CONNECTED_LINE) ||
+				(f->subclass == AST_CONTROL_REDIRECTING))) {
 				ast_verb(3, "%s requested special control %d, passing it to %s\n", in->name, f->subclass, outgoing->chan->name);
 				ast_indicate_data(outgoing->chan, f->subclass, f->data.ptr, f->datalen);
 			}
@@ -1423,11 +1499,11 @@
 
 	ast_copy_string(pa->privcid, l, sizeof(pa->privcid));
 
-	if (strncmp(pa->privcid, "NOCALLERID", 10) != 0 && ast_test_flag64(opts, OPT_SCREEN_NOCLID)) {
-		/* if callerid is set and OPT_SCREEN_NOCLID is set also */
+	if (strncmp(pa->privcid, "NOCALLERID", 10) != 0 && ast_test_flag64(opts, OPT_SCREEN_NOCALLERID)) {
+		/* if callerid is set and OPT_SCREEN_NOCALLERID is set also */
 		ast_verb(3, "CallerID set (%s); N option set; Screening should be off\n", pa->privcid);
 		pa->privdb_val = AST_PRIVACY_ALLOW;
-	} else if (ast_test_flag64(opts, OPT_SCREEN_NOCLID) && strncmp(pa->privcid, "NOCALLERID", 10) == 0) {
+	} else if (ast_test_flag64(opts, OPT_SCREEN_NOCALLERID) && strncmp(pa->privcid, "NOCALLERID", 10) == 0) {
 		ast_verb(3, "CallerID blank; N option set; Screening should happen; dbval is %d\n", pa->privdb_val);
 	}
 	
@@ -1637,7 +1713,7 @@
 		outbound_group = ast_strdupa(outbound_group);
 	}
 	ast_channel_unlock(chan);	
-	ast_copy_flags64(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID | OPT_CALLER_HANGUP | OPT_IGNORE_FORWARDING);
+	ast_copy_flags64(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID | OPT_CALLER_HANGUP | OPT_IGNORE_FORWARDING | OPT_IGNORE_CONNECTEDLINE);
 
 	/* loop through the list of dial destinations */
 	rest = args.peers;
@@ -1674,6 +1750,14 @@
 
 		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
+		 */
+		if (chan->connected.id.number) {
+			ast_party_connected_line_copy(&tmp->connected, &chan->connected);
+		}
 		ast_channel_unlock(chan);
 
 		if (datastore)
@@ -1746,6 +1830,10 @@
 		}
 		pbx_builtin_setvar_helper(tc, "DIALEDPEERNUMBER", numsubst);
 
+		ast_channel_lock(tc);
+		while (ast_channel_trylock(chan)) {
+			CHANNEL_DEADLOCK_AVOIDANCE(tc);
+		}
 		/* Setup outgoing SDP to match incoming one */
 		if (!outgoing && !rest) {
 			ast_rtp_instance_early_bridge_make_compatible(tc, chan);
@@ -1759,20 +1847,31 @@
 		tc->data = "(Outgoing Line)";
 		memset(&tc->whentohangup, 0, sizeof(tc->whentohangup));
 
-		S_REPLACE(tc->cid.cid_num, ast_strdup(chan->cid.cid_num));
-		S_REPLACE(tc->cid.cid_name, ast_strdup(chan->cid.cid_name));
-		S_REPLACE(tc->cid.cid_ani, ast_strdup(chan->cid.cid_ani));
+		/* If the new channel has no callerid, try to guess what it should be */
+		if (ast_strlen_zero(tc->cid.cid_num)) {
+			if (!ast_strlen_zero(chan->connected.id.number)) {
+				ast_set_callerid(tc, chan->connected.id.number, chan->connected.id.name, chan->connected.ani);
+			} else if (!ast_strlen_zero(chan->cid.cid_dnid)) {
+				ast_set_callerid(tc, chan->cid.cid_dnid, NULL, NULL);
+			} 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_connected_line_copy_from_caller(&tc->connected, &chan->cid);
+
 		S_REPLACE(tc->cid.cid_rdnis, ast_strdup(chan->cid.cid_rdnis));
-		
+		ast_party_redirecting_copy(&tc->redirecting, &chan->redirecting);
+
+		tc->cid.cid_tns = chan->cid.cid_tns;
+
 		ast_string_field_set(tc, accountcode, chan->accountcode);
 		tc->cdrflags = chan->cdrflags;
 		if (ast_strlen_zero(tc->musicclass))
 			ast_string_field_set(tc, musicclass, chan->musicclass);
-		/* Pass callingpres, type of number, tns, ADSI CPE, transfer capability */
-		tc->cid.cid_pres = chan->cid.cid_pres;
-		tc->cid.cid_ton = chan->cid.cid_ton;
-		tc->cid.cid_tns = chan->cid.cid_tns;
-		tc->cid.cid_ani2 = chan->cid.cid_ani2;
+
+		/* Pass ADSI CPE and transfer capability */
 		tc->adsicpe = chan->adsicpe;
 		tc->transfercapability = chan->transfercapability;
 
@@ -1809,6 +1908,8 @@
 			if (tc->hangupcause) {
 				chan->hangupcause = tc->hangupcause;
 			}
+			ast_channel_unlock(chan);
+			ast_channel_unlock(tc);
 			ast_hangup(tc);
 			tc = NULL;
 			ast_free(tmp);
@@ -1816,8 +1917,11 @@
 		} else {
 			senddialevent(chan, tc, numsubst);
 			ast_verb(3, "Called %s\n", numsubst);
-			if (!ast_test_flag64(peerflags, OPT_ORIGINAL_CLID))
+			if (!ast_test_flag64(peerflags, OPT_ORIGINAL_CLID)) {
 				ast_set_callerid(tc, S_OR(chan->macroexten, chan->exten), get_cid_name(cidname, sizeof(cidname), chan), NULL);
+			}
+			ast_channel_unlock(chan);
+			ast_channel_unlock(tc);
 		}
 		/* Put them in the list of outgoing thingies...  We're ready now.
 		   XXX If we're forcibly removed, these outgoing calls won't get

Modified: team/tilghman/str_substitution/apps/app_directed_pickup.c
URL: http://svn.digium.com/svn-view/asterisk/team/tilghman/str_substitution/apps/app_directed_pickup.c?view=diff&rev=187103&r1=187102&r2=187103
==============================================================================
--- team/tilghman/str_substitution/apps/app_directed_pickup.c (original)
+++ team/tilghman/str_substitution/apps/app_directed_pickup.c Wed Apr  8 12:30:05 2009
@@ -40,6 +40,7 @@
 #include "asterisk/lock.h"
 #include "asterisk/app.h"
 #include "asterisk/features.h"
+#include "asterisk/callerid.h"
 
 #define PICKUPMARK "PICKUPMARK"
 
@@ -91,8 +92,20 @@
 static int pickup_do(struct ast_channel *chan, struct ast_channel *target)
 {
 	int res = 0;
+	struct ast_party_connected_line connected_caller;
 
 	ast_debug(1, "Call pickup on '%s' by '%s'\n", target->name, chan->name);
+
+	connected_caller = target->connected;
+	connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
+	ast_channel_update_connected_line(chan, &connected_caller);
+
+	ast_channel_lock(chan);
+	ast_connected_line_copy_from_caller(&connected_caller, &chan->cid);
+	ast_channel_unlock(chan);
+	connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
+	ast_channel_queue_connected_line_update(chan, &connected_caller);
+	ast_party_connected_line_free(&connected_caller);
 
 	if ((res = ast_answer(chan))) {
 		ast_log(LOG_WARNING, "Unable to answer '%s'\n", chan->name);

Modified: team/tilghman/str_substitution/apps/app_macro.c
URL: http://svn.digium.com/svn-view/asterisk/team/tilghman/str_substitution/apps/app_macro.c?view=diff&rev=187103&r1=187102&r2=187103
==============================================================================
--- team/tilghman/str_substitution/apps/app_macro.c (original)
+++ team/tilghman/str_substitution/apps/app_macro.c Wed Apr  8 12:30:05 2009
@@ -62,10 +62,6 @@
 			at the location of the Goto.</para>
 			<para>If <variable>MACRO_OFFSET</variable> is set at termination, Macro will attempt to continue
 			at priority MACRO_OFFSET + N + 1 if such a step exists, and N + 1 otherwise.</para>
-			<para>Extensions: While a macro is being executed, it becomes the current context. This means that if
-			a hangup occurs, for instance, that the macro will be searched for an <literal>h</literal> extension,
-			NOT the context from which the macro was called. So, make sure to define all appropriate extensions
-			in your macro! (Note: AEL does not use macros)</para>
 			<warning><para>Because of the way Macro is implemented (it executes the priorities contained within
 			it via sub-engine), and a fixed per-thread memory stack allowance, macros are limited to 7 levels
 			of nesting (macro calling macro calling macro, etc.); It may be possible that stack-intensive

Modified: team/tilghman/str_substitution/apps/app_queue.c
URL: http://svn.digium.com/svn-view/asterisk/team/tilghman/str_substitution/apps/app_queue.c?view=diff&rev=187103&r1=187102&r2=187103
==============================================================================
--- team/tilghman/str_substitution/apps/app_queue.c (original)
+++ team/tilghman/str_substitution/apps/app_queue.c Wed Apr  8 12:30:05 2009
@@ -94,6 +94,7 @@
 #include "asterisk/strings.h"
 #include "asterisk/global_datastores.h"
 #include "asterisk/taskprocessor.h"
+#include "asterisk/callerid.h"
 
 /*!
  * \par Please read before modifying this file.
@@ -140,6 +141,10 @@
 					<option name="i">
 						<para>Ignore call forward requests from queue members and do nothing

[... 12325 lines stripped ...]



More information about the svn-commits mailing list