[asterisk-commits] may: branch may/ooh323_ipv6_direct_rtp r321506 - in /team/may/ooh323_ipv6_dir...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat May 28 04:19:06 CDT 2011


Author: may
Date: Sat May 28 04:18:48 2011
New Revision: 321506

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=321506
Log:
Merged revisions 319024,319084,319086-319087,319143,319146,319212,319260,319262,319316,319366,319368,319427,319470-319471,319530,319564,319661,319759,319813,319867,319939,319998 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r319024 | wedhorn | 2011-05-16 03:17:57 +0400 (Mon, 16 May 2011) | 8 lines
  
  Add activatesub and dialandactivate sub.
  
  When called, activatesub first cleans up the active sub and then
  handles the sub passed. dialandactivatesub first sets sub->exten
  and then calls activatesub. Revise handle_offhook to utilise the
  callid sent to chan_skinny. Some other minor fixes especially around
  d->hookstate (which still needs some more work).
................
  r319084 | dvossel | 2011-05-16 18:29:06 +0400 (Mon, 16 May 2011) | 12 lines
  
  Merged revisions 319083 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r319083 | dvossel | 2011-05-16 09:26:33 -0500 (Mon, 16 May 2011) | 5 lines
    
    Fixes Big Endian build issue.
    
    (closes issue #19298)
    Reported by: tzafrir
  ........
................
  r319086 | pabelanger | 2011-05-16 18:38:16 +0400 (Mon, 16 May 2011) | 17 lines
  
  Merged revisions 319085 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r319085 | pabelanger | 2011-05-16 10:35:21 -0400 (Mon, 16 May 2011) | 10 lines
    
    Support gmime-2.4
    
    (closes issue #18863)
    Reported by: tzafrir
    Patches:
          gmime-2.4-18.diff uploaded by tzafrir (license 46)
          Tested by: tzafrir
    
    Review: https://reviewboard.asterisk.org/r/1213/
  ........
................
  r319087 | irroot | 2011-05-16 18:56:53 +0400 (Mon, 16 May 2011) | 16 lines
  
   When a error in T.38 negotiation happens or its rejected on a channel the
   state of the channel reverts to unknown this should be rejected.
   
   this is important for negotiating T.38 gateway see #13405
  
   This patch adds a option T38_REJECTED that behaves as T38_DISABLED except it reports state rejected.
  
   Trivial Change to res_fax to honnor UNAVAILABLE and REJECTED states.
  
   (closes issue #18889)
   Reported by: irroot
   Tested by: irroot, darkbasic, 	mnicholson
  
   Review: https://reviewboard.asterisk.org/r/1115
................
  r319143 | mnicholson | 2011-05-16 19:54:52 +0400 (Mon, 16 May 2011) | 15 lines
  
  Merged revisions 319142 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r319142 | mnicholson | 2011-05-16 10:53:26 -0500 (Mon, 16 May 2011) | 8 lines
    
    Make sure tcptls_session exists before dereferencing it.
    
    (closes issue #19192)
    Reported by: stknob
    Patches:
          10-tcptls-unreachable-peer-segfault.patch uploaded by Chainsaw (license 723)
    Tested by: vois, Chainsaw
  ........
................
  r319146 | dvossel | 2011-05-16 19:58:12 +0400 (Mon, 16 May 2011) | 18 lines
  
  Merged revisions 319145 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ................
    r319145 | dvossel | 2011-05-16 10:57:26 -0500 (Mon, 16 May 2011) | 9 lines
    
    Merged revisions 319144 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.6.2
    
    ........
      r319144 | dvossel | 2011-05-16 10:56:16 -0500 (Mon, 16 May 2011) | 2 lines
      
      Fixes issue with peer ref-counting during handle_request_subscribe.
      (closes issue #19293)
      Reported by: irroot
    ........
  ................
................
  r319212 | twilson | 2011-05-16 22:21:17 +0400 (Mon, 16 May 2011) | 18 lines
  
  Merged revisions 319204 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ................
    r319204 | twilson | 2011-05-16 13:17:43 -0500 (Mon, 16 May 2011) | 11 lines
    
    Merged revisions 319202 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.6.2
    
    ........
      r319202 | twilson | 2011-05-16 11:00:21 -0700 (Mon, 16 May 2011) | 4 lines
      
      Unlink a peer from peers_by_ip when expiring a registration
      
      Review: https://reviewboard.asterisk.org/r/1218/
    ........
  ................
................
  r319260 | rmudgett | 2011-05-17 00:41:31 +0400 (Tue, 17 May 2011) | 20 lines
  
  Merged revisions 319259 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r319259 | rmudgett | 2011-05-16 15:33:37 -0500 (Mon, 16 May 2011) | 13 lines
    
    Deadlock between generic CCSS agent and native ISDN CCSS.
    
    Deadlock can occur when the generic CCSS agent is deleting duplicate CC
    offers and the native ISDN CC driver is processing an incoming CC message.
    The cc_core_instances container lock cannot be held when an agent or
    monitor callback is invoked without the possibility of a deadlock.
    
    * Make kill_duplicate_offers() remove the reference in cc_core_instances
    outside of the container lock.
    
    JIRA AST-566
    JIRA SWP-3469
  ........
................
  r319262 | jrose | 2011-05-17 01:08:50 +0400 (Tue, 17 May 2011) | 9 lines
  
  Merged revisions 319261 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r319261 | jrose | 2011-05-16 16:00:55 -0500 (Mon, 16 May 2011) | 2 lines
    
    Makes busy detection in dsp.c always allow for at least one frame (20ms) of error so that 200ms tone lengths don't get ignored by single frame error lengths.
  ........
................
  r319316 | wedhorn | 2011-05-17 01:39:33 +0400 (Tue, 17 May 2011) | 8 lines
  
  Fix up skinny hints.
  
  Probably haven't been working for a couple of years. May still need
  some more love, but they are now working, both as a hint device and
  monitoring a hint. Changes centre around the long ago change
  to remove the requirement for a device name in a skinny line, and 
  changes to the transmit_* functions.
................
  r319366 | lmadsen | 2011-05-17 16:40:02 +0400 (Tue, 17 May 2011) | 14 lines
  
  Merged revisions 319365 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r319365 | lmadsen | 2011-05-17 07:39:37 -0500 (Tue, 17 May 2011) | 6 lines
    
    Make Debian init script lsb compliant
    
    (closes issue #18896)
    Reported by: manwe
    Patches: 
          debian_init_lsb.patch uploaded by manwe (license 1223)
  ........
................
  r319368 | lmadsen | 2011-05-17 16:54:13 +0400 (Tue, 17 May 2011) | 18 lines
  
  Merged revisions 319367 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r319367 | lmadsen | 2011-05-17 07:53:50 -0500 (Tue, 17 May 2011) | 10 lines
    
    Don't create [general] voicemail context when using users.conf
    
    Prior to this patch, app_voicemail would create a [general] context when parsing users.conf.
    
    (closes issue #18891)
    Reported by: pdugas
    Patches: 
          app_voicemail-ignore-general.patch uploaded by pdugas (license 1222)
          app_voicemail-ignore-general-style-guidelines.patch uploaded by seanbright (license 71)
    Tested by: pdugas
  ........
................
  r319427 | rmudgett | 2011-05-18 00:13:27 +0400 (Wed, 18 May 2011) | 19 lines
  
  Option needed for Q931_IE_TIME_DATE to be optional in CONNECT message.
  
  The NEC SV8300 rejects the Q931_IE_TIME_DATE for Q.SIG.
  
  Add option to specify if and how much of the current time is put in
  Q931_IE_TIME_DATE.
  * Send date/time ie never.
  * Send date/time ie date only.
  * Send date/time ie date and hour.
  * Send date/time ie date, hour, and minute.
  * Send date/time ie date, hour, minute, and second.
  * Send date/time ie default: Libpri will send date and hhmm only when in
  NT PTMP mode to support ISDN phones.
  
  (closes issue #19221)
  Reported by: kenner
  
  JIRA SWP-3396
................
  r319470 | wedhorn | 2011-05-18 01:59:55 +0400 (Wed, 18 May 2011) | 4 lines
  
  Remove extraneous line variables.
  
  The vars were either explicitly or implicitly not used.
................
  r319471 | rmudgett | 2011-05-18 02:04:59 +0400 (Wed, 18 May 2011) | 29 lines
  
  Merged revisions 319469 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ................
    r319469 | rmudgett | 2011-05-17 16:57:56 -0500 (Tue, 17 May 2011) | 22 lines
    
    Merged revision 319468 from
    https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
    
    ..........
      r319468 | rmudgett | 2011-05-17 16:49:31 -0500 (Tue, 17 May 2011) | 15 lines
    
      The mISDN HDLC mode is prevented on dialed channels.
    
      The use of mISDN HDLC mode is prevented if the mISDN dial technology
      option 'h1' is used when config option astdtmf=yes.
    
      There is a bug in channels/misdn/isdn_lib.c which prevents the use of HDLC
      mode.  Instead of setting the channel to HDLC mode it is set to
      transparent(no dsp, no hdlc), although hdlc is not "no hdlc".  I.e the
      logging message is correct, but the if condition is not.
    
      Make check the nodsp and hdlc flags.
    
      JIRA ABE-2787
      JIRA SWP-3437
    ..........
  ................
................
  r319530 | twilson | 2011-05-19 00:07:07 +0400 (Thu, 19 May 2011) | 31 lines
  
  Merged revisions 319529 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ................
    r319529 | twilson | 2011-05-18 13:05:34 -0700 (Wed, 18 May 2011) | 24 lines
    
    Merged revisions 319528 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.6.2
    
    ................
      r319528 | twilson | 2011-05-18 13:02:06 -0700 (Wed, 18 May 2011) | 17 lines
      
      Merged revisions 319527 via svnmerge from 
      https://origsvn.digium.com/svn/asterisk/branches/1.4
      
      ........
        r319527 | twilson | 2011-05-18 12:56:08 -0700 (Wed, 18 May 2011) | 10 lines
        
        Fix app_dial ring groups
        
        Revert part of r315643. We need to remove the datastore here as well.
        The code in bridging code will catch anything that app_dial might miss.
        
        (closes issue #19311)
        Reported by: mspuhler
        Patches: 
              issue_19311_no_answer.diff uploaded by elguero (license 37)
      ........
    ................
  ................
................
  r319564 | twilson | 2011-05-19 00:25:32 +0400 (Thu, 19 May 2011) | 18 lines
  
  Merged revisions 319552 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r319552 | twilson | 2011-05-18 13:22:36 -0700 (Wed, 18 May 2011) | 11 lines
    
    Unbreak the storing of registrations for restart
    
    The fix for issue 18882 broke retrieving non-realtime peers from the ast_db
    on restart/reload. This patch tries to unbreak things while leaving the intent
    of the original fix intact.
    (closes issue #19318)
    Reported by: remiq
    Patches: 
          diff.txt uploaded by twilson (license 396)
    Tested by: lmadsen, remiq
  ........
................
  r319661 | twilson | 2011-05-19 03:18:32 +0400 (Thu, 19 May 2011) | 29 lines
  
  Merged revisions 319654 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ................
    r319654 | twilson | 2011-05-18 16:15:58 -0700 (Wed, 18 May 2011) | 22 lines
    
    Merged revisions 319653 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.6.2
    
    ................
      r319653 | twilson | 2011-05-18 16:11:57 -0700 (Wed, 18 May 2011) | 15 lines
      
      Merged revisions 319652 via svnmerge from 
      https://origsvn.digium.com/svn/asterisk/branches/1.4
      
      ........
        r319652 | twilson | 2011-05-18 16:04:35 -0700 (Wed, 18 May 2011) | 8 lines
        
        Make sure everyone gets an unhold when a transfer succeeds
        
        Some phones, like the Snom phones, send a hold to the transfer target after
        before sending the REFER. We need to make sure that we unhold the parties
        that are being connected after the masquerade. If Local channels with the /nm
        option are used when dialing the parties, hold music would still be playing on
        the transfer target, even after being connected with the transferee.
      ........
    ................
  ................
................
  r319759 | rmudgett | 2011-05-19 20:52:47 +0400 (Thu, 19 May 2011) | 28 lines
  
  Merged revisions 319758 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r319758 | rmudgett | 2011-05-19 11:50:48 -0500 (Thu, 19 May 2011) | 21 lines
    
    CCSS generic agent with POTS and ISDN phones fail caller busy call-back test.
    
    If the following is true after a CCSS activation:
    * The generic agent is for an analog phone or ISDN phone.  (Caller party)
    * The called party becomes available.
    * The caller party is not available.
    
    When the caller party becomes available, the caller is not alerted to the
    called party being available.  The generic agent still thinks the caller
    is busy.
    
    * Fixed the generic agent device state event subscription to look for all
    device states that are considered available.
    
    * Encapsulated the device state test for CCSS generic device available in
    cc_generic_is_device_available().  Made the generic agent and monitor use
    the new function instead of the manually coded inline equivalent.
    
    JIRA AST-559
    JIRA SWP-3462
  ........
................
  r319813 | markm | 2011-05-19 22:12:49 +0400 (Thu, 19 May 2011) | 16 lines
  
  Merged revisions 319812 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r319812 | markm | 2011-05-19 13:59:01 -0400 (Thu, 19 May 2011) | 9 lines
    
    In cel_odbc, an uninitialized RWLIST is attempted to be locked.
    
    Added INIT and DESTROY for the RWLIST odbc_tables
    
    (closes issue #19331)
    Reported by: kobaz
    Patches: 
          odbc_cel.patch uploaded by kobaz (license 834)
  ........
................
  r319867 | jrose | 2011-05-19 22:36:38 +0400 (Thu, 19 May 2011) | 18 lines
  
  Merged revisions 319866 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r319866 | jrose | 2011-05-19 13:32:38 -0500 (Thu, 19 May 2011) | 11 lines
    
    Fix Randomize option on Park()
    
    The randomize option was generally not working like it should have at all on Park().
    This patch restores intended functionality.
    
    (closes issue #18862)
    Reported by: davidw
    Tested by: jrose
    
    Review: https://reviewboard.asterisk.org/r/1222/
  ........
................
  r319939 | jrose | 2011-05-20 17:42:15 +0400 (Fri, 20 May 2011) | 19 lines
  
  Merged revisions 319938 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r319938 | jrose | 2011-05-20 08:28:24 -0500 (Fri, 20 May 2011) | 12 lines
    
    Adds legacy_useroption_parsing to address interoperability concerns.
    
    With the new option engaged, Asterisk should interpret user fields with useroptions
    contained within the userfield of the uri by stripping them out of the original message
    whenever a semicolon is encountered in the userfield string.
    
    (closes issue #18344)
    Reported by: danimal
    Tested by: jrose
    
    Review: https://reviewboard.asterisk.org/r/1223/
  ........
................
  r319998 | rmudgett | 2011-05-20 19:52:20 +0400 (Fri, 20 May 2011) | 32 lines
  
  Merged revisions 319997 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r319997 | rmudgett | 2011-05-20 10:48:25 -0500 (Fri, 20 May 2011) | 25 lines
    
    Crash when using directed pickup applications.
    
    The directed pickup applications can cause a crash if the pickup was
    successful because the dialplan keeps executing.
    
    This patch does the following:
    
    * Completes the channel masquerade on a successful pickup before the
    application returns.  The channel is now guaranteed a zombie and must not
    continue executing the dialplan.
    
    * Changes the return value of the directed pickup applications to return
    zero if the pickup failed and nonzero(-1) if the pickup succeeded.
    
    * Made some code optimizations that no longer require re-checking the
    pickup channel to see if it is still available to pickup.
    
    (closes issue #19310)
    Reported by: remiq
    Patches:
          issue19310_v1.8_v2.patch uploaded by rmudgett (license 664)
    Tested by: alecdavis, remiq, rmudgett
    
    Review: https://reviewboard.asterisk.org/r/1221/
  ........
................

Modified:
    team/may/ooh323_ipv6_direct_rtp/   (props changed)
    team/may/ooh323_ipv6_direct_rtp/CHANGES
    team/may/ooh323_ipv6_direct_rtp/apps/app_dial.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_directed_pickup.c
    team/may/ooh323_ipv6_direct_rtp/apps/app_voicemail.c
    team/may/ooh323_ipv6_direct_rtp/cel/cel_odbc.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_dahdi.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_sip.c
    team/may/ooh323_ipv6_direct_rtp/channels/chan_skinny.c
    team/may/ooh323_ipv6_direct_rtp/channels/misdn/isdn_lib.c
    team/may/ooh323_ipv6_direct_rtp/channels/sig_pri.c
    team/may/ooh323_ipv6_direct_rtp/channels/sig_pri.h
    team/may/ooh323_ipv6_direct_rtp/channels/sip/include/sip.h
    team/may/ooh323_ipv6_direct_rtp/configs/chan_dahdi.conf.sample
    team/may/ooh323_ipv6_direct_rtp/configs/sip.conf.sample
    team/may/ooh323_ipv6_direct_rtp/configure
    team/may/ooh323_ipv6_direct_rtp/configure.ac
    team/may/ooh323_ipv6_direct_rtp/contrib/init.d/rc.debian.asterisk
    team/may/ooh323_ipv6_direct_rtp/formats/format_wav.c
    team/may/ooh323_ipv6_direct_rtp/include/asterisk/autoconfig.h.in
    team/may/ooh323_ipv6_direct_rtp/main/ccss.c
    team/may/ooh323_ipv6_direct_rtp/main/dsp.c
    team/may/ooh323_ipv6_direct_rtp/main/features.c
    team/may/ooh323_ipv6_direct_rtp/res/res_fax.c
    team/may/ooh323_ipv6_direct_rtp/res/res_http_post.c

Propchange: team/may/ooh323_ipv6_direct_rtp/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Propchange: team/may/ooh323_ipv6_direct_rtp/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat May 28 04:18:48 2011
@@ -1,1 +1,1 @@
-/trunk:1-313143,313191,313280,313367,313383-313481,313483-313744,313781-313906,313908-313943,313945-315447,315453-316213,316216-316520,316552-319000
+/trunk:1-313143,313191,313280,313367,313383-313481,313483-313744,313781-313906,313908-313943,313945-315447,315453-316213,316216-316520,316552-319000,319024-320000

Modified: team/may/ooh323_ipv6_direct_rtp/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/CHANGES?view=diff&rev=321506&r1=321505&r2=321506
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/CHANGES (original)
+++ team/may/ooh323_ipv6_direct_rtp/CHANGES Sat May 28 04:18:48 2011
@@ -199,6 +199,7 @@
    res_stun_monitor module support in chan_sip.
  * Addition of the 'auth_options_requests' option for turning on and off
    authentication for OPTIONS requests in chan_sip.
+ * Add T38 support for REJECTED state where T.38 Negotiation is explicitly rejected.
 
 
 IAX2 Changes

Modified: team/may/ooh323_ipv6_direct_rtp/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/apps/app_dial.c?view=diff&rev=321506&r1=321505&r2=321506
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/apps/app_dial.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/apps/app_dial.c Sat May 28 04:18:48 2011
@@ -2395,6 +2395,17 @@
 	peer = wait_for_answer(chan, outgoing, &to, peerflags, opt_args, &pa, &num, &result,
 		dtmf_progress, ignore_cc, &forced_clid, &stored_clid);
 
+	/* The ast_channel_datastore_remove() function could fail here if the
+	 * datastore was moved to another channel during a masquerade. If this is
+	 * the case, don't free the datastore here because later, when the channel
+	 * to which the datastore was moved hangs up, it will attempt to free this
+	 * datastore again, causing a crash
+	 */
+	ast_channel_lock(chan);
+	if (!ast_channel_datastore_remove(chan, datastore)) {
+		ast_datastore_free(datastore);
+	}
+	ast_channel_unlock(chan);
 	if (!peer) {
 		if (result) {
 			res = result;

Modified: team/may/ooh323_ipv6_direct_rtp/apps/app_directed_pickup.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/apps/app_directed_pickup.c?view=diff&rev=321506&r1=321505&r2=321506
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/apps/app_directed_pickup.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/apps/app_directed_pickup.c Sat May 28 04:18:48 2011
@@ -158,22 +158,21 @@
 	return ast_channel_callback(pickup_by_name_cb, NULL, &pickup_args, 0);
 }
 
-/*! \brief Attempt to pick up specified channel named , does not use context */
+/*! \brief Attempt to pick up named channel, does not use context */
 static int pickup_by_channel(struct ast_channel *chan, char *pickup)
 {
-	int res = 0;
+	int res = -1;
 	struct ast_channel *target;
 
-	if (!(target = my_ast_get_channel_by_name_locked(pickup))) {
-		return -1;
-	}
-
-	/* Just check that we are not picking up the SAME as target */
-	if (chan != target) {
-		res = ast_do_pickup(chan, target);
-	}
-	ast_channel_unlock(target);
-	target = ast_channel_unref(target);
+	target = my_ast_get_channel_by_name_locked(pickup);
+	if (target) {
+		/* Just check that we are not picking up the SAME as target. (i.e. ourself) */
+		if (chan != target) {
+			res = ast_do_pickup(chan, target);
+		}
+		ast_channel_unlock(target);
+		target = ast_channel_unref(target);
+	}
 
 	return res;
 }
@@ -215,17 +214,16 @@
 	struct ast_channel *c = obj;
 	const char *mark = data;
 	const char *tmp;
-	int res;
 
 	ast_channel_lock(c);
-
-	res = (tmp = pbx_builtin_getvar_helper(c, PICKUPMARK)) &&
-		!strcasecmp(tmp, mark) &&
-		can_pickup(c);
-
+	tmp = pbx_builtin_getvar_helper(c, PICKUPMARK);
+	if (tmp && !strcasecmp(tmp, mark) && can_pickup(c)) {
+		/* Return with the channel still locked on purpose */
+		return CMP_MATCH | CMP_STOP;
+	}
 	ast_channel_unlock(c);
 
-	return res ? CMP_MATCH | CMP_STOP : 0;
+	return 0;
 }
 
 /* Attempt to pick up specified mark */
@@ -234,18 +232,13 @@
 	struct ast_channel *target;
 	int res = -1;
 
-	if (!(target = ast_channel_callback(find_by_mark, NULL, (char *) mark, 0))) {
-		return res;
-	}
-
-	ast_channel_lock(target);
-	if (can_pickup(target)) {
+	/* The found channel is already locked. */
+	target = ast_channel_callback(find_by_mark, NULL, (char *) mark, 0);
+	if (target) {
 		res = ast_do_pickup(chan, target);
-	} else {
-		ast_log(LOG_WARNING, "target has gone, or not ringing anymore for %s\n", chan->name);
-	}
-	ast_channel_unlock(target);
-	target = ast_channel_unref(target);
+		ast_channel_unlock(target);
+		target = ast_channel_unref(target);
+	}
 
 	return res;
 }
@@ -254,14 +247,15 @@
 {
 	struct ast_channel *chan = obj;
 	struct ast_channel *c = data;
-	int i;
 
 	ast_channel_lock(chan);
-	i = (c != chan) && (c->pickupgroup & chan->callgroup) &&
-		can_pickup(chan);
-
+	if (c != chan && (c->pickupgroup & chan->callgroup) && can_pickup(chan)) {
+		/* Return with the channel still locked on purpose */
+		return CMP_MATCH | CMP_STOP;
+	}
 	ast_channel_unlock(chan);
-	return i ? CMP_MATCH | CMP_STOP : 0;
+
+	return 0;
 }
 
 static int pickup_by_group(struct ast_channel *chan)
@@ -269,19 +263,14 @@
 	struct ast_channel *target;
 	int res = -1;
 
-	if (!(target = ast_channel_callback(find_channel_by_group, NULL, chan, 0))) {
-		return res;
-	}
-
-	ast_log(LOG_NOTICE, "%s, pickup attempt by %s\n", target->name, chan->name);
-	ast_channel_lock(target);
-	if (can_pickup(target)) {
+	/* The found channel is already locked. */
+	target = ast_channel_callback(find_channel_by_group, NULL, chan, 0);
+	if (target) {
+		ast_log(LOG_NOTICE, "pickup %s attempt by %s\n", target->name, chan->name);
 		res = ast_do_pickup(chan, target);
-	} else {
-		ast_log(LOG_WARNING, "target has gone, or not ringing anymore for %s\n", chan->name);
-	}
-	ast_channel_unlock(target);
-	target = ast_channel_unref(target);
+		ast_channel_unlock(target);
+		target = ast_channel_unref(target);
+	}
 
 	return res;
 }
@@ -289,13 +278,11 @@
 /* application entry point for Pickup() */
 static int pickup_exec(struct ast_channel *chan, const char *data)
 {
-	int res = 0;
 	char *tmp = ast_strdupa(data);
 	char *exten = NULL, *context = NULL;
 
 	if (ast_strlen_zero(data)) {
-		res = pickup_by_group(chan);
-		return res;
+		return pickup_by_group(chan) ? 0 : -1;
 	}
 
 	/* Parse extension (and context if there) */
@@ -303,16 +290,21 @@
 		if ((context = strchr(exten, '@')))
 			*context++ = '\0';
 		if (!ast_strlen_zero(context) && !strcasecmp(context, PICKUPMARK)) {
-			if (!pickup_by_mark(chan, exten))
-				break;
+			if (!pickup_by_mark(chan, exten)) {
+				/* Pickup successful.  Stop the dialplan this channel is a zombie. */
+				return -1;
+			}
 		} else {
-			if (!pickup_by_exten(chan, exten, !ast_strlen_zero(context) ? context : chan->context))
-				break;
+			if (!pickup_by_exten(chan, exten, !ast_strlen_zero(context) ? context : chan->context)) {
+				/* Pickup successful.  Stop the dialplan this channel is a zombie. */
+				return -1;
+			}
 		}
 		ast_log(LOG_NOTICE, "No target channel found for %s.\n", exten);
 	}
 
-	return res;
+	/* Pickup failed.  Keep going in the dialplan. */
+	return 0;
 }
 
 /* Find channel for pick up specified by partial channel name */ 
@@ -320,16 +312,16 @@
 {
 	struct ast_channel *c = obj; 
 	const char *part = data;
-	int res = 0;
 	int len = strlen(part);
 
 	ast_channel_lock(c);
-	if (len <= strlen(c->name)) {
-		res = !(strncmp(c->name, part, len)) && (can_pickup(c));
+	if (len <= strlen(c->name) && !strncmp(c->name, part, len) && can_pickup(c)) {
+		/* Return with the channel still locked on purpose */
+		return CMP_MATCH | CMP_STOP;
 	}
 	ast_channel_unlock(c);
 
-	return res ? CMP_MATCH | CMP_STOP : 0;
+	return 0;
 }
 
 /* Attempt to pick up specified by partial channel name */ 
@@ -338,13 +330,10 @@
 	struct ast_channel *target;
 	int res = -1;
 
-	if ((target = ast_channel_callback(find_by_part, NULL, (char *) part, 0))) {
-		ast_channel_lock(target);
-		if (can_pickup(target)) {
-			res = ast_do_pickup(chan, target);
-		} else {
-			ast_log(LOG_WARNING, "target has gone, or not ringing anymore for %s\n", chan->name);
-		}
+	/* The found channel is already locked. */
+	target = ast_channel_callback(find_by_part, NULL, (char *) part, 0);
+	if (target) {
+		res = ast_do_pickup(chan, target);
 		ast_channel_unlock(target);
 		target = ast_channel_unref(target);
 	}
@@ -355,7 +344,6 @@
 /* application entry point for PickupChan() */
 static int pickupchan_exec(struct ast_channel *chan, const char *data)
 {
-	int res = 0;
 	int partial_pickup = 0;
 	char *pickup = NULL;
 	char *parse = ast_strdupa(data);
@@ -367,7 +355,8 @@
 
 	if (ast_strlen_zero(args.channel)) {
 		ast_log(LOG_WARNING, "PickupChan requires an argument (channel)!\n");
-		return -1;
+		/* Pickup failed.  Keep going in the dialplan. */
+		return 0;
 	}
 
 	if (!ast_strlen_zero(args.options) && strchr(args.options, 'p')) {
@@ -381,16 +370,19 @@
 		} else {
 			if (partial_pickup) {
 				if (!pickup_by_part(chan, pickup)) {
-					break;
+					/* Pickup successful.  Stop the dialplan this channel is a zombie. */
+					return -1;
 				}
 			} else if (!pickup_by_channel(chan, pickup)) {
-				break;
+				/* Pickup successful.  Stop the dialplan this channel is a zombie. */
+				return -1;
 			}
 			ast_log(LOG_NOTICE, "No target channel found for %s.\n", pickup);
 		}
 	}
 
-	return res;
+	/* Pickup failed.  Keep going in the dialplan. */
+	return 0;
 }
 
 static int unload_module(void)

Modified: team/may/ooh323_ipv6_direct_rtp/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/apps/app_voicemail.c?view=diff&rev=321506&r1=321505&r2=321506
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/apps/app_voicemail.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/apps/app_voicemail.c Sat May 28 04:18:48 2011
@@ -12129,6 +12129,9 @@
 
 		if (ucfg) {	
 			for (cat = ast_category_browse(ucfg, NULL); cat ; cat = ast_category_browse(ucfg, cat)) {
+				if (!strcasecmp(cat, "general")) {
+					continue;
+				}
 				if (!ast_true(ast_config_option(ucfg, cat, "hasvoicemail")))
 					continue;
 				if ((current = find_or_create(userscontext, cat))) {

Modified: team/may/ooh323_ipv6_direct_rtp/cel/cel_odbc.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/cel/cel_odbc.c?view=diff&rev=321506&r1=321505&r2=321506
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/cel/cel_odbc.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/cel/cel_odbc.c Sat May 28 04:18:48 2011
@@ -751,11 +751,15 @@
 
 	free_config();
 	AST_RWLIST_UNLOCK(&odbc_tables);
+	AST_RWLIST_HEAD_DESTROY(&odbc_tables);
+        
 	return 0;
 }
 
 static int load_module(void)
 {
+	AST_RWLIST_HEAD_INIT(&odbc_tables);
+
 	if (AST_RWLIST_WRLOCK(&odbc_tables)) {
 		ast_log(LOG_ERROR, "Unable to lock column list.  Load failed.\n");
 		return 0;

Modified: team/may/ooh323_ipv6_direct_rtp/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/channels/chan_dahdi.c?view=diff&rev=321506&r1=321505&r2=321506
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/channels/chan_dahdi.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/channels/chan_dahdi.c Sat May 28 04:18:48 2011
@@ -12522,6 +12522,9 @@
 #if defined(HAVE_PRI_MCID)
 						pris[span].pri.mcid_send = conf->pri.pri.mcid_send;
 #endif	/* defined(HAVE_PRI_MCID) */
+#if defined(HAVE_PRI_DATETIME_SEND)
+						pris[span].pri.datetime_send = conf->pri.pri.datetime_send;
+#endif	/* defined(HAVE_PRI_DATETIME_SEND) */
 
 						for (x = 0; x < PRI_MAX_TIMERS; x++) {
 							pris[span].pri.pritimers[x] = conf->pri.pri.pritimers[x];
@@ -16811,6 +16814,40 @@
 	return options;
 }
 #endif	/* defined(HAVE_PRI_DISPLAY_TEXT) */
+#endif	/* defined(HAVE_PRI) */
+
+#if defined(HAVE_PRI)
+#if defined(HAVE_PRI_DATETIME_SEND)
+/*!
+ * \internal
+ * \brief Determine the configured date/time send policy option.
+ * \since 1.10
+ *
+ * \param value Configuration value string.
+ *
+ * \return Configured date/time send policy option.
+ */
+static int dahdi_datetime_send_option(const char *value)
+{
+	int option;
+
+	option = PRI_DATE_TIME_SEND_DEFAULT;
+
+	if (ast_false(value)) {
+		option = PRI_DATE_TIME_SEND_NO;
+	} else if (!strcasecmp(value, "date")) {
+		option = PRI_DATE_TIME_SEND_DATE;
+	} else if (!strcasecmp(value, "date_hh")) {
+		option = PRI_DATE_TIME_SEND_DATE_HH;
+	} else if (!strcasecmp(value, "date_hhmm")) {
+		option = PRI_DATE_TIME_SEND_DATE_HHMM;
+	} else if (!strcasecmp(value, "date_hhmmss")) {
+		option = PRI_DATE_TIME_SEND_DATE_HHMMSS;
+	}
+
+	return option;
+}
+#endif	/* defined(HAVE_PRI_DATETIME_SEND) */
 #endif	/* defined(HAVE_PRI) */
 
 /*! process_dahdi() - ignore keyword 'channel' and similar */
@@ -17633,6 +17670,10 @@
 			} else if (!strcasecmp(v->name, "mcid_send")) {
 				confp->pri.pri.mcid_send = ast_true(v->value);
 #endif	/* defined(HAVE_PRI_MCID) */
+#if defined(HAVE_PRI_DATETIME_SEND)
+			} else if (!strcasecmp(v->name, "datetime_send")) {
+				confp->pri.pri.datetime_send = dahdi_datetime_send_option(v->value);
+#endif	/* defined(HAVE_PRI_DATETIME_SEND) */
 #endif /* HAVE_PRI */
 #if defined(HAVE_SS7)
 			} else if (!strcasecmp(v->name, "ss7type")) {

Modified: team/may/ooh323_ipv6_direct_rtp/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/channels/chan_sip.c?view=diff&rev=321506&r1=321505&r2=321506
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/channels/chan_sip.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/channels/chan_sip.c Sat May 28 04:18:48 2011
@@ -2758,7 +2758,7 @@
 	ast_debug(2, "Shutting down thread for %s server\n", tcptls_session->ssl ? "SSL" : "TCP");
 
 cleanup:
-	if (!tcptls_session->client && !authenticated) {
+	if (tcptls_session && !tcptls_session->client && !authenticated) {
 		ast_atomic_fetchadd_int(&unauth_sessions, -1);
 	}
 
@@ -4300,6 +4300,9 @@
 				break;
 			case T38_ENABLED:
 				state = T38_STATE_NEGOTIATED;
+				break;
+			case T38_REJECTED:
+				state = T38_STATE_REJECTED;
 				break;
 			default:
 				state = T38_STATE_UNKNOWN;
@@ -4961,6 +4964,7 @@
 		parameters.request_response = AST_T38_NEGOTIATED;
 		ast_udptl_set_tag(p->udptl, "SIP/%s", p->username);
 		break;
+	case T38_REJECTED:
 	case T38_DISABLED:
 		if (old == T38_ENABLED) {
 			parameters.request_response = AST_T38_TERMINATED;
@@ -6528,11 +6532,11 @@
 	case AST_T38_REQUEST_NEGOTIATE:         /* Request T38 */
 		/* Negotiation can not take place without a valid max_ifp value. */
 		if (!parameters->max_ifp) {
-			change_t38_state(p, T38_DISABLED);
 			if (p->t38.state == T38_PEER_REINVITE) {
 				AST_SCHED_DEL_UNREF(sched, p->t38id, dialog_unref(p, "when you delete the t38id sched, you should dec the refcount for the stored dialog ptr"));
 				transmit_response_reliable(p, "488 Not acceptable here", &p->initreq);
 			}
+			change_t38_state(p, T38_REJECTED);
 			break;
 		} else if (p->t38.state == T38_PEER_REINVITE) {
 			AST_SCHED_DEL_UNREF(sched, p->t38id, dialog_unref(p, "when you delete the t38id sched, you should dec the refcount for the stored dialog ptr"));
@@ -6570,7 +6574,7 @@
 	case AST_T38_REQUEST_TERMINATE:         /* Shutdown T38 */
 		if (p->t38.state == T38_PEER_REINVITE) {
 			AST_SCHED_DEL_UNREF(sched, p->t38id, dialog_unref(p, "when you delete the t38id sched, you should dec the refcount for the stored dialog ptr"));
-			change_t38_state(p, T38_DISABLED);
+			change_t38_state(p, T38_REJECTED);
 			transmit_response_reliable(p, "488 Not acceptable here", &p->initreq);
 		} else if (p->t38.state == T38_ENABLED)
 			transmit_reinvite_with_sdp(p, FALSE, FALSE);
@@ -9141,7 +9145,7 @@
 		}
 	}
 
-	if ((portno == -1) && (p->t38.state != T38_DISABLED)) {
+	if ((portno == -1) && (p->t38.state != T38_DISABLED) && (p->t38.state != T38_REJECTED)) {
 		ast_debug(3, "Have T.38 but no audio, accepting offer anyway\n");
 		res = 0;
 		goto process_sdp_cleanup;
@@ -13394,6 +13398,11 @@
 	if (peer->selfdestruct ||
 	    ast_test_flag(&peer->flags[1], SIP_PAGE2_RTAUTOCLEAR)) {
 		unlink_peer_from_tables(peer);
+	} else if (!ast_sockaddr_isnull(&peer->addr)) {
+		/* If we aren't self-destructing a temp_peer, we still need to unlink the peer
+		 * from the peers_by_ip table, otherwise we end up with multiple copies hanging
+		 * around each time a registration expires and the peer re-registers. */
+		ao2_t_unlink(peers_by_ip, peer, "ao2_unlink of peer from peers_by_ip table");
 	}
 
 	/* Only clear the addr after we check for destruction.  The addr must remain
@@ -13515,6 +13524,18 @@
 	return TRUE;		
 }
 
+/*! \brief parse uri in a way that allows semicolon stripping if legacy mode is enabled */
+static int parse_uri_legacy_check(char *uri, const char *scheme, char **user, char **pass, char **domain, char **transport) {
+	int ret = parse_uri(uri, scheme, user, pass, domain, transport);
+	if (sip_cfg.legacy_useroption_parsing) { /* if legacy mode is active, strip semis from the user field */
+		char *p;
+		if ((p = strchr(uri, (int)';'))) {
+			*p = '\0';
+		}
+	}
+	return ret;
+}
+
 static int __set_address_from_contact(const char *fullcontact, struct ast_sockaddr *addr, int tcp)
 {
 	char *domain, *transport;
@@ -13532,7 +13553,7 @@
 	 * We still need to be able to send to the remote agent through the proxy.
 	 */
 
-	if (parse_uri(contact, "sip:,sips:", &contact, NULL, &domain,
+	if (parse_uri_legacy_check(contact, "sip:,sips:", &contact, NULL, &domain,
 		      &transport)) {
 		ast_log(LOG_WARNING, "Invalid contact uri %s (missing sip: or sips:), attempting to use anyway\n", fullcontact);
 	}
@@ -13661,7 +13682,7 @@
 	ast_string_field_build(pvt, our_contact, "<%s>", curi);
 
 	/* Make sure it's a SIP URL */
-	if (parse_uri(curi, "sip:,sips:", &curi, NULL, &domain, &transport)) {
+	if (parse_uri_legacy_check(curi, "sip:,sips:", &curi, NULL, &domain, &transport)) {
 		ast_log(LOG_NOTICE, "Not a valid SIP contact (missing sip:/sips:) trying to use anyway\n");
 	}
 
@@ -14362,7 +14383,7 @@
 	c = get_in_brackets(tmp);
 	c = remove_uri_parameters(c);
 
-	if (parse_uri(c, "sip:,sips:", &name, &dummy, &domain, NULL)) {
+	if (parse_uri_legacy_check(c, "sip:,sips:", &name, &dummy, &domain, NULL)) {
 		ast_log(LOG_NOTICE, "Invalid to address: '%s' from %s (missing sip:) trying to use anyway...\n", c, ast_sockaddr_stringify_addr(addr));
 		return -1;
 	}
@@ -14943,7 +14964,7 @@
 	
 	uri = ast_strdupa(get_in_brackets(tmp));
 
-	if (parse_uri(uri, "sip:,sips:", &uri, &dummy, &domain, NULL)) {
+	if (parse_uri_legacy_check(uri, "sip:,sips:", &uri, &dummy, &domain, NULL)) {
 		ast_log(LOG_WARNING, "Not a SIP header (%s)?\n", uri);
 		return SIP_GET_DEST_INVALID_URI;
 	}
@@ -14968,7 +14989,7 @@
 	ast_copy_string(tmpf, get_header(req, "From"), sizeof(tmpf));
 	if (!ast_strlen_zero(tmpf)) {
 		from = get_in_brackets(tmpf);
-		if (parse_uri(from, "sip:,sips:", &from, NULL, &domain, NULL)) {
+		if (parse_uri_legacy_check(from, "sip:,sips:", &from, NULL, &domain, NULL)) {
 			ast_log(LOG_WARNING, "Not a SIP header (%s)?\n", from);
 			return SIP_GET_DEST_INVALID_URI;
 		}
@@ -15379,7 +15400,7 @@
 	ast_copy_string(tmp, get_header(req, "Also"), sizeof(tmp));
 	c = get_in_brackets(tmp);
 
-	if (parse_uri(c, "sip:,sips:", &c, NULL, &a, NULL)) {
+	if (parse_uri_legacy_check(c, "sip:,sips:", &c, NULL, &a, NULL)) {
 		ast_log(LOG_WARNING, "Huh?  Not a SIP header in Also: transfer (%s)?\n", c);
 		return -1;
 	}
@@ -15755,7 +15776,7 @@
 	ast_string_field_set(p, from, of);
 
 	/* ignore all fields but name */
-	if (parse_uri(of, "sip:,sips:", &of, &dummy, &domain, NULL)) {
+	if (parse_uri_legacy_check(of, "sip:,sips:", &of, &dummy, &domain, NULL)) {
 		ast_log(LOG_NOTICE, "From address missing 'sip:', using it anyway\n");
 	}
 
@@ -17610,6 +17631,7 @@
 	ast_cli(a->fd, "  Regexten on Qualify:    %s\n", AST_CLI_YESNO(sip_cfg.regextenonqualify));
 	ast_cli(a->fd, "  Trust RPID:             %s\n", AST_CLI_YESNO(ast_test_flag(&global_flags[1], SIP_TRUSTRPID)));
 	ast_cli(a->fd, "  Send RPID:              %s\n", AST_CLI_YESNO(ast_test_flag(&global_flags[1], SIP_SENDRPID)));
+	ast_cli(a->fd, "  Legacy userfield parse: %s\n", AST_CLI_YESNO(sip_cfg.legacy_useroption_parsing));
 	ast_cli(a->fd, "  Caller ID:              %s\n", default_callerid);
 	if ((default_fromdomainport) && (default_fromdomainport != STANDARD_SIP_PORT)) {
 		ast_cli(a->fd, "  From: Domain:           %s:%d\n", default_fromdomain, default_fromdomainport);
@@ -19081,7 +19103,7 @@
 	} else  if (!strcasecmp(data, "peername")) {
 		ast_copy_string(buf, p->peername, len);
 	} else if (!strcasecmp(data, "t38passthrough")) {
-		if (p->t38.state == T38_DISABLED) {
+		if ((p->t38.state == T38_DISABLED) || (p->t38.state == T38_REJECTED)) {
 			ast_copy_string(buf, "0", len);
 		} else { /* T38 is offered or enabled in this call */

[... 1260 lines stripped ...]



More information about the asterisk-commits mailing list