[Pkg-voip-commits] [asterisk] 01/03: Imported Upstream version 11.7.0~dfsg

Jeremy Lainé sharky at moszumanska.debian.org
Wed Dec 18 07:21:41 UTC 2013


This is an automated email from the git hooks/post-receive script.

sharky pushed a commit to branch master
in repository asterisk.

commit b246b969b6479bf47c9db631e305e800887265b1
Author: Jeremy Lainé <jeremy.laine at m4x.org>
Date:   Wed Dec 18 08:16:53 2013 +0100

    Imported Upstream version 11.7.0~dfsg
---
 .version                             |   2 +-
 ChangeLog                            | 620 ++++++++++++++++++++++++++++++++++-
 Makefile                             |   1 +
 UPGRADE.txt                          |  10 +
 apps/app_confbridge.c                |   5 +-
 apps/app_queue.c                     |  39 ++-
 apps/app_sms.c                       |   2 +-
 apps/app_voicemail.c                 |   8 +-
 apps/confbridge/conf_config_parser.c |   6 +-
 apps/confbridge/include/confbridge.h |   1 +
 asterisk-11.6.1-summary.html         |  74 -----
 asterisk-11.6.1-summary.txt          | 104 ------
 asterisk-11.7.0-summary.html         | 457 ++++++++++++++++++++++++++
 asterisk-11.7.0-summary.txt          | 569 ++++++++++++++++++++++++++++++++
 cdr/cdr_adaptive_odbc.c              |  10 +-
 channels/chan_dahdi.c                |  57 +++-
 channels/chan_iax2.c                 |  51 +--
 channels/chan_mgcp.c                 |   8 +-
 channels/chan_sip.c                  | 138 +++++---
 channels/sig_analog.c                |  52 ++-
 channels/sig_ss7.c                   |   9 +-
 channels/sip/include/sip.h           |   1 +
 channels/sip/reqresp_parser.c        |   8 +-
 configs/confbridge.conf.sample       |   3 +
 configs/sip.conf.sample              |   3 +
 configure                            | 119 ++++++-
 configure.ac                         |  16 +-
 doc/astdb2bdb.8                      |  46 +++
 doc/astdb2sqlite3.8                  |  39 +++
 funcs/func_config.c                  |   6 +-
 funcs/func_db.c                      |   2 +-
 funcs/func_env.c                     |   2 +-
 funcs/func_lock.c                    |   2 +-
 funcs/func_math.c                    |   5 +-
 funcs/func_realtime.c                |   2 +-
 funcs/func_shell.c                   |   2 +-
 include/asterisk/pbx.h               |  10 +
 include/asterisk/rtp_engine.h        |   6 +-
 main/app.c                           |   6 +-
 main/asterisk.c                      |   8 +-
 main/astobj2.c                       |   8 +-
 main/channel.c                       |   2 +-
 main/config_options.c                |  28 +-
 main/data.c                          |   5 +-
 main/editline/readline.c             |   7 +-
 main/editline/term.c                 |   6 +-
 main/jitterbuf.c                     |   8 +-
 main/logger.c                        |   3 +-
 main/pbx.c                           |  65 ++--
 main/rtp_engine.c                    |  96 +++---
 main/security_events.c               |   8 +-
 main/tcptls.c                        |   2 +-
 main/test.c                          |   8 +-
 main/translate.c                     |   6 +-
 main/utils.c                         |  22 +-
 res/res_jabber.c                     |   4 +-
 res/res_rtp_asterisk.c               |  71 ++--
 res/res_rtp_multicast.c              |  10 +-
 res/res_xmpp.c                       |   4 +-
 tests/test_dlinklists.c              |   4 +-
 tests/test_linkedlists.c             |   9 +-
 utils/clicompat.c                    |  12 +-
 62 files changed, 2411 insertions(+), 486 deletions(-)

diff --git a/.version b/.version
index 1a31377..308bbae 100644
--- a/.version
+++ b/.version
@@ -1 +1 @@
-11.6.1
+11.7.0
diff --git a/ChangeLog b/ChangeLog
index 8cb9c47..d336a2a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
+2013-12-17  Asterisk Development Team <asteriskteam at digium.com>
+
+	* Asterisk 11.7.0 Released.
+
 2013-12-16  Asterisk Development Team <asteriskteam at digium.com>
 
-	* Asterisk 11.6.1 Released.
+	* Asterisk 11.7.0-rc2 Released.
 
 	* AST-2013-006 - app_sms: BufferOverflow when receiving odd length 16
 	  bit message
@@ -27,6 +31,620 @@
 
 	  (closes issue ASTERISK-22905)
 
+2013-10-28  Asterisk Development Team <asteriskteam at digium.com>
+
+	* Asterisk 11.7.0-rc1 Released.
+
+2013-10-25 23:32 +0000 [r401960-402042]  Scott Griepentrog <sgriepentrog at digium.com>
+
+	* /, include/asterisk/rtp_engine.h, main/rtp_engine.c: rtp_engine:
+	  fix rtp payloads copy and improve argument names In function
+	  ast_rtp_instance_early _bridge_make_compatible the use of
+	  instance 0/1 as arguments doesn't clearly communicate a direction
+	  that the copying of payloads from the source channel to the
+	  destination channel will occur, making it more probable to have
+	  the arguments to ast_rtp_codecs_payloads_copy() put in the
+	  reverse order. This patch renames the arguments with _dst and
+	  _src suffixes and corrects the copy direction. (closes issue
+	  ASTERISK-21464) Reported by: Kevin Stewart Review:
+	  https://reviewboard.asterisk.org/r/2894/ ........ Merged
+	  revisions 402000 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8 Test shows
+	  rtpmap:119 being copied per this change, but is not in sip invite
+
+	* include/asterisk/pbx.h, main/pbx.c, /: pbx.c: fix confused match
+	  caller id that deleted exten still in hash This fixes a bug where
+	  a zero length callerid match adjacent to a no match callerid
+	  extension entry would be deleted together, which then resulted in
+	  hashtable references to free'd memory. A third state of the
+	  matchcid value has been added to indicate match to any extension
+	  which allows enforcing comparison of matchcid on/off without
+	  errors. (closes issue AST-1235) Reported by: Guenther Kelleter
+	  Review: https://reviewboard.asterisk.org/r/2930/ ........ Merged
+	  revisions 401959 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-25 17:29 +0000 [r401896-401935]  Jonathan Rose <jrose at digium.com>
+
+	* /, utils/clicompat.c: Put clicompat-r2.patch back in We've
+	  figured out how to resolve the problems this was causing in
+	  12/trunk, so this can go back in now. (issue ASTERISK-22467)
+	  Reported by: Corey Farrell Patches: clicompat-r2.patch uploaded
+	  by coreyfarrell (license 5909) ........ Merged revisions 401914
+	  from http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+	* utils/clicompat.c, /: revert clicompat-r2.patch from r401704
+	  Patch caused the following build errors against testsuite
+	  https://bamboo.asterisk.org/bamboo/browse/AST-ATRUNKBUILD4-244
+	  (issue ASTERISK-22467) Reported by: Corey Farrell ........ Merged
+	  revisions 401895 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-25 16:05 +0000 [r401833-401884]  Kevin Harwell <kharwell at digium.com>
+
+	* channels/chan_sip.c: chan_sip: Allow a sip peer to accept both
+	  AVP and AVPF calls Adapts the behaviour of avpf to only impact
+	  the format of outgoing calls. For inbound calls, both AVP and
+	  AVPF calls will be accepted regardless of the value of avpf in
+	  the configuration. (closes issue ASTERISK-22005) Reported by:
+	  Torrey Searle Patches: optional_avpf_trunk.patch uploaded by
+	  tsearle (license 5334)
+
+	* main/logger.c: Logging: Logging types ignored after specifying a
+	  verbose level If one specified a verbose level within a logging
+	  facility in logger.conf then any component after it was ignored.
+	  Fixed so all values are correctly read. (closes issue
+	  ASTERISK-22456) Reported by: Kevin Harwell
+
+2013-10-24 20:33 +0000 [r401620-401830]  Jonathan Rose <jrose at digium.com>
+
+	* /, main/utils.c: utils: Fix memory leaks and missed
+	  unregistration of CLI commands on shutdown Final set of patches
+	  in a series of memory leak/cleanup patches by Corey Farrell
+	  (closes issue ASTERISK-22467) Reported by: Corey Farrell Patches:
+	  main-utils-1.8.patch uploaded by coreyfarrell (license 5909)
+	  main-utils-11.patch uploaded by coreyfarrell (license 5909)
+	  main-utils-12up.patch uploaded by coreyfarrell (license 5909)
+	  ........ Merged revisions 401829 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+	* /, tests/test_linkedlists.c: test_linkedlists: Fix memory leak
+	  (issue ASTERISK-22467) Reported by: Corey Farrell Patches:
+	  test_linkedlists-1.8.patch uploaded by coreyfarrell (license
+	  5909) test_linkedlists-11up.patch uploaded by coreyfarrell
+	  (license 5909) ........ Merged revisions 401790 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+	* main/jitterbuf.c, /: jitterbuf: Fix memory leak on jitter buffer
+	  reset (issue ASTERISK-22467) Reported by: Corey Farrell Patches:
+	  jitterbuf-jb_reset-leak-1.8.patch
+	  jitterbuf-jb_reset-leak-11up.patch ........ Merged revisions
+	  401786 from http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+	* /, main/astobj2.c: astobj2: Unregister debug CLI commands at exit
+	  (issue ASTERISK-22467) Reported by: Corey Farrell Patches:
+	  astobj2-clean-debug-cli-1.8-11.patch uploaded by coreyfarrell
+	  (license 5909) astobj2-clean-debug-cli-12up.patch uploaded by
+	  coreyfarrell (license 5909) ........ Merged revisions 401781 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+	* /, apps/app_voicemail.c: app_voicemail: Memory Leaks against
+	  tests (issue ASTERISK-22467) Reported by: Corey Farrell Patches:
+	  app_voicemail-1.8.patch uploaded by coreyfarrell (license 5909)
+	  app_voicemail-11up.patch uploaded by coreyfarrell (license 5909)
+	  ........ Merged revisions 401743 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+	* utils/clicompat.c, channels/chan_dahdi.c, codecs/ilbc/doCPLC.c,
+	  main/data.c, /, main/app.c, main/asterisk.c: memory leaks: Memory
+	  leak cleanup patch by Corey Farrell (second set) Also covers
+	  ast_app_parse_timelen-fail-zero-length.patch, but the patch was
+	  replaced with one of my own. (issue ASTERISK-22467) Reported by:
+	  Corey Farrell Patches: chan_dahdi-cleanup_push.patch uploaded by
+	  coreyfarrell (license 5909) clicompat-r2.patch uploaded by
+	  coreyfarrell (license 5909) codecs-ilbc-doCPLC.patch uploaded by
+	  coreyfarrell (license 5909) data-cleanup-test-registration.patch
+	  uploaded by coreyfarrell (license 5909)
+	  main-asterisk-kill-listener.patch uploaded by coreyfarrell
+	  (license 5909) ........ Merged revisions 401704 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+	* tests/test_dlinklists.c, funcs/func_math.c,
+	  channels/sip/reqresp_parser.c, main/test.c,
+	  main/editline/readline.c, /: memory leaks: Memory leak cleanup
+	  patch by Corey Farrell (first set) (issue ASTERSIK-22467)
+	  Reported by: Corey Farrell Patches:
+	  chan_sip-parse_contact_header_test-free-contacts.patch uploaded
+	  by coreyfarrell (license 5909) cli-filename-completion-leak.patch
+	  uploaded by coreyfarrell (license 5909) func_math.patch uploaded
+	  by corefarrell (license 5909) main-test-cleanup.patch uploaded by
+	  coreyfarrell (license 5909) test_dlinklists.patch uploaded by
+	  coreyfarrell (license 5909) ........ Merged revisions 401660 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+	* res/res_rtp_asterisk.c, /, main/translate.c: res_rtp_asterisk:
+	  Address jittery DTMF events in RTP streams (closes issue
+	  ASTERISK-21170) Reported by: NITESH BANSAL Patches:
+	  dtmf-timestamp.patch uploaded by NITESH BANSAL (license 6418)
+	  Review: https://reviewboard.asterisk.org/r/2938/ ........ Merged
+	  revisions 401619 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-23 16:46 +0000 [r401579]  Richard Mudgett <rmudgett at digium.com>
+
+	* cdr/cdr_adaptive_odbc.c, /: cdr_adaptive_odbc: Also apply a
+	  filter when the CDR value is empty. Extra CDR records are written
+	  if a filtered CDR value is empty because the filter is not
+	  checked. (closes issue ASTERISK-22272) Reported by: Jordi Llull
+	  Chavarria ........ Merged revisions 401577 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-23 15:22 +0000 [r401538]  Kinsey Moore <kmoore at digium.com>
+
+	* channels/chan_mgcp.c, /: chan_mgcp: Properly handle malformed
+	  media lines This corrects a situation in which a media line was
+	  not parsed properly and resulted in a crash. (closes issue
+	  ASTERISK-21190) Reported by: adomjan Patches:
+	  chan_mgcp.c-sscnaf_fix uploaded by adomjan (License 5448)
+	  ........ Merged revisions 401537 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-23 11:11 +0000 [r401498]  Joshua Colp <jcolp at digium.com>
+
+	* /, channels/chan_sip.c: Fix an issue where an incompatible audio
+	  format may be added to SDP. If preferred codecs included any
+	  non-audio format the code would mistakenly add the audio format,
+	  even if it was not a joint capability with the remote side.
+	  (closes issue ASTERISK-21131) Reported by: nbougues Patches:
+	  patch_unsupported_codec_1.8.patch uploaded by nbougues (license
+	  6470) ........ Merged revisions 401497 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-22 22:42 +0000 [r401446]  Matthew Jordan <mjordan at digium.com>
+
+	* res/res_rtp_asterisk.c, /: res_rtp_asterisk: Fix crash when RTCP
+	  is not available during SSRC change In r400089, a patch was put
+	  in to correct erroneous RTCP statistic resets. Unfortunately,
+	  ast_rtp_read can be called on an RTP instance that does not have
+	  RTCP information. This patch prevents that crash by only
+	  resetting the statistics if we do actually have an RTCP instance.
+	  (issue AST-1174) (closes issue ASTERISK-22667) Reported by: John
+	  Bigelow ........ Merged revisions 401445 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-22 19:02 +0000 [r401379-401433]  Richard Mudgett <rmudgett at digium.com>
+
+	* apps/app_queue.c: app_queue: Fix CLI "queue remove member"
+	  queue_log entry. The queue_log entry resulting from CLI "queue
+	  remove member" when log_membername_as_agent is enabled is wrong.
+	  It always uses the interface name instead of the member name in
+	  the queue_log entry. * Get the queue member before removing it
+	  from the queue so the member name is available for the queue_log
+	  entry. (closes issue ASTERISK-21826) Reported by: Oscar Esteve
+	  Patches: fix_membername.diff (license #6505) patch uploaded by
+	  Oscar Esteve (modified to fix potential ref leak)
+
+	* channels/sig_analog.c, /: chan_dahdi: Fix unable to get index
+	  warning when transferring an analog call. Transferring an analog
+	  call using flashhooks generated an unable to get index WARNING
+	  message when the transfer is completed. * Removed unnecessary
+	  analog subchannel shell games when transferring a call using
+	  flashhooks. Thanks to Tzafrir Cohen for mentioning this in a
+	  comment on issue ASTERISK-22720. ........ Merged revisions 401378
+	  from http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-21 19:46 +0000 [r401326]  Kevin Harwell <kharwell at digium.com>
+
+	* main/editline/term.c, /: Segfault in LIBEDIT_INTERNAL after
+	  tgetstr(), when libncurses5-dev isn't installed Include the
+	  appropriate declarations when not using termcap, but term+curses
+	  and [n]curses do not exist. (closes issue ASTERISK-22351)
+	  Reported by: A. Iglesias Patches:
+	  issueA22351_libedit_internal_without_ncurses_dev.patch uploaded
+	  by wdoekes (license 5674) ........ Merged revisions 401325 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-18 15:11 +0000 [r401182]  Michael L. Young <elgueromexicano at gmail.com>
+
+	* channels/chan_sip.c: Remove Port Restriction When Checking For
+	  NAT When trying to determine if a peer is behind NAT, we should
+	  not be using the ports when comparing addresses. This patch
+	  removes the port from being checked and just useds the addresses
+	  now. (closes issue ASTERISK-22729) Reported by: Michael L. Young
+	  Tested by: Michael L. Young Patches:
+	  asterisk-remove-using-port-for-nat-check.diff uploaded by Michael
+	  L. Young (license 5026) Review:
+	  https://reviewboard.asterisk.org/r/2927/
+
+2013-10-18 14:43 +0000 [r401179]  Walter Doekes <walter+asterisk at wjd.nu>
+
+	* main/channel.c, /: Properly copy/remove the device state cache
+	  flag over a masquerade. In r378303 the
+	  AST_FLAG_DISABLE_DEVSTATE_CACHE flag was added that tells the
+	  devstate system to not cache states for non-real devices.
+	  However, when optimizing away channels (ast_do_masquerade), that
+	  flag wasn't copied. In my case, using Local devices as queue
+	  members created a situation where the endpoint was considered in
+	  use, but the state change of the device being available again was
+	  ignored (not cached). The endpoint channel was optimized into the
+	  (previously) Local channel, but kept the do-not-cache flag. The
+	  end result being that the queue member apparently stayed in use
+	  forever. (closes issue ASTERISK-22718) Reported by: Walter Doekes
+	  Review: https://reviewboard.asterisk.org/r/2925/ ........ Merged
+	  revisions 401178 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-17 20:32 +0000 [r401167]  Michael L. Young <elgueromexicano at gmail.com>
+
+	* channels/chan_sip.c: Fix Setting A chan_sip Dialog's
+	  SIP_NAT_FORCE_RPORT Flag A condition was added in a commit to fix
+	  ASTERISK-21374, that, if the SIP_PAGE3_NAT_AUTO_RPORT flag was
+	  set, to then copy a peer's SIP_NAT_FORCE_RPORT flag to the
+	  dialog. This condition should not have been there since it
+	  assumed that if Asterisk is in an environment where NAT is
+	  involved, that the auto_* nat settings or force_rport setting
+	  would be on in the global settings. If the nat setting in the
+	  global setting is set to 'nat=no' and then turned on for peers
+	  (which is not quite the recommended way, although it is allowed)
+	  this flag is never copied to the dialog resulting in problems
+	  like, REGISTER replies going to the wrong port. This patch
+	  removes this conditional check and will now always use the peer's
+	  flag which by this point in the code the checks on whether the
+	  peer is behind NAT or not (if using auto_force_rport) have
+	  already been run. (closes issue ASTERISK-22236) Reported by:
+	  Filip Frank Tested by: Michael L. Young Patches:
+	  asterisk-2236-always-set-rport.diff uploaded by Michael L. Young
+	  (license 5026) Review: https://reviewboard.asterisk.org/r/2919/
+
+2013-10-17 15:36 +0000 [r401120]  Kinsey Moore <kmoore at digium.com>
+
+	* /, res/res_xmpp.c, res/res_jabber.c: Reduce log level of a
+	  non-pubsub error message Drop an error log message to debug level
+	  1 since distributed device state functions correctly when
+	  receiving this message and it spams the logs. (closes issue
+	  ASTERISK-22410) Reported by: abelbeck Patches:
+	  asterisk-1.8-res_jabber-log-nonpubsub-error-to-debug.patch
+	  uploaded by abelbeck (License 5903)
+	  asterisk-11-res_xmpp-log-nonpubsub-error-to-debug.patch uploaded
+	  by abelbeck (License 5903) ........ Merged revisions 401119 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-16 11:52 +0000 [r401076]  Walter Doekes <walter+asterisk at wjd.nu>
+
+	* apps/app_queue.c, /: Don't check all realtime queues when doing
+	  "queue show some_queue". When using realtime queues, queues have
+	  to be fetched from the database every now and then to see if any
+	  info has been changed or to see if the queue has been removed.
+	  When fetching info for an individual queue, the pruning of other
+	  queues is unnecessarily costly. Review:
+	  https://reviewboard.asterisk.org/r/2907/ ........ Merged
+	  revisions 401049 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-15 19:57 +0000 [r401016]  Richard Mudgett <rmudgett at digium.com>
+
+	* channels/chan_iax2.c: chan_iax2: Fix channel left locked in off
+	  nominal code path.
+
+2013-10-15 14:58 +0000 [r400971]  Mark Michelson <mmichelson at digium.com>
+
+	* /, channels/chan_sip.c: Prevent chan_sip from sending duplicate
+	  BYEs. When a 200 OK for an initial INVITE is received, we were
+	  doing the right thing by ACKing and sending an immediate BYE.
+	  However, we also were doing the wrong thing and queuing an answer
+	  frame, thus causing the call to be answered. This would cause the
+	  call to be hung up by the channel thread, thus resulting in a
+	  second BYE being sent out. In this fix, I also have set the
+	  hangupcause to be correct since the initial BYE being sent by
+	  Asterisk had an unknown hangup cause. I have changed to using
+	  "Bearer capabilty not available" since the call was hung up due
+	  to an SDP offer/answer error. (closes issue ASTERISK-22621)
+	  reported by Kinsey Moore ........ Merged revisions 400970 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-14 21:44 +0000 [r400909]  Richard Mudgett <rmudgett at digium.com>
+
+	* channels/chan_dahdi.c, /: chan_dahdi: Reflect the set software
+	  gain in the CLI "dahdi show channel" output. * Remember the
+	  swgain setting from CLI "dahdi set swgain" command so the CLI
+	  "dahdi show channel" output will reflect the current setting. *
+	  Updated CLI "dahdi set hwgain" and "dahdi set swgain"
+	  documentation. (issue ASTERISK-22429) Reported by: Jaco Kroon
+	  Patches: jira_asterisk_22429_v1.8_v2.patch (license #5621) patch
+	  uploaded by rmudgett ........ Merged revisions 400907 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-14 21:42 +0000 [r400908]  Mark Michelson <mmichelson at digium.com>
+
+	* /, channels/chan_sip.c: Do not increment the SDP version between
+	  183 and 200 responses. Bumping the SDP version number can cause
+	  interoperability problems since receivers of the responses will
+	  expect that a 200 SDP will be identical to a previous 183 SDP.
+	  (closes issue ASTERISK-21204) reported by NITESH BANSAL Patches:
+	  dont-increment-session-version-in-2xx-after-183.patch uploaded by
+	  NITESH BANSAL (License #6418) ........ Merged revisions 400906
+	  from http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-08 22:27 +0000 [r400768]  Kinsey Moore <kmoore at digium.com>
+
+	* /, configure, configure.ac: Add warning when compiling with iODBC
+	  support When running configure, libiodbc2 development headers
+	  will fulfill the requirement for ODBC development headers, but
+	  will not function properly. This adds a warning when libiodbc2
+	  development headers are detected instead of unixodbc development
+	  headers. (closes issue ASTERISK-22459) Reported by: Patrick
+	  Maille Tested by: Walter Doekes Patches:
+	  issueA22459_warn_when_using_iodbc.patch uploaded by Walter Doekes
+	  (License 5674) ........ Merged revisions 400767 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-08 20:14 +0000 [r400723-400741]  Richard Mudgett <rmudgett at digium.com>
+
+	* UPGRADE.txt, apps/app_confbridge.c,
+	  apps/confbridge/conf_config_parser.c,
+	  configs/confbridge.conf.sample,
+	  apps/confbridge/include/confbridge.h: app_confbridge: Can now set
+	  the language used for announcements to the conference. ConfBridge
+	  now has the ability to set the language of announcements to the
+	  conference. The language can be set on a bridge profile in
+	  confbridge.conf or by the dialplan function
+	  CONFBRIDGE(bridge,language)=en. (closes issue ASTERISK-19983)
+	  Reported by: Jonathan White Patches: M19983_rev2.diff (license
+	  #5138) patch uploaded by junky (modified) Tested by: rmudgett
+
+	* apps/confbridge/conf_config_parser.c: app_confbridge: Fix
+	  duplicate default_user profile. * Fixed looking in the wrong
+	  profiles container to see if the default_user profile is already
+	  created in verify_default_profiles(). The bridge profile
+	  container is never going to hold user profiles. :)
+
+2013-10-08 18:18 +0000 [r400681-400697]  Kinsey Moore <kmoore at digium.com>
+
+	* funcs/func_config.c, /: Fix func_config list entry allocation The
+	  AST_CONFIG dialplan function defined in func_config.c allocates
+	  its config file list entries using ast_malloc. List entry
+	  allocations destined for use with Asterisk's linked list API must
+	  be ast_calloc()d or otherwise initialized so that list pointers
+	  are set to NULL. These uses of ast_malloc have been replaced by
+	  ast_calloc to prevent dereferencing of uninitialized pointer
+	  values when traversing the list. (closes issue ASTERISK-22483)
+	  Reported by: Brian Scott ........ Merged revisions 400694 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+	* res/res_rtp_asterisk.c: Fix STUN crash when using IPv6 any
+	  address Ensure that when chan_sip binds to the IPv6 any address
+	  ([::]), IPv4 candidates are also added. (closes issue
+	  ASTERISK-21917) Reported by: Torrey Searle Patches:
+	  0023_ipv6_stun_crash.patch uploaded by Torrey Searle (License
+	  5334)
+
+2013-10-06 17:09 +0000 [r400623]  Michael L. Young <elgueromexicano at gmail.com>
+
+	* apps/app_queue.c, /: Fix Regression With Queuelog EXITWITHKEY
+	  Only Logging Two Out Of Four Fields Commit r62462 added two extra
+	  fields for logging "the original position the caller entered the
+	  queue at, and the amount of time the caller was waiting in the
+	  queue." But when r75969 was merged from 1.4 into trunk (r75977),
+	  these two fields disappeared. Those two extra fields were not
+	  logged in 1.4 and when the patch was merged, those fields went
+	  away. Therefore, this is a regression and was caught by the
+	  reporter because he was reading the awesome "Asterisk: The
+	  Definitive Guide" book. (closes issue ASTERISK-22197) Reported
+	  by: Dalius M. Tested by: Dalius M. Patches:
+	  asterisk-22197-q-log-exitwithkey.diff uploaded by Michael L.
+	  Young (license 5026) Review:
+	  https://reviewboard.asterisk.org/r/2901/ ........ Merged
+	  revisions 400622 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-03 22:59 +0000 [r400470]  Jonathan Rose <jrose at digium.com>
+
+	* /, channels/chan_sip.c: chan_sip: Don't ignore expires value in
+	  contact header if it lacks semicolon (closes issue
+	  ASTERISK-22574) Reported by: Filip Jenicek Patches:
+	  chan_sip_expires.patch uploaded by Filip Jenicek (license 6277)
+	  ........ Merged revisions 400469 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-03 19:22 +0000 [r400394-400421]  Kinsey Moore <kmoore at digium.com>
+
+	* main/security_events.c: Fix security events for AMI invalid
+	  password In r337595, additional security events were added for
+	  chan_sip authentication failures. The new IEs added to the
+	  existing invalid password event were defined as required IEs, but
+	  existing users of the event did not set the new IEs and could not
+	  since they didn't apply to existing uses. They are now marked as
+	  optional IEs. (closes issue ASTERISK-22578) Reported by: Matt
+	  Jordan
+
+	* res/res_rtp_multicast.c, /: Ensure res_rtp_mutlicast sets SSRC
+	  properly This fixes a bug where the SSRC field on multicast RTP
+	  can be stuck at 0 which can cause problems for endpoints trying
+	  to make sense of incoming streams. (closes issue ASTERISK-22567)
+	  Reported by: Simone Camporeale Patches:
+	  22567_res_mulitcast_ssrc.patch uploaded by Simone Camporeale
+	  (License 6536) ........ Merged revisions 400393 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-02 21:31 +0000 [r400315]  Michael L. Young <elgueromexicano at gmail.com>
+
+	* /, channels/chan_iax2.c: Cast Integer Argument To Unsigned Char
+	  The member reg in the peercnt structure is an unsigned char and
+	  peercnt_modify() is expecting an unsigned char argument which
+	  gets assigned to peercnt->reg. This patch fixes that by casting
+	  the integer argument being passed to peercnt_modify to unsigned
+	  char. ........ Merged revisions 400314 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-10-02 17:36 +0000 [r400279]  Tzafrir Cohen <tzafrir.cohen at xorcom.com>
+
+	* Makefile, doc/astdb2sqlite3.8 (added), doc/astdb2bdb.8 (added):
+	  man pages for astdb2bdb and astdb2sqlite3 Review:
+	  https://reviewboard.asterisk.org/r/2898/
+
+2013-09-30 15:26 +0000 [r400140]  Kinsey Moore <kmoore at digium.com>
+
+	* UPGRADE.txt, configs/sip.conf.sample, /, channels/chan_sip.c:
+	  Allow Asterisk to retry after 403 on register This adds a global
+	  option in chan_sip to allow it to continue attempting
+	  registration if a 403 is received, clearing the cached nonce and
+	  treating it as a non-fatal response. Normally, this would cause
+	  registration attempts to that endpoint to stop. (closes issue
+	  ASTERISK-17138) Review: https://reviewboard.asterisk.org/r/2874/
+	  Reported by: Rudi ........ Merged revisions 400137 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-09-28 22:21 +0000 [r400075-400093]  Matthew Jordan <mjordan at digium.com>
+
+	* res/res_rtp_asterisk.c, /: res_rtp_asterisk: Correct erroneous
+	  lost packet information in RTCP reports RTCP's calculation of the
+	  number of lost packets in an RTP stream is based on that stream's
+	  sequence number count, the number of received packets, and how
+	  many packets we expect to receive. When the SSRC for an RTP
+	  stream changes, there can - and almost always will be - a large
+	  jump in the next packet's timestamp and sequence number. If we
+	  don't reset the number of received packets, sequence number
+	  count, and other metrics used by RTCP, the next RR/SR report will
+	  use the previous SSRC's values to calculate the lost packet count
+	  for the new SSRC - resulting in a very large number of lost
+	  packets. This patch modifies res_rtp_asterisk such that, if it
+	  detects a SSRC change, it will reset the various values used by
+	  the RTCP calculations. From the perspective of RTCP, this appears
+	  as a new media stream - which is what it is. Review:
+	  https://reviewboard.asterisk.org/r/2886/ (closes issue AST-1174)
+	  Reported by: Thomas Arimont ........ Merged revisions 400089 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+	* /, configure, configure.ac: Add check for openSUSE when detecting
+	  bfd library In ASTERISK-17842, some additional library checks
+	  were added to the configure script so that the bfd library could
+	  be found on CentOS and Fedora systems. As it turns out, openSUSE
+	  requires an additional library. This patch adds another check to
+	  the configure script for openSUSE that will add that library.
+	  Review: https://reviewboard.asterisk.org/r/2885/ (closes issue
+	  AST-1169) Reported by: Guenther Kelleter ........ Merged
+	  revisions 400073 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-09-27 21:35 +0000 [r400014]  Richard Mudgett <rmudgett at digium.com>
+
+	* /, channels/chan_sip.c, channels/sip/reqresp_parser.c: chan_sip:
+	  Increase some scratch buffer sizes dealing with caller id. *
+	  Eliminated an unnecessary initialization in check_user_full().
+	  (closes issue ASTERISK-22477) Reported by: Michael Shepelev
+	  ........ Merged revisions 400013 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-09-27 17:24 +0000 [r399962]  Jonathan Rose <jrose at digium.com>
+
+	* /, channels/chan_sip.c, channels/sip/include/sip.h: chan_sip:
+	  Reject calls on 200 OKs if no SDP has been received When Asterisk
+	  receives a 200 OK in response to an invite, that peer should have
+	  sent an SDP at some point by then. If the channel has never
+	  received an SDP, media won't have been set and the remote address
+	  won't be known. Endpoints in general should not be doing this.
+	  This patch makes it so that Asterisk will simply hang up a call
+	  if it sends a 200 OK at this point. So far this odd behavior for
+	  endpoints has only been observed in tests which involved manually
+	  created SIP transactions in SIPp. (closes issue ASTERISK-22424)
+	  Reported by: Jonathan Rose Review:
+	  https://reviewboard.asterisk.org/r/2827/ ........ Merged
+	  revisions 399939 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-09-25 20:28 +0000 [r399834]  Richard Mudgett <rmudgett at digium.com>
+
+	* channels/sig_ss7.c, channels/chan_dahdi.c, /: chan_dahdi: CLI
+	  "core stop gracefully" has needless delay for PRI and SS7. The
+	  PRI and SS7 link control threads are not stopped correctly when
+	  the chan_dahdi.so module is unloaded. The link control threads
+	  pri_dchannel() and ss7_linkset() are not awakened from a poll()
+	  to cancel the thread. * Added a SIGURG signal after requesting
+	  the thread cancel to break the link control thread poll()
+	  immediately. For SS7 it was slightly worse, the link poll()
+	  timeout would always be whatever was the last libss7 scheduled
+	  event time used. If no libss7 scheduled event was pending, the
+	  thread could run more often than necessary. * Set nextms to 60
+	  seconds for the ss7_linkset() poll() if there is no other libss7
+	  scheduled event. ........ Merged revisions 399818 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-09-25 19:27 +0000 [r399795]  Michael L. Young <elgueromexicano at gmail.com>
+
+	* /, channels/chan_sip.c: Fix Realtime Peer Update Problem When
+	  Un-registering And Expires Header In 200ok 1st Issue When a
+	  realtime peer sends an un-REGISTER request, Asterisk un-registers
+	  the peer but the database table record still has regseconds and
+	  fullcontact for the peer. This results in calls attempting to be
+	  routed to the peer which is no longer registered. The expected
+	  behavior is to get busy/congested when attempting to call an
+	  un-registered peer through the dialplan. What was discovered is
+	  that we are clearing out the peer's registration in the database
+	  in parse_register_contact() when calling expire_register() but
+	  then upon returning from parse_register_contact(), update_peer()
+	  is run which stores back in the database table regseconds and
+	  fullcontact. 2nd Issue The reporter pointed out that the 200 ok
+	  being returned by Asterisk after un-registering a peer contains a
+	  Contact header with ;expires= and the Expires header is not set
+	  to 0. This is actually a regression. Tests were created for this
+	  second issue (ASTERISK-22548). The tests have been reviewed and a
+	  Ship It! was received on those tests. This patch does the
+	  following: * Do not ignore the Expires header value even when it
+	  is set to 0. The patch sets the pvt->expiry earlier on in the
+	  function so that it is set properly and used. * If pvt->expiry is
+	  0, do not call update_peer since that means the peer has already
+	  been un-registered and there is no need to update the database
+	  record again since nothing has changed. (closes issue
+	  ASTERISK-22428) Reported by: Ben Smithurst Tested by: Ben
+	  Smithurst, Michael L. Young Patches:
+	  asterisk-22428-rt-peer-update-and-expires-header.diff by Michael
+	  L. Young (license 5026) Review:
+	  https://reviewboard.asterisk.org/r/2869/ ........ Merged
+	  revisions 399794 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-09-24 20:20 +0000 [r399708]  Richard Mudgett <rmudgett at digium.com>
+
+	* /, channels/chan_iax2.c: chan_iax2: Prevent some needless
+	  breaking of the native IAX2 bridge. * Clean up some twisted code
+	  in the iax2_bridge() loop. * Add AST_CONTROL_VIDUPDATE and
+	  AST_CONTROL_SRCCHANGE to a list of frames to prevent the native
+	  bridge loop from breaking. * Passing the
+	  AST_CONTROL_T38_PARAMETERS frame should also allow FAX over a
+	  native IAX2 bridge. (issue ABE-2912) Review:
+	  https://reviewboard.asterisk.org/r/2870/ ........ Merged
+	  revisions 399697 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
+2013-09-20 22:35 +0000 [r399564]  Kinsey Moore <kmoore at digium.com>
+
+	* main/config_options.c: Ensure global types in the config
+	  framework are initialized If a config object was allocated but
+	  one of its global objects was never encountered, then the global
+	  object's defaults were never applied. Ensure that global objects
+	  are initialized properly upon allocation instead of on
+	  configuration. Review: https://reviewboard.asterisk.org/r/2866/
+
+2013-09-20 14:23 +0000 [r399513]  Kevin Harwell <kharwell at digium.com>
+
+	* main/logger.c: Fix memory leak in logger. Fixed a memory leak
+	  discovered in the logger where a temporary string buffer was not
+	  being freed. (closes issue ASTERISK-22540) Reported by: John
+	  Hardin
+
+2013-09-19 16:45 +0000 [r399457]  Jonathan Rose <jrose at digium.com>
+
+	* /, channels/chan_sip.c: chan_sip: Make direct media reinvites for
+	  T38 put Asterisk in the media path Prior to this patch, Asterisk
+	  would incorrectly use the previous endpoint addresses in SDP in
+	  spite of providing its own port. T38 is never meant to be done
+	  through directmedia and Asterisk should always be in the media
+	  path for these streams. (closes issue ASTERISK-17273) Reported
+	  by: Kevin Stewart (closes issue ASTERISK-18706) Reported by:
+	  Jeremy Kister Review: https://reviewboard.asterisk.org/r/2853/
+	  ........ Merged revisions 399456 from
+	  http://svn.asterisk.org/svn/asterisk/branches/1.8
+
 2013-10-21  Asterisk Development Team <asteriskteam at digium.com>
 
 	* Asterisk 11.6.0 Released.
diff --git a/Makefile b/Makefile
index 8082bc0..9686725 100644
--- a/Makefile
+++ b/Makefile
@@ -564,6 +564,7 @@ bininstall: _all installdirs $(SUBDIRS_INSTALL) main-bininstall
 	$(INSTALL) -m 644 doc/core-*.xml "$(DESTDIR)$(ASTDATADIR)/documentation"
 	$(INSTALL) -m 644 doc/appdocsxml.dtd "$(DESTDIR)$(ASTDATADIR)/documentation"
 	$(INSTALL) -m 644 doc/asterisk.8 "$(DESTDIR)$(ASTMANDIR)/man8"
+	$(INSTALL) -m 644 doc/astdb*.8 "$(DESTDIR)$(ASTMANDIR)/man8"
 	$(INSTALL) -m 644 contrib/scripts/astgenkey.8 "$(DESTDIR)$(ASTMANDIR)/man8"
 	$(INSTALL) -m 644 contrib/scripts/autosupport.8 "$(DESTDIR)$(ASTMANDIR)/man8"
 	$(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 "$(DESTDIR)$(ASTMANDIR)/man8"
diff --git a/UPGRADE.txt b/UPGRADE.txt
index 3da1bd9..22bcbf2 100644
--- a/UPGRADE.txt
+++ b/UPGRADE.txt
@@ -19,6 +19,13 @@
 === UPGRADE-10.txt -- Upgrade info for 1.8 to 10
 ===
 ===========================================================
+
+From 11.6 to 11.7:
+ConfBridge
+ - ConfBridge now has the ability to set the language of announcements to the
+   conference.  The language can be set on a bridge profile in confbridge.conf
+   or by the dialplan function CONFBRIDGE(bridge,language)=en.
+
 * Certain dialplan functions have been marked as 'dangerous', and may only be
   executed from the dialplan. Execution from extenal sources (AMI's GetVar and
   SetVar actions; etc.) may be inhibited by setting live_dangerously in the
@@ -34,6 +41,9 @@ From 11.5 to 11.6:
   returning RESULT_SUCCESS even if there was an error.
 * The libuuid development library is now optional for res_rtp_asterisk. If the
   library is not present when building ICE and TURN support will not be present.
+* The option "register_retry_403" has been added to chan_sip to work around
+  servers that are known to erroneously send 403 in response to valid
+  REGISTER requests and allows Asterisk to continue attepmting to connect.
 
 From 11.4 to 11.5:
 * The default settings for chan_sip are now overriden properly by the general
diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c
index 9f01eb2..7f0c120 100644
--- a/apps/app_confbridge.c
+++ b/apps/app_confbridge.c
@@ -34,7 +34,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 391700 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 400741 $")
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -1342,6 +1342,9 @@ static int alloc_playback_chan(struct conference_bridge *conference_bridge)
 
 	ast_channel_internal_bridge_set(conference_bridge->playback_chan, conference_bridge->bridge);
 
+	/* To make sure playback_chan has the same language of that profile */
+	ast_channel_language_set(conference_bridge->playback_chan, conference_bridge->b_profile.language);
+
 	if (ast_call(conference_bridge->playback_chan, "", 0)) {
 		ast_hangup(conference_bridge->playback_chan);
 		conference_bridge->playback_chan = NULL;
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 11d18f9..4eabc2d 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -63,7 +63,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398885 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401433 $")
 
 #include <sys/time.h>
 #include <sys/signal.h>
@@ -7192,7 +7192,7 @@ stop:
 			}
 		} else if (qe.valid_digits) {
 			ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "EXITWITHKEY",
-				"%s|%d", qe.digits, qe.pos);
+				"%s|%d|%d|%ld", qe.digits, qe.pos, qe.opos, (long) time(NULL) - qe.start);
 		}
 	}
 
@@ -8253,9 +8253,10 @@ static char *__queues_show(struct mansession *s, int fd, int argc, const char *
 		ao2_lock(q);
 		/* This check is to make sure we don't print information for realtime
 		 * queues which have been deleted from realtime but which have not yet
-		 * been deleted from the in-core container
+		 * been deleted from the in-core container. Only do this if we're not
+		 * looking for a specific queue.
 		 */
-		if (q->realtime) {
+		if (argc < 3 && q->realtime) {
 			realtime_queue = find_load_queue_rt_friendly(q->name);
 			if (!realtime_queue) {
 				ao2_unlock(q);
@@ -9134,6 +9135,7 @@ static char *handle_queue_remove_member(struct ast_cli_entry *e, int cmd, struct
 {
 	const char *queuename, *interface;
 	struct member *mem = NULL;
+	char *res = CLI_FAILURE;
 
 	switch (cmd) {
 	case CLI_INIT:
@@ -9155,36 +9157,39 @@ static char *handle_queue_remove_member(struct ast_cli_entry *e, int cmd, struct
 	queuename = a->argv[5];
 	interface = a->argv[3];
 
+	if (log_membername_as_agent) {
+		mem = find_member_by_queuename_and_interface(queuename, interface);
+	}
+
 	switch (remove_from_queue(queuename, interface)) {
 	case RES_OKAY:
-		if (log_membername_as_agent) {
-			mem = find_member_by_queuename_and_interface(queuename, interface);
-		}
 		if (!mem || ast_strlen_zero(mem->membername)) {
 			ast_queue_log(queuename, "CLI", interface, "REMOVEMEMBER", "%s", "");
 		} else {
 			ast_queue_log(queuename, "CLI", mem->membername, "REMOVEMEMBER", "%s", "");
 		}
-		if (mem) {
-			ao2_ref(mem, -1);
-		}
 		ast_cli(a->fd, "Removed interface %s from queue '%s'\n", interface, queuename);
-		return CLI_SUCCESS;
+		res = CLI_SUCCESS;
+		break;
 	case RES_EXISTS:
 		ast_cli(a->fd, "Unable to remove interface '%s' from queue '%s': Not there\n", interface, queuename);
-		return CLI_FAILURE;
+		break;
 	case RES_NOSUCHQUEUE:
 		ast_cli(a->fd, "Unable to remove interface from queue '%s': No such queue\n", queuename);
-		return CLI_FAILURE;
+		break;
 	case RES_OUTOFMEMORY:
 		ast_cli(a->fd, "Out of memory\n");
-		return CLI_FAILURE;
+		break;
 	case RES_NOT_DYNAMIC:
 		ast_cli(a->fd, "Unable to remove interface '%s' from queue '%s': Member is not dynamic\n", interface, queuename);
-		return CLI_FAILURE;
-	default:
-		return CLI_FAILURE;
+		break;
 	}
+
+	if (mem) {
+		ao2_ref(mem, -1);
+	}
+
+	return res;
 }
 
 static char *complete_queue_pause_member(const char *line, const char *word, int pos, int state)
diff --git a/apps/app_sms.c b/apps/app_sms.c
index f943e2f..9f95672 100644
--- a/apps/app_sms.c
+++ b/apps/app_sms.c
@@ -40,7 +40,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403974 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403978 $")
 
 #include <dirent.h>
 #include <ctype.h>
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index fcad6a8..865f3dd 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -91,7 +91,7 @@
 #endif
 #endif
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398281 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401744 $")
 
 #include "asterisk/paths.h"	/* use ast_config_AST_SPOOL_DIR */
 #include <sys/time.h>
@@ -11994,6 +11994,7 @@ static int acf_mailbox_exists(struct ast_channel *chan, const char *cmd, char *a
 
 static int acf_vm_info(struct ast_channel *chan, const char *cmd, char *args, char *buf, size_t len)
 {
+	struct ast_vm_user svm;
 	struct ast_vm_user *vmu = NULL;
 	char *tmp, *mailbox, *context, *parse;
 	int res = 0;
@@ -12027,7 +12028,7 @@ static int acf_vm_info(struct ast_channel *chan, const char *cmd, char *args, ch
 		 context = "default";
 	}
 
-	vmu = find_user(NULL, context, mailbox);
+	vmu = find_user(&svm, context, mailbox);
 
 	if (!strncasecmp(arg.attribute, "exists", 5)) {
 		ast_copy_string(buf, vmu ? "1" : "0", len);
@@ -13752,6 +13753,7 @@ AST_TEST_DEFINE(test_voicemail_msgcount)
 {
 	int i, j, res = AST_TEST_PASS, syserr;
 	struct ast_vm_user *vmu;
+	struct ast_vm_user svm;
 	struct vm_state vms;
 #ifdef IMAP_STORAGE
 	struct ast_channel *chan = NULL;
@@ -13804,7 +13806,7 @@ AST_TEST_DEFINE(test_voicemail_msgcount)
 	}
 #endif
 
-	if (!(vmu = find_user(NULL, testcontext, testmailbox)) &&
+	if (!(vmu = find_user(&svm, testcontext, testmailbox)) &&
 		!(vmu = find_or_create(testcontext, testmailbox))) {
 		ast_test_status_update(test, "Cannot create vmu structure\n");
 		ast_unreplace_sigchld();
diff --git a/apps/confbridge/conf_config_parser.c b/apps/confbridge/conf_config_parser.c
index 99b7b42..6ee5df5 100644
--- a/apps/confbridge/conf_config_parser.c
+++ b/apps/confbridge/conf_config_parser.c
@@ -29,7 +29,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 391700 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 400741 $")
 #include "asterisk/logger.h"
 #include "asterisk/config.h"
 #include "asterisk/config_options.h"
@@ -852,6 +852,7 @@ static char *handle_cli_confbridge_show_bridge_profile(struct ast_cli_entry *e,
 
 	ast_cli(a->fd,"--------------------------------------------\n");
 	ast_cli(a->fd,"Name:                 %s\n", b_profile.name);
+	ast_cli(a->fd,"Language:             %s\n", b_profile.language);
 
 	if (b_profile.internal_sample_rate) {
 		snprintf(tmp, sizeof(tmp), "%d", b_profile.internal_sample_rate);
@@ -1306,7 +1307,7 @@ static int verify_default_profiles(void)
 		ao2_link(cfg->bridge_profiles, bridge_profile);
 	}
 
-	user_profile = ao2_find(cfg->bridge_profiles, DEFAULT_USER_PROFILE, OBJ_KEY);
+	user_profile = ao2_find(cfg->user_profiles, DEFAULT_USER_PROFILE, OBJ_KEY);
 	if (!user_profile) {
 		user_profile = user_profile_alloc(DEFAULT_USER_PROFILE);
 		if (!user_profile) {
@@ -1364,6 +1365,7 @@ int conf_load_config(void)
 	aco_option_register_custom(&cfg_info, "video_mode", ACO_EXACT, bridge_types, NULL, video_mode_handler, 0);
 	aco_option_register(&cfg_info, "max_members", ACO_EXACT, bridge_types, "0", OPT_UINT_T, 0, FLDSET(struct bridge_profile, max_members));
 	aco_option_register(&cfg_info, "record_file", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_file));
+	aco_option_register(&cfg_info, "language", ACO_EXACT, bridge_types, "en", OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, language));
 	aco_option_register_custom(&cfg_info, "^sound_", ACO_REGEX, bridge_types, NULL, sound_option_handler, 0);
 	/* This option should only be used with the CONFBRIDGE dialplan function */
 	aco_option_register_custom(&cfg_info, "template", ACO_EXACT, bridge_types, NULL, bridge_template_handler, 0);
diff --git a/apps/confbridge/include/confbridge.h b/apps/confbridge/include/confbridge.h
index 0de2c50..f9fc93d 100644
--- a/apps/confbridge/include/confbridge.h
+++ b/apps/confbridge/include/confbridge.h
@@ -191,6 +191,7 @@ struct bridge_profile_sounds {
 
 struct bridge_profile {
 	char name[64];
+	char language[MAX_LANGUAGE];		  /*!< Language used for playback_chan */
 	char rec_file[PATH_MAX];
 	unsigned int flags;
 	unsigned int max_members;          /*!< The maximum number of participants allowed in the conference */
diff --git a/asterisk-11.6.1-summary.html b/asterisk-11.6.1-summary.html
deleted file mode 100644
index 011eb59..0000000
--- a/asterisk-11.6.1-summary.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Release Summary - asterisk-11.6.1</title></head>
-<body>
-<h1 align="center"><a name="top">Release Summary</a></h1>
-<h3 align="center">asterisk-11.6.1</h3>
-<h3 align="center">Date: 2013-12-16</h3>
-<h3 align="center"><asteriskteam at digium.com></h3>
-<hr/>
-<h2 align="center">Table of Contents</h2>
-<ol>
-   <li><a href="#summary">Summary</a></li>
-   <li><a href="#contributors">Contributors</a></li>
-   <li><a href="#commits">Other Changes</a></li>
-   <li><a href="#diffstat">Diffstat</a></li>
-</ol>
-<hr/>
-<a name="summary"><h2 align="center">Summary</h2></a>
-<center><a href="#top">[Back to Top]</a></center><br/><p>This release has been made to address one or more security vulnerabilities that have been identified.  A security advisory document has been published for each vulnerability that includes additional information.  Users of versions of Asterisk that are affected are strongly encouraged to review the advisories and determine what action they should take to protect their systems from these issues.</p>
-<p>Security Advisories: <a href="http://downloads.asterisk.org/pub/security/AST-2013-006.html">AST-2013-006</a>, <a href="http://downloads.asterisk.org/pub/security/AST-2013-007.html">AST-2013-007</a></p>
-<p>The data in this summary reflects changes that have been made since the previous release, asterisk-11.6.0.</p>
-<hr/>
-<a name="contributors"><h2 align="center">Contributors</h2></a>
-<center><a href="#top">[Back to Top]</a></center><br/><p>This table lists the people who have submitted code, those that have tested patches, as well as those that reported issues on the issue tracker that were resolved in this release.  For coders, the number is how many of their patches (of any size) were committed into this release.  For testers, the number is the number of times their name was listed as assisting with testing a patch.  Finally, for reporters, the number is the number [...]
-<table width="100%" border="0">
-<tr>
-<td width="33%"><h3>Coders</h3></td>
-<td width="33%"><h3>Testers</h3></td>
-<td width="33%"><h3>Reporters</h3></td>
-</tr>
-<tr valign="top">
-<td>
-3 bebuild<br/>
-</td>
-<td>
-</td>
-<td>
-</td>
-</tr>
-</table>
-<hr/>
-<a name="commits"><h2 align="center">Commits Not Associated with an Issue</h2></a>
-<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all changes that went into this release that did not directly close an issue from the issue tracker.  The commits may have been marked as being related to an issue.  If that is the case, the issue numbers are listed here, as well.</p>
-<table width="100%" border="1">
-<tr><td><b>Revision</b></td><td><b>Author</b></td><td><b>Summary</b></td><td><b>Issues Referenced</b></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/11.6.1?view=revision&revision=403838">403838</a></td><td>bebuild</td><td>Create 11.6.1</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/11.6.1?view=revision&revision=403848">403848</a></td><td>bebuild</td><td>Update .version; Remove old summaries</td>
-<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/11.6.1?view=revision&revision=403974">403974</a></td><td>bebuild</td><td>Update 11.6.1</td>
-<td></td></tr></table>
-<hr/>
-<a name="diffstat"><h2 align="center">Diffstat Results</h2></a>
-<center><a href="#top">[Back to Top]</a></center><br/><p>This is a summary of the changes to the source code that went into this release that was generated using the diffstat utility.</p>
-<pre>
-.version                           |    2
-ChangeLog                          |   29 +
-README-SERIOUSLY.bestpractices.txt |   24 +
-UPGRADE.txt                        |    8
-apps/app_sms.c                     |    3
-asterisk-11.6.0-summary.html       |  581 ----------------------------
-asterisk-11.6.0-summary.txt        |  761 -------------------------------------
-configs/asterisk.conf.sample       |    6
-funcs/func_db.c                    |   20
-funcs/func_env.c                   |   28 +
-funcs/func_lock.c                  |   21 -
-funcs/func_realtime.c              |   60 +-
-funcs/func_shell.c                 |   18
-include/asterisk/pbx.h             |   54 ++
-main/asterisk.c                    |    5
-main/pbx.c                         |  254 ++++++++++++
-main/tcptls.c                      |   11
-17 files changed, 504 insertions(+), 1381 deletions(-)
-</pre><br/>
-<hr/>
-</body>
-</html>
diff --git a/asterisk-11.6.1-summary.txt b/asterisk-11.6.1-summary.txt
deleted file mode 100644
index 8e31b0a..0000000
--- a/asterisk-11.6.1-summary.txt
+++ /dev/null
@@ -1,104 +0,0 @@
-                                Release Summary
-
-                                asterisk-11.6.1
-
-                                Date: 2013-12-16
-
-                           <asteriskteam at digium.com>
-
-     ----------------------------------------------------------------------
-
-                               Table of Contents
-
-    1. Summary
-    2. Contributors
-    3. Other Changes
-    4. Diffstat
-
-     ----------------------------------------------------------------------
-
-                                    Summary
-
-                                 [Back to Top]
-
-   This release has been made to address one or more security vulnerabilities
-   that have been identified. A security advisory document has been published
-   for each vulnerability that includes additional information. Users of
-   versions of Asterisk that are affected are strongly encouraged to review
-   the advisories and determine what action they should take to protect their
-   systems from these issues.
-
-   Security Advisories: AST-2013-006, AST-2013-007
-
-   The data in this summary reflects changes that have been made since the
-   previous release, asterisk-11.6.0.
-
-     ----------------------------------------------------------------------
-
-                                  Contributors
-
-                                 [Back to Top]
-
-   This table lists the people who have submitted code, those that have
-   tested patches, as well as those that reported issues on the issue tracker
-   that were resolved in this release. For coders, the number is how many of
-   their patches (of any size) were committed into this release. For testers,
-   the number is the number of times their name was listed as assisting with
-   testing a patch. Finally, for reporters, the number is the number of
-   issues that they reported that were closed by commits that went into this
-   release.
-
-     Coders                   Testers                  Reporters              
-   3 bebuild                
-
-     ----------------------------------------------------------------------
-
-                      Commits Not Associated with an Issue
-
-                                 [Back to Top]
-
-   This is a list of all changes that went into this release that did not
-   directly close an issue from the issue tracker. The commits may have been
-   marked as being related to an issue. If that is the case, the issue
-   numbers are listed here, as well.
-
-   +------------------------------------------------------------------------+
-   | Revision | Author  | Summary                       | Issues Referenced |
-   |----------+---------+-------------------------------+-------------------|
-   | 403838   | bebuild | Create 11.6.1                 |                   |
-   |----------+---------+-------------------------------+-------------------|
-   | 403848   | bebuild | Update .version; Remove old   |                   |
-   |          |         | summaries                     |                   |
-   |----------+---------+-------------------------------+-------------------|
-   | 403974   | bebuild | Update 11.6.1                 |                   |
-   +------------------------------------------------------------------------+
-
-     ----------------------------------------------------------------------
-
-                                Diffstat Results
-
-                                 [Back to Top]
-
-   This is a summary of the changes to the source code that went into this
-   release that was generated using the diffstat utility.
-
- .version                           |    2
- ChangeLog                          |   29 +
- README-SERIOUSLY.bestpractices.txt |   24 +
- UPGRADE.txt                        |    8
- apps/app_sms.c                     |    3
- asterisk-11.6.0-summary.html       |  581 ----------------------------
- asterisk-11.6.0-summary.txt        |  761 -------------------------------------
- configs/asterisk.conf.sample       |    6
- funcs/func_db.c                    |   20
- funcs/func_env.c                   |   28 +
- funcs/func_lock.c                  |   21 -
- funcs/func_realtime.c              |   60 +-
- funcs/func_shell.c                 |   18
- include/asterisk/pbx.h             |   54 ++
- main/asterisk.c                    |    5
- main/pbx.c                         |  254 ++++++++++++
- main/tcptls.c                      |   11
- 17 files changed, 504 insertions(+), 1381 deletions(-)
-
-     ----------------------------------------------------------------------
diff --git a/asterisk-11.7.0-summary.html b/asterisk-11.7.0-summary.html
new file mode 100644
index 0000000..cfba305
--- /dev/null
+++ b/asterisk-11.7.0-summary.html
@@ -0,0 +1,457 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Release Summary - asterisk-11.7.0</title></head>
+<body>
+<h1 align="center"><a name="top">Release Summary</a></h1>
+<h3 align="center">asterisk-11.7.0</h3>
+<h3 align="center">Date: 2013-12-17</h3>
+<h3 align="center"><asteriskteam at digium.com></h3>
+<hr/>
+<h2 align="center">Table of Contents</h2>
+<ol>
+   <li><a href="#summary">Summary</a></li>
+   <li><a href="#contributors">Contributors</a></li>
+   <li><a href="#issues">Closed Issues</a></li>
+   <li><a href="#commits">Other Changes</a></li>
+   <li><a href="#diffstat">Diffstat</a></li>
+</ol>
+<hr/>
+<a name="summary"><h2 align="center">Summary</h2></a>
+<center><a href="#top">[Back to Top]</a></center><br/><p>This release includes only bug fixes.  The changes included were made only to address problems that have been identified in this release series.  Users should be able to safely upgrade to this version if this release series is already in use.  Users considering upgrading from a previous release series are strongly encouraged to review the UPGRADE.txt document as well as the CHANGES document for information about upgrading to this r [...]
+<p>The data in this summary reflects changes that have been made since the previous release, asterisk-11.6.0.</p>
+<hr/>
+<a name="contributors"><h2 align="center">Contributors</h2></a>
+<center><a href="#top">[Back to Top]</a></center><br/><p>This table lists the people who have submitted code, those that have tested patches, as well as those that reported issues on the issue tracker that were resolved in this release.  For coders, the number is how many of their patches (of any size) were committed into this release.  For testers, the number is the number of times their name was listed as assisting with testing a patch.  Finally, for reporters, the number is the number [...]
+<table width="100%" border="0">
+<tr>
+<td width="33%"><h3>Coders</h3></td>
+<td width="33%"><h3>Testers</h3></td>
+<td width="33%"><h3>Reporters</h3></td>
+</tr>
+<tr valign="top">
+<td>
+11 jrose<br/>
+8 rmudgett<br/>
+5 elguero<br/>
+4 bebuild<br/>
+4 kmoore<br/>
+4 wdoekes<br/>
+3 mjordan<br/>
+2 kharwell<br/>
+2 NITESH BANSAL<br/>
+2 sgriepentrog<br/>
+1 abelbeck<br/>
+1 adomjan<br/>
+1 coreyfarrell<br/>
+1 Filip Jenicek<br/>
+1 junky<br/>
+1 mmichelson<br/>
+1 nbougues<br/>
+1 Oscar Esteve<br/>
+1 Simone Camporeale<br/>
+1 Torrey Searle<br/>
+1 tsearle<br/>
+1 tzafrir<br/>
+</td>
+<td>
+3 elguero<br/>
+1 Ben Smithurst<br/>
+1 Dalius M.<br/>
+1 rmudgett<br/>
+1 wdoekes<br/>
+</td>
+<td>
+2 gkelleter<br/>
+2 nbansal<br/>
+2 tsearle<br/>
+1 abelbeck<br/>
+1 adomjan<br/>
+1 aragon<br/>
+1 arcanos<br/>
+1 bensmithurst<br/>
+1 brianscott<br/>
+1 coreyfarrell<br/>
+1 dario<br/>
+1 docent<br/>
+1 elguero<br/>
+1 frenk77<br/>
+1 jbigelow<br/>
+1 jkister<br/>
+1 jllull<br/>
+1 jrose<br/>
+1 kharwell<br/>
+1 kmoore<br/>
+1 londonnet<br/>
+1 mdalius<br/>
+1 mjordan<br/>
+1 nbougues<br/>
+1 oscares<br/>
+1 patrickm<br/>
+1 phill<br/>
+1 rudolf<br/>
+1 simone.camporeale<br/>
+1 skavin<br/>
+1 tomaso<br/>
+1 wdoekes<br/>
+</td>
+</tr>
+</table>
+<hr/>
+<a name="issues"><h2 align="center">Closed Issues</h2></a>
+<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all issues from the issue tracker that were closed by changes that went into this release.</p>
+<h3>Category: Applications/app_confbridge</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-19983">ASTERISK-19983</a>: ConfBridge does not expose a mechanism to change the language on the Bridging channel, defaulting to 'en'<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=400741">400741</a><br/>
+Reporter: londonnet<br/>
+Testers: rmudgett<br/>
+Coders: junky<br/>
+<br/>
+<h3>Category: Applications/app_queue</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21826">ASTERISK-21826</a>: [patch] Bad queue_log entry when removed member from queue via CLI<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401433">401433</a><br/>
+Reporter: oscares<br/>
+Coders: Oscar Esteve<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22197">ASTERISK-22197</a>: [patch] Queuelog EXITWITHKEY only two of four parameters<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=400623">400623</a><br/>
+Reporter: mdalius<br/>
+Testers: Dalius M.<br/>
+Coders: elguero<br/>
+<br/>
+<h3>Category: Applications/app_voicemail</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22467">ASTERISK-22467</a>: [patch] memory leaks 1.8+<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401830">401830</a><br/>
+Reporter: coreyfarrell<br/>
+Coders: coreyfarrell<br/>
+<br/>
+<h3>Category: Bridges/bridge_native_rtp</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22424">ASTERISK-22424</a>: bridge_native_rtp: Asterisk 12 attempts to remotely bridge on 200OK response to invite when the 200 lacks SDP<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=399962">399962</a><br/>
+Reporter: jrose<br/>
+Coders: jrose<br/>
+<br/>
+<h3>Category: CDR/cdr_adaptive_odbc</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22272">ASTERISK-22272</a>: [patch] Unexepected behaviour with adaptive odbc filter<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401579">401579</a><br/>
+Reporter: jllull<br/>
+Coders: rmudgett<br/>
+<br/>
+<h3>Category: Channels/chan_dahdi</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22467">ASTERISK-22467</a>: [patch] memory leaks 1.8+<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401830">401830</a><br/>
+Reporter: coreyfarrell<br/>
+Coders: coreyfarrell<br/>
+<br/>
+<h3>Category: Channels/chan_mgcp</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21190">ASTERISK-21190</a>: chan_mgcp crash on chunked m= sdp line<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401538">401538</a><br/>
+Reporter: adomjan<br/>
+Coders: adomjan<br/>
+<br/>
+<h3>Category: Channels/chan_pjsip</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22667">ASTERISK-22667</a>: crash: directmedia with both phones placing each other on hold<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401446">401446</a><br/>
+Reporter: jbigelow<br/>
+Coders: mjordan<br/>
+<br/>
+<h3>Category: Channels/chan_sip/CodecHandling</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21131">ASTERISK-21131</a>: [patch] - Asterisk creates SDP with (peer) unsupported audio codec<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401498">401498</a><br/>
+Reporter: nbougues<br/>
+Coders: nbougues<br/>
+<br/>
+<h3>Category: Channels/chan_sip/General</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21204">ASTERISK-21204</a>: Asterisk increments the session version in 2xx message even if a '183 Session in Progress' with SDP has already been sent in response to initial INVITE.<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=400908">400908</a><br/>
+Reporter: nbansal<br/>
+Coders: NITESH BANSAL<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22467">ASTERISK-22467</a>: [patch] memory leaks 1.8+<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401830">401830</a><br/>
+Reporter: coreyfarrell<br/>
+Coders: coreyfarrell<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22477">ASTERISK-22477</a>: array calleridname in the function check_user_full is too short<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=400014">400014</a><br/>
+Reporter: docent<br/>
+Coders: rmudgett<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22621">ASTERISK-22621</a>: chan_sip can send two BYEs for a single call<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=400971">400971</a><br/>
+Reporter: kmoore<br/>
+Coders: mmichelson<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22667">ASTERISK-22667</a>: crash: directmedia with both phones placing each other on hold<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401446">401446</a><br/>
+Reporter: jbigelow<br/>
+Coders: mjordan<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22729">ASTERISK-22729</a>: [patch] Remove Port Restriction When Checking For NAT<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401182">401182</a><br/>
+Reporter: elguero<br/>
+Testers: elguero<br/>
+Coders: elguero<br/>
+<br/>
+<h3>Category: Channels/chan_sip/Interoperability</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22005">ASTERISK-22005</a>: Allow a sip peer to accept both AVP and AVPF calls<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401884">401884</a><br/>
+Reporter: tsearle<br/>
+Coders: tsearle<br/>
+<br/>
+<h3>Category: Channels/chan_sip/Registration</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-17138">ASTERISK-17138</a>: [patch] Asterisk not re-registering after it receives "Forbidden - wrong password on authentication"<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=400140">400140</a><br/>
+Reporter: rudolf<br/>
+Coders: kmoore<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22236">ASTERISK-22236</a>: REGISTER reply send to bad port with nat=yes(or force_rport,comedia) in 11.5.0<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401167">401167</a><br/>
+Reporter: frenk77<br/>
+Testers: elguero<br/>
+Coders: elguero<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22428">ASTERISK-22428</a>: [patch] SIP unregister does not fully unregister when using Realtime sip peers and Expires not 0 on 200ok<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=399795">399795</a><br/>
+Reporter: bensmithurst<br/>
+Testers: Ben Smithurst, elguero<br/>
+Coders: elguero<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22574">ASTERISK-22574</a>: [patch]Value of expires= is ignored in the Contact header<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=400470">400470</a><br/>
+Reporter: phill<br/>
+Coders: Filip Jenicek<br/>
+<br/>
+<h3>Category: Channels/chan_sip/T.38</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-17273">ASTERISK-17273</a>: [patch] - Incorrect address specified in SIP re-INVITE with T.38 when directmedia enabled<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=399457">399457</a><br/>
+Reporter: dario<br/>
+Coders: jrose<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-18706">ASTERISK-18706</a>: UDPTL fail while using directmedia<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=399457">399457</a><br/>
+Reporter: jkister<br/>
+Coders: jrose<br/>
+<br/>
+<h3>Category: Codecs/codec_ilbc</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22467">ASTERISK-22467</a>: [patch] memory leaks 1.8+<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401830">401830</a><br/>
+Reporter: coreyfarrell<br/>
+Coders: coreyfarrell<br/>
+<br/>
+<h3>Category: Core/BuildSystem</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22351">ASTERISK-22351</a>: Segfault in LIBEDIT_INTERNAL after tgetstr(), when libncurses5-dev isn't installed<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401326">401326</a><br/>
+Reporter: arcanos<br/>
+Coders: wdoekes<br/>
+<br/>
+<h3>Category: Core/General</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22351">ASTERISK-22351</a>: Segfault in LIBEDIT_INTERNAL after tgetstr(), when libncurses5-dev isn't installed<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401326">401326</a><br/>
+Reporter: arcanos<br/>
+Coders: wdoekes<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22467">ASTERISK-22467</a>: [patch] memory leaks 1.8+<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401830">401830</a><br/>
+Reporter: coreyfarrell<br/>
+Coders: coreyfarrell<br/>
+<br/>
+<h3>Category: Core/Jitterbuffer</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22467">ASTERISK-22467</a>: [patch] memory leaks 1.8+<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401830">401830</a><br/>
+Reporter: coreyfarrell<br/>
+Coders: coreyfarrell<br/>
+<br/>
+<h3>Category: Core/Logging</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22456">ASTERISK-22456</a>: Logger.conf: Logging types ignored after specifying a verbose level<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401833">401833</a><br/>
+Reporter: kharwell<br/>
+Coders: kharwell<br/>
+<br/>
+<h3>Category: Core/ManagerInterface</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22578">ASTERISK-22578</a>: Invalid manager logins aren't reported via security events: Invalid IE Specified ERROR<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=400421">400421</a><br/>
+Reporter: mjordan<br/>
+Coders: kmoore<br/>
+<br/>
+<h3>Category: Core/RTP</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21464">ASTERISK-21464</a>: with directrtpsetup some payload type identifiers from A party's INVITE are not copied to the INVITE for B party<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=402042">402042</a><br/>
+Reporter: skavin<br/>
+Coders: sgriepentrog<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22424">ASTERISK-22424</a>: bridge_native_rtp: Asterisk 12 attempts to remotely bridge on 200OK response to invite when the 200 lacks SDP<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=399962">399962</a><br/>
+Reporter: jrose<br/>
+Coders: jrose<br/>
+<br/>
+<h3>Category: Core/UDPTL</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-18706">ASTERISK-18706</a>: UDPTL fail while using directmedia<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=399457">399457</a><br/>
+Reporter: jkister<br/>
+Coders: jrose<br/>
+<br/>
+<h3>Category: Functions/func_config</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22483">ASTERISK-22483</a>: AST_LIST_INSERT_TAIL doesn't set field.next on added entry<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=400697">400697</a><br/>
+Reporter: brianscott<br/>
+Coders: kmoore<br/>
+<br/>
+<h3>Category: Functions/func_math</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22467">ASTERISK-22467</a>: [patch] memory leaks 1.8+<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401830">401830</a><br/>
+Reporter: coreyfarrell<br/>
+Coders: coreyfarrell<br/>
+<br/>
+<h3>Category: General</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22540">ASTERISK-22540</a>: WARNING[2324] asterisk.c: Fork failed: Cannot allocate memory in /var/log/asterisk/messages then segfault<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=399513">399513</a><br/>
+Reporter: aragon<br/>
+Coders: kharwell<br/>
+<br/>
+<h3>Category: Resources/res_jabber</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22410">ASTERISK-22410</a>: [patch] Change "Error isn't a PubSub error ..." error log to a debug log<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401120">401120</a><br/>
+Reporter: abelbeck<br/>
+Coders: abelbeck<br/>
+<br/>
+<h3>Category: Resources/res_odbc</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22459">ASTERISK-22459</a>: Compiling res_odbc against iODBC instead of unixodbc produces runtime errors<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=400768">400768</a><br/>
+Reporter: patrickm<br/>
+Testers: wdoekes<br/>
+Coders: wdoekes<br/>
+<br/>
+<h3>Category: Resources/res_rtp_asterisk</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21170">ASTERISK-21170</a>: DTMF timestamp issue<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401620">401620</a><br/>
+Reporter: nbansal<br/>
+Coders: NITESH BANSAL<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21917">ASTERISK-21917</a>: [patch] STUN crashes when SIP is bound to ipv4 and ipv6<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=400681">400681</a><br/>
+Reporter: tsearle<br/>
+Coders: Torrey Searle<br/>
+<br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22667">ASTERISK-22667</a>: crash: directmedia with both phones placing each other on hold<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401446">401446</a><br/>
+Reporter: jbigelow<br/>
+Coders: mjordan<br/>
+<br/>
+<h3>Category: Resources/res_rtp_multicast</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22567">ASTERISK-22567</a>: [patch]MutlicastRTP does not set SSRC. SSRC is always set to 0<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=400394">400394</a><br/>
+Reporter: simone.camporeale<br/>
+Coders: Simone Camporeale<br/>
+<br/>
+<h3>Category: Resources/res_xmpp</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22410">ASTERISK-22410</a>: [patch] Change "Error isn't a PubSub error ..." error log to a debug log<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401120">401120</a><br/>
+Reporter: abelbeck<br/>
+Coders: abelbeck<br/>
+<br/>
+<h3>Category: Tests/General</h3><br/>
+<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22467">ASTERISK-22467</a>: [patch] memory leaks 1.8+<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401830">401830</a><br/>
+Reporter: coreyfarrell<br/>
+Coders: coreyfarrell<br/>
+<br/>
+<hr/>
+<a name="commits"><h2 align="center">Commits Not Associated with an Issue</h2></a>
+<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all changes that went into this release that did not directly close an issue from the issue tracker.  The commits may have been marked as being related to an issue.  If that is the case, the issue numbers are listed here, as well.</p>
+<table width="100%" border="1">
+<tr><td><b>Revision</b></td><td><b>Author</b></td><td><b>Summary</b></td><td><b>Issues Referenced</b></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=399564">399564</a></td><td>kmoore</td><td>Ensure global types in the config framework are initialized</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=399708">399708</a></td><td>rmudgett</td><td>chan_iax2: Prevent some needless breaking of the native IAX2 bridge.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=399834">399834</a></td><td>rmudgett</td><td>chan_dahdi: CLI "core stop gracefully" has needless delay for PRI and SS7.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=400279">400279</a></td><td>tzafrir</td><td>man pages for astdb2bdb and astdb2sqlite3</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=400315">400315</a></td><td>elguero</td><td>Cast Integer Argument To Unsigned Char</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=400723">400723</a></td><td>rmudgett</td><td>app_confbridge: Fix duplicate default_user profile.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=400909">400909</a></td><td>rmudgett</td><td>chan_dahdi: Reflect the set software gain in the CLI "dahdi show channel" output.</td>
+<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-22429">ASTERISK-22429</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401016">401016</a></td><td>rmudgett</td><td>chan_iax2: Fix channel left locked in off nominal code path.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401076">401076</a></td><td>wdoekes</td><td>Don't check all realtime queues when doing "queue show some_queue".</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401379">401379</a></td><td>rmudgett</td><td>chan_dahdi: Fix unable to get index warning when transferring an analog call.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401661">401661</a></td><td>jrose</td><td>memory leaks: Memory leak cleanup patch by Corey Farrell (first set)</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401705">401705</a></td><td>jrose</td><td>memory leaks: Memory leak cleanup patch by Corey Farrell (second set)</td>
+<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-22467">ASTERISK-22467</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401744">401744</a></td><td>jrose</td><td>app_voicemail: Memory Leaks against tests</td>
+<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-22467">ASTERISK-22467</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401783">401783</a></td><td>jrose</td><td>astobj2: Unregister debug CLI commands at exit</td>
+<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-22467">ASTERISK-22467</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401787">401787</a></td><td>jrose</td><td>jitterbuf: Fix memory leak on jitter buffer reset</td>
+<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-22467">ASTERISK-22467</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401791">401791</a></td><td>jrose</td><td>test_linkedlists: Fix memory leak</td>
+<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-22467">ASTERISK-22467</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401896">401896</a></td><td>jrose</td><td>revert clicompat-r2.patch from r401704</td>
+<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-22467">ASTERISK-22467</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=401935">401935</a></td><td>jrose</td><td>Put clicompat-r2.patch back in</td>
+<td><a href="https://issues.asterisk.org/jira/browse/ASTERISK-22467">ASTERISK-22467</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=403844">403844</a></td><td>bebuild</td><td>Create 11.7.0-rc2</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=403849">403849</a></td><td>bebuild</td><td>Update version; Remove old summaries</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=403978">403978</a></td><td>bebuild</td><td>Update 11.7.0-rc2</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/11?view=revision&revision=403984">403984</a></td><td>bebuild</td><td>Importing release summary for 11.7.0-rc2 release.</td>
+<td></td></tr></table>
+<hr/>
+<a name="diffstat"><h2 align="center">Diffstat Results</h2></a>
+<center><a href="#top">[Back to Top]</a></center><br/><p>This is a summary of the changes to the source code that went into this release that was generated using the diffstat utility.</p>
+<pre>
+.version                             |    2
+ChangeLog                            |   29 +
+Makefile                             |    1
+README-SERIOUSLY.bestpractices.txt   |   24 +
+UPGRADE.txt                          |   18 +
+apps/app_confbridge.c                |    3
+apps/app_queue.c                     |   37 +-
+apps/app_sms.c                       |    3
+apps/app_voicemail.c                 |    6
+apps/confbridge/conf_config_parser.c |    4
+apps/confbridge/include/confbridge.h |    1
+asterisk-11.7.0-rc1-summary.html     |  437 ----------------------------
+asterisk-11.7.0-rc1-summary.txt      |  544 -----------------------------------
+asterisk-11.7.0-rc2-summary.html     |   73 ++++
+asterisk-11.7.0-rc2-summary.txt      |  103 ++++++
+cdr/cdr_adaptive_odbc.c              |    8
+channels/chan_dahdi.c                |   55 ++-
+channels/chan_iax2.c                 |   49 +--
+channels/chan_mgcp.c                 |    6
+channels/chan_sip.c                  |  147 ++++++---
+channels/sig_analog.c                |   52 +--
+channels/sig_ss7.c                   |    9
+channels/sip/include/sip.h           |    1
+channels/sip/reqresp_parser.c        |    6
+codecs/ilbc/doCPLC.c                 |    2
+configs/asterisk.conf.sample         |    6
+configs/confbridge.conf.sample       |    3
+configs/sip.conf.sample              |    3
+configure.ac                         |   14
+doc/astdb2bdb.8                      |   46 ++
+doc/astdb2sqlite3.8                  |   39 ++
+funcs/func_config.c                  |    4
+funcs/func_db.c                      |   20 +
+funcs/func_env.c                     |   28 +
+funcs/func_lock.c                    |   21 +
+funcs/func_math.c                    |    3
+funcs/func_realtime.c                |   60 ++-
+funcs/func_shell.c                   |   18 -
+include/asterisk/pbx.h               |   64 ++++
+include/asterisk/rtp_engine.h        |    6
+main/app.c                           |    4
+main/asterisk.c                      |   11
+main/astobj2.c                       |    6
+main/channel.c                       |   16 +
+main/config_options.c                |   26 +
+main/data.c                          |    3
+main/editline/readline.c             |    7
+main/editline/term.c                 |    6
+main/jitterbuf.c                     |    6
+main/logger.c                        |    3
+main/pbx.c                           |  317 ++++++++++++++++++--
+main/rtp_engine.c                    |   90 ++---
+main/security_events.c               |    6
+main/tcptls.c                        |   11
+main/test.c                          |    6
+main/translate.c                     |    4
+main/utils.c                         |   20 +
+res/res_jabber.c                     |    2
+res/res_rtp_asterisk.c               |   69 +++-
+res/res_rtp_multicast.c              |    8
+res/res_xmpp.c                       |    2
+tests/test_dlinklists.c              |    2
+tests/test_linkedlists.c             |    7
+utils/clicompat.c                    |   10
+64 files changed, 1308 insertions(+), 1289 deletions(-)
+</pre><br/>
+<hr/>
+</body>
+</html>
diff --git a/asterisk-11.7.0-summary.txt b/asterisk-11.7.0-summary.txt
new file mode 100644
index 0000000..62bb6ee
--- /dev/null
+++ b/asterisk-11.7.0-summary.txt
@@ -0,0 +1,569 @@
+                                Release Summary
+
+                                asterisk-11.7.0
+
+                                Date: 2013-12-17
+
+                           <asteriskteam at digium.com>
+
+     ----------------------------------------------------------------------
+
+                               Table of Contents
+
+    1. Summary
+    2. Contributors
+    3. Closed Issues
+    4. Other Changes
+    5. Diffstat
+
+     ----------------------------------------------------------------------
+
+                                    Summary
+
+                                 [Back to Top]
+
+   This release includes only bug fixes. The changes included were made only
+   to address problems that have been identified in this release series.
+   Users should be able to safely upgrade to this version if this release
+   series is already in use. Users considering upgrading from a previous
+   release series are strongly encouraged to review the UPGRADE.txt document
+   as well as the CHANGES document for information about upgrading to this
+   release series.
+
+   The data in this summary reflects changes that have been made since the
+   previous release, asterisk-11.6.0.
+
+     ----------------------------------------------------------------------
+
+                                  Contributors
+
+                                 [Back to Top]
+
+   This table lists the people who have submitted code, those that have
+   tested patches, as well as those that reported issues on the issue tracker
+   that were resolved in this release. For coders, the number is how many of
+   their patches (of any size) were committed into this release. For testers,
+   the number is the number of times their name was listed as assisting with
+   testing a patch. Finally, for reporters, the number is the number of
+   issues that they reported that were closed by commits that went into this
+   release.
+
+     Coders                   Testers                  Reporters              
+   11 jrose                 3 elguero                2 gkelleter              
+   8 rmudgett               1 Ben Smithurst          2 nbansal                
+   5 elguero                1 Dalius M.              2 tsearle                
+   4 bebuild                1 rmudgett               1 abelbeck               
+   4 kmoore                 1 wdoekes                1 adomjan                
+   4 wdoekes                                         1 aragon                 
+   3 mjordan                                         1 arcanos                
+   2 kharwell                                        1 bensmithurst           
+   2 NITESH BANSAL                                   1 brianscott             
+   2 sgriepentrog                                    1 coreyfarrell           
+   1 abelbeck                                        1 dario                  
+   1 adomjan                                         1 docent                 
+   1 coreyfarrell                                    1 elguero                
+   1 Filip Jenicek                                   1 frenk77                
+   1 junky                                           1 jbigelow               
+   1 mmichelson                                      1 jkister                
+   1 nbougues                                        1 jllull                 
+   1 Oscar Esteve                                    1 jrose                  
+   1 Simone Camporeale                               1 kharwell               
+   1 Torrey Searle                                   1 kmoore                 
+   1 tsearle                                         1 londonnet              
+   1 tzafrir                                         1 mdalius                
+                                                     1 mjordan                
+                                                     1 nbougues               
+                                                     1 oscares                
+                                                     1 patrickm               
+                                                     1 phill                  
+                                                     1 rudolf                 
+                                                     1 simone.camporeale      
+                                                     1 skavin                 
+                                                     1 tomaso                 
+                                                     1 wdoekes                
+
+     ----------------------------------------------------------------------
+
+                                 Closed Issues
+
+                                 [Back to Top]
+
+   This is a list of all issues from the issue tracker that were closed by
+   changes that went into this release.
+
+  Category: Applications/app_confbridge
+
+   ASTERISK-19983: ConfBridge does not expose a mechanism to change the
+   language on the Bridging channel, defaulting to 'en'
+   Revision: 400741
+   Reporter: londonnet
+   Testers: rmudgett
+   Coders: junky
+
+  Category: Applications/app_queue
+
+   ASTERISK-21826: [patch] Bad queue_log entry when removed member from queue
+   via CLI
+   Revision: 401433
+   Reporter: oscares
+   Coders: Oscar Esteve
+
+   ASTERISK-22197: [patch] Queuelog EXITWITHKEY only two of four parameters
+   Revision: 400623
+   Reporter: mdalius
+   Testers: Dalius M.
+   Coders: elguero
+
+  Category: Applications/app_voicemail
+
+   ASTERISK-22467: [patch] memory leaks 1.8+
+   Revision: 401830
+   Reporter: coreyfarrell
+   Coders: coreyfarrell
+
+  Category: Bridges/bridge_native_rtp
+
+   ASTERISK-22424: bridge_native_rtp: Asterisk 12 attempts to remotely bridge
+   on 200OK response to invite when the 200 lacks SDP
+   Revision: 399962
+   Reporter: jrose
+   Coders: jrose
+
+  Category: CDR/cdr_adaptive_odbc
+
+   ASTERISK-22272: [patch] Unexepected behaviour with adaptive odbc filter
+   Revision: 401579
+   Reporter: jllull
+   Coders: rmudgett
+
+  Category: Channels/chan_dahdi
+
+   ASTERISK-22467: [patch] memory leaks 1.8+
+   Revision: 401830
+   Reporter: coreyfarrell
+   Coders: coreyfarrell
+
+  Category: Channels/chan_mgcp
+
+   ASTERISK-21190: chan_mgcp crash on chunked m= sdp line
+   Revision: 401538
+   Reporter: adomjan
+   Coders: adomjan
+
+  Category: Channels/chan_pjsip
+
+   ASTERISK-22667: crash: directmedia with both phones placing each other on
+   hold
+   Revision: 401446
+   Reporter: jbigelow
+   Coders: mjordan
+
+  Category: Channels/chan_sip/CodecHandling
+
+   ASTERISK-21131: [patch] - Asterisk creates SDP with (peer) unsupported
+   audio codec
+   Revision: 401498
+   Reporter: nbougues
+   Coders: nbougues
+
+  Category: Channels/chan_sip/General
+
+   ASTERISK-21204: Asterisk increments the session version in 2xx message
+   even if a '183 Session in Progress' with SDP has already been sent in
+   response to initial INVITE.
+   Revision: 400908
+   Reporter: nbansal
+   Coders: NITESH BANSAL
+
+   ASTERISK-22467: [patch] memory leaks 1.8+
+   Revision: 401830
+   Reporter: coreyfarrell
+   Coders: coreyfarrell
+
+   ASTERISK-22477: array calleridname in the function check_user_full is too
+   short
+   Revision: 400014
+   Reporter: docent
+   Coders: rmudgett
+
+   ASTERISK-22621: chan_sip can send two BYEs for a single call
+   Revision: 400971
+   Reporter: kmoore
+   Coders: mmichelson
+
+   ASTERISK-22667: crash: directmedia with both phones placing each other on
+   hold
+   Revision: 401446
+   Reporter: jbigelow
+   Coders: mjordan
+
+   ASTERISK-22729: [patch] Remove Port Restriction When Checking For NAT
+   Revision: 401182
+   Reporter: elguero
+   Testers: elguero
+   Coders: elguero
+
+  Category: Channels/chan_sip/Interoperability
+
+   ASTERISK-22005: Allow a sip peer to accept both AVP and AVPF calls
+   Revision: 401884
+   Reporter: tsearle
+   Coders: tsearle
+
+  Category: Channels/chan_sip/Registration
+
+   ASTERISK-17138: [patch] Asterisk not re-registering after it receives
+   "Forbidden - wrong password on authentication"
+   Revision: 400140
+   Reporter: rudolf
+   Coders: kmoore
+
+   ASTERISK-22236: REGISTER reply send to bad port with nat=yes(or
+   force_rport,comedia) in 11.5.0
+   Revision: 401167
+   Reporter: frenk77
+   Testers: elguero
+   Coders: elguero
+
+   ASTERISK-22428: [patch] SIP unregister does not fully unregister when
+   using Realtime sip peers and Expires not 0 on 200ok
+   Revision: 399795
+   Reporter: bensmithurst
+   Testers: Ben Smithurst, elguero
+   Coders: elguero
+
+   ASTERISK-22574: [patch]Value of expires= is ignored in the Contact header
+   Revision: 400470
+   Reporter: phill
+   Coders: Filip Jenicek
+
+  Category: Channels/chan_sip/T.38
+
+   ASTERISK-17273: [patch] - Incorrect address specified in SIP re-INVITE
+   with T.38 when directmedia enabled
+   Revision: 399457
+   Reporter: dario
+   Coders: jrose
+
+   ASTERISK-18706: UDPTL fail while using directmedia
+   Revision: 399457
+   Reporter: jkister
+   Coders: jrose
+
+  Category: Codecs/codec_ilbc
+
+   ASTERISK-22467: [patch] memory leaks 1.8+
+   Revision: 401830
+   Reporter: coreyfarrell
+   Coders: coreyfarrell
+
+  Category: Core/BuildSystem
+
+   ASTERISK-22351: Segfault in LIBEDIT_INTERNAL after tgetstr(), when
+   libncurses5-dev isn't installed
+   Revision: 401326
+   Reporter: arcanos
+   Coders: wdoekes
+
+  Category: Core/General
+
+   ASTERISK-22351: Segfault in LIBEDIT_INTERNAL after tgetstr(), when
+   libncurses5-dev isn't installed
+   Revision: 401326
+   Reporter: arcanos
+   Coders: wdoekes
+
+   ASTERISK-22467: [patch] memory leaks 1.8+
+   Revision: 401830
+   Reporter: coreyfarrell
+   Coders: coreyfarrell
+
+  Category: Core/Jitterbuffer
+
+   ASTERISK-22467: [patch] memory leaks 1.8+
+   Revision: 401830
+   Reporter: coreyfarrell
+   Coders: coreyfarrell
+
+  Category: Core/Logging
+
+   ASTERISK-22456: Logger.conf: Logging types ignored after specifying a
+   verbose level
+   Revision: 401833
+   Reporter: kharwell
+   Coders: kharwell
+
+  Category: Core/ManagerInterface
+
+   ASTERISK-22578: Invalid manager logins aren't reported via security
+   events: Invalid IE Specified ERROR
+   Revision: 400421
+   Reporter: mjordan
+   Coders: kmoore
+
+  Category: Core/RTP
+
+   ASTERISK-21464: with directrtpsetup some payload type identifiers from A
+   party's INVITE are not copied to the INVITE for B party
+   Revision: 402042
+   Reporter: skavin
+   Coders: sgriepentrog
+
+   ASTERISK-22424: bridge_native_rtp: Asterisk 12 attempts to remotely bridge
+   on 200OK response to invite when the 200 lacks SDP
+   Revision: 399962
+   Reporter: jrose
+   Coders: jrose
+
+  Category: Core/UDPTL
+
+   ASTERISK-18706: UDPTL fail while using directmedia
+   Revision: 399457
+   Reporter: jkister
+   Coders: jrose
+
+  Category: Functions/func_config
+
+   ASTERISK-22483: AST_LIST_INSERT_TAIL doesn't set field.next on added entry
+   Revision: 400697
+   Reporter: brianscott
+   Coders: kmoore
+
+  Category: Functions/func_math
+
+   ASTERISK-22467: [patch] memory leaks 1.8+
+   Revision: 401830
+   Reporter: coreyfarrell
+   Coders: coreyfarrell
+
+  Category: General
+
+   ASTERISK-22540: WARNING[2324] asterisk.c: Fork failed: Cannot allocate
+   memory in /var/log/asterisk/messages then segfault
+   Revision: 399513
+   Reporter: aragon
+   Coders: kharwell
+
+  Category: Resources/res_jabber
+
+   ASTERISK-22410: [patch] Change "Error isn't a PubSub error ..." error log
+   to a debug log
+   Revision: 401120
+   Reporter: abelbeck
+   Coders: abelbeck
+
+  Category: Resources/res_odbc
+
+   ASTERISK-22459: Compiling res_odbc against iODBC instead of unixodbc
+   produces runtime errors
+   Revision: 400768
+   Reporter: patrickm
+   Testers: wdoekes
+   Coders: wdoekes
+
+  Category: Resources/res_rtp_asterisk
+
+   ASTERISK-21170: DTMF timestamp issue
+   Revision: 401620
+   Reporter: nbansal
+   Coders: NITESH BANSAL
+
+   ASTERISK-21917: [patch] STUN crashes when SIP is bound to ipv4 and ipv6
+   Revision: 400681
+   Reporter: tsearle
+   Coders: Torrey Searle
+
+   ASTERISK-22667: crash: directmedia with both phones placing each other on
+   hold
+   Revision: 401446
+   Reporter: jbigelow
+   Coders: mjordan
+
+  Category: Resources/res_rtp_multicast
+
+   ASTERISK-22567: [patch]MutlicastRTP does not set SSRC. SSRC is always set
+   to 0
+   Revision: 400394
+   Reporter: simone.camporeale
+   Coders: Simone Camporeale
+
+  Category: Resources/res_xmpp
+
+   ASTERISK-22410: [patch] Change "Error isn't a PubSub error ..." error log
+   to a debug log
+   Revision: 401120
+   Reporter: abelbeck
+   Coders: abelbeck
+
+  Category: Tests/General
+
+   ASTERISK-22467: [patch] memory leaks 1.8+
+   Revision: 401830
+   Reporter: coreyfarrell
+   Coders: coreyfarrell
+
+     ----------------------------------------------------------------------
+
+                      Commits Not Associated with an Issue
+
+                                 [Back to Top]
+
+   This is a list of all changes that went into this release that did not
+   directly close an issue from the issue tracker. The commits may have been
+   marked as being related to an issue. If that is the case, the issue
+   numbers are listed here, as well.
+
+   +------------------------------------------------------------------------+
+   | Revision | Author   | Summary                      | Issues Referenced |
+   |----------+----------+------------------------------+-------------------|
+   |          |          | Ensure global types in the   |                   |
+   | 399564   | kmoore   | config framework are         |                   |
+   |          |          | initialized                  |                   |
+   |----------+----------+------------------------------+-------------------|
+   |          |          | chan_iax2: Prevent some      |                   |
+   | 399708   | rmudgett | needless breaking of the     |                   |
+   |          |          | native IAX2 bridge.          |                   |
+   |----------+----------+------------------------------+-------------------|
+   |          |          | chan_dahdi: CLI "core stop   |                   |
+   | 399834   | rmudgett | gracefully" has needless     |                   |
+   |          |          | delay for PRI and SS7.       |                   |
+   |----------+----------+------------------------------+-------------------|
+   | 400279   | tzafrir  | man pages for astdb2bdb and  |                   |
+   |          |          | astdb2sqlite3                |                   |
+   |----------+----------+------------------------------+-------------------|
+   | 400315   | elguero  | Cast Integer Argument To     |                   |
+   |          |          | Unsigned Char                |                   |
+   |----------+----------+------------------------------+-------------------|
+   |          |          | app_confbridge: Fix          |                   |
+   | 400723   | rmudgett | duplicate default_user       |                   |
+   |          |          | profile.                     |                   |
+   |----------+----------+------------------------------+-------------------|
+   |          |          | chan_dahdi: Reflect the set  |                   |
+   | 400909   | rmudgett | software gain in the CLI     | ASTERISK-22429    |
+   |          |          | "dahdi show channel" output. |                   |
+   |----------+----------+------------------------------+-------------------|
+   |          |          | chan_iax2: Fix channel left  |                   |
+   | 401016   | rmudgett | locked in off nominal code   |                   |
+   |          |          | path.                        |                   |
+   |----------+----------+------------------------------+-------------------|
+   |          |          | Don't check all realtime     |                   |
+   | 401076   | wdoekes  | queues when doing "queue     |                   |
+   |          |          | show some_queue".            |                   |
+   |----------+----------+------------------------------+-------------------|
+   |          |          | chan_dahdi: Fix unable to    |                   |
+   | 401379   | rmudgett | get index warning when       |                   |
+   |          |          | transferring an analog call. |                   |
+   |----------+----------+------------------------------+-------------------|
+   |          |          | memory leaks: Memory leak    |                   |
+   | 401661   | jrose    | cleanup patch by Corey       |                   |
+   |          |          | Farrell (first set)          |                   |
+   |----------+----------+------------------------------+-------------------|
+   |          |          | memory leaks: Memory leak    |                   |
+   | 401705   | jrose    | cleanup patch by Corey       | ASTERISK-22467    |
+   |          |          | Farrell (second set)         |                   |
+   |----------+----------+------------------------------+-------------------|
+   | 401744   | jrose    | app_voicemail: Memory Leaks  | ASTERISK-22467    |
+   |          |          | against tests                |                   |
+   |----------+----------+------------------------------+-------------------|
+   | 401783   | jrose    | astobj2: Unregister debug    | ASTERISK-22467    |
+   |          |          | CLI commands at exit         |                   |
+   |----------+----------+------------------------------+-------------------|
+   | 401787   | jrose    | jitterbuf: Fix memory leak   | ASTERISK-22467    |
+   |          |          | on jitter buffer reset       |                   |
+   |----------+----------+------------------------------+-------------------|
+   | 401791   | jrose    | test_linkedlists: Fix memory | ASTERISK-22467    |
+   |          |          | leak                         |                   |
+   |----------+----------+------------------------------+-------------------|
+   | 401896   | jrose    | revert clicompat-r2.patch    | ASTERISK-22467    |
+   |          |          | from r401704                 |                   |
+   |----------+----------+------------------------------+-------------------|
+   | 401935   | jrose    | Put clicompat-r2.patch back  | ASTERISK-22467    |
+   |          |          | in                           |                   |
+   |----------+----------+------------------------------+-------------------|
+   | 403844   | bebuild  | Create 11.7.0-rc2            |                   |
+   |----------+----------+------------------------------+-------------------|
+   | 403849   | bebuild  | Update version; Remove old   |                   |
+   |          |          | summaries                    |                   |
+   |----------+----------+------------------------------+-------------------|
+   | 403978   | bebuild  | Update 11.7.0-rc2            |                   |
+   |----------+----------+------------------------------+-------------------|
+   | 403984   | bebuild  | Importing release summary    |                   |
+   |          |          | for 11.7.0-rc2 release.      |                   |
+   +------------------------------------------------------------------------+
+
+     ----------------------------------------------------------------------
+
+                                Diffstat Results
+
+                                 [Back to Top]
+
+   This is a summary of the changes to the source code that went into this
+   release that was generated using the diffstat utility.
+
+ .version                             |    2
+ ChangeLog                            |   29 +
+ Makefile                             |    1
+ README-SERIOUSLY.bestpractices.txt   |   24 +
+ UPGRADE.txt                          |   18 +
+ apps/app_confbridge.c                |    3
+ apps/app_queue.c                     |   37 +-
+ apps/app_sms.c                       |    3
+ apps/app_voicemail.c                 |    6
+ apps/confbridge/conf_config_parser.c |    4
+ apps/confbridge/include/confbridge.h |    1
+ asterisk-11.7.0-rc1-summary.html     |  437 ----------------------------
+ asterisk-11.7.0-rc1-summary.txt      |  544 -----------------------------------
+ asterisk-11.7.0-rc2-summary.html     |   73 ++++
+ asterisk-11.7.0-rc2-summary.txt      |  103 ++++++
+ cdr/cdr_adaptive_odbc.c              |    8
+ channels/chan_dahdi.c                |   55 ++-
+ channels/chan_iax2.c                 |   49 +--
+ channels/chan_mgcp.c                 |    6
+ channels/chan_sip.c                  |  147 ++++++---
+ channels/sig_analog.c                |   52 +--
+ channels/sig_ss7.c                   |    9
+ channels/sip/include/sip.h           |    1
+ channels/sip/reqresp_parser.c        |    6
+ codecs/ilbc/doCPLC.c                 |    2
+ configs/asterisk.conf.sample         |    6
+ configs/confbridge.conf.sample       |    3
+ configs/sip.conf.sample              |    3
+ configure.ac                         |   14
+ doc/astdb2bdb.8                      |   46 ++
+ doc/astdb2sqlite3.8                  |   39 ++
+ funcs/func_config.c                  |    4
+ funcs/func_db.c                      |   20 +
+ funcs/func_env.c                     |   28 +
+ funcs/func_lock.c                    |   21 +
+ funcs/func_math.c                    |    3
+ funcs/func_realtime.c                |   60 ++-
+ funcs/func_shell.c                   |   18 -
+ include/asterisk/pbx.h               |   64 ++++
+ include/asterisk/rtp_engine.h        |    6
+ main/app.c                           |    4
+ main/asterisk.c                      |   11
+ main/astobj2.c                       |    6
+ main/channel.c                       |   16 +
+ main/config_options.c                |   26 +
+ main/data.c                          |    3
+ main/editline/readline.c             |    7
+ main/editline/term.c                 |    6
+ main/jitterbuf.c                     |    6
+ main/logger.c                        |    3
+ main/pbx.c                           |  317 ++++++++++++++++++--
+ main/rtp_engine.c                    |   90 ++---
+ main/security_events.c               |    6
+ main/tcptls.c                        |   11
+ main/test.c                          |    6
+ main/translate.c                     |    4
+ main/utils.c                         |   20 +
+ res/res_jabber.c                     |    2
+ res/res_rtp_asterisk.c               |   69 +++-
+ res/res_rtp_multicast.c              |    8
+ res/res_xmpp.c                       |    2
+ tests/test_dlinklists.c              |    2
+ tests/test_linkedlists.c             |    7
+ utils/clicompat.c                    |   10
+ 64 files changed, 1308 insertions(+), 1289 deletions(-)
+
+     ----------------------------------------------------------------------
diff --git a/cdr/cdr_adaptive_odbc.c b/cdr/cdr_adaptive_odbc.c
index dd89dbe..3a91e9b 100644
--- a/cdr/cdr_adaptive_odbc.c
+++ b/cdr/cdr_adaptive_odbc.c
@@ -31,7 +31,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 360724 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401579 $")
 
 #include <sys/types.h>
 #include <time.h>
@@ -711,6 +711,14 @@ static int odbc_log(struct ast_cdr *cdr)
 					continue;
 				}
 				first = 0;
+			} else if (entry->filtervalue
+				&& ((!entry->negatefiltervalue && entry->filtervalue[0] != '\0')
+					|| (entry->negatefiltervalue && entry->filtervalue[0] == '\0'))) {
+				ast_verb(4, "CDR column '%s' was not set and does not match filter of"
+					" %s'%s'.  Cancelling this CDR.\n",
+					entry->cdrname, entry->negatefiltervalue ? "!" : "",
+					entry->filtervalue);
+				goto early_release;
 			}
 		}
 
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 17d8576..9540765 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -49,7 +49,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 397744 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401705 $")
 
 #if defined(__NetBSD__) || defined(__FreeBSD__)
 #include <pthread.h>
@@ -744,9 +744,9 @@ struct dahdi_pvt {
 	struct dahdi_pvt *oprpeer;				/*!< "Operator Services" peer tech_pvt ptr */
 	/*! \brief Amount of gain to increase during caller id */
 	float cid_rxgain;
-	/*! \brief Rx gain set by chan_dahdi.conf */
+	/*! \brief Software Rx gain set by chan_dahdi.conf */
 	float rxgain;
-	/*! \brief Tx gain set by chan_dahdi.conf */
+	/*! \brief Software Tx gain set by chan_dahdi.conf */
 	float txgain;
 
 	float txdrc; /*!< Dynamic Range Compression factor. a number between 1 and 6ish */
@@ -11949,6 +11949,11 @@ static struct dahdi_pvt *handle_init_event(struct dahdi_pvt *i, int event)
 	return NULL;
 }
 
+static void monitor_pfds_clean(void *arg) {
+	struct pollfd **pfds = arg;
+	ast_free(*pfds);
+}
+
 static void *do_monitor(void *data)
 {
 	int count, res, res2, spoint, pollres=0;
@@ -11972,6 +11977,7 @@ static void *do_monitor(void *data)
 #endif
 	pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
 
+	pthread_cleanup_push(monitor_pfds_clean, &pfds);
 	for (;;) {
 		/* Lock the interface list */
 		ast_mutex_lock(&iflock);
@@ -12231,6 +12237,7 @@ static void *do_monitor(void *data)
 		ast_mutex_unlock(&iflock);
 	}
 	/* Never reached */
+	pthread_cleanup_pop(1);
 	return NULL;
 
 }
@@ -15975,15 +15982,20 @@ static char *dahdi_set_hwgain(struct ast_cli_entry *e, int cmd, struct ast_cli_a
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "dahdi set hwgain";
+		e->command = "dahdi set hwgain {rx|tx}";
 		e->usage =
 			"Usage: dahdi set hwgain <rx|tx> <chan#> <gain>\n"
-			"	Sets the hardware gain on a a given channel, overriding the\n"
-			"   value provided at module loadtime, whether the channel is in\n"
-			"   use or not.  Changes take effect immediately.\n"
+			"   Sets the hardware gain on a given channel.  Changes take effect\n"
+			"   immediately whether the channel is in use or not.\n"
+			"\n"
 			"   <rx|tx> which direction do you want to change (relative to our module)\n"
 			"   <chan num> is the channel number relative to the device\n"
-			"   <gain> is the gain in dB (e.g. -3.5 for -3.5dB)\n";
+			"   <gain> is the gain in dB (e.g. -3.5 for -3.5dB)\n"
+			"\n"
+			"   Please note:\n"
+			"   * This is currently the only way to set hwgain by the channel driver.\n"
+			"   * hwgain is only supportable by hardware with analog ports because\n"
+			"     hwgain works on the analog side of an analog-digital conversion.\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
@@ -16044,12 +16056,13 @@ static char *dahdi_set_swgain(struct ast_cli_entry *e, int cmd, struct ast_cli_a
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "dahdi set swgain";
+		e->command = "dahdi set swgain {rx|tx}";
 		e->usage =
 			"Usage: dahdi set swgain <rx|tx> <chan#> <gain>\n"
-			"	Sets the software gain on a a given channel, overriding the\n"
-			"   value provided at module loadtime, whether the channel is in\n"
-			"   use or not.  Changes take effect immediately.\n"
+			"   Sets the software gain on a given channel and overrides the\n"
+			"   value provided at module loadtime.  Changes take effect\n"
+			"   immediately whether the channel is in use or not.\n"
+			"\n"
 			"   <rx|tx> which direction do you want to change (relative to our module)\n"
 			"   <chan num> is the channel number relative to the device\n"
 			"   <gain> is the gain in dB (e.g. -3.5 for -3.5dB)\n";
@@ -16093,6 +16106,12 @@ static char *dahdi_set_swgain(struct ast_cli_entry *e, int cmd, struct ast_cli_a
 
 		ast_cli(a->fd, "software %s gain set to %.1f on channel %d\n",
 			tx ? "tx" : "rx", gain, channel);
+
+		if (tx) {
+			tmp->txgain = gain;
+		} else {
+			tmp->rxgain = gain;
+		}
 		break;
 	}
 	ast_mutex_unlock(&iflock);
@@ -17065,8 +17084,10 @@ static int __unload_module(void)
 
 #ifdef HAVE_PRI
 	for (i = 0; i < NUM_SPANS; i++) {
-		if (pris[i].pri.master != AST_PTHREADT_NULL)
+		if (pris[i].pri.master != AST_PTHREADT_NULL) {
 			pthread_cancel(pris[i].pri.master);
+			pthread_kill(pris[i].pri.master, SIGURG);
+		}
 	}
 	ast_cli_unregister_multiple(dahdi_pri_cli, ARRAY_LEN(dahdi_pri_cli));
 	ast_unregister_application(dahdi_send_keypad_facility_app);
@@ -17076,9 +17097,11 @@ static int __unload_module(void)
 #endif
 #if defined(HAVE_SS7)
 	for (i = 0; i < NUM_SPANS; i++) {
-		if (linksets[i].ss7.master != AST_PTHREADT_NULL)
+		if (linksets[i].ss7.master != AST_PTHREADT_NULL) {
 			pthread_cancel(linksets[i].ss7.master);
+			pthread_kill(linksets[i].ss7.master, SIGURG);
 		}
+	}
 	ast_cli_unregister_multiple(dahdi_ss7_cli, ARRAY_LEN(dahdi_ss7_cli));
 #endif	/* defined(HAVE_SS7) */
 #if defined(HAVE_OPENR2)
@@ -17122,8 +17145,9 @@ static int __unload_module(void)
 
 #if defined(HAVE_PRI)
 	for (i = 0; i < NUM_SPANS; i++) {
-		if (pris[i].pri.master && (pris[i].pri.master != AST_PTHREADT_NULL))
+		if (pris[i].pri.master && (pris[i].pri.master != AST_PTHREADT_NULL)) {
 			pthread_join(pris[i].pri.master, NULL);
+		}
 		for (j = 0; j < SIG_PRI_NUM_DCHANS; j++) {
 			dahdi_close_pri_fd(&(pris[i]), j);
 		}
@@ -17138,8 +17162,9 @@ static int __unload_module(void)
 
 #if defined(HAVE_SS7)
 	for (i = 0; i < NUM_SPANS; i++) {
-		if (linksets[i].ss7.master && (linksets[i].ss7.master != AST_PTHREADT_NULL))
+		if (linksets[i].ss7.master && (linksets[i].ss7.master != AST_PTHREADT_NULL)) {
 			pthread_join(linksets[i].ss7.master, NULL);
+		}
 		for (j = 0; j < SIG_SS7_NUM_DCHANS; j++) {
 			dahdi_close_ss7_fd(&(linksets[i]), j);
 		}
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index a68f20d..cef349c 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -38,7 +38,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 399159 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401016 $")
 
 #include <sys/mman.h>
 #include <dirent.h>
@@ -5655,35 +5655,44 @@ static enum ast_bridge_result iax2_bridge(struct ast_channel *c0, struct ast_cha
 			break;
 		}
 		other = (who == c0) ? c1 : c0;  /* the 'other' channel */
-		if ((f->frametype == AST_FRAME_CONTROL)) {
-			if (f->subclass.integer == AST_CONTROL_PVT_CAUSE_CODE) {
+		if (f->frametype == AST_FRAME_CONTROL && !(flags & AST_BRIDGE_IGNORE_SIGS)) {
+			switch (f->subclass.integer) {
+			case AST_CONTROL_VIDUPDATE:
+			case AST_CONTROL_SRCUPDATE:
+			case AST_CONTROL_SRCCHANGE:
+			case AST_CONTROL_T38_PARAMETERS:
+				ast_write(other, f);
+				break;
+			case AST_CONTROL_PVT_CAUSE_CODE:
 				ast_channel_hangupcause_hash_set(other, f->data.ptr, f->datalen);
-			} else if (!(flags & AST_BRIDGE_IGNORE_SIGS)
-				&& (f->subclass.integer != AST_CONTROL_SRCUPDATE)) {
+				break;
+			default:
 				*fo = f;
 				*rc = who;
-				res =  AST_BRIDGE_COMPLETE;
+				res = AST_BRIDGE_COMPLETE;
 				break;
 			}
-		}
-		if ((f->frametype == AST_FRAME_VOICE) ||
-			(f->frametype == AST_FRAME_TEXT) ||
-			(f->frametype == AST_FRAME_VIDEO) || 
-			(f->frametype == AST_FRAME_IMAGE) ||
-			(f->frametype == AST_FRAME_DTMF) ||
-			(f->frametype == AST_FRAME_CONTROL && f->subclass.integer != AST_CONTROL_PVT_CAUSE_CODE)) {
+			if (res == AST_BRIDGE_COMPLETE) {
+				break;
+			}
+		} else if (f->frametype == AST_FRAME_VOICE
+			|| f->frametype == AST_FRAME_TEXT
+			|| f->frametype == AST_FRAME_VIDEO
+			|| f->frametype == AST_FRAME_IMAGE) {
+			ast_write(other, f);
+		} else if (f->frametype == AST_FRAME_DTMF) {
 			/* monitored dtmf take out of the bridge.
 			 * check if we monitor the specific source.
 			 */
 			int monitored_source = (who == c0) ? AST_BRIDGE_DTMF_CHANNEL_0 : AST_BRIDGE_DTMF_CHANNEL_1;
-			if (f->frametype == AST_FRAME_DTMF && (flags & monitored_source)) {
+
+			if (flags & monitored_source) {
 				*rc = who;
 				*fo = f;
 				res = AST_BRIDGE_COMPLETE;
 				/* Remove from native mode */
 				break;
 			}
-			/* everything else goes to the other side */
 			ast_write(other, f);
 		}
 		ast_frfree(f);
@@ -8718,7 +8727,7 @@ static void __expire_registry(const void *data)
 		realtime_update_peer(peer->name, &peer->addr, 0);
 	manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "ChannelType: IAX2\r\nPeer: IAX2/%s\r\nPeerStatus: Unregistered\r\nCause: Expired\r\n", peer->name);
 	/* modify entry in peercnts table as _not_ registered */
-	peercnt_modify(0, 0, &peer->addr);
+	peercnt_modify((unsigned char) 0, 0, &peer->addr);
 	/* Reset the address */
 	memset(&peer->addr, 0, sizeof(peer->addr));
 	/* Reset expiry value */
@@ -8860,7 +8869,7 @@ static int update_registry(struct sockaddr_in *sin, int callno, char *devtype, i
 		}
 
 		/* modify entry in peercnts table as _not_ registered */
-		peercnt_modify(0, 0, &p->addr);
+		peercnt_modify((unsigned char) 0, 0, &p->addr);
 
 		/* Stash the IP address from which they registered */
 		ast_sockaddr_from_sin(&p->addr, sin);
@@ -8888,7 +8897,7 @@ static int update_registry(struct sockaddr_in *sin, int callno, char *devtype, i
 
 	/* modify entry in peercnts table as registered */
 	if (p->maxcallno) {
-		peercnt_modify(1, p->maxcallno, &p->addr);
+		peercnt_modify((unsigned char) 1, p->maxcallno, &p->addr);
 	}
 
 	/* Make sure our call still exists, an INVAL at the right point may make it go away */
@@ -10533,9 +10542,9 @@ static int socket_process_helper(struct iax2_thread *thread)
 										ast_set_read_format(iaxs[fr->callno]->owner, ast_channel_readformat(iaxs[fr->callno]->owner));
 									}
 									ast_format_cap_copy(native, orignative);
-									ast_channel_unlock(iaxs[fr->callno]->owner);
 									orignative = ast_format_cap_destroy(orignative);
 								}
+								ast_channel_unlock(iaxs[fr->callno]->owner);
 							}
 						} else {
 							ast_debug(1, "Neat, somebody took away the channel at a magical time but i found it!\n");
@@ -12681,7 +12690,7 @@ static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, st
 			peer->pokefreqok = DEFAULT_FREQ_OK;
 			peer->pokefreqnotok = DEFAULT_FREQ_NOTOK;
 			peer->maxcallno = 0;
-			peercnt_modify(0, 0, &peer->addr);
+			peercnt_modify((unsigned char) 0, 0, &peer->addr);
 			peer->calltoken_required = CALLTOKEN_DEFAULT;
 			ast_string_field_set(peer,context,"");
 			ast_string_field_set(peer,peercontext,"");
@@ -12869,7 +12878,7 @@ static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, st
 				if (sscanf(v->value, "%10hu", &peer->maxcallno) != 1) {
 					ast_log(LOG_WARNING, "maxcallnumbers must be set to a valid number. %s is not valid at line %d.\n", v->value, v->lineno);
 				} else {
-					peercnt_modify(1, peer->maxcallno, &peer->addr);
+					peercnt_modify((unsigned char) 1, peer->maxcallno, &peer->addr);
 				}
 			} else if (!strcasecmp(v->name, "requirecalltoken")) {
 				/* default is required unless in optional ip list */
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index ccb3ebe..d519b6d 100644
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -36,7 +36,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 366408 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401538 $")
 
 #include <sys/socket.h>
 #include <sys/ioctl.h>
@@ -1960,7 +1960,7 @@ static int process_sdp(struct mgcp_subchannel *sub, struct mgcp_request *req)
 	char *c;
 	char *a;
 	char host[258];
-	int len;
+	int len = 0;
 	int portno;
 	struct ast_format_cap *peercap;
 	int peerNonCodecCapability;
@@ -1990,8 +1990,8 @@ static int process_sdp(struct mgcp_subchannel *sub, struct mgcp_request *req)
 		ast_log(LOG_WARNING, "Unable to lookup host in c= line, '%s'\n", c);
 		return -1;
 	}
-	if (sscanf(m, "audio %30d RTP/AVP %n", &portno, &len) != 1) {
-		ast_log(LOG_WARNING, "Unable to determine port number for RTP in '%s'\n", m);
+	if (sscanf(m, "audio %30d RTP/AVP %n", &portno, &len) != 1 || !len) {
+		ast_log(LOG_WARNING, "Malformed media stream descriptor: %s\n", m);
 		return -1;
 	}
 	sin.sin_family = AF_INET;
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 2e96a4f..4fc2322 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -210,7 +210,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401235 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401884 $")
 
 #include <signal.h>
 #include <sys/signal.h>
@@ -770,6 +770,7 @@ static int global_rtpholdtimeout;   /*!< Time out call if no RTP during hold */
 static int global_rtpkeepalive;     /*!< Send RTP keepalives */
 static int global_reg_timeout;      /*!< Global time between attempts for outbound registrations */
 static int global_regattempts_max;  /*!< Registration attempts before giving up */
+static int global_reg_retry_403;    /*!< Treat 403 responses to registrations as 401 responses */
 static int global_shrinkcallerid;   /*!< enable or disable shrinking of caller id  */
 static int global_callcounter;      /*!< Enable call counters for all devices. This is currently enabled by setting the peer
                                      *   call-limit to INT_MAX. When we remove the call-limit from the code, we can make it
@@ -7257,6 +7258,7 @@ static int sip_answer(struct ast_channel *ast)
 {
 	int res = 0;
 	struct sip_pvt *p = ast_channel_tech_pvt(ast);
+	int oldsdp = FALSE;
 
 	if (!p) {
 		ast_debug(1, "Asked to answer channel %s without tech pvt; ignoring\n",
@@ -7267,10 +7269,14 @@ static int sip_answer(struct ast_channel *ast)
 	if (ast_channel_state(ast) != AST_STATE_UP) {
 		try_suggested_sip_codec(p);
 
+		if (ast_test_flag(&p->flags[0], SIP_PROGRESS_SENT)) {
+			oldsdp = TRUE;
+		}
+
 		ast_setstate(ast, AST_STATE_UP);
 		ast_debug(1, "SIP answering channel: %s\n", ast_channel_name(ast));
 		ast_rtp_instance_update_source(p->rtp);
-		res = transmit_response_with_sdp(p, "200 OK", &p->initreq, XMIT_CRITICAL, FALSE, TRUE);
+		res = transmit_response_with_sdp(p, "200 OK", &p->initreq, XMIT_CRITICAL, oldsdp, TRUE);
 		ast_set_flag(&p->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED);
 	}
 	sip_pvt_unlock(p);
@@ -10104,11 +10110,26 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
 				}
 
 				if ((!strcmp(protocol, "RTP/SAVPF") || !strcmp(protocol, "UDP/TLS/RTP/SAVPF")) && !ast_test_flag(&p->flags[2], SIP_PAGE3_USE_AVPF)) {
-					ast_log(LOG_WARNING, "Received SAVPF profle in audio offer but AVPF is not enabled: %s\n", m);
-					continue;
+					if (req->method != SIP_RESPONSE) {
+						ast_log(LOG_NOTICE, "Received SAVPF profle in audio offer but AVPF is not enabled, enabling: %s\n", m);
+						secure_audio = 1;
+						ast_set_flag(&p->flags[2], SIP_PAGE3_USE_AVPF);
+					}
+					else {
+
+						ast_log(LOG_WARNING, "Received SAVPF profle in audio answer but AVPF is not enabled: %s\n", m);
+						continue;
+					}
 				} else if ((!strcmp(protocol, "RTP/SAVP") || !strcmp(protocol, "UDP/TLS/RTP/SAVP")) && ast_test_flag(&p->flags[2], SIP_PAGE3_USE_AVPF)) {
-					ast_log(LOG_WARNING, "Received SAVP profile in audio offer but AVPF is enabled: %s\n", m);
-					continue;
+					if (req->method != SIP_RESPONSE) {
+						ast_log(LOG_NOTICE, "Received SAVP profle in audio offer but AVPF is enabled, disabling: %s\n", m);
+						secure_audio = 1;
+						ast_clear_flag(&p->flags[2], SIP_PAGE3_USE_AVPF);
+					}
+					else {
+						ast_log(LOG_WARNING, "Received SAVP profile in audio offer but AVPF is enabled: %s\n", m);
+						continue;
+					}
 				} else if (!strcmp(protocol, "UDP/TLS/RTP/SAVP") || !strcmp(protocol, "UDP/TLS/RTP/SAVPF")) {
 					secure_audio = 1;
 
@@ -10118,11 +10139,23 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
 				} else if (!strcmp(protocol, "RTP/SAVP") || !strcmp(protocol, "RTP/SAVPF")) {
 					secure_audio = 1;
 				} else if (!strcmp(protocol, "RTP/AVPF") && !ast_test_flag(&p->flags[2], SIP_PAGE3_USE_AVPF)) {
-					ast_log(LOG_WARNING, "Received AVPF profile in audio offer but AVPF is not enabled: %s\n", m);
-					continue;
+					if (req->method != SIP_RESPONSE) {
+						ast_log(LOG_NOTICE, "Received AVPF profile in audio offer but AVPF is not enabled, enabling: %s\n", m);
+						ast_set_flag(&p->flags[2], SIP_PAGE3_USE_AVPF);
+					}
+					else {
+						ast_log(LOG_WARNING, "Received AVP profile in audio answer but AVPF is enabled: %s\n", m);
+						continue;
+					}
 				} else if (!strcmp(protocol, "RTP/AVP") && ast_test_flag(&p->flags[2], SIP_PAGE3_USE_AVPF)) {
-					ast_log(LOG_WARNING, "Received AVP profile in audio offer but AVPF is enabled: %s\n", m);
-					continue;
+					if (req->method != SIP_RESPONSE) {
+						ast_log(LOG_NOTICE, "Received AVP profile in audio answer but AVPF is enabled, disabling: %s\n", m);
+						ast_clear_flag(&p->flags[2], SIP_PAGE3_USE_AVPF);
+					}
+					else {
+						ast_log(LOG_WARNING, "Received AVP profile in audio answer but AVPF is enabled: %s\n", m);
+						continue;
+					}
 				} else if ((!strcmp(protocol, "UDP/TLS/RTP/SAVP") || !strcmp(protocol, "UDP/TLS/RTP/SAVPF")) &&
 					   (!(dtls = ast_rtp_instance_get_dtls(p->rtp)) || !dtls->active(p->rtp))) {
 					ast_log(LOG_WARNING, "Received UDP/TLS in audio offer but DTLS is not enabled: %s\n", m);
@@ -13191,19 +13224,18 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
 		*/
 
 		/* Prefer the audio codec we were requested to use, first, no matter what
-		   Note that p->prefcodec can include video codecs, so mask them out
+		   Note that p->prefcodec can include video codecs, so ignore them
 		*/
-		if (ast_format_cap_has_joint(tmpcap, p->prefcaps)) {
-			ast_format_cap_iter_start(p->prefcaps);
-			while (!(ast_format_cap_iter_next(p->prefcaps, &tmp_fmt))) {
-				if (AST_FORMAT_GET_TYPE(tmp_fmt.id) != AST_FORMAT_TYPE_AUDIO) {
-					continue;
-				}
-				add_codec_to_sdp(p, &tmp_fmt, &m_audio, &a_audio, debug, &min_audio_packet_size);
-				ast_format_cap_add(alreadysent, &tmp_fmt);
+		ast_format_cap_iter_start(p->prefcaps);
+		while (!(ast_format_cap_iter_next(p->prefcaps, &tmp_fmt))) {
+			if (AST_FORMAT_GET_TYPE(tmp_fmt.id) != AST_FORMAT_TYPE_AUDIO ||
+				!ast_format_cap_iscompatible(tmpcap, &tmp_fmt)) {
+				continue;
 			}
-			ast_format_cap_iter_end(p->prefcaps);
+			add_codec_to_sdp(p, &tmp_fmt, &m_audio, &a_audio, debug, &min_audio_packet_size);
+			ast_format_cap_add(alreadysent, &tmp_fmt);
 		}
+		ast_format_cap_iter_end(p->prefcaps);
 
 		/* Start by sending our preferred audio/video codecs */
 		for (x = 0; x < AST_CODEC_PREF_SIZE; x++) {
@@ -13282,13 +13314,9 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
 		/* Our T.38 end is */
 		ast_udptl_get_us(p->udptl, &udptladdr);
 
-		/* Determine T.38 UDPTL destination */
-		if (!ast_sockaddr_isnull(&p->udptlredirip)) {
-			ast_sockaddr_copy(&udptldest, &p->udptlredirip);
-		} else {
-			ast_sockaddr_copy(&udptldest, &p->ourip);
-			ast_sockaddr_set_port(&udptldest, ast_sockaddr_port(&udptladdr));
-		}
+		/* We don't use directmedia for T.38, so keep the destination the same as our IP address. */
+		ast_sockaddr_copy(&udptldest, &p->ourip);
+		ast_sockaddr_set_port(&udptldest, ast_sockaddr_port(&udptladdr));
 
 		if (debug) {
 			ast_debug(1, "T.38 UDPTL is at %s port %d\n", ast_sockaddr_stringify_addr(&p->ourip), ast_sockaddr_port(&udptladdr));
@@ -13299,9 +13327,9 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
 
 		ast_str_append(&m_modem, 0, "m=image %d udptl t38\r\n", ast_sockaddr_port(&udptldest));
 
-		if (!ast_sockaddr_cmp(&udptldest, &dest)) {
+		if (ast_sockaddr_cmp(&udptldest, &dest)) {
 			ast_str_append(&m_modem, 0, "c=IN %s %s\r\n",
-					(ast_sockaddr_is_ipv6(&dest) && !ast_sockaddr_is_ipv4_mapped(&dest)) ?
+					(ast_sockaddr_is_ipv6(&udptldest) && !ast_sockaddr_is_ipv4_mapped(&udptldest)) ?
 					"IP6" : "IP4", ast_sockaddr_stringify_addr_remote(&udptldest));
 		}
 
@@ -15912,6 +15940,14 @@ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, st
 		}
 	}
 
+	if (expire > max_expiry) {
+		expire = max_expiry;
+	}
+	if (expire < min_expiry && expire != 0) {
+		expire = min_expiry;
+	}
+	pvt->expiry = expire;
+
 	copy_socket_data(&pvt->socket, &req->socket);
 
 	do {
@@ -16051,12 +16087,6 @@ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, st
 	AST_SCHED_DEL_UNREF(sched, peer->expire,
 			sip_unref_peer(peer, "remove register expire ref"));
 
-	if (expire > max_expiry) {
-		expire = max_expiry;
-	}
-	if (expire < min_expiry) {
-		expire = min_expiry;
-	}
 	if (peer->is_realtime && !ast_test_flag(&peer->flags[1], SIP_PAGE2_RTCACHEFRIENDS)) {
 		peer->expire = -1;
 	} else {
@@ -16066,7 +16096,6 @@ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, st
 			sip_unref_peer(peer, "remote registration ref");
 		}
 	}
-	pvt->expiry = expire;
 	snprintf(data, sizeof(data), "%s:%d:%s:%s", ast_sockaddr_stringify(&peer->addr),
 		 expire, peer->username, peer->fullcontact);
 	/* We might not immediately be able to reconnect via TCP, but try caching it anyhow */
@@ -16918,7 +16947,10 @@ static enum check_auth_result register_verify(struct sip_pvt *p, struct ast_sock
 						break;
 					case PARSE_REGISTER_UPDATE:
 						ast_string_field_set(p, fullcontact, peer->fullcontact);
-						update_peer(peer, p->expiry);
+						/* If expiry is 0, peer has been unregistered already */
+						if (p->expiry != 0) {
+							update_peer(peer, p->expiry);
+						}
 						/* Say OK and ask subsystem to retransmit msg counter */
 						transmit_response_with_date(p, "200 OK", req);
 						send_mwi = 1;
@@ -18275,9 +18307,9 @@ static enum check_auth_result check_user_full(struct sip_pvt *p, struct sip_requ
 					      int sipmethod, const char *uri, enum xmittype reliable,
 					      struct ast_sockaddr *addr, struct sip_peer **authpeer)
 {
-	char from[256] = "", *of, *name, *unused_password, *domain;
+	char from[256], *of, *name, *unused_password, *domain;
 	enum check_auth_result res = AUTH_DONT_KNOW;
-	char calleridname[50];
+	char calleridname[256];
 	char *uri2 = ast_strdupa(uri);
 
 	terminate_uri(uri2);	/* trim extra stuff */
@@ -20682,6 +20714,7 @@ static char *sip_show_settings(struct ast_cli_entry *e, int cmd, struct ast_cli_
 	ast_cli(a->fd, "  Sub. max duration:      %d secs\n", max_subexpiry);
 	ast_cli(a->fd, "  Outbound reg. timeout:  %d secs\n", global_reg_timeout);
 	ast_cli(a->fd, "  Outbound reg. attempts: %d\n", global_regattempts_max);
+	ast_cli(a->fd, "  Outbound reg. retry 403:%d\n", global_reg_retry_403);
 	ast_cli(a->fd, "  Notify ringing state:   %s\n", AST_CLI_YESNO(sip_cfg.notifyringing));
 	if (sip_cfg.notifyringing) {
 		ast_cli(a->fd, "    Include CID:          %s%s\n",
@@ -22780,13 +22813,26 @@ static void handle_response_invite(struct sip_pvt *p, int resp, const char *rest
 		}
 		p->authtries = 0;
 		if (find_sdp(req)) {
-			if ((res = process_sdp(p, req, SDP_T38_ACCEPT)) && !req->ignore)
+			if ((res = process_sdp(p, req, SDP_T38_ACCEPT)) && !req->ignore) {
 				if (!reinvite) {
 					/* This 200 OK's SDP is not acceptable, so we need to ack, then hangup */
 					/* For re-invites, we try to recover */
 					ast_set_flag(&p->flags[0], SIP_PENDINGBYE);
+					ast_channel_hangupcause_set(p->owner, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
+					p->hangupcause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL;
+					sip_queue_hangup_cause(p, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
 				}
+			}
 			ast_rtp_instance_activate(p->rtp);
+		} else if (!reinvite) {
+			struct ast_sockaddr remote_address = {{0,}};
+
+			ast_rtp_instance_get_remote_address(p->rtp, &remote_address);
+			if (ast_sockaddr_isnull(&remote_address) || (!ast_strlen_zero(p->theirprovtag) && strcmp(p->theirtag, p->theirprovtag))) {
+				ast_log(LOG_WARNING, "Received response: \"200 OK\" from '%s' without SDP\n", p->relatedpeer->name);
+				ast_set_flag(&p->flags[0], SIP_PENDINGBYE);
+				ast_rtp_instance_activate(p->rtp);
+			}
 		}
 
 		if (!req->ignore && p->owner) {
@@ -22846,7 +22892,7 @@ static void handle_response_invite(struct sip_pvt *p, int resp, const char *rest
 		}
 
 		if (!req->ignore && p->owner) {
-			if (!reinvite) {
+			if (!reinvite && !res) {
 				ast_queue_control(p->owner, AST_CONTROL_ANSWER);
 				if (sip_cfg.callevents) {
 					manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
@@ -23406,8 +23452,9 @@ static int handle_response_register(struct sip_pvt *p, int resp, const char *res
 			}
 			tmptmp = strcasestr(contact, "expires=");
 			if (tmptmp) {
-				if (sscanf(tmptmp + 8, "%30d;", &expires) != 1)
+				if (sscanf(tmptmp + 8, "%30d", &expires) != 1) {
 					expires = 0;
+				}
 			}
 			
 		}
@@ -23709,7 +23756,11 @@ static void handle_response(struct sip_pvt *p, int resp, const char *rest, struc
 
 		gettag(req, "To", tag, sizeof(tag));
 		ast_string_field_set(p, theirtag, tag);
+	} else {
+		/* Store theirtag to track for changes when 200 responses to invites are received without SDP */
+		ast_string_field_set(p, theirprovtag, p->theirtag);
 	}
+
 	/* This needs to be configurable on a channel/peer level,
 	   not mandatory for all communication. Sadly enough, NAT implementations
 	   are not so stable so we can always rely on these headers.
@@ -31376,6 +31427,7 @@ static int reload_config(enum channelreloadreason reason)
 	sip_cfg.compactheaders = DEFAULT_COMPACTHEADERS;
 	global_reg_timeout = DEFAULT_REGISTRATION_TIMEOUT;
 	global_regattempts_max = 0;
+	global_reg_retry_403 = 0;
 	sip_cfg.pedanticsipchecking = DEFAULT_PEDANTIC;
 	sip_cfg.autocreatepeer = DEFAULT_AUTOCREATEPEER;
 	global_autoframing = 0;
@@ -31763,6 +31815,8 @@ static int reload_config(enum channelreloadreason reason)
 			}
 		} else if (!strcasecmp(v->name, "registerattempts")) {
 			global_regattempts_max = atoi(v->value);
+		} else if (!strcasecmp(v->name, "register_retry_403")) {
+			global_reg_retry_403 = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "bindaddr") || !strcasecmp(v->name, "udpbindaddr")) {
 			if (ast_parse_arg(v->value, PARSE_ADDR, &bindaddr)) {
 				ast_log(LOG_WARNING, "Invalid address: %s\n", v->value);
diff --git a/channels/sig_analog.c b/channels/sig_analog.c
index 85fda9d..ca0724a 100644
--- a/channels/sig_analog.c
+++ b/channels/sig_analog.c
@@ -689,13 +689,11 @@ static int analog_is_dialing(struct analog_pvt *p, enum analog_sub index)
  * \param p Analog private structure.
  * \param inthreeway TRUE if the 3-way call is conferenced.
  *
- * \note
- * On entry these locks are held: real-call, private, 3-way call.
+ * \note On entry these locks are held: real-call, private, 3-way call.
+ * \note On exit these locks are held: real-call, private.
  *
- * \retval 1 Transfer successful.  3-way call is unlocked and subchannel is unalloced.
- *         Swapped real and 3-way subchannel.
- * \retval 0 Transfer successful.  3-way call is unlocked and subchannel is unalloced.
- * \retval -1 on error.  Caller must unlock 3-way call.
+ * \retval 0 on success.
+ * \retval -1 on error.
  */
 static int analog_attempt_transfer(struct analog_pvt *p, int inthreeway)
 {
@@ -703,6 +701,7 @@ static int analog_attempt_transfer(struct analog_pvt *p, int inthreeway)
 	struct ast_channel *owner_3way;
 	struct ast_channel *bridge_real;
 	struct ast_channel *bridge_3way;
+	int ret = 0;
 
 	owner_real = p->subs[ANALOG_SUB_REAL].owner;
 	owner_3way = p->subs[ANALOG_SUB_THREEWAY].owner;
@@ -730,15 +729,8 @@ static int analog_attempt_transfer(struct analog_pvt *p, int inthreeway)
 			bridge_3way, ast_channel_connected(owner_3way), !inthreeway)) {
 			ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n",
 				ast_channel_name(bridge_3way), ast_channel_name(owner_real));
-			return -1;
+			ret = -1;
 		}
-
-		/* Three-way is now the REAL */
-		analog_swap_subs(p, ANALOG_SUB_THREEWAY, ANALOG_SUB_REAL);
-		ast_channel_unlock(owner_3way);
-		analog_unalloc_sub(p, ANALOG_SUB_THREEWAY);
-		/* Tell the caller not to hangup */
-		return 1;
 	} else if (bridge_real) {
 		/* Try transferring the other way. */
 		ast_verb(3, "TRANSFERRING %s to %s\n", ast_channel_name(owner_real), ast_channel_name(owner_3way));
@@ -756,18 +748,19 @@ static int analog_attempt_transfer(struct analog_pvt *p, int inthreeway)
 			!inthreeway, bridge_real, ast_channel_connected(owner_real), 0)) {
 			ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n",
 				ast_channel_name(bridge_real), ast_channel_name(owner_3way));
-			return -1;
+			ret = -1;
 		}
-
-		/* Orphan the channel after releasing the lock */
-		ast_channel_unlock(owner_3way);
-		analog_unalloc_sub(p, ANALOG_SUB_THREEWAY);
-		return 0;
 	} else {
 		ast_debug(1, "Neither %s nor %s are in a bridge, nothing to transfer\n",
 			ast_channel_name(owner_real), ast_channel_name(owner_3way));
-		return -1;
+		ret = -1;
+	}
+
+	if (ret) {
+		ast_softhangup_nolock(owner_3way, AST_SOFTHANGUP_DEV);
 	}
+	ast_channel_unlock(owner_3way);
+	return ret;
 }
 
 static int analog_update_conf(struct analog_pvt *p)
@@ -2912,16 +2905,13 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
 								analog_set_new_owner(p, NULL);
 								/* Ring the phone */
 								analog_ring(p);
-							} else {
-								res = analog_attempt_transfer(p, inthreeway);
-								if (res < 0) {
-									/* Transfer attempt failed. */
-									ast_softhangup_nolock(p->subs[ANALOG_SUB_THREEWAY].owner, AST_SOFTHANGUP_DEV);
-									ast_channel_unlock(p->subs[ANALOG_SUB_THREEWAY].owner);
-								} else if (res) {
-									/* Don't actually hang up at this point */
-									break;
-								}
+							} else if (!analog_attempt_transfer(p, inthreeway)) {
+								/*
+								 * Transfer successful.  Don't actually hang up at this point.
+								 * Let our channel legs of the calls die off as the transfer
+								 * percolates through the core.
+								 */
+								break;
 							}
 						} else {
 							ast_softhangup_nolock(p->subs[ANALOG_SUB_THREEWAY].owner, AST_SOFTHANGUP_DEV);
diff --git a/channels/sig_ss7.c b/channels/sig_ss7.c
index baf152d..e6e11be 100644
--- a/channels/sig_ss7.c
+++ b/channels/sig_ss7.c
@@ -788,7 +788,9 @@ void *ss7_linkset(void *data)
 	ss7_event *e = NULL;
 	struct sig_ss7_chan *p;
 	struct pollfd pollers[SIG_SS7_NUM_DCHANS];
-	int nextms = 0;
+	int nextms;
+
+#define SS7_MAX_POLL	60000	/* Maximum poll time in ms. */
 
 	pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
 
@@ -813,6 +815,11 @@ void *ss7_linkset(void *data)
 			}
 			nextms = tv.tv_sec * 1000;
 			nextms += tv.tv_usec / 1000;
+			if (SS7_MAX_POLL < nextms) {
+				nextms = SS7_MAX_POLL;
+			}
+		} else {
+			nextms = SS7_MAX_POLL;
 		}
 
 		for (i = 0; i < linkset->numsigchans; i++) {
diff --git a/channels/sip/include/sip.h b/channels/sip/include/sip.h
index 073f5f4..d8bee12 100644
--- a/channels/sip/include/sip.h
+++ b/channels/sip/include/sip.h
@@ -1038,6 +1038,7 @@ struct sip_pvt {
 		AST_STRING_FIELD(rdnis);        /*!< Referring DNIS */
 		AST_STRING_FIELD(redircause);   /*!< Referring cause */
 		AST_STRING_FIELD(theirtag);     /*!< Their tag */
+		AST_STRING_FIELD(theirprovtag); /*!< Provisional their tag, used when evaluating responses to invites */
 		AST_STRING_FIELD(tag);          /*!< Our tag for this session */
 		AST_STRING_FIELD(username);     /*!< [user] name */
 		AST_STRING_FIELD(peername);     /*!< [peer] name, not set if [user] */
diff --git a/channels/sip/reqresp_parser.c b/channels/sip/reqresp_parser.c
index 403aa22..006d526 100644
--- a/channels/sip/reqresp_parser.c
+++ b/channels/sip/reqresp_parser.c
@@ -25,7 +25,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 379393 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401661 $")
 
 #include "include/sip.h"
 #include "include/sip_utils.h"
@@ -806,7 +806,7 @@ AST_TEST_DEFINE(get_calleridname_test)
 int get_name_and_number(const char *hdr, char **name, char **number)
 {
 	char header[256];
-	char tmp_name[50];
+	char tmp_name[256];
 	char *tmp_number = NULL;
 	char *hostport = NULL;
 	char *dummy = NULL;
@@ -1562,6 +1562,10 @@ AST_TEST_DEFINE(parse_contact_header_test)
 
 				contactptr = AST_LIST_NEXT(contactptr,list);
 			}
+
+			while ((contactptr = AST_LIST_REMOVE_HEAD(contactlistptr,list))) {
+				ast_free(contactptr);
+			}
 		}
 	}
 
diff --git a/configs/confbridge.conf.sample b/configs/confbridge.conf.sample
index 08a2dd3..a4f829a 100644
--- a/configs/confbridge.conf.sample
+++ b/configs/confbridge.conf.sample
@@ -197,6 +197,9 @@ type=bridge
                            ;               is the single source of video distribution among all participants. If
                            ;               that user leaves, the marked user to join after them becomes the source.
 
+;language=en               ; Set the language used for announcements to the conference.
+                           ; Default is en (English).
+
 ; All sounds in the conference are customizable using the bridge profile options below.
 ; Simply state the option followed by the filename or full path of the filename after
 ; the option.  Example: sound_had_joined=conf-hasjoin  This will play the conf-hasjoin
diff --git a/configs/sip.conf.sample b/configs/sip.conf.sample
index 702f6e5..562b64c 100644
--- a/configs/sip.conf.sample
+++ b/configs/sip.conf.sample
@@ -774,6 +774,9 @@ srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
                                 ; 0 = continue forever, hammering the other server
                                 ; until it accepts the registration
                                 ; Default is 0 tries, continue forever
+;register_retry_403=yes         ; Treat 403 responses to registrations as if they were
+                                ; 401 responses and continue retrying according to normal
+                                ; retry rules.
 
 ;----------------------------------------- OUTBOUND MWI SUBSCRIPTIONS -------------------------
 ; Asterisk can subscribe to receive the MWI from another SIP server and store it locally for retrieval
diff --git a/configure b/configure
index 37cd437..c5a74f1 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 385356 .
+# From configure.ac Revision: 400075 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.69 for asterisk trunk.
 #
@@ -17517,6 +17517,114 @@ fi
 
 fi
 
+if test "${PBX_BFD}" = "0"; then
+  # openSUSE requires -lz
+
+if test "x${PBX_BFD}" != "x1" -a "${USE_BFD}" != "no"; then
+   pbxlibdir=""
+   # if --with-BFD=DIR has been specified, use it.
+   if test "x${BFD_DIR}" != "x"; then
+      if test -d ${BFD_DIR}/lib; then
+         pbxlibdir="-L${BFD_DIR}/lib"
+      else
+         pbxlibdir="-L${BFD_DIR}"
+      fi
+   fi
+   pbxfuncname="bfd_check_format"
+   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
+      AST_BFD_FOUND=yes
+   else
+      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} "
+      as_ac_Lib=`$as_echo "ac_cv_lib_bfd_${pbxfuncname}" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lbfd" >&5
+$as_echo_n "checking for ${pbxfuncname} in -lbfd... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbfd ${pbxlibdir} -ldl -liberty -lz $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ${pbxfuncname} ();
+int
+main ()
+{
+return ${pbxfuncname} ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$as_ac_Lib=yes"
+else
+  eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+  AST_BFD_FOUND=yes
+else
+  AST_BFD_FOUND=no
+fi
+
+      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+   fi
+
+   # now check for the header.
+   if test "${AST_BFD_FOUND}" = "yes"; then
+      BFD_LIB="${pbxlibdir} -lbfd -ldl -liberty -lz"
+      # if --with-BFD=DIR has been specified, use it.
+      if test "x${BFD_DIR}" != "x"; then
+         BFD_INCLUDE="-I${BFD_DIR}/include"
+      fi
+      BFD_INCLUDE="${BFD_INCLUDE} "
+      if test "xbfd.h" = "x" ; then	# no header, assume found
+         BFD_HEADER_FOUND="1"
+      else				# check for the header
+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${BFD_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "bfd.h" "ac_cv_header_bfd_h" "$ac_includes_default"
+if test "x$ac_cv_header_bfd_h" = xyes; then :
+  BFD_HEADER_FOUND=1
+else
+  BFD_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+      fi
+      if test "x${BFD_HEADER_FOUND}" = "x0" ; then
+         BFD_LIB=""
+         BFD_INCLUDE=""
+      else
+         if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
+            BFD_LIB=""
+         fi
+         PBX_BFD=1
+         cat >>confdefs.h <<_ACEOF
+#define HAVE_BFD 1
+_ACEOF
+
+      fi
+   fi
+fi
+
+
+fi
+
 if test "x${OSARCH}" = "xlinux-gnu" ; then
 
 if test "x${PBX_CAP}" != "x1" -a "${USE_CAP}" != "no"; then
@@ -31765,6 +31873,15 @@ echo "       \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$.                "
 echo
 fi
 
+if test "x${AST_IODBC_FOUND}" = "xyes"; then
+	echo "WARNING: iodbc libs/headers found!"
+	echo
+	echo "  If you plan to use ODBC functionality, you should consider"
+	echo "  switching to unixodbc instead."
+	echo "  See: https://issues.asterisk.org/jira/browse/ASTERISK-22459"
+	echo
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: Package configured for: " >&5
 $as_echo "$as_me: Package configured for: " >&6;}
 { $as_echo "$as_me:${as_lineno-$LINENO}: OS type  : $host_os" >&5
diff --git a/configure.ac b/configure.ac
index d2a8f32..ad366f3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@ AC_CONFIG_SRCDIR([main/asterisk.c])
 AC_CONFIG_AUX_DIR(`pwd`)
 
 AC_COPYRIGHT("Asterisk")
-AC_REVISION($Revision: 388769 $)
+AC_REVISION($Revision: 400768 $)
 
 # preserve any CFLAGS or LDFLAGS that may be set
 # NOTE: This must be done before calling any macros that end up
@@ -1217,6 +1217,11 @@ if test "${PBX_BFD}" = "0"; then
   AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_check_format], [bfd.h], [-ldl -liberty])
 fi
 
+if test "${PBX_BFD}" = "0"; then
+  # openSUSE requires -lz
+  AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_check_format], [bfd.h], [-ldl -liberty -lz])
+fi
+
 if test "x${OSARCH}" = "xlinux-gnu" ; then
   AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
 fi
@@ -2412,6 +2417,15 @@ echo "       \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$.                "
 echo
 fi
 
+if test "x${AST_IODBC_FOUND}" = "xyes"; then
+	echo "WARNING: iodbc libs/headers found!"
+	echo
+	echo "  If you plan to use ODBC functionality, you should consider"
+	echo "  switching to unixodbc instead."
+	echo "  See: https://issues.asterisk.org/jira/browse/ASTERISK-22459"
+	echo
+fi
+
 AC_MSG_NOTICE(Package configured for: )
 AC_MSG_NOTICE( OS type  : $host_os)
 AC_MSG_NOTICE( Host CPU : $host_cpu)
diff --git a/doc/astdb2bdb.8 b/doc/astdb2bdb.8
new file mode 100644
index 0000000..735bf21
--- /dev/null
+++ b/doc/astdb2bdb.8
@@ -0,0 +1,46 @@
+.TH "ASTDB2BDB" "8" "30 SEPTEMBER 2013" "Asterisk 11" ""
+
+.SH NAME
+astdb2bdb \- convert astdb back to Berkeley DB 1.86
+.SH SYNOPSIS
+
+.B cd \fIastvarlibdir\fB && astdb2bdb path/to/astdb.sqlite3
+
+.SH "DESCRIPTION"
+Up until version version 11, Asterisk used an old version of the
+Berkeley DB 1.86 (bdb) to store its internal persistent database. In
+version 11 it switched to using a SQLIte 3 database. This program is
+used to convert the newly-formatted SQLite 3 astdb back to bdb.
+
+You may need it in case of reverting an upgrade or other similar
+scenarios.
+
+.SH OPTIONS
+There is a single (and required) parameter: the path the the sqlite file.
+The output file will be a file called
+.B astdb
+in the current working directory.
+
+.SH EXAMPLES
+In case you want to revert an upgrade to Asterisk 11, you can do the
+following (while Asterisk is not running):
+
+  cd /var/lib/asterisk && astdb2bdb astdb.sqlite3 && rm astdb.sqlite3
+
+This will convert the newly-formatted astdb back to the old format, and
+delete it (to avoid obsolete data copies).
+
+.SH NOTES
+Berkeley DB 1.86 is obsolete. It is incompatible with newer versions
+(4.x and newer) that you may see around. Chances are you don't have the
+tools to use it independently of Asterisk.
+
+.SH SEE ALSO
+.B astdb2sqlite3(8),
+.B asterisk(8)
+
+.SH AUTHOR
+astdb2bdb was written by Terry Wilson <twilson at digium.com>.
+
+This manual page was written by Tzafrir Cohen <tzafrir.cohen at xorcom.com>.
+
diff --git a/doc/astdb2sqlite3.8 b/doc/astdb2sqlite3.8
new file mode 100644
index 0000000..406d966
--- /dev/null
+++ b/doc/astdb2sqlite3.8
@@ -0,0 +1,39 @@
+.TH "ASTDB2SQLITE3" "8" "30 SEPTEMBER 2013" "Asterisk 11" ""
+
+.SH NAME
+astdb2sqlite3 \- convert astdb to SQLite 3
+.SH SYNOPSIS
+
+.B astdb2sqlite3 path/to/astdb
+
+.SH "DESCRIPTION"
+Up until version version 11, Asterisk used an old version of the
+Berkeley DB 1.86 (bdb) to store its internal persistent database. In
+version 11 it switched to using a SQLite 3 database. This program is
+used to convert an existing bdb astdb file to astdb.sqlite3.
+
+Normally the conversion is done by Asterisk itself which will run this
+program. But you may need to run it on your own.
+
+.SH OPTIONS
+There is a single (and required) parameter: the path the the bdb file.
+The output file name will be the same as the input, with
+.B .sqlite3
+appended.
+
+.SH EXAMPLES
+Asterisk will typically run the following to upgrade the database:
+
+  astdb2sqlite3 /var/lib/asterisk/astdb
+
+which will create \fB/var/lib/asterisk/astdb.sqlite3\fR.
+
+.SH SEE ALSO
+.B astdb2bdb(8),
+.B asterisk(8)
+
+.SH AUTHOR
+astdb2sqlite3 was written by Terry Wilson <twilson at digium.com>.
+
+This manual page was written by Tzafrir Cohen <tzafrir.cohen at xorcom.com>.
+
diff --git a/funcs/func_config.c b/funcs/func_config.c
index 6e55551..d3ea099 100644
--- a/funcs/func_config.c
+++ b/funcs/func_config.c
@@ -33,7 +33,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 328259 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 400697 $")
 
 #include "asterisk/module.h"
 #include "asterisk/channel.h"
@@ -120,7 +120,7 @@ static int config_function_read(struct ast_channel *chan, const char *cmd, char
 			/* At worst, we might leak an entry while upgrading locks */
 			AST_RWLIST_UNLOCK(&configs);
 			AST_RWLIST_WRLOCK(&configs);
-			if (!(cur = ast_malloc(sizeof(*cur) + strlen(args.filename) + 1))) {
+			if (!(cur = ast_calloc(1, sizeof(*cur) + strlen(args.filename) + 1))) {
 				AST_RWLIST_UNLOCK(&configs);
 				return -1;
 			}
@@ -149,7 +149,7 @@ static int config_function_read(struct ast_channel *chan, const char *cmd, char
 		}
 
 		if (!cur) {
-			if (!(cur = ast_malloc(sizeof(*cur) + strlen(args.filename) + 1))) {
+			if (!(cur = ast_calloc(1, sizeof(*cur) + strlen(args.filename) + 1))) {
 				AST_RWLIST_UNLOCK(&configs);
 				return -1;
 			}
diff --git a/funcs/func_db.c b/funcs/func_db.c
index 23ecfe5..db796a3 100644
--- a/funcs/func_db.c
+++ b/funcs/func_db.c
@@ -33,7 +33,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403974 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403978 $")
 
 #include <regex.h>
 
diff --git a/funcs/func_env.c b/funcs/func_env.c
index 3ba1374..b091d54 100644
--- a/funcs/func_env.c
+++ b/funcs/func_env.c
@@ -27,7 +27,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403974 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403978 $")
 
 #include <sys/stat.h>   /* stat(2) */
 
diff --git a/funcs/func_lock.c b/funcs/func_lock.c
index 76ff4bc..aa17d80 100644
--- a/funcs/func_lock.c
+++ b/funcs/func_lock.c
@@ -32,7 +32,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403974 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403978 $")
 
 #include <signal.h>
 
diff --git a/funcs/func_math.c b/funcs/func_math.c
index 27a935f..7cbe9ab 100644
--- a/funcs/func_math.c
+++ b/funcs/func_math.c
@@ -34,7 +34,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 372630 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401661 $")
 
 #include <math.h>
 
@@ -503,6 +503,9 @@ AST_TEST_DEFINE(test_MATH_function)
 		res = AST_TEST_FAIL;
 	}
 
+	ast_free(expr);
+	ast_free(result);
+
 	return res;
 }
 #endif
diff --git a/funcs/func_realtime.c b/funcs/func_realtime.c
index f5363e5..9a1c9b9 100644
--- a/funcs/func_realtime.c
+++ b/funcs/func_realtime.c
@@ -30,7 +30,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403974 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403978 $")
 
 #include "asterisk/file.h"
 #include "asterisk/channel.h"
diff --git a/funcs/func_shell.c b/funcs/func_shell.c
index 577aa1c..a4a1223 100644
--- a/funcs/func_shell.c
+++ b/funcs/func_shell.c
@@ -31,7 +31,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403974 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403978 $")
 
 #include "asterisk/module.h"
 #include "asterisk/channel.h"
diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h
index e3d65e6..47a787e 100644
--- a/include/asterisk/pbx.h
+++ b/include/asterisk/pbx.h
@@ -69,6 +69,16 @@ enum ast_extension_states {
 	AST_EXTENSION_ONHOLD = 1 << 4,	/*!< All devices ONHOLD */
 };
 
+/*!
+ * \brief extension matchcid types
+ * \note matchcid in ast_exten retains 0/1, this adds 3rd state for functions to specify all
+ * \see ast_context_remove_extension_callerid
+ */
+enum ast_ext_matchcid_types {
+	AST_EXT_MATCHCID_OFF = 0,	/*!< Match only extensions with matchcid=0 */
+	AST_EXT_MATCHCID_ON = 1,	/*!< Match only extensions with matchcid=1 AND cidmatch matches */
+	AST_EXT_MATCHCID_ANY = 2,	/*!< Match both - used only in functions manipulating ast_exten's */
+};
 
 struct ast_context;
 struct ast_exten;
diff --git a/include/asterisk/rtp_engine.h b/include/asterisk/rtp_engine.h
index 51455e9..e2dfc2e 100644
--- a/include/asterisk/rtp_engine.h
+++ b/include/asterisk/rtp_engine.h
@@ -1608,12 +1608,12 @@ struct ast_rtp_instance *ast_rtp_instance_get_bridged(struct ast_rtp_instance *i
 /*!
  * \brief Make two channels compatible for early bridging
  *
- * \param c0 First channel part of the bridge
- * \param c1 Second channel part of the bridge
+ * \param c_dst Destination channel to copy to
+ * \param c_src Source channel to copy from
  *
  * \since 1.8
  */
-void ast_rtp_instance_early_bridge_make_compatible(struct ast_channel *c0, struct ast_channel *c1);
+void ast_rtp_instance_early_bridge_make_compatible(struct ast_channel *c_dst, struct ast_channel *c_src);
 
 /*!
  * \brief Early bridge two channels that use RTP instances
diff --git a/main/app.c b/main/app.c
index ddb22fa..26b256d 100644
--- a/main/app.c
+++ b/main/app.c
@@ -29,7 +29,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 375301 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401705 $")
 
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
@@ -2579,7 +2579,9 @@ int ast_app_parse_timelen(const char *timestr, int *result, enum ast_timelen uni
 		return -1;
 	}
 
-	if ((res = sscanf(timestr, FMT, &amount, u)) == 0) {
+	res = sscanf(timestr, FMT, &amount, u);
+
+	if (res == 0 || res == EOF) {
 #undef FMT
 		return -1;
 	} else if (res == 2) {
diff --git a/main/asterisk.c b/main/asterisk.c
index c812fc8..c8f3f5b 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -65,7 +65,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403974 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403978 $")
 
 #include "asterisk/_private.h"
 
@@ -1836,11 +1836,17 @@ static void really_quit(int num, shutdown_nice_t niceness, int restart)
 		close(ast_socket);
 		ast_socket = -1;
 		unlink(ast_config_AST_SOCKET);
+		pthread_kill(lthread, SIGURG);
+		pthread_join(lthread, NULL);
 	}
 	if (ast_consock > -1)
 		close(ast_consock);
 	if (!ast_opt_remote)
 		unlink(ast_config_AST_PID);
+	if (sig_alert_pipe[0])
+		close(sig_alert_pipe[0]);
+	if (sig_alert_pipe[1])
+		close(sig_alert_pipe[1]);
 	printf("%s", term_quit());
 	if (restart) {
 		int i;
diff --git a/main/astobj2.c b/main/astobj2.c
index 5ab68fd..88efb77 100644
--- a/main/astobj2.c
+++ b/main/astobj2.c
@@ -24,7 +24,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 399099 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401783 $")
 
 #include "asterisk/_private.h"
 #include "asterisk/astobj2.h"
@@ -1710,12 +1710,18 @@ static struct ast_cli_entry cli_astobj2[] = {
 	AST_CLI_DEFINE(handle_astobj2_stats, "Print astobj2 statistics"),
 	AST_CLI_DEFINE(handle_astobj2_test, "Test astobj2"),
 };
+
+static void astobj2_cleanup(void)
+{
+	ast_cli_unregister_multiple(cli_astobj2, ARRAY_LEN(cli_astobj2));
+}
 #endif /* AO2_DEBUG */
 
 int astobj2_init(void)
 {
 #ifdef AO2_DEBUG
 	ast_cli_register_multiple(cli_astobj2, ARRAY_LEN(cli_astobj2));
+	ast_register_atexit(astobj2_cleanup);
 #endif
 
 	return 0;
diff --git a/main/channel.c b/main/channel.c
index b9cab80..1086adf 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -29,7 +29,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401235 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401179 $")
 
 #include "asterisk/_private.h"
 
diff --git a/main/config_options.c b/main/config_options.c
index 0780bf3..2759dd1 100644
--- a/main/config_options.c
+++ b/main/config_options.c
@@ -27,7 +27,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 392810 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 399564 $")
 
 #include <regex.h>
 
@@ -370,10 +370,6 @@ static int process_category(struct ast_config *cfg, struct aco_info *info, struc
 	}
 
 	if (type->type == ACO_GLOBAL && *field) {
-		if (aco_set_defaults(type, cat, *field)) {
-			ast_log(LOG_ERROR, "In %s: Setting defaults for %s failed\n", file->filename, cat);
-			return -1;
-		}
 		if (aco_process_category_options(type, cfg, cat, *field)) {
 			ast_log(LOG_ERROR, "In %s: Processing options for %s failed\n", file->filename, cat);
 			return -1;
@@ -504,6 +500,28 @@ enum aco_process_status aco_process_config(struct aco_info *info, int reload)
 
 	while (res != ACO_PROCESS_ERROR && (file = info->files[x++])) {
 		const char *filename = file->filename;
+		struct aco_type *match;
+		int i;
+
+		/* set defaults for global objects */
+		for (i = 0, match = file->types[i]; match; match = file->types[++i]) {
+			void **field = info->internal->pending + match->item_offset;
+
+			if (match->type != ACO_GLOBAL || !*field) {
+				continue;
+			}
+
+			if (aco_set_defaults(match, match->category, *field)) {
+				ast_log(LOG_ERROR, "In %s: Setting defaults for %s failed\n", file->filename, match->category);
+				res = ACO_PROCESS_ERROR;
+				break;
+			}
+		}
+
+		if (res == ACO_PROCESS_ERROR) {
+			break;
+		}
+
 try_alias:
 		if (!(cfg = ast_config_load(filename, cfg_flags))) {
 			if (file->alias && strcmp(file->alias, filename)) {
diff --git a/main/data.c b/main/data.c
index 12c2e2c..bdb7e18 100644
--- a/main/data.c
+++ b/main/data.c
@@ -28,7 +28,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 396961 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401705 $")
 
 #include "asterisk/_private.h"
 
@@ -3322,6 +3322,7 @@ static void data_shutdown(void)
 	ao2_t_ref(root_data.container, -1, "Unref root_data.container in data_shutdown");
 	root_data.container = NULL;
 	ast_rwlock_destroy(&root_data.lock);
+	AST_TEST_UNREGISTER(test_data_get);
 }
 
 int ast_data_init(void)
@@ -3339,9 +3340,7 @@ int ast_data_init(void)
 
 	res |= ast_manager_register_xml_core("DataGet", 0, manager_data_get);
 
-#ifdef TEST_FRAMEWORK
 	AST_TEST_REGISTER(test_data_get);
-#endif
 
 	ast_register_atexit(data_shutdown);
 
diff --git a/main/editline/readline.c b/main/editline/readline.c
index adf054d..d202adb 100644
--- a/main/editline/readline.c
+++ b/main/editline/readline.c
@@ -1236,8 +1236,11 @@ filename_completion_function(const char *text, int state)
 	filename_len = strlen(filename);
 
 	dir = opendir(dirname ? dirname : ".");
-	if (!dir)
+	if (!dir) {
+		free(filename);
+		free(dirname);
 		return (NULL);	/* cannot open the directory */
+	}
 
 	/* find the match */
 	while ((entry = readdir(dir)) != NULL) {
@@ -1274,6 +1277,8 @@ filename_completion_function(const char *text, int state)
 	} else
 		temp = NULL;
 	closedir(dir);
+	free(filename);
+	free(dirname);
 
 	return (temp);
 }
diff --git a/main/editline/term.c b/main/editline/term.c
index 63cec6e..00b68ed 100644
--- a/main/editline/term.c
+++ b/main/editline/term.c
@@ -65,15 +65,17 @@ __RCSID("$NetBSD: term.c,v 1.35 2002/03/18 16:00:59 christos Exp $");
 #include <ncurses.h>
 #endif
 #if defined(HAVE_TERM_H)
-#include "term.h"
 /* Can not use /usr/include/term.h because of a lot of incompatibilities, so just define some prototypes */
+#include "term.h"
+#endif /* defined(HAVE_TERM_H) */
+#if defined(HAVE_TERM_H) || !(defined(HAVE_TERMCAP_H) || defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H))
 extern int tgetent(char *, const char *);
 extern int tgetflag(const char *);
 extern int tgetnum(const char *);
 extern char *tgetstr(const char *, char **);
 extern int tputs (const char *, int, int (*)(int));
 extern char *tgoto (const char *, int, int);
-#endif /* defined(HAVE_TERM_H) */
+#endif /* defined(HAVE_TERM_H) or none_of_the_others */
 #include <sys/types.h>
 #include <sys/ioctl.h>
 
diff --git a/main/jitterbuf.c b/main/jitterbuf.c
index 333a6d2..7c6187f 100644
--- a/main/jitterbuf.c
+++ b/main/jitterbuf.c
@@ -33,7 +33,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 369013 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401787 $")
 
 #include "jitterbuf.h"
 #include "asterisk/utils.h"
@@ -73,10 +73,12 @@ static void decrement_losspct(jitterbuf *jb)
 
 void jb_reset(jitterbuf *jb)
 {
-	/* only save settings */
+	/* only save settings and free list */
 	jb_conf s = jb->info.conf;
+	jb_frame *fr = jb->free;
 	memset(jb, 0, sizeof(*jb));
 	jb->info.conf = s;
+	jb->free = fr;
 
 	/* initialize length, using the default value */
 	jb->info.current = jb->info.target = jb->info.conf.target_extra = JB_TARGET_EXTRA;
@@ -87,7 +89,7 @@ jitterbuf * jb_new()
 {
 	jitterbuf *jb;
 
-	if (!(jb = ast_malloc(sizeof(*jb))))
+	if (!(jb = ast_calloc(1, sizeof(*jb))))
 		return NULL;
 
 	jb_reset(jb);
diff --git a/main/logger.c b/main/logger.c
index e7a3274..5700b7e 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -31,7 +31,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401235 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401833 $")
 
 /* When we include logger.h again it will trample on some stuff in syslog.h, but
  * nothing we care about in here. */
@@ -254,7 +254,6 @@ static unsigned int make_components(const char *s, int lineno, int *verbosity)
 			break;
 		} else if (!strncasecmp(w, "verbose(", 8) && sscanf(w + 8, "%d)", verbosity) == 1) {
 			res |= (1 << __LOG_VERBOSE);
-			break;
 		} else for (x = 0; x < ARRAY_LEN(levels); x++) {
 			if (levels[x] && !strcasecmp(w, levels[x])) {
 				res |= (1 << x);
diff --git a/main/pbx.c b/main/pbx.c
index 1294324..8e84374 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -29,7 +29,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403974 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403978 $")
 
 #include "asterisk/_private.h"
 #include "asterisk/paths.h"	/* use ast_config_AST_SYSTEM_NAME */
@@ -1250,13 +1250,22 @@ static int hashtab_compare_extens(const void *ah_a, const void *ah_b)
 	}
 
 	/* but if they are the same, do the cidmatch values match? */
-	if (ac->matchcid && bc->matchcid) {
-		return strcmp(ac->cidmatch,bc->cidmatch);
-	} else if (!ac->matchcid && !bc->matchcid) {
-		return 0; /* if there's no matchcid on either side, then this is a match */
-	} else {
-		return 1; /* if there's matchcid on one but not the other, they are different */
+	/* not sure which side may be using ast_ext_matchcid_types, so check both */
+	if (ac->matchcid == AST_EXT_MATCHCID_ANY || bc->matchcid == AST_EXT_MATCHCID_ANY) {
+		return 0;
+	}
+	if (ac->matchcid == AST_EXT_MATCHCID_OFF && bc->matchcid == AST_EXT_MATCHCID_OFF) {
+		return 0;
+	}
+	if (ac->matchcid != bc->matchcid) {
+		return 1;
 	}
+	/* all other cases already disposed of, match now required on callerid string (cidmatch) */
+	/* although ast_add_extension2_lockopt() enforces non-zero ptr, caller may not have */
+	if (ast_strlen_zero(ac->cidmatch) && ast_strlen_zero(bc->cidmatch)) {
+		return 0;
+	}
+	return strcmp(ac->cidmatch, bc->cidmatch);
 }
 
 static int hashtab_compare_exten_numbers(const void *ah_a, const void *ah_b)
@@ -1284,7 +1293,7 @@ static unsigned int hashtab_hash_extens(const void *obj)
 	const struct ast_exten *ac = obj;
 	unsigned int x = ast_hashtab_hash_string(ac->exten);
 	unsigned int y = 0;
-	if (ac->matchcid)
+	if (ac->matchcid == AST_EXT_MATCHCID_ON)
 		y = ast_hashtab_hash_string(ac->cidmatch);
 	return x+y;
 }
@@ -1483,7 +1492,7 @@ int check_contexts(char *file, int line )
 				ast_copy_string(dummy_name, e1->exten, sizeof(dummy_name));
 				e2 = ast_hashtab_lookup(c1->root_table, &ex);
 				if (!e2) {
-					if (e1->matchcid) {
+					if (e1->matchcid == AST_EXT_MATCHCID_ON) {
 						ast_log(LOG_NOTICE,"Called from: %s:%d: The %s context records the exten %s (CID match: %s) but it is not in its root_table\n", file, line, c2->name, dummy_name, e1->cidmatch );
 					} else {
 						ast_log(LOG_NOTICE,"Called from: %s:%d: The %s context records the exten %s but it is not in its root_table\n", file, line, c2->name, dummy_name );
@@ -7076,7 +7085,7 @@ int ast_context_remove_switch2(struct ast_context *con, const char *sw, const ch
 /*! \note This function will lock conlock. */
 int ast_context_remove_extension(const char *context, const char *extension, int priority, const char *registrar)
 {
-	return ast_context_remove_extension_callerid(context, extension, priority, NULL, 0, registrar);
+	return ast_context_remove_extension_callerid(context, extension, priority, NULL, AST_EXT_MATCHCID_ANY, registrar);
 }
 
 int ast_context_remove_extension_callerid(const char *context, const char *extension, int priority, const char *callerid, int matchcallerid, const char *registrar)
@@ -7106,7 +7115,7 @@ int ast_context_remove_extension_callerid(const char *context, const char *exten
  */
 int ast_context_remove_extension2(struct ast_context *con, const char *extension, int priority, const char *registrar, int already_locked)
 {
-	return ast_context_remove_extension_callerid2(con, extension, priority, NULL, 0, registrar, already_locked);
+	return ast_context_remove_extension_callerid2(con, extension, priority, NULL, AST_EXT_MATCHCID_ANY, registrar, already_locked);
 }
 
 int ast_context_remove_extension_callerid2(struct ast_context *con, const char *extension, int priority, const char *callerid, int matchcallerid, const char *registrar, int already_locked)
@@ -7122,10 +7131,6 @@ int ast_context_remove_extension_callerid2(struct ast_context *con, const char *
 	if (!already_locked)
 		ast_wrlock_context(con);
 
-	/* Handle this is in the new world */
-
-	/* FIXME For backwards compatibility, if callerid==NULL, then remove ALL
-	 * peers, not just those matching the callerid. */
 #ifdef NEED_DEBUG
 	ast_verb(3,"Removing %s/%s/%d%s%s from trees, registrar=%s\n", con->name, extension, priority, matchcallerid ? "/" : "", matchcallerid ? callerid : "", registrar);
 #endif
@@ -7134,7 +7139,7 @@ int ast_context_remove_extension_callerid2(struct ast_context *con, const char *
 #endif
 	/* find this particular extension */
 	ex.exten = dummy_name;
-	ex.matchcid = matchcallerid && !ast_strlen_zero(callerid); /* don't say match if there's no callerid */
+	ex.matchcid = matchcallerid;
 	ex.cidmatch = callerid;
 	ast_copy_string(dummy_name, extension, sizeof(dummy_name));
 	exten = ast_hashtab_lookup(con->root_table, &ex);
@@ -7157,7 +7162,6 @@ int ast_context_remove_extension_callerid2(struct ast_context *con, const char *
 			ex.priority = priority;
 			exten2 = ast_hashtab_lookup(exten->peer_table, &ex);
 			if (exten2) {
-
 				if (exten2->label) { /* if this exten has a label, remove that, too */
 					exten3 = ast_hashtab_remove_this_object(exten->peer_label_table,exten2);
 					if (!exten3)
@@ -7218,10 +7222,11 @@ int ast_context_remove_extension_callerid2(struct ast_context *con, const char *
 
 	/* scan the priority list to remove extension with exten->priority == priority */
 	for (peer = exten, next_peer = exten->peer ? exten->peer : exten->next;
-		 peer && !strcmp(peer->exten, extension) && (!matchcallerid || (!ast_strlen_zero(callerid) && !ast_strlen_zero(peer->cidmatch) && !strcmp(peer->cidmatch,callerid)) || (ast_strlen_zero(callerid) && ast_strlen_zero(peer->cidmatch)));
+		 peer && !strcmp(peer->exten, extension) &&
+			(!callerid || (!matchcallerid && !peer->matchcid) || (matchcallerid && peer->matchcid && !strcmp(peer->cidmatch, callerid))) ;
 			peer = next_peer, next_peer = next_peer ? (next_peer->peer ? next_peer->peer : next_peer->next) : NULL) {
+
 		if ((priority == 0 || peer->priority == priority) &&
-				(!callerid || !matchcallerid || (matchcallerid && !strcmp(peer->cidmatch, callerid))) &&
 				(!registrar || !strcmp(peer->registrar, registrar) )) {
 			found = 1;
 
@@ -7252,6 +7257,7 @@ int ast_context_remove_extension_callerid2(struct ast_context *con, const char *
 				previous_peer->peer = peer->peer;
 			}
 
+
 			/* now, free whole priority extension */
 			destroy_exten(peer);
 		} else {
@@ -7931,7 +7937,7 @@ static int show_dialplan_helper(int fd, const char *context, const char *exten,
 			dpc->total_prio++;
 
 			/* write extension name and first peer */
-			if (e->matchcid)
+			if (e->matchcid == AST_EXT_MATCHCID_ON)
 				snprintf(buf, sizeof(buf), "'%s' (CID match '%s') => ", ast_get_extension_name(e), e->cidmatch);
 			else
 				snprintf(buf, sizeof(buf), "'%s' =>", ast_get_extension_name(e));
@@ -10101,10 +10107,10 @@ static int ast_add_extension2_lockopt(struct ast_context *con,
 	/* Blank callerid and NULL callerid are two SEPARATE things.  Do NOT confuse the two!!! */
 	if (callerid) {
 		p += ext_strncpy(p, callerid, strlen(callerid) + 1) + 1;
-		tmp->matchcid = 1;
+		tmp->matchcid = AST_EXT_MATCHCID_ON;
 	} else {
 		*p++ = '\0';
-		tmp->matchcid = 0;
+		tmp->matchcid = AST_EXT_MATCHCID_OFF;
 	}
 	tmp->app = p;
 	strcpy(p, application);
@@ -10121,7 +10127,7 @@ static int ast_add_extension2_lockopt(struct ast_context *con,
 								an extension, and the trie exists, then we need to incrementally add this pattern to it. */
 		ast_copy_string(dummy_name, extension, sizeof(dummy_name));
 		dummy_exten.exten = dummy_name;
-		dummy_exten.matchcid = 0;
+		dummy_exten.matchcid = AST_EXT_MATCHCID_OFF;
 		dummy_exten.cidmatch = 0;
 		tmp2 = ast_hashtab_lookup(con->root_table, &dummy_exten);
 		if (!tmp2) {
@@ -10134,11 +10140,11 @@ static int ast_add_extension2_lockopt(struct ast_context *con,
 	for (e = con->root; e; el = e, e = e->next) {   /* scan the extension list */
 		res = ext_cmp(e->exten, tmp->exten);
 		if (res == 0) { /* extension match, now look at cidmatch */
-			if (!e->matchcid && !tmp->matchcid)
+			if (e->matchcid == AST_EXT_MATCHCID_OFF && tmp->matchcid == AST_EXT_MATCHCID_OFF)
 				res = 0;
-			else if (tmp->matchcid && !e->matchcid)
+			else if (tmp->matchcid == AST_EXT_MATCHCID_ON && e->matchcid == AST_EXT_MATCHCID_OFF)
 				res = 1;
-			else if (e->matchcid && !tmp->matchcid)
+			else if (e->matchcid == AST_EXT_MATCHCID_ON && tmp->matchcid == AST_EXT_MATCHCID_OFF)
 				res = -1;
 			else
 				res = ext_cmp(e->cidmatch, tmp->cidmatch);
@@ -10215,7 +10221,7 @@ static int ast_add_extension2_lockopt(struct ast_context *con,
 		}
 	}
 	if (option_debug) {
-		if (tmp->matchcid) {
+		if (tmp->matchcid == AST_EXT_MATCHCID_ON) {
 			ast_debug(1, "Added extension '%s' priority %d (CID match '%s') to %s (%p)\n",
 					  tmp->exten, tmp->priority, tmp->cidmatch, con->name, con);
 		} else {
@@ -10224,7 +10230,7 @@ static int ast_add_extension2_lockopt(struct ast_context *con,
 		}
 	}
 
-	if (tmp->matchcid) {
+	if (tmp->matchcid == AST_EXT_MATCHCID_ON) {
 		ast_verb(3, "Added extension '%s' priority %d (CID match '%s') to %s\n",
 				 tmp->exten, tmp->priority, tmp->cidmatch, con->name);
 	} else {
@@ -10846,12 +10852,11 @@ void __ast_context_destroy(struct ast_context *list, struct ast_hashtab *context
 						}
 						ast_verb(3, "Remove %s/%s/%d, registrar=%s; con=%s(%p); con->root=%p\n",
 								 tmp->name, prio_item->exten, prio_item->priority, registrar, con? con->name : "<nil>", con, con? con->root_table: NULL);
-						/* set matchcid to 1 to insure we get a direct match, and NULL registrar to make sure no wildcarding is done */
 						ast_copy_string(extension, prio_item->exten, sizeof(extension));
 						if (prio_item->cidmatch) {
 							ast_copy_string(cidmatch, prio_item->cidmatch, sizeof(cidmatch));
 						}
-						end_traversal &= ast_context_remove_extension_callerid2(tmp, extension, prio_item->priority, prio_item->cidmatch ? cidmatch : NULL, 1, NULL, 1);
+						end_traversal &= ast_context_remove_extension_callerid2(tmp, extension, prio_item->priority, cidmatch, prio_item->matchcid, NULL, 1);
 					}
 					/* Explanation:
 					 * ast_context_remove_extension_callerid2 will destroy the extension that it comes across. This
diff --git a/main/rtp_engine.c b/main/rtp_engine.c
index 09aeb61..a52d173 100644
--- a/main/rtp_engine.c
+++ b/main/rtp_engine.c
@@ -29,7 +29,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 381306 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 402042 $")
 
 #include <math.h>
 
@@ -1627,90 +1627,90 @@ struct ast_rtp_instance *ast_rtp_instance_get_bridged(struct ast_rtp_instance *i
 	return instance->bridged;
 }
 
-void ast_rtp_instance_early_bridge_make_compatible(struct ast_channel *c0, struct ast_channel *c1)
+void ast_rtp_instance_early_bridge_make_compatible(struct ast_channel *c_dst, struct ast_channel *c_src)
 {
-	struct ast_rtp_instance *instance0 = NULL, *instance1 = NULL,
-		*vinstance0 = NULL, *vinstance1 = NULL,
-		*tinstance0 = NULL, *tinstance1 = NULL;
-	struct ast_rtp_glue *glue0, *glue1;
-	enum ast_rtp_glue_result audio_glue0_res = AST_RTP_GLUE_RESULT_FORBID, video_glue0_res = AST_RTP_GLUE_RESULT_FORBID;
-	enum ast_rtp_glue_result audio_glue1_res = AST_RTP_GLUE_RESULT_FORBID, video_glue1_res = AST_RTP_GLUE_RESULT_FORBID;
-	struct ast_format_cap *cap0 = ast_format_cap_alloc_nolock();
-	struct ast_format_cap *cap1 = ast_format_cap_alloc_nolock();
+	struct ast_rtp_instance *instance_dst = NULL, *instance_src = NULL,
+		*vinstance_dst = NULL, *vinstance_src = NULL,
+		*tinstance_dst = NULL, *tinstance_src = NULL;
+	struct ast_rtp_glue *glue_dst, *glue_src;
+	enum ast_rtp_glue_result audio_glue_dst_res = AST_RTP_GLUE_RESULT_FORBID, video_glue_dst_res = AST_RTP_GLUE_RESULT_FORBID;
+	enum ast_rtp_glue_result audio_glue_src_res = AST_RTP_GLUE_RESULT_FORBID, video_glue_src_res = AST_RTP_GLUE_RESULT_FORBID;
+	struct ast_format_cap *cap_dst = ast_format_cap_alloc_nolock();
+	struct ast_format_cap *cap_src = ast_format_cap_alloc_nolock();
 
 	/* Lock both channels so we can look for the glue that binds them together */
-	ast_channel_lock_both(c0, c1);
+	ast_channel_lock_both(c_dst, c_src);
 
-	if (!cap1 || !cap0) {
+	if (!cap_src || !cap_dst) {
 		goto done;
 	}
 
 	/* Grab glue that binds each channel to something using the RTP engine */
-	if (!(glue0 = ast_rtp_instance_get_glue(ast_channel_tech(c0)->type)) || !(glue1 = ast_rtp_instance_get_glue(ast_channel_tech(c1)->type))) {
-		ast_debug(1, "Can't find native functions for channel '%s'\n", glue0 ? ast_channel_name(c1) : ast_channel_name(c0));
+	if (!(glue_dst = ast_rtp_instance_get_glue(ast_channel_tech(c_dst)->type)) || !(glue_src = ast_rtp_instance_get_glue(ast_channel_tech(c_src)->type))) {
+		ast_debug(1, "Can't find native functions for channel '%s'\n", glue_dst ? ast_channel_name(c_src) : ast_channel_name(c_dst));
 		goto done;
 	}
 
-	audio_glue0_res = glue0->get_rtp_info(c0, &instance0);
-	video_glue0_res = glue0->get_vrtp_info ? glue0->get_vrtp_info(c0, &vinstance0) : AST_RTP_GLUE_RESULT_FORBID;
+	audio_glue_dst_res = glue_dst->get_rtp_info(c_dst, &instance_dst);
+	video_glue_dst_res = glue_dst->get_vrtp_info ? glue_dst->get_vrtp_info(c_dst, &vinstance_dst) : AST_RTP_GLUE_RESULT_FORBID;
 
-	audio_glue1_res = glue1->get_rtp_info(c1, &instance1);
-	video_glue1_res = glue1->get_vrtp_info ? glue1->get_vrtp_info(c1, &vinstance1) : AST_RTP_GLUE_RESULT_FORBID;
+	audio_glue_src_res = glue_src->get_rtp_info(c_src, &instance_src);
+	video_glue_src_res = glue_src->get_vrtp_info ? glue_src->get_vrtp_info(c_src, &vinstance_src) : AST_RTP_GLUE_RESULT_FORBID;
 
 	/* If we are carrying video, and both sides are not going to remotely bridge... fail the native bridge */
-	if (video_glue0_res != AST_RTP_GLUE_RESULT_FORBID && (audio_glue0_res != AST_RTP_GLUE_RESULT_REMOTE || video_glue0_res != AST_RTP_GLUE_RESULT_REMOTE)) {
-		audio_glue0_res = AST_RTP_GLUE_RESULT_FORBID;
+	if (video_glue_dst_res != AST_RTP_GLUE_RESULT_FORBID && (audio_glue_dst_res != AST_RTP_GLUE_RESULT_REMOTE || video_glue_dst_res != AST_RTP_GLUE_RESULT_REMOTE)) {
+		audio_glue_dst_res = AST_RTP_GLUE_RESULT_FORBID;
 	}
-	if (video_glue1_res != AST_RTP_GLUE_RESULT_FORBID && (audio_glue1_res != AST_RTP_GLUE_RESULT_REMOTE || video_glue1_res != AST_RTP_GLUE_RESULT_REMOTE)) {
-		audio_glue1_res = AST_RTP_GLUE_RESULT_FORBID;
+	if (video_glue_src_res != AST_RTP_GLUE_RESULT_FORBID && (audio_glue_src_res != AST_RTP_GLUE_RESULT_REMOTE || video_glue_src_res != AST_RTP_GLUE_RESULT_REMOTE)) {
+		audio_glue_src_res = AST_RTP_GLUE_RESULT_FORBID;
 	}
-	if (audio_glue0_res == AST_RTP_GLUE_RESULT_REMOTE && (video_glue0_res == AST_RTP_GLUE_RESULT_FORBID || video_glue0_res == AST_RTP_GLUE_RESULT_REMOTE) && glue0->get_codec) {
-		glue0->get_codec(c0, cap0);
+	if (audio_glue_dst_res == AST_RTP_GLUE_RESULT_REMOTE && (video_glue_dst_res == AST_RTP_GLUE_RESULT_FORBID || video_glue_dst_res == AST_RTP_GLUE_RESULT_REMOTE) && glue_dst->get_codec) {
+		glue_dst->get_codec(c_dst, cap_dst);
 	}
-	if (audio_glue1_res == AST_RTP_GLUE_RESULT_REMOTE && (video_glue1_res == AST_RTP_GLUE_RESULT_FORBID || video_glue1_res == AST_RTP_GLUE_RESULT_REMOTE) && glue1->get_codec) {
-		glue1->get_codec(c1, cap1);
+	if (audio_glue_src_res == AST_RTP_GLUE_RESULT_REMOTE && (video_glue_src_res == AST_RTP_GLUE_RESULT_FORBID || video_glue_src_res == AST_RTP_GLUE_RESULT_REMOTE) && glue_src->get_codec) {
+		glue_src->get_codec(c_src, cap_src);
 	}
 
 	/* If any sort of bridge is forbidden just completely bail out and go back to generic bridging */
-	if (audio_glue0_res != AST_RTP_GLUE_RESULT_REMOTE || audio_glue1_res != AST_RTP_GLUE_RESULT_REMOTE) {
+	if (audio_glue_dst_res != AST_RTP_GLUE_RESULT_REMOTE || audio_glue_src_res != AST_RTP_GLUE_RESULT_REMOTE) {
 		goto done;
 	}
 
 	/* Make sure we have matching codecs */
-	if (!ast_format_cap_has_joint(cap0, cap1)) {
+	if (!ast_format_cap_has_joint(cap_dst, cap_src)) {
 		goto done;
 	}
 
-	ast_rtp_codecs_payloads_copy(&instance0->codecs, &instance1->codecs, instance1);
+	ast_rtp_codecs_payloads_copy(&instance_src->codecs, &instance_dst->codecs, instance_dst);
 
-	if (vinstance0 && vinstance1) {
-		ast_rtp_codecs_payloads_copy(&vinstance0->codecs, &vinstance1->codecs, vinstance1);
+	if (vinstance_dst && vinstance_src) {
+		ast_rtp_codecs_payloads_copy(&vinstance_src->codecs, &vinstance_dst->codecs, vinstance_dst);
 	}
-	if (tinstance0 && tinstance1) {
-		ast_rtp_codecs_payloads_copy(&tinstance0->codecs, &tinstance1->codecs, tinstance1);
+	if (tinstance_dst && tinstance_src) {
+		ast_rtp_codecs_payloads_copy(&tinstance_src->codecs, &tinstance_dst->codecs, tinstance_dst);
 	}
 
-	if (glue0->update_peer(c0, instance1, vinstance1, tinstance1, cap1, 0)) {
+	if (glue_dst->update_peer(c_dst, instance_src, vinstance_src, tinstance_src, cap_src, 0)) {
 		ast_log(LOG_WARNING, "Channel '%s' failed to setup early bridge to '%s'\n",
-			ast_channel_name(c0), ast_channel_name(c1));
+			ast_channel_name(c_dst), ast_channel_name(c_src));
 	} else {
 		ast_debug(1, "Seeded SDP of '%s' with that of '%s'\n",
-			ast_channel_name(c0), ast_channel_name(c1));
+			ast_channel_name(c_dst), ast_channel_name(c_src));
 	}
 
 done:
-	ast_channel_unlock(c0);
-	ast_channel_unlock(c1);
-
-	ast_format_cap_destroy(cap0);
-	ast_format_cap_destroy(cap1);
-
-	unref_instance_cond(&instance0);
-	unref_instance_cond(&instance1);
-	unref_instance_cond(&vinstance0);
-	unref_instance_cond(&vinstance1);
-	unref_instance_cond(&tinstance0);
-	unref_instance_cond(&tinstance1);
+	ast_channel_unlock(c_dst);
+	ast_channel_unlock(c_src);
+
+	ast_format_cap_destroy(cap_dst);
+	ast_format_cap_destroy(cap_src);
+
+	unref_instance_cond(&instance_dst);
+	unref_instance_cond(&instance_src);
+	unref_instance_cond(&vinstance_dst);
+	unref_instance_cond(&vinstance_src);
+	unref_instance_cond(&tinstance_dst);
+	unref_instance_cond(&tinstance_src);
 }
 
 int ast_rtp_instance_early_bridge(struct ast_channel *c0, struct ast_channel *c1)
diff --git a/main/security_events.c b/main/security_events.c
index b29ea07..e395a2a 100644
--- a/main/security_events.c
+++ b/main/security_events.c
@@ -30,7 +30,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 376471 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 400421 $")
 
 #include "asterisk/utils.h"
 #include "asterisk/strings.h"
@@ -341,14 +341,14 @@ static const struct {
 		{ AST_EVENT_IE_SESSION_ID, SEC_EVT_FIELD(common, session_id) },
 		{ AST_EVENT_IE_LOCAL_ADDR, SEC_EVT_FIELD(common, local_addr) },
 		{ AST_EVENT_IE_REMOTE_ADDR, SEC_EVT_FIELD(common, remote_addr) },
-		{ AST_EVENT_IE_CHALLENGE, SEC_EVT_FIELD(inval_password, challenge) },
-		{ AST_EVENT_IE_RECEIVED_CHALLENGE, SEC_EVT_FIELD(inval_password, received_challenge) },
-		{ AST_EVENT_IE_RECEIVED_HASH, SEC_EVT_FIELD(inval_password, received_hash) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 	.optional_ies = {
 		{ AST_EVENT_IE_MODULE, SEC_EVT_FIELD(common, module) },
 		{ AST_EVENT_IE_SESSION_TV, SEC_EVT_FIELD(common, session_tv) },
+		{ AST_EVENT_IE_CHALLENGE, SEC_EVT_FIELD(inval_password, challenge) },
+		{ AST_EVENT_IE_RECEIVED_CHALLENGE, SEC_EVT_FIELD(inval_password, received_challenge) },
+		{ AST_EVENT_IE_RECEIVED_HASH, SEC_EVT_FIELD(inval_password, received_hash) },
 		{ AST_EVENT_IE_END, 0 }
 	},
 },
diff --git a/main/tcptls.c b/main/tcptls.c
index 8cc5865..99cc716 100644
--- a/main/tcptls.c
+++ b/main/tcptls.c
@@ -31,7 +31,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403974 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 403978 $")
 
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
diff --git a/main/test.c b/main/test.c
index a0d1823..b361f52 100644
--- a/main/test.c
+++ b/main/test.c
@@ -31,7 +31,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 370598 $");
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401661 $");
 
 #include "asterisk/_private.h"
 
@@ -931,6 +931,11 @@ int __ast_test_suite_assert_notify(const char *file, const char *func, int line,
 	return 0;
 }
 
+static void test_shutdown(void)
+{
+	ast_cli_unregister_multiple(test_cli, ARRAY_LEN(test_cli));
+}
+
 #endif /* TEST_FRAMEWORK */
 
 int ast_test_init()
@@ -938,6 +943,7 @@ int ast_test_init()
 #ifdef TEST_FRAMEWORK
 	/* Register cli commands */
 	ast_cli_register_multiple(test_cli, ARRAY_LEN(test_cli));
+	ast_register_atexit(test_shutdown);
 #endif
 
 	return 0;
diff --git a/main/translate.c b/main/translate.c
index 6353bd1..fadb54b 100644
--- a/main/translate.c
+++ b/main/translate.c
@@ -29,7 +29,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398103 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401620 $")
 
 #include <sys/time.h>
 #include <sys/resource.h>
@@ -540,6 +540,10 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
 		/* Predict next outgoing timestamp from samples in this
 		   frame. */
 		path->nextout = ast_tvadd(path->nextout, ast_samp2tv(out->samples, ast_format_rate(&out->subclass.format)));
+		if (f->samples != out->samples && ast_test_flag(out, AST_FRFLAG_HAS_TIMING_INFO)) {
+			ast_debug(4, "Sample size different %u vs %u\n", f->samples, out->samples);
+			ast_clear_flag(out, AST_FRFLAG_HAS_TIMING_INFO);
+		}
 	} else {
 		out->delivery = ast_tv(0, 0);
 		ast_set2_flag(out, has_timing_info, AST_FRFLAG_HAS_TIMING_INFO);
diff --git a/main/utils.c b/main/utils.c
index 8c8a2fd..6d66bc9 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -29,7 +29,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398649 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401830 $")
 
 #include <ctype.h>
 #include <sys/stat.h>
@@ -1025,9 +1025,6 @@ static char *handle_show_locks(struct ast_cli_entry *e, int cmd, struct ast_cli_
 	struct thr_lock_info *lock_info;
 	struct ast_str *str;
 
-	if (!(str = ast_str_create(4096)))
-		return CLI_FAILURE;
-
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "core show locks";
@@ -1041,7 +1038,10 @@ static char *handle_show_locks(struct ast_cli_entry *e, int cmd, struct ast_cli_
 		return NULL;
 	}
 
-	ast_str_append(&str, 0, "\n"
+	if (!(str = ast_str_create(4096)))
+		return CLI_FAILURE;
+
+	ast_str_append(&str, 0, "\n" 
 	               "=======================================================================\n"
 	               "=== %s\n"
 	               "=== Currently Held Locks\n"
@@ -2163,6 +2163,17 @@ int ast_mkdir(const char *path, int mode)
 	return 0;
 }
 
+static void utils_shutdown(void)
+{
+#ifdef HAVE_DEV_URANDOM
+	close(dev_urandom_fd);
+	dev_urandom_fd = -1;
+#endif
+#if defined(DEBUG_THREADS) && !defined(LOW_MEMORY)
+	ast_cli_unregister_multiple(utils_cli, ARRAY_LEN(utils_cli));
+#endif
+}
+
 int ast_utils_init(void)
 {
 #ifdef HAVE_DEV_URANDOM
@@ -2174,6 +2185,7 @@ int ast_utils_init(void)
 	ast_cli_register_multiple(utils_cli, ARRAY_LEN(utils_cli));
 #endif
 #endif
+	ast_register_atexit(utils_shutdown);
 	return 0;
 }
 
diff --git a/res/res_jabber.c b/res/res_jabber.c
index 5c08fbf..66b60c0 100644
--- a/res/res_jabber.c
+++ b/res/res_jabber.c
@@ -40,7 +40,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398577 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401120 $")
 
 #include <ctype.h>
 #include <iksemel.h>
@@ -3567,7 +3567,7 @@ static int aji_handle_pubsub_error(void *data, ikspak *pak)
 	iks *orig_pubsub = iks_find(pak->x, "pubsub");
 	struct aji_client *client;
 	if (!orig_pubsub) {
-		ast_log(LOG_ERROR, "Error isn't a PubSub error, why are we here?\n");
+		ast_debug(1, "Error isn't a PubSub error, why are we here?\n");
 		return IKS_FILTER_EAT;
 	}
 	orig_request = iks_child(orig_pubsub);
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index ba04952..2231e8e 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -35,7 +35,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 397604 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401620 $")
 
 #include <sys/time.h>
 #include <signal.h>
@@ -96,6 +96,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision: 397604 $")
 #define RTCP_PT_APP     204
 
 #define RTP_MTU		1200
+#define DTMF_SAMPLE_RATE_MS    8 /*!< DTMF samples per millisecond */
 
 #define DEFAULT_DTMF_TIMEOUT (150 * (8000 / 1000))	/*!< samples */
 
@@ -1660,7 +1661,13 @@ static void rtp_add_candidates_to_ice(struct ast_rtp_instance *instance, struct
 	unsigned int count = PJ_ARRAY_SIZE(address), pos = 0;
 
 	/* Add all the local interface IP addresses */
-	pj_enum_ip_interface(ast_sockaddr_is_ipv4(addr) ? pj_AF_INET() : pj_AF_INET6(), &count, address);
+	if (ast_sockaddr_is_ipv4(addr)) {
+		pj_enum_ip_interface(pj_AF_INET(), &count, address);
+	} else if (ast_sockaddr_is_any(addr)) {
+		pj_enum_ip_interface(pj_AF_UNSPEC(), &count, address);
+	} else {
+		pj_enum_ip_interface(pj_AF_INET6(), &count, address);
+	}
 
 	for (pos = 0; pos < count; pos++) {
 		pj_sockaddr_set_port(&address[pos], port);
@@ -1719,6 +1726,35 @@ static void rtp_add_candidates_to_ice(struct ast_rtp_instance *instance, struct
 }
 #endif
 
+/*!
+ * \internal
+ * \brief Calculates the elapsed time from issue of the first tx packet in an
+ *        rtp session and a specified time
+ *
+ * \param rtp pointer to the rtp struct with the transmitted rtp packet
+ * \param delivery time of delivery - if NULL or zero value, will be ast_tvnow()
+ *
+ * \return time elapsed in milliseconds
+ */
+static unsigned int calc_txstamp(struct ast_rtp *rtp, struct timeval *delivery)
+{
+	struct timeval t;
+	long ms;
+
+	if (ast_tvzero(rtp->txcore)) {
+		rtp->txcore = ast_tvnow();
+		rtp->txcore.tv_usec -= rtp->txcore.tv_usec % 20000;
+	}
+
+	t = (delivery && !ast_tvzero(*delivery)) ? *delivery : ast_tvnow();
+	if ((ms = ast_tvdiff_ms(t, rtp->txcore)) < 0) {
+		ms = 0;
+	}
+	rtp->txcore = t;
+
+	return (unsigned int) ms;
+}
+
 static int ast_rtp_new(struct ast_rtp_instance *instance,
 		       struct ast_sched_context *sched, struct ast_sockaddr *addr,
 		       void *data)
@@ -1952,6 +1988,7 @@ static int ast_rtp_dtmf_begin(struct ast_rtp_instance *instance, char digit)
 
 	rtp->dtmfmute = ast_tvadd(ast_tvnow(), ast_tv(0, 500000));
 	rtp->send_duration = 160;
+	rtp->lastts += calc_txstamp(rtp, NULL) * DTMF_SAMPLE_RATE_MS;
 	rtp->lastdigitts = rtp->lastts + rtp->send_duration;
 
 	/* Create the actual packet that we will be sending */
@@ -2036,6 +2073,7 @@ static int ast_rtp_dtmf_continuation(struct ast_rtp_instance *instance)
 	/* And now we increment some values for the next time we swing by */
 	rtp->seqno++;
 	rtp->send_duration += 160;
+	rtp->lastts += calc_txstamp(rtp, NULL) * DTMF_SAMPLE_RATE_MS;
 
 	return 0;
 }
@@ -2115,7 +2153,7 @@ static int ast_rtp_dtmf_end_with_duration(struct ast_rtp_instance *instance, cha
 	res = 0;
 
 	/* Oh and we can't forget to turn off the stuff that says we are sending DTMF */
-	rtp->lastts += rtp->send_duration;
+	rtp->lastts += calc_txstamp(rtp, NULL) * DTMF_SAMPLE_RATE_MS;
 cleanup:
 	rtp->sending_digit = 0;
 	rtp->send_digit = 0;
@@ -2165,25 +2203,6 @@ static void ast_rtp_change_source(struct ast_rtp_instance *instance)
 	return;
 }
 
-static unsigned int calc_txstamp(struct ast_rtp *rtp, struct timeval *delivery)
-{
-	struct timeval t;
-	long ms;
-
-	if (ast_tvzero(rtp->txcore)) {
-		rtp->txcore = ast_tvnow();
-		rtp->txcore.tv_usec -= rtp->txcore.tv_usec % 20000;
-	}
-
-	t = (delivery && !ast_tvzero(*delivery)) ? *delivery : ast_tvnow();
-	if ((ms = ast_tvdiff_ms(t, rtp->txcore)) < 0) {
-		ms = 0;
-	}
-	rtp->txcore = t;
-
-	return (unsigned int) ms;
-}
-
 static void timeval2ntp(struct timeval tv, unsigned int *msw, unsigned int *lsw)
 {
 	unsigned int sec, usec, frac;
@@ -3654,8 +3673,16 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc
 		f = ast_frisolate(&srcupdate);
 		AST_LIST_INSERT_TAIL(&frames, f, frame_list);
 
+		rtp->seedrxseqno = 0;
+		rtp->rxcount = 0;
+		rtp->cycles = 0;
+		rtp->lastrxseqno = 0;
 		rtp->last_seqno = 0;
 		rtp->last_end_timestamp = 0;
+		if (rtp->rtcp) {
+			rtp->rtcp->expected_prior = 0;
+			rtp->rtcp->received_prior = 0;
+		}
 	}
 
 	rtp->rxssrc = ssrc;
diff --git a/res/res_rtp_multicast.c b/res/res_rtp_multicast.c
index fa10131..2e3e956 100644
--- a/res/res_rtp_multicast.c
+++ b/res/res_rtp_multicast.c
@@ -34,7 +34,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 385689 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 400394 $")
 
 #include <sys/time.h>
 #include <signal.h>
@@ -260,15 +260,15 @@ static int multicast_rtp_write(struct ast_rtp_instance *instance, struct ast_fra
 	/* Construct an RTP header for our packet */
 	rtpheader = (unsigned char *)(f->data.ptr - hdrlen);
 	put_unaligned_uint32(rtpheader, htonl((2 << 30) | (codec << 16) | (multicast->seqno)));
-	put_unaligned_uint32(rtpheader + 4, htonl(multicast->lastts));
 	
 	if (ast_test_flag(f, AST_FRFLAG_HAS_TIMING_INFO)) {
 		put_unaligned_uint32(rtpheader + 4, htonl(f->ts * 8));
-	} 
-	else {
-		put_unaligned_uint32(rtpheader + 8, htonl(multicast->ssrc));
+	} else {
+		put_unaligned_uint32(rtpheader + 4, htonl(multicast->lastts));
 	}
 
+	put_unaligned_uint32(rtpheader + 8, htonl(multicast->ssrc));
+
 	/* Increment sequence number and wrap to 0 if it overflows 16 bits. */
 	multicast->seqno = 0xFFFF & (multicast->seqno + 1);
 
diff --git a/res/res_xmpp.c b/res/res_xmpp.c
index 4b6af98..abf239d 100644
--- a/res/res_xmpp.c
+++ b/res/res_xmpp.c
@@ -39,7 +39,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 398618 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401120 $")
 
 #include <ctype.h>
 #include <iksemel.h>
@@ -1382,7 +1382,7 @@ static int xmpp_pubsub_handle_error(void *data, ikspak *pak)
 	}
 
 	if (!orig_pubsub) {
-		ast_log(LOG_ERROR, "Error isn't a PubSub error, why are we here?\n");
+		ast_debug(1, "Error isn't a PubSub error, why are we here?\n");
 		return IKS_FILTER_EAT;
 	}
 
diff --git a/tests/test_dlinklists.c b/tests/test_dlinklists.c
index 32e9cb9..1009338 100644
--- a/tests/test_dlinklists.c
+++ b/tests/test_dlinklists.c
@@ -33,7 +33,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 338557 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401661 $")
 
 #include "asterisk/file.h"
 #include "asterisk/channel.h"
@@ -337,6 +337,7 @@ static void dll_tests(void)
 
 		if (e == b) {
 			AST_DLLIST_REMOVE_CURRENT(list);  /* C A */
+			free(b);
 			print_list(tc, "C <=> A");
 		}
 		if (e == a) {
@@ -348,6 +349,7 @@ static void dll_tests(void)
 	AST_DLLIST_TRAVERSE_SAFE_END;
 	print_list(tc, "C <=> A <=> D");
 
+	destroy_test_container(tc);
 }
 
 static int unload_module(void)
diff --git a/tests/test_linkedlists.c b/tests/test_linkedlists.c
index 697e11a..9badff6 100644
--- a/tests/test_linkedlists.c
+++ b/tests/test_linkedlists.c
@@ -30,7 +30,7 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 370655 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 401791 $")
 
 #include "asterisk/module.h"
 #include "asterisk/test.h"
@@ -105,19 +105,16 @@ static int dbl_list_expect_reverse(struct test_dbl_llist *test_list, const char
 #define MATCH_OR_FAIL(list, val, retbuf) \
 	if (list_expect(list, val, &retbuf)) { \
 		ast_test_status_update(test, "Expected: %s, Got: %s\n", val, ast_str_buffer(retbuf)); \
-		ast_free(retbuf); \
 		return AST_TEST_FAIL; \
 	}
 
 #define MATCH_OR_FAIL_DBL(list, val, retbuf) \
 	if (dbl_list_expect_forward(list, val, &retbuf)) { \
 		ast_test_status_update(test, "Expected: %s, Got: %s\n", val, ast_str_buffer(retbuf)); \
-		ast_free(retbuf); \
 		return AST_TEST_FAIL; \
 	} \
 	if (dbl_list_expect_reverse(list, val, &retbuf)) { \
 		ast_test_status_update(test, "Expected reverse of: %s, Got: %s\n", val, ast_str_buffer(retbuf)); \
-		ast_free(retbuf); \
 		return AST_TEST_FAIL; \
 	}
 
@@ -129,7 +126,7 @@ static int dbl_list_expect_reverse(struct test_dbl_llist *test_list, const char
 
 AST_TEST_DEFINE(single_ll_tests)
 {
-	struct ast_str *buf;
+	RAII_VAR(struct ast_str *, buf, NULL, ast_free);
 	struct test_llist test_list = { 0, };
 	struct test_llist other_list = { 0, };
 	struct test_val *bogus;
@@ -340,7 +337,7 @@ AST_TEST_DEFINE(single_ll_tests)
 
 AST_TEST_DEFINE(double_ll_tests)
 {
-	struct ast_str *buf;
+	RAII_VAR(struct ast_str *, buf, NULL, ast_free);
 	struct test_dbl_llist test_list = { 0, };
 	struct test_dbl_llist other_list = { 0, };
 	struct test_val *bogus;
diff --git a/utils/clicompat.c b/utils/clicompat.c
index ee4a764..6c25fb8 100644
--- a/utils/clicompat.c
+++ b/utils/clicompat.c
@@ -1,6 +1,6 @@
 /*
  * Stubs for some cli functions used by the test routines.
- * $Revision: 92103 $
+ * $Revision: 401935 $
  */
 void ast_cli(int fd, const char *fmt, ...);
 void ast_cli(int fd, const char *fmt, ...)
@@ -9,8 +9,18 @@ void ast_cli(int fd, const char *fmt, ...)
 
 struct ast_cli_entry;
 
+int ast_register_atexit(void (*func)(void));
+int ast_register_atexit(void (*func)(void))
+{
+	return 0;
+}
 int ast_cli_register_multiple(struct ast_cli_entry *e, int len);
 int ast_cli_register_multiple(struct ast_cli_entry *e, int len)
 {
 	return 0;
 }
+int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len);
+int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
+{
+	return 0;
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/asterisk.git



More information about the Pkg-voip-commits mailing list