]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
12 years agoconfbridge: Fix a bug which made conferences not record with AMI/CLI commands
Jonathan Rose [Tue, 30 Oct 2012 14:58:19 +0000 (14:58 +0000)] 
confbridge: Fix a bug which made conferences not record with AMI/CLI commands

When confbridge was changed to handle conference status with a state machine in
r374658. The function responsible for starting recording for a conference was
refactored with the function actually responsible for launching the recording
thread being split into a function with another name. The old function name was
still used for manually started recordings through AMI or CLI. This patch fixes
that by switching which function is used to start recording the conference.

(closes issue ASTERISK-20601)
Reported by: Vilius
Patches:
    confbridge_mixmonitor.diff uploaded by Jonathan Rose (license 6182)
........

Merged revisions 375470 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoEnsure that the Queue application tracks busy members in off nominal situations
Matthew Jordan [Tue, 30 Oct 2012 02:22:20 +0000 (02:22 +0000)] 
Ensure that the Queue application tracks busy members in off nominal situations

There are a few code paths where the Queue application fails to count a paused
or in use queue member as being 'busy'.  This can cause callers to get stuck
in the Queue until a paused agent unpauses themselves.

(closes issue ASTERISK-20623)
Reported by: Bryan Walters
patches:
  app_queue.patch uploaded by Bryan Walters (license 5851)
........

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

Merged revisions 375451 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoPrevent resetting of NATted realtime peer address on reload.
Mark Michelson [Mon, 29 Oct 2012 21:23:25 +0000 (21:23 +0000)] 
Prevent resetting of NATted realtime peer address on reload.

If a "sip reload" is issued for a SIP peer, then his
IP address will be cleared, thus resulting in forgetting the
public IP address. Asterisk will then attempt to route SIP
traffic to the private IP address.

The fix here is to make "sip reload" ignore realtime peers
when "host = dynamic" is spotted. Realtime peers can now only
have their IP address reset if they have gone from being not
dynamic to being dynamic.

(closes issue ASTERISK-18203)
reported by daren ferreira

(closes issue ASTERISK-20572)
reported by JoshE
Patches:
fix_nat_realtime.diff uploaded by JoshE (license #6075)
........

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

Merged revisions 375417 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix the Park 'r' option when a channel parks itself.
Richard Mudgett [Mon, 29 Oct 2012 19:29:53 +0000 (19:29 +0000)] 
Fix the Park 'r' option when a channel parks itself.

When a channel uses the Park appliation to park itself with the 'r'
option, the channel hears music-on-hold instead of the requested ringing.

* Added a missing check for the 'r' option when a channel parks itself.

(closes issue ASTERISK-19382)
Reported by: James Stocks
Patches by: dsessions

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

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

Merged revisions 375389 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agochan_dahdi: Fix segfault dereferencing a NULL tech_pvt.
Richard Mudgett [Mon, 29 Oct 2012 15:54:42 +0000 (15:54 +0000)] 
chan_dahdi: Fix segfault dereferencing a NULL tech_pvt.

The tech support customer was using the AMI Redirect action shortly after
a call was placed.  While the channel tried to do an ast_read(), the
masquerade resulting from the channel redirect took place.  The masquerade
in the middle of the ast_read() resulted in the segfault.

(closes issue AST-1025)
Reported by: Trey Blancher
Patches:
      jira_ast_1025_v1.8_v2.patch (license #5621) patch uploaded by rmudgett
........

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

Merged revisions 375362 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoast_tls_cert script: Better response for various exit conditions to openssl
Jonathan Rose [Tue, 23 Oct 2012 16:22:12 +0000 (16:22 +0000)] 
ast_tls_cert script: Better response for various exit conditions to openssl

(closes issue ASTERISK-20260)
Reported by: Daniel O'Connor
Patches:
ast_tls_cert-update.diff uploaded by Daniel O'Connor (license 6419)
........

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

Merged revisions 375326 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agocore: Fix a memory leak in app.c from an early return
Jonathan Rose [Mon, 22 Oct 2012 20:04:02 +0000 (20:04 +0000)] 
core: Fix a memory leak in app.c from an early return

ast_app_group_match_get_count allocates memory with the regcomp
function and we previously forgot to free it when bailing out
due to a regex compilation failure against category.

(closes issue AST-1018)
Reported by: Guenther Kelleter
Patches:
regcomp_memleak.diff uploaded by Guenther Kelleter (license 6372)
........

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

Merged revisions 375300 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoGSM: Fix encoding problems with GSM
Jonathan Rose [Mon, 22 Oct 2012 17:22:18 +0000 (17:22 +0000)] 
GSM: Fix encoding problems with GSM

(closes issue ASTERISK-20457)
Reported by: Richard Miller
Patches:
code.patch uploaded by Richard Miller (license 5685)
........

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

Merged revisions 375273 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoapp_queue: add upgrade notes for 375216
Jonathan Rose [Thu, 18 Oct 2012 21:44:22 +0000 (21:44 +0000)] 
app_queue: add upgrade notes for 375216

Adds UPGRADE notes describing behavioral changes to rrmemory strategy caused by
375216

(issue AST-989)
Reported by: Thomas Arimont

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

12 years agoBlocked revisions 375245
Jonathan Rose [Thu, 18 Oct 2012 21:39:57 +0000 (21:39 +0000)] 
Blocked revisions 375245

........
app_queue: add upgrade notes for 375216

Adds notes describing behavioral changes to rrmemory strategy caused by
375216

(issue AST-989)
Reported by: Thomas Arimont

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

12 years agoapp_queue: Make ordering of rrmemory/rrordered persist over add/remove members
Jonathan Rose [Thu, 18 Oct 2012 21:17:15 +0000 (21:17 +0000)] 
app_queue: Make ordering of rrmemory/rrordered persist over add/remove members

Prior to this patch, adding, removing or reloading  members to rrmemory would
cause the order to become completely jumbled. Now it behaves more or less like
rrordered other than the fact that it stores the members on a hash table rather
than a linked list. This patch also prevents removal of members and member
reloads from jumbling rrordered queues.

(issue AST-989)
Reported by: Thomas Arimont
Review: https://reviewboard.asterisk.org/r/2164/
........

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

Merged revisions 375217 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agobuild_tools: Allow Asterisk to report git SHAs in version string.
Richard Mudgett [Thu, 18 Oct 2012 20:02:02 +0000 (20:02 +0000)] 
build_tools: Allow Asterisk to report git SHAs in version string.

Make git more attractive for managing work-in-progress.  Especially
convenient when a potential patch set needs to be tested on multiple
platforms since one can use git to keep all the test environments in sync
independent of a subversion server.

Now the Asterisk version will show the exact git SHA5 that was used when
building (still appended by "M" if there are local modifications) from a
git clone of the Asterisk repository so the developer can more easily know
what is actually under test.

You will now get this:

  $ asterisk -V
  Asterisk GIT-1698298

Instead of this:

  $ asterisk -V
  Asterisk UNKNOWN__and_probably_unsupported

This has zero impact for those not using git with the exception of an
extra test in the configure script to gather git's path.  This is
necessary to prevent "sudo make install" from failing since git may not be
in the path in make's shell environment.

(closes issue ASTERISK-20483)
Reported by: Shaun Ruffell
Patches:
      0001-build_tools-Allow-Asterisk-to-report-git-SHAs-in-ver.patch (license #5417) patch uploaded by Shaun Ruffell
      Modified
........

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

Merged revisions 375190 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoEnsure Asterisk fails TCP/TLS SIP calls when certificate checking fails
Kinsey Moore [Wed, 17 Oct 2012 19:00:35 +0000 (19:00 +0000)] 
Ensure Asterisk fails TCP/TLS SIP calls when certificate checking fails

When placing a call to a TCP/TLS SIP endpoint whose certificate is not
signed by a configured CA certificate, Asterisk would issue a warning
and continue to process the call as if there was not an issue with the
certificate.  Asterisk now properly fails the call if the certificate
fails verification or if the certificate does not exist when
certificate checking is enabled (the default behavior).

(closes issue ASTERISK-20559)
Reported by: kmoore

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

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

Merged revisions 375147 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFixes to the fd-oriented SIP TCP reads.
Walter Doekes [Tue, 16 Oct 2012 21:44:46 +0000 (21:44 +0000)] 
Fixes to the fd-oriented SIP TCP reads.

Don't crash on large user input. Allow SIP headers without space.
Optimize code a bit.

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

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

Merged revisions 375112 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoUpdate sip_request_call SIP dial string documentation.
Walter Doekes [Tue, 16 Oct 2012 19:23:57 +0000 (19:23 +0000)] 
Update sip_request_call SIP dial string documentation.

This was missed when merging review r1859.
........

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

Merged revisions 375078 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoRemove a log message that was left in accidentally from call-id logging development.
Joshua Colp [Tue, 16 Oct 2012 14:08:28 +0000 (14:08 +0000)] 
Remove a log message that was left in accidentally from call-id logging development.

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

12 years agoFix some potential misuses of ast_str in the code.
Mark Michelson [Mon, 15 Oct 2012 21:15:09 +0000 (21:15 +0000)] 
Fix some potential misuses of ast_str in the code.

Passing an ast_str pointer by value that then calls
ast_str_set(), ast_str_set_va(), ast_str_append(), or
ast_str_append_va() can result in the pointer originally
passed by value being invalidated if the ast_str had
to be reallocated.

This fixes places in the code that do this. Only the
example in ccss.c could result in pointer invalidation
though since the other cases use a stack-allocated ast_str
and cannot be reallocated.

I've also updated the doxygen in strings.h to include
notes about potential misuse of the functions mentioned
previously.

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

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

Merged revisions 375026 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix underscreen buttons warnings apeared while transfer process
Igor Goncharovskiy [Mon, 15 Oct 2012 08:11:45 +0000 (08:11 +0000)] 
Fix underscreen buttons warnings apeared while transfer process

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

12 years agoUpdate config.guess and config.sub: 2012-10-10
Tzafrir Cohen [Sun, 14 Oct 2012 11:57:11 +0000 (11:57 +0000)] 
Update config.guess and config.sub: 2012-10-10

Update config.guess and config.sub to revision
fb456b34ef4aa02b95dc6be69aaa66fa94a844fb from the savannah.gnu.org git
repo. Adds support for e.g. aarch64 (ARM 64bit).

config.guess:timestamp='2012-09-25'
config.sub:timestamp='2012-10-10'
........

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

Merged revisions 374991 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoAvoid a segfault on invalid format names
Kinsey Moore [Fri, 12 Oct 2012 21:57:29 +0000 (21:57 +0000)] 
Avoid a segfault on invalid format names

If a format name was not found by ast_getformatbyname, a NULL pointer
would be passed into ast_format_rate and immediately dereferenced.
This ensures that a valid pointer is used since the structure is
already allocated on the stack.

(closes issue DPH-523)
Reported-by: Steve Pitts
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@374932 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 years agoDo not use a FILE handle when doing SIP TCP reads.
Mark Michelson [Fri, 12 Oct 2012 16:20:15 +0000 (16:20 +0000)] 
Do not use a FILE handle when doing SIP TCP reads.

This is used to solve an issue where a poll on a file
descriptor does not necessarily correspond to the readiness
of a FILE handle to be read.

This change makes it so that for TCP connections, we do a
recv() on the file descriptor instead.

Because TCP does not guarantee that an entire message or even
just one single message will arrive during a read, a loop has
been introduced to ensure that we only attempt to handle a
single message at a time. The tcptls_session_instance structure
has also had an overflow buffer added to it so that if more
than one TCP message arrives in one go, there is a place to
throw the excess.

Huge thanks goes out to Walter Doekes for doing extensive review
on this change and finding edge cases where code could fail.

(closes issue ASTERISK-20212)
reported by Phil Ciccone

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

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

Merged revisions 374906 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix a bug where audio on Google Voice would not work due to ignoring candidates.
Joshua Colp [Thu, 11 Oct 2012 21:18:50 +0000 (21:18 +0000)] 
Fix a bug where audio on Google Voice would not work due to ignoring candidates.

Instead of ignoring parts of the message that are not known just ignore the ones
we know may be present and that would cause a problem.

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

12 years agoRemove code that should not have gotten in.
Joshua Colp [Thu, 11 Oct 2012 16:04:19 +0000 (16:04 +0000)] 
Remove code that should not have gotten in.

(issue ASTERISK-20554)

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

12 years agoFix an issue where outgoing calls would fail to establish audio due to ICE negotiatio...
Joshua Colp [Thu, 11 Oct 2012 16:02:31 +0000 (16:02 +0000)] 
Fix an issue where outgoing calls would fail to establish audio due to ICE negotiation failures.

This change removes the requirement for ufrag and pwd in the transport stanza and also
makes us the controlling agent.

(closes issue ASTERISK-20554)
Reported by: mmichelson

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

12 years agoFix incorrect billing duration reported when batch mode is enabled
Matthew Jordan [Thu, 11 Oct 2012 15:44:00 +0000 (15:44 +0000)] 
Fix incorrect billing duration reported when batch mode is enabled

Similar to r369351, the billing duration can be skewed when batch mode is
enabled.  This happened much more rarely than the duration, as it only
occured when the call was answered (thereby indicating an actual answer
time) and immediately hung up on (indicating a billsec of 0).  Since
a billing time of '0' can either mean that the call immediately ended
or that the CDR was improperly answered, we have to use additional information
to know whether or not we can trust the CDR billsec value.  Prior to this
patch, we looked to see if we had a valid answer time.  If we did, and
billsec was zero, we used the current time to calculate what billsec value
we could from the CDR being written.  If batch mode is enabled, this will
incorrectly report a billsec value being much greater than the actual
duration of the call.

Instead of relying on the presence of an answer time to know whether or not
we can re-calculate the billsec for the CDR, we now also use the presence
of the CDR's end time to know if we need to re-calculate or whether we can
trust the billsec value that we have.  This prevents erroneous jumps in the
billsec value, while still making sure that in the worst case, some billing
time will be calculated.

(closes issue AST-1016)
Reported by: Thomas Arimont
Tested by: Thomas Arimont
........

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

Merged revisions 374844 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoDon't make chan_sip export global symbols.
Mark Michelson [Thu, 11 Oct 2012 15:31:10 +0000 (15:31 +0000)] 
Don't make chan_sip export global symbols.

During testing, it was discovered that having chan_sip
export global symbols was problematic.

The biggest problem was that load order was affected.
Trying to use realtime could be problematic since in
all likelihood the necessary realtime driver(s) would
not be loaded before chan_sip.

In addition, it was found that it was impossible to
use the Digium Phone Module for Asterisk since it
must be loaded before chan_sip since it must hook
into chan_sip's configuration parsing.

The solution is to use a virtual table in the same
manner that other modules in Asterisk do, like
app_voicemail.

(closes issue ASTERISK-20545)
Reported by: kmoore

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

12 years agoConsider the Google Talk content stanza name (jin:content) valid.
Joshua Colp [Thu, 11 Oct 2012 13:33:29 +0000 (13:33 +0000)] 
Consider the Google Talk content stanza name (jin:content) valid.

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

12 years agoapp_queue: Made pass connected line updates from the caller to ringing queue members.
Richard Mudgett [Wed, 10 Oct 2012 21:03:29 +0000 (21:03 +0000)] 
app_queue: Made pass connected line updates from the caller to ringing queue members.

Party A calls Party B
Party B puts Party A on hold.
Party B calls a queue.
Ringing queue member D sees Party B identification.
Party B transfers Party A to the queue.
Queue member D does not get a connected line update for Party A.
Queue member D answers the call and still sees Party B information.

However, if Party A later transfers the call to Party C then queue member
D gets a connected line update for Party C.

* Made pass connected line updates from the caller to queue members while
the queue members are ringing.

(closes issue AST-1017)
Reported by: Thomas Arimont

(closes issue ABE-2886)
Reported by: Thomas Arimont
Tested by: rmudgett

........

Merged revisions 374801 from https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
........

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

Merged revisions 374803 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix segfault regression from r370681
Kinsey Moore [Wed, 10 Oct 2012 13:35:53 +0000 (13:35 +0000)] 
Fix segfault regression from r370681

Due to usage of ast_hook_send_action, AMI action handling code should
be able to handle a NULL mansession->session.  This would cause a crash
on NULL dereference if action_originate was called from
ast_hook_send_action.

(closes issue ASTERISK-20544)

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

12 years agoFix execution of 'i' extension due to uninitialized variable.
Richard Mudgett [Tue, 9 Oct 2012 22:21:54 +0000 (22:21 +0000)] 
Fix execution of 'i' extension due to uninitialized variable.

The fix for ASTERISK-18243 added code that could potentially use
dst_exten[] uninitialized.  As a result the 'i' exten may not be executed
when it should.

(closes issue ASTERISK-20455)
Reported by: Richard Miller
Patches:
      pbx-1.8.16.0.diff (license #5685) patch uploaded by Richard Miller
      Made some cosmetic modifications.
........

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

Merged revisions 374763 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoImprove logging for DTLS-SRTP failure situations.
Joshua Colp [Tue, 9 Oct 2012 21:34:01 +0000 (21:34 +0000)] 
Improve logging for DTLS-SRTP failure situations.

(closes issue ASTERISK-20487)
Reported by: mjordan

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

12 years agoAdd a log message for when DTLS-SRTP is requested and the underlying engine does...
Joshua Colp [Tue, 9 Oct 2012 21:29:07 +0000 (21:29 +0000)] 
Add a log message for when DTLS-SRTP is requested and the underlying engine does not support it.

(closes issue ASTERISK-20487)
Reported by: mjordan

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

12 years agodahdi.conf.sample: Add description for "buffers" setting.
Richard Mudgett [Mon, 8 Oct 2012 22:30:27 +0000 (22:30 +0000)] 
dahdi.conf.sample: Add description for "buffers" setting.

This contains an edited version of the patch originally created by John
Bigelow.

(closes issue ASTERISK-14435)
Reported by: John Bigelow
Patches:
      buffers.patch (license #5091) patch uploaded by John Bigelow
      0001-dahdi.conf.sample-Add-description-for-buffers-settin.patch (license #5417) patch uploaded by Shaun Ruffell
      Modified
........

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

Merged revisions 374728 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix deletion of unopenable spool files.
Richard Mudgett [Mon, 8 Oct 2012 21:21:37 +0000 (21:21 +0000)] 
Fix deletion of unopenable spool files.

If scan_service() cannot open the spool file, it logs a message saying
that it will delete the file and calls remove_from_queue() to do it.
However, remove_from_queue() fails to delete the spool file because struct
outgoing has not yet been fully initialized.

* Merged allocating a new struct outgoing and init_outgoing() into
new_outgoing().  Allocation is initialization.

* Made apply_outgoing() not initialize the spool filename in struct
outgoing.

* Made apply_outgoing() call ast_trim_blanks() and ast_skip_blanks()
rather than manually inlining them.

* Reduced indentation levels in apply_outgoing().

* Fixed a garbled comment in remove_from_queue().

* Reworked scan_service() to simplify it.

(closes issue ASTERISK-17231)
Reported by: David Chappell
Patches:
      spool_open_failure.diff (license #4997) patch uploaded by David Chappell
      Started with this patch.
........

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

* Fixed some memory leaks on off nominal paths in init_outgoing() when
merging into the new_outgoing() function dealing with o->capabilities.
........

Merged revisions 374695 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoDisable ICE support by default
Matthew Jordan [Mon, 8 Oct 2012 20:38:58 +0000 (20:38 +0000)] 
Disable ICE support by default

Since there are a number of legacy devices out there that fail to handle ICE
candidates properly (which is a nice way of saying something much uglier),
disable it by default.

Support for ICE candidates can be enabled in rtp.conf using the icesupport
setting.

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

12 years agoResolve issues in ConfBridge regarding marked, waitmarked, and unmarked users
Matthew Jordan [Mon, 8 Oct 2012 18:47:10 +0000 (18:47 +0000)] 
Resolve issues in ConfBridge regarding marked, waitmarked, and unmarked users

Thank's to Neil Tallim (flan)'s tireless testing, issue reporting, and patches
it became clear that app_confbridge had some complex logic in how it handled
interactions between marked, waitmarked, and unmarked users.  In particular,
there were some areas in which the interactions between the users resulted
in inconsistent behavior, and app_confbridge was missing logic in how to handle
some corner cases.  Some areas included:
 * Poor handling of mixing unmarked and waitmarked users
 * Inconsistencies in how MOH and muting was applied to various users
 * Handling of various announcements for different user profile options
flan's patches seem to fix the various issues, but highlighted how hard the
code could be to maintain.  In an attempt to make things easier to maintain and
to more fully enumerate the various cases that exist, this patch breaks up the
logic into a state machine-like setup.

Please note that the various state transitioned are documented on the Asterisk
wiki:

https://wiki.asterisk.org/wiki/display/AST/Confbridge+state+changes

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

Note that for the following issues, mjordan uploaded the patch, although it
was written by twilson.  Any contributor license discrepency is due to that.

(closes issue ASTERISK-19562)
Reported by: flan
Tested by: flan, mjordan, jrose
patches:
  bugASTERISK-19562_ASTERISK-19726_ASTERISK-20181.patch uploaded by twilson (license 6283)

(closes issue ASTERISK-19726)
Reported by: flan
Tested by: flan
patches:
  bugASTERISK-19562_ASTERISK-19726_ASTERISK-20181.patch uploaded by twilson (license 6283)

(closes issue ASTERISK-20181)
Reported by: Jonathan White
Tested by: Jonathan White
patches:
  bugASTERISK-19562_ASTERISK-19726_ASTERISK-20181.patch uploaded by twilson (license 6283)
........

Merged revisions 374652 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agopjproject: Fix for Solaris builds. Do not undef s_addr.
Matthew Jordan [Mon, 8 Oct 2012 00:41:01 +0000 (00:41 +0000)] 
pjproject: Fix for Solaris builds. Do not undef s_addr.

pjproject, in order to solve build problems on Windows [1], undefines s_addr in
one of it's headers that is included in res_rtp_asterisk.c. On Solaris s_addr
is not a structure member, but defined to map to the real strucuture member,
therefore when building on Solaris it's possible to get build errors like:

    [CC] res_rtp_asterisk.c -> res_rtp_asterisk.o
    In file included from /export/home/admin/asterisk-11-svn/include/asterisk/stun.h:29,
                     from res_rtp_asterisk.c:51:
    /export/home/admin/asterisk-11-svn/include/asterisk/network.h: In function `inaddrcmp':
    /export/home/admin/asterisk-11-svn/include/asterisk/network.h:92: error: structure has no member named `s_addr'
    /export/home/admin/asterisk-11-svn/include/asterisk/network.h:92: error: structure has no member named `s_addr'
    res_rtp_asterisk.c: In function `ast_rtp_on_ice_tx_pkt':
    res_rtp_asterisk.c:706: warning: dereferencing type-punned pointer will break strict-aliasing rules
    res_rtp_asterisk.c:710: warning: dereferencing type-punned pointer will break strict-aliasing rules
    res_rtp_asterisk.c: In function `rtp_add_candidates_to_ice':
    res_rtp_asterisk.c:1085: error: structure has no member named `s_addr'
    make[2]: *** [res_rtp_asterisk.o] Error 1
    make[1]: *** [res] Error 2
    make[1]: Leaving directory `/export/home/admin/asterisk-11-svn'
    gmake: *** [_cleantest_all] Error 2

Unfortunately, in order to make this work, I also had to make sure pjproject
only used the typdef pj_in_addr and not the struct pj_in_addr so that when
building Asterisk I could "typedef struct in_addr pj_in_addr". It's possible
then that the library and users of those interfaces in Asterisk have a different
idea about the type of the argument, while on the surface it looks like they are
all 32 bit big endian values.

[1] http://trac.pjsip.org/repos/changeset/484

(issues ASTERISK-20366)
Reported by: Ben Klang
Tested by: Ben Klang, mjordan
patches:
  0001-pjproject-Fix-for-Solaris-builds.-Do-not-undef-s.patch uploaded by Shaun Ruffell (license 5417)

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

12 years agoTrivial patch to make 'best_score' defined for all architectures.
Matthew Jordan [Sun, 7 Oct 2012 17:31:53 +0000 (17:31 +0000)] 
Trivial patch to make 'best_score' defined for all architectures.

Fixes trivial build error on Solaris:

  acl.c: In function `get_local_address':
  acl.c:196: error: `best_score' undeclared (first use in this function)
  acl.c:196: error: (Each undeclared identifier is reported only once
  acl.c:196: error: for each function it appears in.)
  make[2]: *** [acl.o] Error 1

(issue ASTERISK-20366)
Reported by: Ben Klang
Tested by: Ben Klang
patches:
  0002-main-acl.c-Trivial.-best_score-should-be-defined-for.patch by Shaun Ruffell (license 5417)

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

12 years agoHandle capability stanzas that fail to provide node or version information
Matthew Jordan [Sat, 6 Oct 2012 03:20:56 +0000 (03:20 +0000)] 
Handle capability stanzas that fail to provide node or version information

While XEP-0115 states that the node and ver attributes are both required, some
devices fail to provide either field.  Prior to this patch, failure to provide
the node or ver attribute would cause a crash in res_xmpp.  While failing to
provide the node or ver attribute is technically invalid, since this
information is not utilized by Asterisk except for reporting purposes, for
interoperability reasons, we continue to process the capability stanza anyways.

(closes issue ASTERISK-20495)
Reported by: Martin W
Tested by: Martin W
patches:
  20495.patch uploaded by Martin W (license #6434)

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

12 years agoUpdate documentation for MessageSend application/command's From field for XMPP
Matthew Jordan [Sat, 6 Oct 2012 01:44:41 +0000 (01:44 +0000)] 
Update documentation for MessageSend application/command's From field for XMPP

When using the channel technology agnostic application/AMI command MessageSend,
the "From" field is technically optional for the SIP channel driver.  However,
if being sent by the XMPP resource module (either res_xmpp or res_jabber), the
"From" field is necessary, and must correspond to a defined account.  This
patch updates the documentation for this application/AMI command to reflect
this.

(closes issue ASTERISK-20405)
Reported by: Leif Madsen

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

12 years agoMultiple revisions 374570,374581
David M. Lee [Fri, 5 Oct 2012 20:32:42 +0000 (20:32 +0000)] 
Multiple revisions 374570,374581

........
  r374570 | dlee | 2012-10-05 15:14:41 -0500 (Fri, 05 Oct 2012) | 22 lines

  Improve AMI long line error handling

  In AMI's parser, when it receives a long line (> 1024 characters), it discards
  that line, but continues to process the message normally.

  Typically, this is not a problem because a) who has lines that long and b)
  usually a discarded line results in an invalid message. But if that line is
  specifying an optional field, then the message will be processed, you get a
  'Response: Success', but things don't work the way you expected them to.

  This patch changes the behavior when a line-too-long parse error occurs.

  * Changes the log message to avoid way-too-long (and truncated anyways) log
    messages
  * Adds a 'parsing' status flag to Response: Success
  * Sets parsing = MESSAGE_LINE_TOO_LONG if, well, a line is too long
  * Responds with an appropriate error if parsing != MESSAGE_OKAY

  (closes issue AST-961)
  Reported by: John Bigelow
  Review: https://reviewboard.asterisk.org/r/2142/
........
  r374581 | dlee | 2012-10-05 15:20:28 -0500 (Fri, 05 Oct 2012) | 1 line

  I've committed too much. Reverting part of r374570.
........

Merged revisions 374570,374581 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 374586 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoMerged revisions 374515-374535 from
Richard Mudgett [Fri, 5 Oct 2012 18:34:41 +0000 (18:34 +0000)] 
Merged revisions 374515-374535 from
https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier

................
  r374515 | rmudgett | 2012-10-04 17:52:36 -0500 (Thu, 04 Oct 2012) | 10 lines

  chan_misdn: Remove some deadcode

  * Made setup_bc() static.

  Patches:
patch1_unused-code.diff (license #6372) patch uploaded by Guenther Kelleter
Modified

  JIRA ABE-2882

................
  r374516 | rmudgett | 2012-10-04 18:01:01 -0500 (Thu, 04 Oct 2012) | 7 lines

  chan_misdn: Remove unused bchan states

  Patches:
patch2_unused-states.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374517 | rmudgett | 2012-10-04 18:17:51 -0500 (Thu, 04 Oct 2012) | 16 lines

  chan_misdn: Remove unnecessary null pointer checks and checks for stack->nt

  * cleanup_bc() is always called with valid bc (or it would've crashed
  before).

  * Value of stack->nt is known in advance at some places.

  * Rename handle_event() to handle_event_te(), handle_frm() to
  handle_frm_te().

  Patches:
patch3_checks.diff (license #6372) patch uploaded by Guenther Kelleter
Modified

  JIRA ABE-2882

................
  r374518 | rmudgett | 2012-10-04 18:21:59 -0500 (Thu, 04 Oct 2012) | 7 lines

  chan_misdn: Fix spelling in log messages

  Patches:
patch4_spelling.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374519 | rmudgett | 2012-10-04 18:31:59 -0500 (Thu, 04 Oct 2012) | 15 lines

  chan_misdn: Don't cleanup a bc twice.

  In handle_frm_te() after calling misdn_lib_send_event(bc,
  EVENT_RELEASE_COMPLETE) bc is emptied, cleaned and set not in use,
  although misdn_lib_send_event() already did the same.  This is bad.  When
  it's not in use we are not allowed to touch it.

  * Moved log message in front of the resulting actions and fixed it to
  match the case.

  Patches:
patch5_bccleanup.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374520 | rmudgett | 2012-10-04 18:43:56 -0500 (Thu, 04 Oct 2012) | 12 lines

  chan_misdn: Fix memory leaks, bc, chan not cleaned up etc., really bad stuff.

  * Fix return codes of cb_events() for EVENT_SETUP to use caller's cleanup
  mechanisms.

  * Move cl_queue_chan() call after bearer check.

  Patches:
patch6_leaks.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374521 | rmudgett | 2012-10-04 18:48:38 -0500 (Thu, 04 Oct 2012) | 11 lines

  chan_misdn: We must initialize cause on sending a DISCONNECT.

  We must initialize cause on sending a DISCONNECT, so it is later correctly
  indicated to ast_channel in case the answer (RELEASE/RELEASE_COMPLETE)
  does not include one.

  Patches:
patch7_hangupcause.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374522 | rmudgett | 2012-10-04 19:03:56 -0500 (Thu, 04 Oct 2012) | 7 lines

  chan_misdn: Remove unused code for upqueue

  Patches:
patch8_unused-upqueue.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374523 | rmudgett | 2012-10-04 19:11:50 -0500 (Thu, 04 Oct 2012) | 7 lines

  chan_misdn: Improve debugging (port number, messages fixed, dups removed)

  Patches:
patch9_debug.diff (license #6372) patch uploaded by Guenther Kelleter

  JIRA ABE-2882

................
  r374533 | rmudgett | 2012-10-05 12:17:18 -0500 (Fri, 05 Oct 2012) | 8 lines

  chan_misdn: Better debug: we can print_bc_info even if there's no ast leg.

  Patches:
patch10_debug-bc-2.diff (license #6372) patch uploaded by Guenther Kelleter
Modified.

  JIRA ABE-2882

................
  r374534 | rmudgett | 2012-10-05 12:34:10 -0500 (Fri, 05 Oct 2012) | 16 lines

  chan_misdn: setup_bc() is called too early for an incoming SETUP on TE.

  This prevents the B channel from being setup for HDLC mode when requested
  by the bearer capability and config option hdlc=yes.  It violates
  ETS300102 Ch.5.2.3.2: "The user, in any case, must not connect to the
  channel until a CONNECT ACKNOWLEDGE message has been received."

  * Call setup_bc() on receipt of CONNECT_ACKNOWLEGDE for PTMP, and on first
  response to SETUP for PTP.

  Patches:
abe-2881-2.diff (license #6372) patch uploaded by Guenther Kelleter
Modified.

  JIRA ABE-2881

................
  r374535 | rmudgett | 2012-10-05 12:41:05 -0500 (Fri, 05 Oct 2012) | 2 lines

  chan_misdn: Remove some more deadcode.

................
........

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

Merged revisions 374537 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agodsp.c User Configurable DTMF_HITS_TO_BEGIN and DTMF_MISSES_TO_END
Alec L Davis [Thu, 4 Oct 2012 20:18:59 +0000 (20:18 +0000)] 
dsp.c User Configurable DTMF_HITS_TO_BEGIN and DTMF_MISSES_TO_END

Instead of a recompile, allow values to be adjusted in dsp.conf

For binary distributions allows easy adjustment for wobbly GSM calls, and other reasons.

Defaults to DTMF_HITS_TO_BEGIN=2 and DTMF_MISSES_TO_END=3

(closes issue ASTERISK-17493)
Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

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

Merged revisions 374481 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agodsp.c fix incorrect DTMF Digit_Duration.
Alec L Davis [Thu, 4 Oct 2012 20:06:45 +0000 (20:06 +0000)] 
dsp.c fix incorrect DTMF Digit_Duration.

it's always short by 'hits_to_begin*DTMF_GSIZE', or 25.5ms if hitstobegin=2

(issue ASTERISK-16003)
Tested by: alecdavis
alecdavis (license 585)

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

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

Merged revisions 374476 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix DBDelTree error codes for AMI, CLI and AGI
David M. Lee [Thu, 4 Oct 2012 15:42:07 +0000 (15:42 +0000)] 
Fix DBDelTree error codes for AMI, CLI and AGI

The AMI DBDelTree command will return Success/Key tree deleted successfully even
if the given key does not exist. The CLI command 'database deltree' had a
similar problem, but was saved because it actually responded with '0 database
entries removed'. AGI had a slightly different error, where it would return
success if the database was unavailable.

This came from confusion about the ast_db_deltree retval, which is -1 in the
event of a database error, or number of entries deleted (including 0 for
deleting nothing).

* Changed some poorly named res variables to num_deleted
* Specified specific errors when calling ast_db_deltree (database unavailable
  vs. entry not found vs. success)
* Fixed similar bug in AGI database deltree, where 'Database unavailable'
  results in successful result

(closes issue AST-967)
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/2138/
........

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

Merged revisions 374427 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agodsp.c User configuration of DTMF_NORMAL_TWIST and DTMF_REVERSE_TWIST values
Alec L Davis [Thu, 4 Oct 2012 04:43:32 +0000 (04:43 +0000)] 
dsp.c User configuration of DTMF_NORMAL_TWIST and DTMF_REVERSE_TWIST values

Asterisk's DTMF Specifications are based on AT&T specs, which may not be compatible in other countries.

Various countries have different specifications for the maximum power level differences
between the DTMF low group and high group of frequencies.

Power level difference between frequencies for different Administrations/RPOAs
 NTT        = Max. 5 dB
 AT&T       = 4dB(reverse) to 8dB(normal)
 Danish     = Max. 6 dB
 Australian = Max. 10 dB
 Brazilian  = Max. 9 dB
 ETSI       = Max. 6 dB from ETSI ES 201 235-3 V1.3.1 (2006-03)

Now allow 4 variables to be individually configured in dsp.conf, with reasonable min/max of 2dB to 20dB.
Default is AT&T specifications

Add's the following variables to dsp.conf
;dtmf_normal_twist=6.31
;dtmf_reverse_twist=2.51
;relax_dtmf_normal_twist=6.31
;relax_dtmf_reverse_twist=3.98

(closes issue ASTERISK-20442)
Reported by: tbsky
Tested by: tbsky,alecdavis

alecdavis (license 585)

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

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

Merged revisions 374385 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years ago_dsp_init: bring inline with trunk
Alec L Davis [Thu, 4 Oct 2012 04:21:25 +0000 (04:21 +0000)] 
_dsp_init: bring inline with trunk

preparation for clean merge of DTMF TWIST patch

No functional changes, just style.

alecdavis (license 585)
Reported by: Alec Davis
Tested by: alecdavis

related https://reviewboard.asterisk.org/r/2141
........

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

Merged revisions 374370 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoCheck for presence of buddy in info/dinfo handlers
Matthew Jordan [Thu, 4 Oct 2012 02:15:07 +0000 (02:15 +0000)] 
Check for presence of buddy in info/dinfo handlers

The res_jabber resource module uses the ASTOBJ library for managing its ref
counted objects.  After calling ASTOBJ_CONTAINER_FIND to locate a buddy object,
the pointer to the object has to be checked to see if the buddy existed.
Prior to this patch, the buddy object was not checked for NULL; with this patch
in both aji_client_info_handler and aji_dinfo_handler the pointer is checked
before used and, if no buddy object was found, the handlers return an error
code.

This patch does not take the approach that our JID can be used to log in from
another resource.  If that approach is desired, an improvement could be made to
this patch to create the buddy on the fly.  This patch seeks only to prevent
Asterisk from crashing.

FYI: In Asterisk 11+, you really should be using res_xmpp.  It does not have
this problem, as it moved to the astobj2 library.

Note that multiple people have proposed patches for this issue; the patch being
committed here is based on those.

(closes issue ASTERISK-19532)
Reported by: Karsten Wemheuer
Tested by: Byron Clark
patches:
  fix-jabber uploaded by Karsten Wemheuer (license #5930)
  xmpp_no_crash_with_ejabberd.patch uploaded by Byron Clark (license #6157)

(closes issue ASTERISK-19557)
Reported by: ulugutz
........

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

Merged revisions 374336 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoDestroy the generic_monitors container after the core_instances in ccss
Matthew Jordan [Wed, 3 Oct 2012 17:27:05 +0000 (17:27 +0000)] 
Destroy the generic_monitors container after the core_instances in ccss

For each item in core_instances disposed of in the shutdown of ccss, any
generic monitor instances referenced by the objects will be removed from
generic_monitors during their destruction.  Hilarity ensues if
generic_monitors no longer exists.

Thanks to the Asterisk Test Suite's generic_ccss test for complaining loudly
when it ran into this.
........

Merged revisions 374300 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoEnsure Shutdown AMI event is still fired during Asterisk shutdown
Matthew Jordan [Tue, 2 Oct 2012 21:23:01 +0000 (21:23 +0000)] 
Ensure Shutdown AMI event is still fired during Asterisk shutdown

Richard pointed out that having the manager dispose of itself gracefully
during shutdown meant that the Shutdown event will no longer get fired.
This patch moves the AMI event just prior to running the atexit callbacks.
........

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

Merged revisions 374231 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix findings from check-in on r374177
Matthew Jordan [Tue, 2 Oct 2012 17:12:16 +0000 (17:12 +0000)] 
Fix findings from check-in on r374177

Richard pointed out two problems with the check-in from r374177:
* The ast_msg_shutdown function declaration doesn't match the prototype
  in main/message.c.
* The ref/alloc function usage in astobj2 (in trunk) can use the ao2_t_*
  variants of the functions to allow the REF_DEBUG flag to enable/disable
  their debug counterparts.
........

Merged revisions 374210 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix a variety of ref counting issues
Matthew Jordan [Tue, 2 Oct 2012 01:27:19 +0000 (01:27 +0000)] 
Fix a variety of ref counting issues

This patch resolves a number of ref leaks that occur primarily on Asterisk
shutdown.  It adds a variety of shutdown routines to core portions of
Asterisk such that they can reclaim resources allocate duringd initialization.

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

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

Merged revisions 374178 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoapp_queue: Support persisting and loading of long member lists.
Sean Bright [Mon, 1 Oct 2012 20:26:09 +0000 (20:26 +0000)] 
app_queue: Support persisting and loading of long member lists.

Greenlight in #asterisk brought up that he was receiving an error message "Could
not create persistent member string, out of space" when running app_queue in
Asterisk 10.  dump_queue_members() made an assumption that 8K would be enough to
store the generated string, but with queues that have large member lists this is
not always the case.  This patch removes the limitation and uses ast_str instead
of a fixed sized buffer.

The complicating factor comes from the fact that ast_db_get requires a buffer
and buffer size argument, which doesn't let us pull back more than what we pass
in, so I introduced a new ast_db_get_allocated() which returns an ast_strdup()'d
copy of the value from astdb.

As an aside, I did some testing on the maximum size of data that we can store in
the BDB library we distribute and was able to store a 10MB string and retrieve
it with no problems, so I feel this is a safe patch.

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

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

Merged revisions 374135 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoUse ast_copy_string instead of strncpy to guarantee a NUL terminated string.
Sean Bright [Mon, 1 Oct 2012 17:27:57 +0000 (17:27 +0000)] 
Use ast_copy_string instead of strncpy to guarantee a NUL terminated string.
........

Merged revisions 374132 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoDon't destroy confbridge config when error is encountered during a reload.
Mark Michelson [Mon, 1 Oct 2012 16:12:43 +0000 (16:12 +0000)] 
Don't destroy confbridge config when error is encountered during a reload.

Not panicking means that the old config is kept.

(closes issue ASTERISK-20458)
Reported by: Leif Madsen
Patches:
ASTERISK-20458.patch uploaded by Mark Michelson(license #5049)
Tested by Leif Madsen

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

12 years agoFix ref leak when adding ICE candidates to an SDP
Matthew Jordan [Sat, 29 Sep 2012 03:54:15 +0000 (03:54 +0000)] 
Fix ref leak when adding ICE candidates to an SDP

There was a missing decrement to the reference count for the current ICE
candidate when local candidates are being added to an outbound SDP.  This
patch corrects that.

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

12 years agores_jabber: Remove CLI command 'jabber test'
Jonathan Rose [Fri, 28 Sep 2012 19:29:07 +0000 (19:29 +0000)] 
res_jabber: Remove CLI command 'jabber test'

The opinion of development was that it is both improper to have Matt's
personal email address used in the source and that the command wouldn't
be useful without it.

(closes issue AST-467)
Reported by: Malcolm Davenport
........

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

Merged revisions 374045 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoReset hangup flags on channels created through messages and cleanup globals
Brent Eagles [Fri, 28 Sep 2012 13:02:17 +0000 (13:02 +0000)] 
Reset hangup flags on channels created through messages and cleanup globals
in res_xmpp on unload.

This patch fixes an issue where hangup flags were not being reset on a
channel, affecting subsequent use of that channel. The patch also adds some
additional cleanup to res_xmpp to fix an issue with reloading the module.

(closes ASTERISK-20360)
Reported by: Noah Engelberth
Tested by: beagles
Review: https://reviewboard.asterisk.org/r/2134/

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

12 years agoUpdate documentation to make it explicit that "stream file" will not restart musiconhold.
Joshua Colp [Fri, 28 Sep 2012 12:16:40 +0000 (12:16 +0000)] 
Update documentation to make it explicit that "stream file" will not restart musiconhold.

(issue ASTERISK-17367)
Reported by: oej
........

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

Merged revisions 373990 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix SendDTMF crash and channel reference leak using channel name parameter.
Richard Mudgett [Thu, 27 Sep 2012 22:19:03 +0000 (22:19 +0000)] 
Fix SendDTMF crash and channel reference leak using channel name parameter.

The SendDTMF channel name parameter has two issues.
1) Crashes if the channel name does not exist.
2) Leaks a channel reference if the channel is the current channel.
Problem introduced by ASTERISK-15956.

* Updated SendDTMF documentation.

* Renamed app to senddtmf_name and tweaked the type.
........

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

Merged revisions 373946 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoMake res_http_websocket an optional dependency on supported platforms for chan_sip.
Joshua Colp [Thu, 27 Sep 2012 17:05:26 +0000 (17:05 +0000)] 
Make res_http_websocket an optional dependency on supported platforms for chan_sip.

(closes issue ASTERISK-20439)
Reported by: sruffell
Patches:
     0001-chan_sip-websocket-support-is-an-optional-API.patch uploaded by sruffell (license 5417)

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

12 years agoloader: Ensure dependent modules are properly initialized.
Joshua Colp [Thu, 27 Sep 2012 16:51:31 +0000 (16:51 +0000)] 
loader: Ensure dependent modules are properly initialized.

If an Asterisk module specifies a dependency in ast_module_info.nonoptreq, it
is possible for Asterisk to skip calling the modules's .load function.
Asterisk was loading and linking the module via load_dynamic_module() but was
not adding the module to the resource_heap. Therefore the module was not
initialized based on it's priority along with the other modules in the heap.

Now use load_resource() instead of load_dynamic_module() for non-optional
requirement. This will add the module to the resource_heap so the module can
be properly initialized in the correct order.

This is required if there are any module global data structures initialized in
the .load() callback for the module on platforms which do not support weak
references.

(issue ASTERISK-20439)
Reported by: sruffell
Patches:
     0001-loader-Ensure-dependent-modules-are-properly-initial.patch uploaded by sruffell (license 5417)
........

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

Merged revisions 373910 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix an issue where Local channels dialed by app_queue are considered in use immediately.
Joshua Colp [Thu, 27 Sep 2012 11:33:03 +0000 (11:33 +0000)] 
Fix an issue where Local channels dialed by app_queue are considered in use immediately.

The chan_local channel driver returns a device state of in use even if a created Local
channel has not yet been dialed. This fix changes the logic to return a state of not
in use until the channel itself has been dialed.

(closes issue ASTERISK-20390)
Reported by: tim_ringenbach

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

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

Merged revisions 373879 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoMove handling of 408 response so there is no misleading warning message.
Mark Michelson [Wed, 26 Sep 2012 21:16:11 +0000 (21:16 +0000)] 
Move handling of 408 response so there is no misleading warning message.

(closes issue ASTERISK-20060)
Reported by: Walter Doekes
........

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

Merged revisions 373849 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFixed meetme tab completion and command documentation.
Richard Mudgett [Wed, 26 Sep 2012 18:18:01 +0000 (18:18 +0000)] 
Fixed meetme tab completion and command documentation.

* Removed unnecessary case sensitivity in meetme list, lock, unlock, mute,
unmute, and kick commands.

* Separated meetme lock/unlock, mute/unmute, and kick commands into their
own registered commands to simplify tab completion and parameter checking.
meetme_lock_cmd(), meetme_mute_cmd(), and meetme_kick_cmd()

* Simplified meetme_show_cmd()

(closes issue AST-1006)
Reported by: John Bigelow
Tested by: rmudgett
........

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

Merged revisions 373816 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoapp_queue: 'agent available' hint, cleanup restart, and initial state
Alec L Davis [Wed, 26 Sep 2012 08:29:53 +0000 (08:29 +0000)] 
app_queue: 'agent available' hint, cleanup restart, and initial state

Fix previously untested senarios;

1). On queue initialisation set queue_avail devstate to INUSE.
    Previously was unavailable, which indicated an agent was available.

2). When removing members, if there are no other members available, set queue_avail to INUSE.
    Previously, if a member interface had become 'unavailable', they were never going to be removed, particularly when persistant queues is enabled.

3). When adding a member, check that they are available, if they are set queue_avail to NOT_INUSE.
 Previously on reloaded, members may have been 'unavailable'.

4). When pausing or unpausing a member, set appropriate queue availability.

alecdavis (license 585)
Reported by: Alec Davis
Tested by: alecdavis

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

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

12 years agoFix saying of date in Dutch.
Mark Michelson [Tue, 25 Sep 2012 23:09:40 +0000 (23:09 +0000)] 
Fix saying of date in Dutch.

The Dutch say the date before the month.

(closes issue ASTERISK-20353)
Reported by: Teun Ouwehand
........

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

Merged revisions 373774 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoRemove dead code and documentation for nonexistent feature.
Mark Michelson [Tue, 25 Sep 2012 22:55:35 +0000 (22:55 +0000)] 
Remove dead code and documentation for nonexistent feature.

multiplelogin was removed from chan_agent back in 1.6.0 when
AgentCallbackLogin() was removed.

(closes issue AST-948)
reported by Steve Pitts
........

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

Merged revisions 373769 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix error where improper IMAP greetings would be deleted.
Mark Michelson [Tue, 25 Sep 2012 21:13:46 +0000 (21:13 +0000)] 
Fix error where improper IMAP greetings would be deleted.

(closes issue ASTERISK-20435)
Reported by: fhackenberger
Patches:
asterisk-20435-imap-del-greeting.diff uploaded by Michael L. Young (License #5026)
(with suggested modification made by me)
........

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

Merged revisions 373737 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix T.38 support when used with chan_local in between.
Joshua Colp [Tue, 25 Sep 2012 20:13:03 +0000 (20:13 +0000)] 
Fix T.38 support when used with chan_local in between.

Users of the T.38 API can indicate AST_T38_REQUEST_PARMS on a channel to request that the
channel indicate a T.38 negotiation with the parameters present on the channel. The return
value of this indication is expected to be AST_T38_REQUEST_PARMS upon success but with
chan_local involved this could never occur.

This fix changes chan_local to always return AST_T38_REQUEST_PARMS for this situation. If
the underlying channel technology on the other side does not support T.38 this would have
been determined ahead of time using ast_channel_get_t38_state and an indication would
not occur.

(closes issue ASTERISK-20229)
Reported by: wdoekes
Patches:
     ASTERISK-20229.patch uploaded by wdoekes (license 5674)

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

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

Merged revisions 373706 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoRecorded merge of revisions 373703 from http://svn.asterisk.org/svn/asterisk/branches/10
Kinsey Moore [Tue, 25 Sep 2012 19:35:09 +0000 (19:35 +0000)] 
Recorded merge of revisions 373703 from http://svn.asterisk.org/svn/asterisk/branches/10

........
Fix an issue where media would not flow for situations where the legacy STUN code is in use.

The STUN packets should *not* be blocked by strict RTP.

(closes issue ASTERISK-20415)
Reported by: Michele Cicciotti
patches:
  uploaded by Joshua Colp (trunk r369817)
........

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

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

12 years agoProperly handle UAC/UAS roles for SIP session timers
Terry Wilson [Tue, 25 Sep 2012 18:52:12 +0000 (18:52 +0000)] 
Properly handle UAC/UAS roles for SIP session timers

The SIP session timer mechanism contains a mandatory 'refresher' parameter
(included in the Session-Expires header) which is used in the session timer
offer/answer signaling within a SIP Invite dialog. It looks like asterisk is
interpreting the uac resp. uas role only as the initial role of client and
server (caller is uac, callee is uas). The standard rfc 4028 however assigns
the client role to the ((RE)-Invite) requester, the server role to the
((RE)-Invite) responder.

This patch has Asterisk track the actual refresher as "us" or "them" as opposed
to relying on just the configured "uas" or "uac" properties.

(closes issue AST-922)
Reported by: Thomas Airmont

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

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

Merged revisions 373665 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years ago"show" completion option for "queue" shouldn't appear twice
Kinsey Moore [Tue, 25 Sep 2012 18:24:59 +0000 (18:24 +0000)] 
"show" completion option for "queue" shouldn't appear twice

When tab-completing CLI commands starting with "queue", "show" appeared
twice in the list due to the way that Asterisk's tab completion
functions and the order in which the commands were registered. The
registration order has been altered to resolve this issue.

(closes issue AST-940)
Reported-by: Steve Pitts
........

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

Merged revisions 373675 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix valgrind found memcpy issues in codec_ilbc.
Richard Mudgett [Tue, 25 Sep 2012 17:21:08 +0000 (17:21 +0000)] 
Fix valgrind found memcpy issues in codec_ilbc.

Valgrind found codec_ilbc using memcpy instead of memmove for overlapping
memory blocks.

(issue ASTERISK-19890)
(closes issue ASTERISK-20231)
Reported by: Walter Doekes
Patches:
      ASTERISK-20231.patch (license #5674) patch uploaded by Walter Doekes
........

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

Merged revisions 373645 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoMake rebuild GSM, ilbc, or lpc10 codecs if the respective sources change.
Richard Mudgett [Tue, 25 Sep 2012 16:56:54 +0000 (16:56 +0000)] 
Make rebuild GSM, ilbc, or lpc10 codecs if the respective sources change.
........

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

Merged revisions 373633 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agochan_sip: Set Quality of Service for video rtp instance
Jonathan Rose [Tue, 25 Sep 2012 16:31:41 +0000 (16:31 +0000)] 
chan_sip: Set Quality of Service for video rtp instance

(closes issue ASTERISK-20201)
Reported by: ddkprog
Patches:
    chan_sip.c.diff uploaded by ddkprog (license 6008)
........

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

Merged revisions 373631 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years ago"He who go through turnstile sideways is going to Bangkok"
Mark Michelson [Tue, 25 Sep 2012 14:12:05 +0000 (14:12 +0000)] 
"He who go through turnstile sideways is going to Bangkok"

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

12 years agoFix documentation for default username in res_odbc
Kinsey Moore [Tue, 25 Sep 2012 13:29:02 +0000 (13:29 +0000)] 
Fix documentation for default username in res_odbc

This was previously stated to be "root", but is actually the name of
the context if unspecified.

(closes issue ASTERISK-20258)
Reported by: Stefan x
........

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

Merged revisions 373579 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix an issue where a caller to ast_write on a MulticastRTP channel would determine...
Joshua Colp [Tue, 25 Sep 2012 12:07:14 +0000 (12:07 +0000)] 
Fix an issue where a caller to ast_write on a MulticastRTP channel would determine it failed when in reality it did not.

When sending RTP packets via multicast the amount of data sent is stored in a variable and returned
from the write function. This is incorrect as any non-zero value returned is considered a failure while
a return value of 0 is success. For callers (such as ast_streamfile) that checked the return value
they would have considered it a failure when in reality nothing went wrong and it was actually a success.

The write function for the multicast RTP engine now returns -1 on failure and 0 on success, as it should.

(closes issue ASTERISK-17254)
Reported by: wybecom
........

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

Merged revisions 373551 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoRevert change to res_rtp_asterisk committed in r373236 (1.8)
Matthew Jordan [Mon, 24 Sep 2012 22:17:58 +0000 (22:17 +0000)] 
Revert change to res_rtp_asterisk committed in r373236 (1.8)

The change committed in r373236 attempted to account for endpoints that
increased their RTP timestamp in DTMF end of event re-transmissions.  This
change attempted to make Asterisk continue to work with endpoints that
failed to follow the RFC while maintaining the fix that allowed for out of
order DTMF to be handled.  Unfortunately, there is no free lunch, and this
patch broke any system that sent DTMF immediately after an RTP session was
established or when an SSRC is updated.  As such, that patch is being
reverted for the previous behavior.

Endpoints that erroneously increase the RTP timestamp in DTMF end of event
packets will not work properly with Asterisk.

(issue ASTERISK-20424)
........

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

Merged revisions 373505 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoBe consistent, send From: "Anonymous" <sip:anonymous@anonymous.invalid>
Richard Mudgett [Mon, 24 Sep 2012 22:12:39 +0000 (22:12 +0000)] 
Be consistent, send From: "Anonymous" <sip:anonymous@anonymous.invalid>

When setting CALLERID(pres)=unavailable in the dialplan, the From header
in the SIP message contains "Anonymous" <sip:Anonymous@anonymous.invalid>.
For consistency, Asterisk should use a lowercase a in the userpart of the
URI.

* Make the From header use a lowercase A in the userpart of the anonymous
URI.

(closes issue ASTERISK-19838)
Reported by: Antti Yrjola
Patches:
      chan_sip_patch_ASTERISK-19838.patch (license #6383) patch uploaded by Antti Yrjola
........

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

Merged revisions 373501 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agofunc_audiohookinherit: Document some missed sources.
Jonathan Rose [Mon, 24 Sep 2012 21:12:28 +0000 (21:12 +0000)] 
func_audiohookinherit: Document some missed sources.

This patch also mentions that AUDIOHOOK_INHERIT can be used to
transfer MixMonitor audiohooks. There is also wiki that addresses
audiohooks and the use of AUDIOHOOK_INHERIT at the following link:
https://wiki.asterisk.org/wiki/display/AST/Audiohooks

(closes issue ASTERISK-18220)
Reported by: Ishfaq Malik
........

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

Merged revisions 373468 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix potential reentrancy problems in chan_sip.
Richard Mudgett [Mon, 24 Sep 2012 21:08:16 +0000 (21:08 +0000)] 
Fix potential reentrancy problems in chan_sip.

Asterisk v1.8 and later was not as vulnerable to this issue.

* Made find_call() lock each private as it processes the found dialogs.
(Primary cause of ABE-2876)

* Made the other functions that traverse the dialogs container lock each
private as it examines them.

* Fix race condition in sip_call() if the thread that sent the INVITE is
held up long enough for a response to be processed.  The p->initid for the
INVITE retransmission could be added after it was canceled by the response
processing.

* Made __sip_destroy() clean up resource pointers after freeing.  This is
primarily defensive in case someone has a stale private pointer.

* Removed redundant memset() in reqprep().  The call to init_req() already
does the memset() and is the first reference to req in reqprep().

* Removed useless set of req.method in transmit_invite().  The calls to
initreqprep() and reqprep() have to do this because they memset() the req.

JIRA ABE-2876

..........

Merged -r373423 from https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
........

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

Merged revisions 373466 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix a deadlock caused by a race condition between removing a hint and reloading the...
Joshua Colp [Mon, 24 Sep 2012 19:21:57 +0000 (19:21 +0000)] 
Fix a deadlock caused by a race condition between removing a hint and reloading the dialplan and subscribing to the removed hint.

If conditions were right it was possible for both the PBX core and chan_sip to deadlock by both having a lock that the other
wants. In the case of the PBX core it had the contexts lock and wanted a SIP dialog lock, while in the case of chan_sip it
had the SIP dialog lock and wanted the contexts lock.

This fix unlocks the SIP dialog before getting the extension state so that the other thread will not block on trying to lock
it. Once the extension state is retrieved the SIP dialog is locked again and life carries on.

As the SIP dialog is reference counted it is not possible for it to go away after unlocking.

(closes issue ASTERISK-20437)
Reported by: jhutchins
........

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

Merged revisions 373440 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix an issue with H.264 format attribute comparison and fix an issue with improper...
Joshua Colp [Mon, 24 Sep 2012 14:25:43 +0000 (14:25 +0000)] 
Fix an issue with H.264 format attribute comparison and fix an issue with improper SDP being produced.

The H.264 format attribute module compares two format attribute structures to determine if they are
compatible or not. In some instances it was possible for this check to determine that both structures
were incompatible when they actually should be considered compatible. This check has now been made even
more permissive by assuming that if no attribute information is available the two structures are compatible.
If both structures contain attribute information a base level comparison of the H.264 IDC value is done to
see if they are compatible or not.

The above issue uncovered a secondary issue in chan_sip where the SDP being produced would be incorrect if
the formats were considered incompatible. This has now been fixed by checking that all information required
to produce the SDP is available instead of assuming it is.

(closes issue ASTERISK-20464)
Reported by: Leif Madsen

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

12 years agores_rtp_asterisk: Make TURN and STUN server configurations consistent.
Brent Eagles [Mon, 24 Sep 2012 12:33:10 +0000 (12:33 +0000)] 
res_rtp_asterisk: Make TURN and STUN server configurations consistent.

This patch removes the turnport configuration property and changes the
turnaddr property to be a combined host[:port] configuration string. The
patch also modifies the documentation in the example configuration to
reflect the property changes and adds some additional text indicating how
the STUN port is configured.

(closes issue ASTERISK-20344)
Reported by: beagles
Tested by: beagles
Review: https://reviewboard.asterisk.org/r/2111/

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

12 years agoiax2-provision: Fix improper return on failed cache retrieval
Jonathan Rose [Fri, 21 Sep 2012 19:29:12 +0000 (19:29 +0000)] 
iax2-provision: Fix improper return on failed cache retrieval

(closes issue ASTERISK-20337)
reported by: John Covert
Patches:
    iax2-provision.c.patch uploaded by John Covert (license 5512)
........

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

Merged revisions 373343 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoapp_queue: Make queue reload members and variants of that work
Jonathan Rose [Fri, 21 Sep 2012 15:31:06 +0000 (15:31 +0000)] 
app_queue: Make queue reload members and variants of that work

Prior to this patch, 'queue reload members' cli command did not
work at all. This also affects the manager function 'QueueReload'
when supplied with the 'members: yes' field.

(closes issue AST-956)
Reported by: John Bigelow
........

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

Merged revisions 373300 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoFix incorrect MeetME conference bridge reference count decrementing and sometimes...
Joshua Colp [Thu, 20 Sep 2012 19:16:02 +0000 (19:16 +0000)] 
Fix incorrect MeetME conference bridge reference count decrementing and sometimes premature destruction.

When using the 'e' or 'E' option to MeetMe the configured conference bridges are loaded and examined to see
if any are empty. If no conference bridges are empty the caller is prompted to enter the number of one.
This operation left around a pointer to the last created conference bridge still containing participants.
When the caller that was not able to find any empty conference bridge hung up this pointer was disposed of
and the reference count of the conference bridge decremented. If there was only a single participant in the
conference bridge it was ultimately destroyed prematurely.

(closes issue AST-994)
Reported by: John Bigelow
........

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

Merged revisions 373245 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoapp_queue: Support an 'agent available' hint
Matthew Jordan [Thu, 20 Sep 2012 18:59:05 +0000 (18:59 +0000)] 
app_queue: Support an 'agent available' hint

Sets INUSE when no free agents, NOT_INUSE when an agent is free.

modifes handle_statechange() scan members loop to scan for a free agent
and updates the Queue:queuename_avial devstate.

Previously exited early if the member was found in the queue.

Now Exits later when both a member was found, and a free agent was found.

alecdavis (license 585)
Reported by: Alec Davis
Tested by: alecdavis

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

~~~~

Support all ways a member can be available for 'agent available' hints

Alec's patch in r373188 added the ability to subscribe to a hint for when
Queue members are available.  This patch modifies the check that determines
when a Queue member is available by refactoring the availability checks in
num_available_members into a shared function is_member_available.  This
should now handle the ringinuse option, as well as device state values
other than AST_DEVICE_NOT_INUSE.

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

12 years agoWhen processing RFC 2833 DTMF, accomodate increasing timestamps in End events
Matthew Jordan [Thu, 20 Sep 2012 18:44:11 +0000 (18:44 +0000)] 
When processing RFC 2833 DTMF, accomodate increasing timestamps in End events

While endpoints should not be changing the source timestamp between DTMF event
packets, the fact is there exists those endpoints that do exactly that.  To
work around this, we absorb timestamps within the expected re-transmit period.
Note that this period only affects End of Event packets, so it should not
prevent the detection of new DTMF digits that happen to arrive right on top
of each other.

(closes issue ASTERISK-20424)
Reported by: Vladimir Mikhelson
Tested by: mjordan, Vladimir Mikhelson

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

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

Merged revisions 373237 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoAdd queue monitoring hints
Matthew Jordan [Thu, 20 Sep 2012 18:36:11 +0000 (18:36 +0000)] 
Add queue monitoring hints

This patch adds support for hints on a queue.  Hints can be added using
the nomenclature 'Queue:name', where name is the name of the queue being
monitored.

This nifty feature was done by Alec Davis.

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

Reported by: Alec Davis
Tested by: alecdavis
patches:
  review1619.diff2 by alecdavis (license 585)

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

12 years agoAdd support for DTLS-SRTP to res_rtp_asterisk and chan_sip.
Joshua Colp [Thu, 20 Sep 2012 18:18:47 +0000 (18:18 +0000)] 
Add support for DTLS-SRTP to res_rtp_asterisk and chan_sip.

As mentioned on the review for this, WebRTC has moved towards choosing
DTLS-SRTP as the mechanism for key exchange for SRTP. This commit adds
support for this but makes it available for normal SIP clients as well.

Testing has been done to ensure that this introduces no regressions with
existing behavior and also that it functions as expected.

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

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

12 years agoNamed call pickup groups. Fixes, missing functionality, and improvements.
Richard Mudgett [Thu, 20 Sep 2012 17:15:05 +0000 (17:15 +0000)] 
Named call pickup groups. Fixes, missing functionality, and improvements.

* ASTERISK-20383
Missing named call pickup group features:

CHANNEL(callgroup) - Need CHANNEL(namedcallgroup)
CHANNEL(pickupgroup) - Need CHANNEL(namedpickupgroup)
Pickup() - Needs to also select from named pickup groups.

* ASTERISK-20384
Using the pickupexten, the pickup channel selection could fail even though
there was a call it could have picked up.  In a call pickup race when
there are multiple calls to pickup and two extensions try to pickup a
call, it is conceivable that the loser will not pick up any call even
though it could have picked up the next oldest matching call.

Regression because of the named call pickup group feature.

* See ASTERISK-20386 for the implementation improvements.  These are the
changes in channel.c and channel.h.

* Fixed some locking issues in CHANNEL().

(closes issue ASTERISK-20383)
Reported by: rmudgett
(closes issue ASTERISK-20384)
Reported by: rmudgett
(closes issue ASTERISK-20386)
Reported by: rmudgett
Tested by: rmudgett

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

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

12 years agoCorrect handling of unknown SDP stream types
Kinsey Moore [Thu, 20 Sep 2012 13:00:09 +0000 (13:00 +0000)] 
Correct handling of unknown SDP stream types

When the patch to handle arbitrary SDP stream arrangements went into
Asterisk, it also included an ability to transparently decline unknown
stream types. The scanf calls used were not checked properly causing
this part of the functionality to be broken.

(closes issue ASTERISK-20203)

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

12 years agoBlocked revisions 373196
Matthew Jordan [Thu, 20 Sep 2012 02:40:22 +0000 (02:40 +0000)] 
Blocked revisions 373196

........
Ensure that all ConfBridge sounds can be set using CONFBRIDGE function

The CONFBRIDGE function can be used to set the sounds in a ConfBridge
bridge profile.  Unfortunately, three sounds were missed in the portion
of the code that applies the settings passed in from the function:
sound_only_one, join, and leave.  This patch makes sure that the sounds
passed from the function are applied to the bridge profile.

(closes issue ASTERISK-20404)
Reported by: univ
Tested by: mjordan

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

12 years agoDon't crash when passing a NULL message to __astman_get_header.
Sean Bright [Tue, 18 Sep 2012 20:14:01 +0000 (20:14 +0000)] 
Don't crash when passing a NULL message to __astman_get_header.

Before this commit, __astman_get_header would blindly dereference the passed in
'struct message *' to traverse the header list.  There are cases, however, such
as '*CLI> sip qualify peer foo' where the message pointer is NULL, so we need
to check for that.
........

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

Merged revisions 373132 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoAdd -fnested-functions compile flag, if needed.
David M. Lee [Tue, 18 Sep 2012 15:47:01 +0000 (15:47 +0000)] 
Add -fnested-functions compile flag, if needed.

In order to use nested functions on some versions of GCC (e.g. GCC on OS X),
the -fnested-functions flag must be passed to the compiler. This patch adds
detection logic to ./configure to add the flag if necessary. It also adds
a comment to utils.h as to why the nested function needs a prototype.

(closes issue ASTERISK-20399)
Reported by: David M. Lee
Review: https://reviewboard.asterisk.org/r/2102/

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

12 years agoMade companding law for SS7 calls only determined by SS7 signaling type.
Richard Mudgett [Sat, 15 Sep 2012 00:27:06 +0000 (00:27 +0000)] 
Made companding law for SS7 calls only determined by SS7 signaling type.

For SS7, the companding law for a call was chosen inconsistently depending
upon ss7type (ITU vs ANSI) and the DAHDI companding default (T1 vs E1).
For incoming calls, the companding law was determined by ss7type.  For
outgoing calls, the companding law was determined by the DAHDI default.
With the wrong combination you would get A-law/u-law conflicts.  An
A-law/u-law conflict sounds like bad static on the line.

SS7 ITU  signaling with E1 line: ok
SS7 ITU  signaling with T1 line: noise
SS7 ANSI signaling with E1 line: noise
SS7 ANSI signaling with T1 line: ok

* Fix the companding law used to be determined by the SS7 signaling type
only.
........

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

Merged revisions 373101 from http://svn.asterisk.org/svn/asterisk/branches/10

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

12 years agoResolve memory leaks in TLS initialization and TLS client connections
Matthew Jordan [Fri, 14 Sep 2012 19:50:40 +0000 (19:50 +0000)] 
Resolve memory leaks in TLS initialization and TLS client connections

This patch resolves two sources of memory leaks when using TLS in Asterisk:
1) It removes improper initialization (and multiple re-initializations) of
   portions of the SSL library.  Asterisk calls SSL_library_init and
   SSL_load_error_strings during SSL initialization; collectively this
   obviates the need for calling any of the following during initialization
   or client connection handling:
   * ERR_load_crypto_strings (handled by SSL_load_error_strings)
   * OpenSSL_add_all_algorithms (synonym for SSL_library_init)
   * SSLeay_add_ssl_algorithms (synonym for SSL_library_init)
2) Failure to completely clean up all memory allocated by Asterisk and by
   the SSL library for TLS clients.  This included not freeing the SSL_CTX
   object in the SIP channel driver, as well as not clearing the error
   stack when the TLS client exited.

Note that these memory leaks were found by Thomas Arimont, and this patch
was essentially written by him with some minor tweaks.

(closes issue AST-889)
Reported by: Thomas Arimont
Tested by: Thomas Arimont
patches:
  (bugAST-889.patch) by Thomas Arimont (license 5525)

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

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

Merged revisions 373062 from http://svn.asterisk.org/svn/asterisk/branches/10

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