]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
12 years agoMerge r369351 for AST-883
Matthew Jordan [Fri, 24 Aug 2012 13:49:40 +0000 (13:49 +0000)] 
Merge r369351 for AST-883

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@371650 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix error in the "IPorHost" section of a SIP dialstring.
Mark Michelson [Tue, 7 Aug 2012 15:40:46 +0000 (15:40 +0000)] 
Fix error in the "IPorHost" section of a SIP dialstring.

This is based on the review request posted by Walter Doekes
(referenced lower in the commit message)

The main fix here is to treat the IPorHost portion of the dial
string as a temporary outbound proxy. This ensures requests
get sent to the proper location.

Due to the age of the request, some parts were no longer relevant.
For instance, the request moved outbound proxy parsing code into
a single method. This is done in a previous commit, so it was not
necessary to do again.

Also, the review request fixed some errors with regards to request
routing for CANCEL and ACK requests. This has also been fixed in
more recent commits.

(closes issue ASTERISK-19677)
reported by Walter Doekes

Review https://reviewboard.asterisk.org/r/1859
........

Merged revisions 370769 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@370843 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoRevert a change that broke compilation
Terry Wilson [Wed, 25 Jul 2012 03:37:08 +0000 (03:37 +0000)] 
Revert a change that broke compilation

1) There is no such function as ast_ref()
2) The patch was originally credited as the one uploaded by Guenther
   Kelleter (license 6372) via issue AST-921, but the patch committed
   was not the patch referenced on the issue.
3) Guenther Kelleter's patch was actually correct. It moved the
   ast_free above the presencechange_cleanup label. I am not
   committing his change as it is not technically necesary--calling
   ast_free(NULL) is perfectly safe and I worry that moving the
   ast_free outside of the label could lead to future bugs if
   someone ever adds another failure conditional and expects
   'goto presencechange_cleanup;' to clean up after everything.

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@370472 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoDon't attempt free of NULL ptr in pbx.c handle_presencechange
Jonathan Rose [Tue, 24 Jul 2012 20:57:34 +0000 (20:57 +0000)] 
Don't attempt free of NULL ptr in pbx.c handle_presencechange

(closes issue AST-921)
Reported by: Guenther Kelleter
Patches:
    nullptr.patch uploaded by Guenther Kelleter (license 6372)

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@370464 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix bad merge of r368759 in sig_analog
Matthew Jordan [Wed, 11 Jul 2012 19:44:51 +0000 (19:44 +0000)] 
Fix bad merge of r368759 in sig_analog

The patch for r368759 in Asterisk 1.8 relied upon the methods
analog_unlock_private/analog_lock_private.  In earlier versions of 1.8,
including the Certified Asterisk 1.8.11 branch, those two methods were
unused, and hence were undefined out of the source.  When the patch was made
for 1.8.11-cert5, those two functions were not re-defined back in.  This caused
linking errors when sig_analog was loaded.

This patch properly restores those two methods, such that the fix for AST-891
works correctly.

(issue AST-891)

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@369964 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix deadlock between bridged channels that attempt to set the hangup source
Matthew Jordan [Mon, 9 Jul 2012 19:59:20 +0000 (19:59 +0000)] 
Fix deadlock between bridged channels that attempt to set the hangup source

Calling ast_set_hangupsource with the channel lock held can result in a
deadlock because the function also locks the bridged channel.

(issue AST-891)

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@369848 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoAdd support for exposing the received contact URI and also for setting the request...
Joshua Colp [Mon, 9 Jul 2012 19:50:56 +0000 (19:50 +0000)] 
Add support for exposing the received contact URI and also for setting the request URI in messages.

(closes issue AST-911)

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@369845 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoRemove file that should no longer exist.
Jason Parker [Mon, 9 Jul 2012 19:06:26 +0000 (19:06 +0000)] 
Remove file that should no longer exist.

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@369840 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoRe-merge changes that were reverted.
Jason Parker [Mon, 9 Jul 2012 19:05:54 +0000 (19:05 +0000)] 
Re-merge changes that were reverted.

------------------------------------------------------------------------
r365395 | qwell | 2012-05-04 16:17:08 -0500 (Fri, 04 May 2012) | 7 lines

Add support for folders in MixMonitor 'm' option.  Backport manager actions.

The manager actions are needed, so MixMonitor can be executed on existing
channels.

(issue DPMA-68)

------------------------------------------------------------------------
r364761 | qwell | 2012-05-01 12:25:14 -0500 (Tue, 01 May 2012) | 6 lines

Remove folder_dir from voicemail snapshots API.

It was both unused (except in tests, where it was fudged) and unnecessary.

(closes issue AST-842)

------------------------------------------------------------------------
r367161 | mmichelson | 2012-05-21 14:05:52 -0500 (Mon, 21 May 2012) | 21 lines

Add "send to voicemail" Digium phone functionality to Asterisk.

This change accommodates two methods by which calls can be directed to
a user's voicemail.

* Incoming calls can be redirected to any user's voicemail.
* Established calls can be blind transferred to any user's voicemail.

Digium phones indicate the desire to direct a call to voicemail by using
a Diversion header with a reason parameter of "send_to_vm".

This patch adds the "send_to_vm" reason as a valid redirecting reason. In
addition, chan_sip.c has been modified to update redirecting information
on the transferred channel by reading a Diversion header on a REFER request.

(closes issue AST-871)
Reported by Malcolm Davenport

Review: https://reviewboard.asterisk.org/r/1925

------------------------------------------------------------------------
r368790 | mjordan | 2012-06-12 08:44:36 -0500 (Tue, 12 Jun 2012) | 18 lines

Fix deadlock in SIP transfers that involve a REFER request

In r367163, "send to voicemail" functionality was added to the SIP channel
driver.  This required updating the party redirecting information for the
channel based on the headers provided in the REFER request.  When the
redirecting party information is updated on the channel, a call to
ast_indicate_data occurs.  Because handle_request_refer still had the sip_pvt
locked, a deadlock could occur between the pbx_thread and the do_monitor thread
servicing the REFER request.

This patch preserves the proper locking order between the channel and the
sip_pvt by ensuring that the sip_pvt is unlocked prior to updating the party
redirecting information on the channel.

(closes issue AST-903)
Reported by: Matt Jordan
patches:
  jira_ast_903_trunk.patch by rmudgett (license 5621)

------------------------------------------------------------------------
r368962 | qwell | 2012-06-14 13:38:48 -0500 (Thu, 14 Jun 2012) | 11 lines

Remove global symbol requirement from app_voicemail.

This uses the existing "function installation" stuff that already existed for
other functions, like getting message counts.

(closes issue AST-807)
(issue AST-901)
(issue AST-908)

Review: https://reviewboard.asterisk.org/r/1965/

------------------------------------------------------------------------
r368964 | qwell | 2012-06-14 14:03:24 -0500 (Thu, 14 Jun 2012) | 8 lines

These functions that were moved need to be static.

Also wrap test functions in a #ifdef.

(issue AST-807)
(issue AST-901)
(issue AST-908)

------------------------------------------------------------------------
r368998 | qwell | 2012-06-15 10:31:43 -0500 (Fri, 15 Jun 2012) | 6 lines

Remove some symbol exports that got missed in the removal of global symbols.

(issue AST-807)
(issue AST-901)
(issue AST-908)

------------------------------------------------------------------------
r369024 | qwell | 2012-06-15 11:29:40 -0500 (Fri, 15 Jun 2012) | 2 lines

Fix voicemail API tests by using the correct argument order for create/destroy.

------------------------------------------------------------------------

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@369839 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoRevert r369024,368998,368964,368962,368790,367161,365395,364761 for now.
Jason Parker [Tue, 26 Jun 2012 18:14:39 +0000 (18:14 +0000)] 
Revert r369024,368998,368964,368962,368790,367161,365395,364761 for now.

These changes ended up being made a bit prematurely.

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@369410 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix voicemail API tests by using the correct argument order for create/destroy.
Jason Parker [Fri, 15 Jun 2012 16:29:40 +0000 (16:29 +0000)] 
Fix voicemail API tests by using the correct argument order for create/destroy.

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@369024 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoRemove some symbol exports that got missed in the removal of global symbols.
Jason Parker [Fri, 15 Jun 2012 15:31:43 +0000 (15:31 +0000)] 
Remove some symbol exports that got missed in the removal of global symbols.

(issue AST-807)
(issue AST-901)
(issue AST-908)

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@368998 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoThese functions that were moved need to be static.
Jason Parker [Thu, 14 Jun 2012 19:03:24 +0000 (19:03 +0000)] 
These functions that were moved need to be static.

Also wrap test functions in a #ifdef.

(issue AST-807)
(issue AST-901)
(issue AST-908)

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@368964 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoRemove global symbol requirement from app_voicemail.
Jason Parker [Thu, 14 Jun 2012 18:38:48 +0000 (18:38 +0000)] 
Remove global symbol requirement from app_voicemail.

This uses the existing "function installation" stuff that already existed for
other functions, like getting message counts.

(closes issue AST-807)
(issue AST-901)
(issue AST-908)

Review: https://reviewboard.asterisk.org/r/1965/

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@368962 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoEnable res_smdi/res_adsi by default
Matthew Jordan [Wed, 13 Jun 2012 22:16:09 +0000 (22:16 +0000)] 
Enable res_smdi/res_adsi by default

Re-enable res_smdi/res_adsi by default, as they are both now considered
core supported modules.

(issue AST-900)
Reported by: Thomas Arimont

(issue AST-885)
Reported by: Denis Alberto Martinez

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@368919 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoMark res_smdi/res_adsi as 'core' supported modules
Matthew Jordan [Wed, 13 Jun 2012 20:29:33 +0000 (20:29 +0000)] 
Mark res_smdi/res_adsi as 'core' supported modules

Recently, various issues surrounding weak attributes have caused problems with
modules that rely on that feature to be enabled in menuselect.  This includes
app_voicemail and chan_dahdi, as they both rely upon res_smdi and res_adsi,
which, in certain circumstances, may not be enabled by default in menuselect.

Because res_smdi/res_adsi are dependencies for chan_dahdi/app_voicemail, this
patch marks both as 'core' supported modules.  This will allow both
app_voicemail and chan_dahdi to be enabled as well, regardless of whether or
not that system supports weak attributes.

(issue AST-900)
Reported by: Thomas Arimont

(issue AST-885)
Reported by: Denis Alberto Martinez
........

Merged revisions 368894 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@368897 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix deadlock in SIP transfers that involve a REFER request
Matthew Jordan [Tue, 12 Jun 2012 13:44:36 +0000 (13:44 +0000)] 
Fix deadlock in SIP transfers that involve a REFER request

In r367163, "send to voicemail" functionality was added to the SIP channel
driver.  This required updating the party redirecting information for the
channel based on the headers provided in the REFER request.  When the
redirecting party information is updated on the channel, a call to
ast_indicate_data occurs.  Because handle_request_refer still had the sip_pvt
locked, a deadlock could occur between the pbx_thread and the do_monitor thread
servicing the REFER request.

This patch preserves the proper locking order between the channel and the
sip_pvt by ensuring that the sip_pvt is unlocked prior to updating the party
redirecting information on the channel.

(closes issue AST-903)
Reported by: Matt Jordan
patches:
  jira_ast_903_trunk.patch by rmudgett (license 5621)

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@368790 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoAdd feature modifier to versions produced from branches
Matthew Jordan [Wed, 6 Jun 2012 17:32:45 +0000 (17:32 +0000)] 
Add feature modifier to versions produced from branches

Certain branches, such as Certified Asterisk, may have a modifier added to
them that specifies the features available in that branch.  For branches, this
modifier is expected to be reflected in the location of the branch in
subversion. For example, a subversion of URL of /certified/branches/1.8.11
would have a feature modifier of 'certified'.  This is slightly different then
how features are determined for tags, where the feature is part of the actual
tag name, e.g., "10.5.0-digiumphones".

In keeping with the nomenclature used for tags, the feature specifier for
branches is translated and placed after the revision numbers.  For the example
given previously, this would result in a branch version of
"Asterisk SVN-branch-1.8.11-cert-rXXXXXX".

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@368608 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoAST-2012-007: Fix IAX receiving HOLD without suggested MOH class crash.
Matthew Jordan [Tue, 29 May 2012 18:47:28 +0000 (18:47 +0000)] 
AST-2012-007: Fix IAX receiving HOLD without suggested MOH class crash.

* Made schedule_delivery() set the received frame f->data.ptr to NULL if
the datalen is zero.

* Fix queue_signalling() memcpy() size error.

* Made queue_signalling() not use C++ keyword variable names.

(closes issue ASTERISK-19597)
Reported by: mgrobecker
Patches:
      jira_asterisk_19597_v1.8.patch (license #5621) patch uploaded by rmudgett
Tested by: rmudgett, Michael L. Youngi

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@367847 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoAST-2012-008: Fix remote crash vulnerability in chan_skinny
Matthew Jordan [Tue, 29 May 2012 18:46:22 +0000 (18:46 +0000)] 
AST-2012-008: Fix remote crash vulnerability in chan_skinny

When a skinny session is unregistered, the corresponding device pointer is set
to NULL in the channel private data.  If the client was not in the on-hook state
at the time the connection was closed, the device pointer can later be
dereferened if a message or channel event attempts to use a line's pointer to
said device.

The patches prevent this from occurring by checking the line's pointer in
message handlers and channel callbacks that can fire after an unregistration
attempt.

(closes issue ASTERISK-19905)
Reported by: Christoph Hebeisen
Tested by: mjordan, Damien Wedhorn
Patches:
  AST-2012-008-1.8.diff uploaded by mjordan (license 6283)
  AST-2012-008-10.diff uploaded by mjordan (licesen 6283)

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@367846 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoAdd "send to voicemail" Digium phone functionality to Asterisk.
Mark Michelson [Mon, 21 May 2012 19:05:52 +0000 (19:05 +0000)] 
Add "send to voicemail" Digium phone functionality to Asterisk.

This change accommodates two methods by which calls can be directed to
a user's voicemail.

* Incoming calls can be redirected to any user's voicemail.
* Established calls can be blind transferred to any user's voicemail.

Digium phones indicate the desire to direct a call to voicemail by using
a Diversion header with a reason parameter of "send_to_vm".

This patch adds the "send_to_vm" reason as a valid redirecting reason. In
addition, chan_sip.c has been modified to update redirecting information
on the transferred channel by reading a Diversion header on a REFER request.

(closes issue AST-871)
Reported by Malcolm Davenport

Review: https://reviewboard.asterisk.org/r/1925

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@367161 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoAdd support for folders in MixMonitor 'm' option. Backport manager actions.
Jason Parker [Fri, 4 May 2012 21:17:08 +0000 (21:17 +0000)] 
Add support for folders in MixMonitor 'm' option.  Backport manager actions.

The manager actions are needed, so MixMonitor can be executed on existing
channels.

(issue DPMA-68)

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@365395 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoRemove folder_dir from voicemail snapshots API.
Jason Parker [Tue, 1 May 2012 17:25:14 +0000 (17:25 +0000)] 
Remove folder_dir from voicemail snapshots API.

It was both unused (except in tests, where it was fudged) and unnecessary.

(closes issue AST-842)

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@364761 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoAsterisk 1.8-digiumphones branch has become Certified Asterisk 1.8.11.
Jason Parker [Wed, 25 Apr 2012 16:53:42 +0000 (16:53 +0000)] 
Asterisk 1.8-digiumphones branch has become Certified Asterisk 1.8.11.

For more details about Certified Asterisk, see http://tinyurl.com/7pfp639

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@363674 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoDisable extended and deprecated modules by default.
Jason Parker [Tue, 24 Apr 2012 20:57:26 +0000 (20:57 +0000)] 
Disable extended and deprecated modules by default.

Users can still enable any of these using menuselect if they so choose.

(closes issue AST-873)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@363374 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoMultiple revisions 363102,363106,363141
Jason Parker [Mon, 23 Apr 2012 15:17:20 +0000 (15:17 +0000)] 
Multiple revisions 363102,363106,363141

........
  r363102 | mjordan | 2012-04-23 08:37:55 -0500 (Mon, 23 Apr 2012) | 16 lines

  AST-2012-005: Fix remotely exploitable heap overflow in keypad button handling

  When handling a keypad button message event, the received digit is placed into
  a fixed length buffer that acts as a queue.  When a new message event is
  received, the length of that buffer is not checked before placing the new digit
  on the end of the queue.  The situation exists where sufficient keypad button
  message events would occur that would cause the buffer to be overrun.  This
  patch explicitly checks that there is sufficient room in the buffer before
  appending a new digit.

  (closes issue ASTERISK-19592)
  Reported by: Russell Bryant
  ........

  Merged revisions 363100 from http://svn.asterisk.org/svn/asterisk/branches/1.6.2
........
  r363106 | mjordan | 2012-04-23 09:05:02 -0500 (Mon, 23 Apr 2012) | 17 lines

  AST-2012-006: Fix crash in UPDATE handling when no channel owner exists

  If Asterisk receives a SIP UPDATE request after a call has been terminated and
  the channel has been destroyed but before the SIP dialog has been destroyed, a
  condition exists where a connected line update would be attempted on a
  non-existing channel.  This would cause Asterisk to crash.  The patch resolves
  this by first ensuring that the SIP dialog has an owning channel before
  attempting a connected line update.  If an UPDATE request is received and no
  channel is associated with the dialog, a 481 response is sent.

  (closes issue ASTERISK-19770)
  Reported by: Thomas Arimont
  Tested by: Matt Jordan
  Patches:
    ASTERISK-19278-2012-04-16.diff uploaded by Matt Jordan (license 6283)
........
  r363141 | jrose | 2012-04-23 09:33:16 -0500 (Mon, 23 Apr 2012) | 20 lines

  AST-2012-004: Fix an error that allows AMI users to run shell commands sans authorization.

  As detailed in the advisory, AMI users without write authorization for SYSTEM class AMI
  actions were able to run system commands by going through other AMI commands which did
  not require that authorization. Specifically, GetVar and Status allowed users to do this
  by setting their variable/s options to the SHELL or EVAL functions.
  Also, within 1.8, 10, and trunk there was a similar flaw with the Originate action that
  allowed users with originate permission to run MixMonitor and supply a shell command
  in the Data argument. That flaw is fixed in those versions of this patch.

  (closes issue ASTERISK-17465)
  Reported By: David Woolley
  Patches:
   162_ami_readfunc_security_r2.diff uploaded by jrose (license 6182)
   18_ami_readfunc_security_r2.diff uploaded by jrose (license 6182)
   10_ami_readfunc_security_r2.diff uploaded by jrose (license 6182)
  ........

  Merged revisions 363117 from http://svn.asterisk.org/svn/asterisk/branches/1.6.2
........

Merged revisions 363102,363106,363141 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@363161 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoAdd a test application for sending custom SIP INFO messages.
Mark Michelson [Thu, 19 Apr 2012 20:31:07 +0000 (20:31 +0000)] 
Add a test application for sending custom SIP INFO messages.

When TEST_FRAMEWORK is enabled, SIPSendCustomInfo is available
to test sending custom INFO requests.

Review: https://reviewboard.asterisk.org/r/1866

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@362673 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoRename property branches-1.8-merged to branch-1.8-merged
Matthew Jordan [Fri, 13 Apr 2012 17:19:57 +0000 (17:19 +0000)] 
Rename property branches-1.8-merged to branch-1.8-merged

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@362132 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoUpdate properties on 1.8-digiumphones
Matthew Jordan [Fri, 13 Apr 2012 16:01:09 +0000 (16:01 +0000)] 
Update properties on 1.8-digiumphones

Change the merge property tag from svnmerge-integrated to branches-1.8-merged.
Added merged revisions from r362042.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@362083 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoMerge of several needed fixes for 1.8-digiumphones
Matthew Jordan [Thu, 12 Apr 2012 18:47:16 +0000 (18:47 +0000)] 
Merge of several needed fixes for 1.8-digiumphones

This merges fixes for the following issues into the 1.8-digiumphones branch:
 * ASTERISK-19355 - Call transfer with consultation frequently fails in cross-
   linked Asterisk scenario (directmedia & sendrpid active)
 * ASTERISK 19365 - Remote SIP Call legs are frequently not released in a
   cross-linked Asterisk scenario (directmedia & sendrpid)
 * ASTERISK-19183 - Sporadically missing connectedline event to caller channel
   in directed pickup app

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@362042 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix bugs in voicemail APIs and add unit tests.
Mark Michelson [Mon, 9 Apr 2012 20:40:25 +0000 (20:40 +0000)] 
Fix bugs in voicemail APIs and add unit tests.

There were several crashes that could occur due to NULL
inputs, invalid inputs, and the like. This fixes all known
ones and adds unit tests to exercise the APIs.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@361704 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoUpdate Func MESSAGE() and AMI MessageSend documentation.
Richard Mudgett [Fri, 6 Apr 2012 19:08:00 +0000 (19:08 +0000)] 
Update Func MESSAGE() and AMI MessageSend documentation.

* Document MESSAGE(custom_data)

* Update AMI MessageSend documentation

* Eliminate a shadowed variable name in msg_func_write() for custom_data.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@361502 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoAdd additional configuration and presence unit tests.
Mark Michelson [Thu, 5 Apr 2012 17:24:13 +0000 (17:24 +0000)] 
Add additional configuration and presence unit tests.

These were originally written while merging features into trunk, but
these tests apply just as much for the 1.8 version of Digium phones, so
might as well have them here, too.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@361283 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoMake m option for mixmonitor delete the source file once it is finished copying to vm.
Jonathan Rose [Tue, 3 Apr 2012 21:03:01 +0000 (21:03 +0000)] 
Make m option for mixmonitor delete the source file once it is finished copying to vm.

Review: https://reviewboard.asterisk.org/r/1842/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@361088 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoMultiple revisions 359656,359706,359979
Jason Parker [Thu, 29 Mar 2012 21:49:14 +0000 (21:49 +0000)] 
Multiple revisions 359656,359706,359979

........
  r359656 | mjordan | 2012-03-15 13:35:59 -0500 (Thu, 15 Mar 2012) | 22 lines

  Fix remotely exploitable stack overrun in Milliwatt

  Milliwatt is vulnerable to a remotely exploitable stack overrun when using
  the 'o' option.  This occurs due to the milliwatt_generate function not
  accounting for AST_FRIENDLY_OFFSET when calculating the maximum number of
  samples it can put in the output buffer.

  This patch resolves this issue by taking into account AST_FRIENDLY_OFFSET
  when determining the maximum number of samples allowed.  Note that at no
  point is remote code execution possible.  The data that is written into the
  buffer is the pre-defined Milliwatt data, and not custom data.

  (closes issue ASTERISK-19541)
  Reported by: Russell Bryant
  Tested by: Matt Jordan
  Patches:
    milliwatt_stack_overrun.rev1.txt by Russell Bryant (license 6283)
    Note that this patch was written by Russell, even though Matt uploaded it
  ........

  Merged revisions 359645 from http://svn.asterisk.org/svn/asterisk/branches/1.6.2
........
  r359706 | mjordan | 2012-03-15 14:01:22 -0500 (Thu, 15 Mar 2012) | 16 lines

  Fix remotely exploitable stack overflow in HTTP manager

  There exists a remotely exploitable stack buffer overflow in HTTP digest
  authentication handling in Asterisk.  The particular method in question
  is only utilized by HTTP AMI.  When parsing the digest information, the
  length of the string is not checked when it is copied into temporary buffers
  allocated on the stack.

  This patch fixes this behavior by parsing out pre-defined key/value pairs
  and avoiding unnecessary copies to the stack.

  (closes issue ASTERISK-19542)
  Reported by: Russell Bryant
  Tested by: Matt Jordan
........
  r359979 | rmudgett | 2012-03-20 12:21:16 -0500 (Tue, 20 Mar 2012) | 28 lines

  Allow AMI action callback to be reentrant.

  Fix AMI module reload deadlock regression from ASTERISK-18479 when it
  tried to fix the race between calling an AMI action callback and
  unregistering that action.  Refixes ASTERISK-13784 broken by
  ASTERISK-17785 change.

  Locking the ao2 object guaranteed that there were no active callbacks that
  mattered when ast_manager_unregister() was called.  Unfortunately, this
  causes the deadlock situation.  The patch stops locking the ao2 object to
  allow multiple threads to invoke the callback re-entrantly.  There is no
  way to guarantee a module unload will not crash because of an active
  callback.  The code attempts to minimize the chance with the registered
  flag and the maximum 5 second delay before ast_manager_unregister()
  returns.

  The trunk version of the patch changes the API to fix the race condition
  correctly to prevent the module code from unloading from memory while an
  action callback is active.

  * Don't hold the lock while calling the AMI action callback.

  (closes issue ASTERISK-19487)
  Reported by: Philippe Lindheimer

  Review: https://reviewboard.asterisk.org/r/1818/
  Review: https://reviewboard.asterisk.org/r/1820/
........

Merged revisions 359656,359706,359979 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@360826 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoPrevent potentially passing a NULL pointer to strcasecmp()
Mark Michelson [Wed, 21 Mar 2012 15:44:55 +0000 (15:44 +0000)] 
Prevent potentially passing a NULL pointer to strcasecmp()

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@360188 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix one more "(null)" string.
Mark Michelson [Tue, 20 Mar 2012 21:29:00 +0000 (21:29 +0000)] 
Fix one more "(null)" string.

If a hint with no presence portion were added, it would
result in another "(null)" string warning.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@360071 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix another "Possible programming error" bug.
Mark Michelson [Tue, 20 Mar 2012 20:40:46 +0000 (20:40 +0000)] 
Fix another "Possible programming error" bug.

Similar to the previous commit, don't pass
a printf-generated string to ast_strlen_zero.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@360035 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoGet rid of an annoying "Possible programming error" message.
Mark Michelson [Tue, 20 Mar 2012 19:30:07 +0000 (19:30 +0000)] 
Get rid of an annoying "Possible programming error" message.

If an extension's 'app' field is NULL, then a "(null)" string
would be written into an ast_str due to the way that snprintf
works. When this is passed to ast_strlen_zero(), it fires up
a big warning indicating something is probably wrong.

There indeed was a problem, but luckily it wasn't a very big
problem. After the failed ast_strlen_zero() check and big
warning message, the very next if statement, checking to
see if the "(null)" matched a presence provider, would fail,
so no harm was done.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@360031 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFixes unitialized variable use warning introduced by addition of mixmonitor forward...
Jonathan Rose [Thu, 8 Mar 2012 18:40:13 +0000 (18:40 +0000)] 
Fixes unitialized variable use warning introduced by addition of mixmonitor forward to vm

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@358725 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoPrevent outbound SIP NOTIFY packets from displaying a port of 0
Jason Parker [Thu, 8 Mar 2012 18:02:58 +0000 (18:02 +0000)] 
Prevent outbound SIP NOTIFY packets from displaying a port of 0

In the change from 1.6.2 to 1.8, ast_sockaddr was introduced which changed the
behavior of ast_find_ourip such that port number was wiped out.  This caused
the port in internip (which is used for Contact and Call-ID on NOTIFYs) to be
0.  This change causes ast_find_ourip to be port-preserving again.

(closes issue ASTERISK-19430)
........

Merged revisions 357665 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@358692 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFixed xmldoc formatting error for 'm' option
Paul Belanger [Fri, 2 Mar 2012 15:18:53 +0000 (15:18 +0000)] 
Fixed xmldoc formatting error for 'm' option

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@357808 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoAdd support for Digium Phones.
Jason Parker [Tue, 28 Feb 2012 21:52:48 +0000 (21:52 +0000)] 
Add support for Digium Phones.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@357459 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agosvnmerge init
Jason Parker [Tue, 28 Feb 2012 21:48:06 +0000 (21:48 +0000)] 
svnmerge init

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@357457 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoAdd branch that supports Digium Phones for Asterisk 1.8 users.
Jason Parker [Tue, 28 Feb 2012 21:47:07 +0000 (21:47 +0000)] 
Add branch that supports Digium Phones for Asterisk 1.8 users.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@357456 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix callerid of Originated calls.
Richard Mudgett [Mon, 27 Feb 2012 23:34:03 +0000 (23:34 +0000)] 
Fix callerid of Originated calls.

Thanks to Matt Riddell for tracking this down.

(closes issue ASTERISK-19385)
Reported by: ornix

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@357093 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoCopy CDR variables when set during a bridge
Terry Wilson [Mon, 27 Feb 2012 16:03:04 +0000 (16:03 +0000)] 
Copy CDR variables when set during a bridge

This patch makes sure amaflags, accountcode, and userfield get copied
to the bridge CDR when set during a bridge (like via a custom feature).

(closes issue ASTERISK-16990)
Review: https://reviewboard.asterisk.org/r/1721/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@356963 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoRemove possible segfaults from res_odbc by adding locks around usage of odbc handle
Jonathan Rose [Mon, 27 Feb 2012 15:14:45 +0000 (15:14 +0000)] 
Remove possible segfaults from res_odbc by adding locks around usage of odbc handle

(closes issue ASTERISK-19011)
Reported by: Walter Doekes
Patches:
issueA19011_combine_read_and_write_locks_WORK_IN_PROGRESS.patch uploaded by Walter Doekes (license 5674)
review: https://reviewboard.asterisk.org/r/1719/
review: https://reviewboard.asterisk.org/r/1622/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@356917 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix crash in app_voicemail during close_mailbox
Matthew Jordan [Sat, 25 Feb 2012 17:21:29 +0000 (17:21 +0000)] 
Fix crash in app_voicemail during close_mailbox

In r354890, a memory leak in app_voicemail was fixed by properly disposing of
the allocated heard/deleted pointers.  However, there are situations,
particularly when no messages are found in a folder, where these pointers are
not allocated and not NULL.  In that case, an invalid free would be attempted,
which could crash app_voicemail.  As there are a number of code paths where
this could occur, this patch uses the number of messages detected in the folder
before it attempts to free the pointers.  This resolves the crash detected in
the Asterisk Test Suite's check_voicemail_nominal test.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@356797 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix worker thread resource leak in SIP TCP/TLS.
Richard Mudgett [Fri, 24 Feb 2012 18:23:28 +0000 (18:23 +0000)] 
Fix worker thread resource leak in SIP TCP/TLS.

The SIP TCP/TLS worker threads were created joinable but noone could join
them if they died on their own.

* Fix the SIP TCP/TLS worker threads to not be created joinable.

* _sip_tcp_helper_thread() only needs one parameter since the pvt
parameter is only passed in as NULL and never used.

(closes issue ASTERISK-19203)
Reported by: Steve Davies

Review: https://reviewboard.asterisk.org/r/1714/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@356677 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoRemove srtp_shutdown from res_srtp
Matthew Jordan [Fri, 24 Feb 2012 17:41:18 +0000 (17:41 +0000)] 
Remove srtp_shutdown from res_srtp

The patch for ASTERISK-19253 included properly shutting down the libsrtp
library in the case of module unload.  Unfortunately, not all distributions
have the srtp_shutdown call.  As such, this patch removes calling
srtp_shutdown.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@356650 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoAllow SRTP policies to be reloaded
Matthew Jordan [Fri, 24 Feb 2012 15:07:09 +0000 (15:07 +0000)] 
Allow SRTP policies to be reloaded

Currently, when using res_srtp, once the SRTP policy has been added to the
current session the policy is locked into place.  Any attempt to replace an
existing policy, which would be needed if the remote endpoint negotiated a new
cryptographic key, is instead rejected in res_srtp.  This happens in particular
in transfer scenarios, where the endpoint that Asterisk is communicating with
changes but uses the same RTP session.

This patch modifies res_srtp to allow remote and local policies to be reloaded
in the underlying SRTP library.  From the perspective of users of the SRTP API,
the only change is that the adding of remote and local policies are now added
in a single method call, whereas they previously were added separately.  This
was changed to account for the differences in handling remote and local
policies in libsrtp.

Review: https://reviewboard.asterisk.org/r/1741/

(closes issue ASTERISK-19253)
Reported by: Thomas Arimont
Tested by: Thomas Arimont
Patches:
  srtp_renew_keys_2012_02_22.diff uploaded by Matt Jordan (license 6283)
  (with some small modifications for this check-in)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@356604 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix blind transfer parking issues if the dialed extension is not recognized as a...
Richard Mudgett [Thu, 23 Feb 2012 19:49:03 +0000 (19:49 +0000)] 
Fix blind transfer parking issues if the dialed extension is not recognized as a parking extension.

Custom parking extensions may not be coded such that the first and only
extension priority is the Park application.  These custom parking
extensions will not be recognized as parking extensions.  When a call is
blind transferred to an extension that is not recognized as a parking
extension, the normal blind transfer code causes the transferred channel
to start executing dialplan.  Calls that get parked in this manner do not
know the original channel name that parked the call so the original parker
could never be called back if the parked call is not retrieved before the
timeout time.  The parking space is also announced to the call being
parked as a side effect of not knowing the original parking channel.

* Fix handling of BLINDTRANSFER channel variable for call parking.

* Fixed SIP blind transfer using the wrong dialplan context variable to
check for the parking extension.

(closes issue ASTERISK-19322)
Reported by: aragon
Tested by: rmudgett, jparker

Review: https://reviewboard.asterisk.org/r/1730/

JIRA AST-766

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@356521 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix ACK routing for non-2xx responses.
Mark Michelson [Thu, 23 Feb 2012 15:37:59 +0000 (15:37 +0000)] 
Fix ACK routing for non-2xx responses.

When we send an ACK for a 2xx response to an INVITE, we are supposed
to use the learned route set. However, when we receive a non-2xx final
response to an INVITE, we are supposed to send the ACK to the same place
we initially sent the INVITE.

We had been doing this up until the changes went in that would build a route
set from provisional responses. That introduced a regression where we would
use the learned route set under all circumstances.

With this change, we now will set the destination of our ACK based on the
invitestate. If it is INV_COMPLETED then that means that we have received
a non-2xx final response (INV_TERMINATED indicates a 2xx response was received).
If it is INV_CANCELLED, then that means the call is being canceled, which
means that we should be ACKing a 487 response.

The other change introduced here is setting the invitestate to INV_CONFIRMED
when we send an ACK *after* the reqprep instead of before. This way, we can
tell in reqprep more easily what the invitestate is prior to sending the ACK.

(closes issue ASTERISK-19389)
reported by Karsten Wemheuer
patches:
    ASTERISK-19389v2.patch uploaded by Mark Michelson (license #5049)
(with some slight modifications prior to commit)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@356475 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix -Werror=unused-but-set-variable compiler error (gcc 4.6.2)
Paul Belanger [Thu, 23 Feb 2012 03:36:46 +0000 (03:36 +0000)] 
Fix -Werror=unused-but-set-variable compiler error (gcc 4.6.2)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@356430 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoMissed one strsep() function
Paul Belanger [Wed, 22 Feb 2012 21:36:37 +0000 (21:36 +0000)] 
Missed one strsep() function

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@356337 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoAdd back strsep() function for previous commit
Paul Belanger [Wed, 22 Feb 2012 21:29:25 +0000 (21:29 +0000)] 
Add back strsep() function for previous commit

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@356335 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoTrack module use count for res_calendar
Terry Wilson [Wed, 22 Feb 2012 21:08:50 +0000 (21:08 +0000)] 
Track module use count for res_calendar

If the res_calendar module was followed immediately by one of the
calendar tech modules and "core stop gracefully" was run, Asterisk
would crash.

This patch adds use count tracking for res_calendar so that it is
unloaded after the tech modules when shutting down gracefully. It
is now not possible to unload all the of the calendar modules via
"module unload res_calednar.so", but it is still possible to unload
them all via "module unload -h res_calendar.so".

Review: https://reviewboard.asterisk.org/r/1752/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@356291 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix -Werror=unused-but-set-variable compiler error (gcc 4.6.2)
Paul Belanger [Wed, 22 Feb 2012 20:20:29 +0000 (20:20 +0000)] 
Fix -Werror=unused-but-set-variable compiler error (gcc 4.6.2)

Review: https://reviewboard.asterisk.org/r/1763/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@356290 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix potential buffer overrun and memory leak when executing "sip show peers"
Matthew Jordan [Wed, 22 Feb 2012 14:50:20 +0000 (14:50 +0000)] 
Fix potential buffer overrun and memory leak when executing "sip show peers"

The "sip show peers" command uses a fix sized array to sort the current peers
in the peers ao2_container.  The size of the array is based on the current
number of peers in the container.  However, once the size of the array is
determined, the number of peers in the container can change, as the peers
container is not locked.  This could cause a buffer overrun when populating
the array, if peers were added to the container after the array was created.
Additionally, a memory leak of the allocated array would occur if a user
caused the _show_peers method to return CLI_SHOWUSAGE.

We now create a snapshot of the current peers using an ao2_callback with the
OBJ_MULTIPLE flag.  This size of the array is set to the number of peers
that the iterator will iterate over; hence, if peers are added or removed
from the peers container it will not affect the execution of the "sip show
peers" command.

Review: https://reviewboard.asterisk.org/r/1738/

(closes issue ASTERISK-19231)
(closes issue ASTERISK-19361)
Reported by: Thomas Arimont, Jamuel Starkey
Tested by: Thomas Arimont, Jamuel Starkey
Patches: sip_show_peers_2012_02_16.diff uploaded by mjordan (license 6283)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@356214 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoMake 'iax2 show callnumber usage' output make sense when an IP is passed in.
Sean Bright [Tue, 21 Feb 2012 11:16:23 +0000 (11:16 +0000)] 
Make 'iax2 show callnumber usage' output make sense when an IP is passed in.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@356107 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoRemove spurious warning when 'qualifyfreqnotok' is set successfully.
Sean Bright [Mon, 20 Feb 2012 18:38:28 +0000 (18:38 +0000)] 
Remove spurious warning when 'qualifyfreqnotok' is set successfully.

(closes issue ASTERISK-17176)
Reported by: John Covert
Tested by: Sean Bright
Patches:
   chan_iax2.c.qualifyfreqnotok.patch uploaded by John Covert (license 5512)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355997 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoThis was a LOG_NOTICE, so roll it back.
Sean Bright [Mon, 20 Feb 2012 14:40:10 +0000 (14:40 +0000)] 
This was a LOG_NOTICE, so roll it back.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355952 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoChange some debug messages from LOG_DEBUG to ast_debug.
Sean Bright [Mon, 20 Feb 2012 14:30:38 +0000 (14:30 +0000)] 
Change some debug messages from LOG_DEBUG to ast_debug.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355949 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoAdd some boilerplate documentation for IAXVAR and IAXPEER.
Sean Bright [Sun, 19 Feb 2012 18:04:52 +0000 (18:04 +0000)] 
Add some boilerplate documentation for IAXVAR and IAXPEER.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355904 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoSet the length of the ast_sockaddr, so that we can set it's port later.
Sean Bright [Sun, 19 Feb 2012 17:49:45 +0000 (17:49 +0000)] 
Set the length of the ast_sockaddr, so that we can set it's port later.

Without this, the call to ast_sockaddr_set_port a few lines later is a noop.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355901 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agopush 'outgoing' flag from sig_XXX up to chan_dahdi
Alec L Davis [Sat, 18 Feb 2012 07:55:11 +0000 (07:55 +0000)] 
push 'outgoing' flag from sig_XXX up to chan_dahdi

'p->outgoing' in chan_dahdi and sig_analog wern't kept in sync, particulary FXS ast_hangup didn't clear the 'outgoing' flag.
sig_pri and sig_ss7 were keeping 'outgoing' flag insync.

Now provides a callback for all the low level sig_XXX modules.

(issue ASTERISK-19316)

alecdavis (license 585)
Reported by: Jeremy Pepper
Tested by: alecdavis

Review: https://reviewboard.asterisk.org/r/1747/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355850 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix -Werror=unused-but-set-variable compiler error (gcc 4.6.2)
Paul Belanger [Sat, 18 Feb 2012 03:59:26 +0000 (03:59 +0000)] 
Fix -Werror=unused-but-set-variable compiler error (gcc 4.6.2)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355839 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoDon't allow trunkfreq to be greater than 1000ms.
Sean Bright [Fri, 17 Feb 2012 22:01:49 +0000 (22:01 +0000)] 
Don't allow trunkfreq to be greater than 1000ms.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355793 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoPass the correct value to ast_timer_set_rate() for IAX2 trunking.
Sean Bright [Fri, 17 Feb 2012 19:32:52 +0000 (19:32 +0000)] 
Pass the correct value to ast_timer_set_rate() for IAX2 trunking.

IAX2 uses the trunkfreq variable to determine how often to send trunk packets, but
this value is in milliseconds while ast_timer_set_rate() expects the rate argument
to be ticks per second.  So we divide 1000 by trunkfreq and pass that in instead.

With a default of 20ms, this change makes IAX2 send trunk packets every 20ms
instead of every 50ms.

Tracked down by myself and Bob Wienholt.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355746 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix regressions with regards to route-set creation on early dialogs.
Mark Michelson [Fri, 17 Feb 2012 18:57:28 +0000 (18:57 +0000)] 
Fix regressions with regards to route-set creation on early dialogs.

This fixes two main issues:

1. Asterisk would send a CANCEL to the route created by the provisional response
   instead of using the same destination it did in the initial INVITE.
2. If a new route set arrives in a 200 OK than was in the 1XX response (perfectly
   possible if our outbound INVITE gets forked), then the route set in the 200 OK
   needs to overwrite the route set in the 1XX response.

(closes issue ASTERISK-19358)
Reported by: Karsten Wemheuer
Tested by: Karsten Wemheuer
patches:
   ASTERISK-19358.patch uploaded by Mark Michelson (license 5049)
   ASTERISK-19358.patch uploaded by Stefan Schmidt (license 6034)

Review: https://reviewboard.asterisk.org/r/1749

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355732 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoRevert change to translate.c as it has caused an infinite loop to occur in circumstances.
Mark Michelson [Fri, 17 Feb 2012 16:04:24 +0000 (16:04 +0000)] 
Revert change to translate.c as it has caused an infinite loop to occur in circumstances.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355721 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoRevert 355700 and 355701
Paul Belanger [Fri, 17 Feb 2012 00:25:13 +0000 (00:25 +0000)] 
Revert 355700 and 355701

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355711 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoMissed a variable
Paul Belanger [Thu, 16 Feb 2012 23:54:54 +0000 (23:54 +0000)] 
Missed a variable

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355701 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix -Werror=unused-but-set-variable compiler error (gcc 4.6.2)
Paul Belanger [Thu, 16 Feb 2012 23:53:08 +0000 (23:53 +0000)] 
Fix -Werror=unused-but-set-variable compiler error (gcc 4.6.2)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355700 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoRevert a change to audio_audiohook_write_list that had no affect.
Sean Bright [Thu, 16 Feb 2012 20:01:15 +0000 (20:01 +0000)] 
Revert a change to audio_audiohook_write_list that had no affect.

When I made this change initially, I was under the false impression that the
audiohooks structure remained on the channel after all of the hooks had been
detached.  This is not the case, ast ast_read takes care of removing the
audiohooks structure if the lists are empty.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355622 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix compile problem when old version of libvorbisfile v1.1.2 is used.
Richard Mudgett [Thu, 16 Feb 2012 19:26:16 +0000 (19:26 +0000)] 
Fix compile problem when old version of libvorbisfile v1.1.2 is used.

The principle difference between libvorbisfile v1.1.2 and newer (at least
v1.2.0) is the addition of the predefined callbacks OV_CALLBACKS_xxx in
vorbis/vorbisfile.h used for ov_open_callbacks().

* Updated the configure script to detect if libvorbisfile.h declares
OV_CALLBACKS_NOCLOSE.

* Copied the declaration of OV_CALLBACKS_NOCLOSE from v1.2.0 to allow
v1.1.2 to compile.

(closes issue ASTERISK-19370)
Reported by: Jonn Taylor

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355608 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix AMI Monitor action without File header converting channel name into filename.
Richard Mudgett [Thu, 16 Feb 2012 18:26:37 +0000 (18:26 +0000)] 
Fix AMI Monitor action without File header converting channel name into filename.

* Fix potential Solaris crash if Monitor application has a urlbase and no
fname_base option.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355574 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoWhen IAX2 debugging is enabled, make sure to log 'apathetic' messages too.
Sean Bright [Wed, 15 Feb 2012 19:26:38 +0000 (19:26 +0000)] 
When IAX2 debugging is enabled, make sure to log 'apathetic' messages too.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355529 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoOnly use maxtrunkcall and maxnontrunkcall in chan_iax2 if IAX_OLD_FIND is specified.
Sean Bright [Wed, 15 Feb 2012 18:19:46 +0000 (18:19 +0000)] 
Only use maxtrunkcall and maxnontrunkcall in chan_iax2 if IAX_OLD_FIND is specified.

These variables are only accessed from the IAX_OLD_FIND path, so there is no reason
to keep them updated otherwise.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355458 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoUse TRUNK_CALL_START as originally intended.
Sean Bright [Wed, 15 Feb 2012 17:24:22 +0000 (17:24 +0000)] 
Use TRUNK_CALL_START as originally intended.

Back in r646, TRUNK_CALL_START was added and defined as 0x4000.  That same value
was also hard-coded in one part of the IAX2 code instead of using the #define.

TRUNK_CALL_START has changed over the years (for dealing with LOW_MEMORY), but
the hard-coded usage was never updated to match.  This patch fixes that.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355448 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix voicemail problems when using ogg/vorbis.
Richard Mudgett [Tue, 14 Feb 2012 19:10:35 +0000 (19:10 +0000)] 
Fix voicemail problems when using ogg/vorbis.

Ogg/vorbis was fairly useless as a voicemail file format because it did
not implement the seek and tell format callbacks among other problems.

Since we were already using the libvorbis and libvorbisenc libraries we
can use libvorbisfile as it is also part of the vorbis library package.

* Made use the libvorbisfile to handle the ogg/vorbis file stream.  The
format_ogg_vorbis.c is now mostly a wrapper around libvorbisfile.

(closes issue ASTERISK-16926)
Reported by: sque
Patches:
      ogg_vorbis_use_libvorbisfile.patch (license #6108) patch uploaded by sque

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355365 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix lock typo that should be unlock in cel_sqlite_custom reload.
Richard Mudgett [Tue, 14 Feb 2012 18:12:16 +0000 (18:12 +0000)] 
Fix lock typo that should be unlock in cel_sqlite_custom reload.

(closes issue ASTERISK-19356)
Reported by: Alex Villacis Lasso
Patches:
      asterisk-1.8.9.2-cel_sqlite3_custom-fix-reload-locking-typo.patch (license #5617) patch uploaded by Alex Villacis Lasso

Review: https://reviewboard.asterisk.org/r/1740/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355319 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoProperly invert the return of a strncmp call.
Mark Michelson [Tue, 14 Feb 2012 16:26:49 +0000 (16:26 +0000)] 
Properly invert the return of a strncmp call.

This was causing identification that should have been
made private to be public.

(closes issue AST-814)
reported by Patrick Anderson

Patches:
chan_sip.c.diff uploaded by Patrick Anderson (license 5430)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355268 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoDon't enable sqlite3 CDRs by default in sample configs.
Jason Parker [Tue, 14 Feb 2012 15:50:40 +0000 (15:50 +0000)] 
Don't enable sqlite3 CDRs by default in sample configs.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355228 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoClear the high order bit from the destination call number before sending.
Sean Bright [Tue, 14 Feb 2012 13:33:09 +0000 (13:33 +0000)] 
Clear the high order bit from the destination call number before sending.

send_apathetic_reply takes the incoming frame's source call number as the
destination call number for the outgoing frame.  If the incoming frame was a
full frame, then the high order bit of the source call number is set and will be
interpreted as a retransmit when sent back out as the destination call number.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355182 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agocall manager_event only if there is not null channel structure
Alexandr Anikin [Tue, 14 Feb 2012 09:41:38 +0000 (09:41 +0000)] 
call manager_event only if there is not null channel structure

(Closes issue ASTERISK-19298)
Reported by: robinfood
Patches:
        issue19298.patch uploaded by may213 (License #5415)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355136 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix occasional incorrectly delayed call-file execution.
Richard Mudgett [Mon, 13 Feb 2012 22:02:10 +0000 (22:02 +0000)] 
Fix occasional incorrectly delayed call-file execution.

Since the dir timestamp is available at one second resolution, we cannot
know if it was updated within the same second after we scanned it.
Therefore, we will force another scan if the dir was just modified.

* Changed to force another scan if the directory was just modified.

(closes issue ASTERISK-19081)
Reported by: Knut Bakke

Review: https://reviewboard.asterisk.org/r/1688/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355056 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoOnly allow one 'dialplan reload' to execute at a time as otherwise they would share...
Joshua Colp [Mon, 13 Feb 2012 19:49:19 +0000 (19:49 +0000)] 
Only allow one 'dialplan reload' to execute at a time as otherwise they would share the same common local context list.

(closes issue AST-758)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355009 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix reconnecting to pgsql database after connection loss.
Richard Mudgett [Mon, 13 Feb 2012 17:22:17 +0000 (17:22 +0000)] 
Fix reconnecting to pgsql database after connection loss.

There can only be one database connection in res_config_pgsql just like
res_config_sqlite.  If the connection is lost, the connection may not get
reestablished to the same database if the res_pgsql.conf and
extconfig.conf files are inconsistent.

* Made only use the configured database from res_pgsql.conf.

* Fixed potential buffer overwrite of last[] in config_pgsql().

(closes issue ASTERISK-16982)
Reported by: german aracil boned

Review: https://reviewboard.asterisk.org/r/1731/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@354953 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix a voicemail memory leak with heard/deleted messages.
Jason Parker [Fri, 10 Feb 2012 21:45:22 +0000 (21:45 +0000)] 
Fix a voicemail memory leak with heard/deleted messages.

open_mailbox() was changed quite a long time ago to allocate this memory.
close_mailbox() should have been changed to be responsible for freeing it.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@354889 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix AMI Redirect ExtraChannel not redirecting to the same exten and context.
Richard Mudgett [Fri, 10 Feb 2012 18:03:30 +0000 (18:03 +0000)] 
Fix AMI Redirect ExtraChannel not redirecting to the same exten and context.

The astman_get_header() never returns NULL so the check by the code for
NULL would never fail.

(closes issue ASTERISK-16974)
Reported by: Nuno Borges
Patches:
      0018325.patch (license #6116) patch uploaded by Nuno Borges (modified)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@354835 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoNote that CDRs are immutable once a bridge is torn down
Terry Wilson [Thu, 9 Feb 2012 22:01:35 +0000 (22:01 +0000)] 
Note that CDRs are immutable once a bridge is torn down

CDRs cannot be modified after a bridge is torn down, (e.g. after
Dial() returns) even though the CDR() function may be called. Since
modifying the CDR code to change this behavior could very easily
break all kinds of things, this patch just documents this limitation.

(closes issues ASTERISK-16923)
Review: https://reviewboard.asterisk.org/r/1720/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@354749 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix parsing of SIP headers where compact and non-compact headers are mixed
Kinsey Moore [Thu, 9 Feb 2012 20:49:59 +0000 (20:49 +0000)] 
Fix parsing of SIP headers where compact and non-compact headers are mixed

Change parsing of SIP headers so that compactness of the header no longer
influences which header will be chosen.  Previously, a non-compact header
would be chosen instead of a preceeding compact-form header.

(closes issue ASTERISK-17192)
Review: https://reviewboard.asterisk.org/r/1728/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@354702 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoMake the config parser remove escaping backslashes
Kinsey Moore [Thu, 9 Feb 2012 19:52:25 +0000 (19:52 +0000)] 
Make the config parser remove escaping backslashes

The config parser in Asterisk does not currently remove a backslash that is
used to escape a semicolon which would otherwise be interpreted as the start
of a comment.

The change here causes that backslash to be removed, but does not create a
real escape system in the config parser.  The biggest complication with a real
escape system would be breaking existing configs everywhere (parsing \\ as \
and breaking on escaped non-semicolon characters) even though it would be the
"right" way to do things.

(closes issue ASTERISK-17121)
Review: https://reviewboard.asterisk.org/r/1724/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@354655 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoRemove outdated comment.
Mark Michelson [Thu, 9 Feb 2012 18:58:40 +0000 (18:58 +0000)] 
Remove outdated comment.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@354640 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix translation path choices.
Mark Michelson [Thu, 9 Feb 2012 17:32:47 +0000 (17:32 +0000)] 
Fix translation path choices.

This change makes it so computational cost is not taken into account
when deciding if a multistep path is better than a single-step path. This
means that the only time a multistep path will be chosen is if no single-step
path exists. This ensures a better quality translation even if it turns out
to be slightly slower.

(closes issue ASTERISK-16821)
reported by Andrew Lindh

Review: https://reviewboard.asterisk.org/r/1715

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@354594 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoClean-up of minor formatting issues in r354542/3/4
Matthew Jordan [Thu, 9 Feb 2012 17:07:35 +0000 (17:07 +0000)] 
Clean-up of minor formatting issues in r354542/3/4

rmudgett pointed out some formatting issues in the check-in for
ASTERISK-19290.  This cleans those up.

Review: https://reviewboards.asterisk.org/r/1722/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@354547 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoAdding reload support to res_fax.so
Mark Michelson [Thu, 9 Feb 2012 16:56:34 +0000 (16:56 +0000)] 
Adding reload support to res_fax.so

(closes issue ASTERISK-16712)
reported by Frank DiGennaro

Review: https://reviewboard.asterisk.org/r/1713

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@354545 65c4cc65-6c06-0410-ace0-fbb531ad65f3

13 years agoFix SIP INFO DTMF handling for non-numeric codes
Matthew Jordan [Thu, 9 Feb 2012 16:30:56 +0000 (16:30 +0000)] 
Fix SIP INFO DTMF handling for non-numeric codes

In ASTERISK-18924, SIP INFO DTMF handlingw as changed to account for both
lowercase alphatbetic DTMF events, as well as uppercase alphabetic DTMF
events.  When this occurred, the comparison of the character buffer containing
the event code was changed such that the buffer was first compared again '0'
and '9' to determine if it was numeric.  Unfortunately, since the first
character in the buffer will typically be '1' in the case of non-numeric
event codes (10-16), this caused those codes to be converted to a DTMF event
of '1'.  This patch fixes that, and cleans up handling of both
application/dtmf-relay and application/dtmf content types.

Review: https://reviewboard.asterisk.org/r/1722/

(closes issue ASTERISK-19290)
Reported by: Ira Emus
Tested by: mjordan

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@354542 65c4cc65-6c06-0410-ace0-fbb531ad65f3