Commit Graph

26481 Commits

Author SHA1 Message Date
Matthew Jordan ea0098724e clang compiler warnings: Fix autological comparisons
This fixes autological comparison warnings in the following:
 * chan_skinny: letohl may return a signed or unsigned value, depending on the
   macro chosen
 * func_curl: Provide a specific cast to CURLoption to prevent mismatch
 * cel: Fix enum comparisons where the enum can never be negative
 * enum: Fix comparison of return result of dn_expand, which returns a signed
   int value
 * event: Fix enum comparisons where the enum can never be negative
 * indications: tone_data.freq1 and freq2 are unsigned, and hence can never be
   negative
 * presencestate: Use the actual enum value for INVALID state
 * security_events: Fix enum comparisons where the enum can never be negative
 * udptl: Don't bother to check if the return value from encode_length is less
   than 0, as it returns an unsigned int
 * translate: Since the parameters are unsigned int, don't bother checking
   to see if they are negative. The cast to unsigned int would already blow
   past the matrix bounds.
 * res_pjsip_exten_state: Use a temporary value to cache the return of
   ast_hint_presence_state
 * res_stasis_playback: Fix enum comparisons where the enum can never be
   negative
 * res_stasis_recording: Add an enum value for the case where the recording
   operation is in error; fix enum comparisons
 * resource_bridges: Use enum value as opposed to -1
 * resource_channels: Use enum value as opposed to -1

Review: https://reviewboard.asterisk.org/r/4533
ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4533.patch submitted by dkdegroot (License 6600)
........

Merged revisions 434469 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 434470 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-09 12:57:21 +00:00
Matthew Jordan 2201e27340 apps/app_queue: Prevent possible crash when evaluating queue penalty rules
Although it only occurred once, a crash occurred when a queue attempted to
evaluate a queue penalty rule that appeared to have already been destroyed.
In many locations in app_queue, a test is done to see if qe->pr is NULL;
however, when we dispose of a queue's penalty rules, we don't set the pointer
to NULL after free'ing it. This patch does that to prevent any dangling
pointers from lingering on the queue object.

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

ASTERISK-23319 #close
Reported by: Vadim
patches:
  rb4552.patch submitted by Stefan Engström (License 6691)
........

Merged revisions 434448 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 434449 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-09 02:05:26 +00:00
Jonathan Rose a759714101 res_pjsip_t38: Fix FAX failures when using PJSIP with authentication
Without this patch, if a PJSIP endpoint with udptl enabled and authentication
set attempted to use sendFax, the FAX session would fail during setup. This
was because the invite issued in response to being auth challenged would cause
the PJSIP channel performing the FAX to receive a second T38 framehook and
this would cause frames to be consumed in an inappropriate manner.

ASTERISK-24933 #close
Reported by: Jonathan Rose
Review: https://reviewboard.asterisk.org/r/4577/
........

Merged revisions 434425 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434431 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-08 18:32:31 +00:00
Richard Mudgett 09df34d880 Bridging: Eliminate the unnecessary make channel compatible with bridge operation.
When a channel enters the bridging system it is first made compatible with
the bridge and then the bridge technology makes the channel compatible
with the technology.  For all but the DAHDI native and softmix bridge
technologies the make channel compatible with the bridge step is an
effective noop because the other technologies allow all audio formats.
For the DAHDI native bridge technology it doesn't matter because it is not
an initial bridge technology and chan_dahdi allows only one native format
per channel.  For the softmix bridge technology, it is a noop at best and
harmful at worst because the wrong translation path could be setup if the
channel's native formats allow more than one audio format.

This is an intermediate patch for a series of patches aimed at improving
translation path choices.

* Removed code dealing with the unnecessary step of making the channel
compatible with the bridge.

ASTERISK-24841
Reported by: Matt Jordan

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

Merged revisions 434424 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434430 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-08 18:20:26 +00:00
Jonathan Rose 8ec9a82b9a Security/tcptls: MitM Attack potential from certificate with NULL byte in CN.
When registering to a SIP server with TLS, Asterisk will accept CA signed
certificates with a common name that was signed for a domain other than the
one requested if it contains a null character in the common name portion of
the cert. This patch fixes that by checking that the common name length
matches the the length of the content we actually read from the common name
segment. Some certificate authorities automatically sign CA requests when
the requesting CN isn't already taken, so an attacker could potentially
register a CN with something like www.google.com\x00www.secretlyevil.net
and have their certificate signed and Asterisk would accept that certificate
as though it had been for www.google.com - this is a security fix and is
noted in AST-2015-003.

ASTERISK-24847 #close
Reported by: Maciej Szmigiero
Patches:
 asterisk-null-in-cn.patch submitted by mhej (license 6085)
........

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

Merged revisions 434338 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 434384 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-08 16:49:18 +00:00
Richard Mudgett 2bd9e008a7 format_cache.c: Add missing slin12 format to ast_format_cache_is_slinear().
........

Merged revisions 434357 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-08 16:31:45 +00:00
Matthew Jordan 3f54af689f chan_iax2: Fix compilation issue due to funky merge
Don't mix declarations and code!


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-08 12:02:37 +00:00
Matthew Jordan a9b6a62461 chan_iax2: Fix crash caused by unprotected access to iaxs[peer->callno]
This patch fixes an access to the peer callnumber that is unprotected by a
corresponding mutex. The peer->callno value can be changed by multiple threads,
and all data inside the iaxs array must be procted by a corresponding lock
of iaxsl.

The patch moves the unprotected access to a location where the mutex is
safely obtained.

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

ASTERISK-21211 #close
Reported by: Jaco Kroon
patches:
  asterisk-11.2.1-iax2_poke-segfault.diff submitted by Jaco Kroon (License 5671)
........

Merged revisions 434291 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 434292 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-08 12:00:35 +00:00
Matthew Jordan 477536ef25 chan_sip: Handle IPv4 mapped IPv6 clients when NAT is enabled
When udpbindaddr is set to the IPv6 bind all address of '::', Asterisk will
attempt to handle both IPv4 and IPv6 addresses, although the information will
be stored in a struct with an AF_INET6 address type. However, the current
NAT handling code won't handle the IPv4 mapped IPv6 addresses correctly.
This patch adds an additional check for the mapped address case, allowing
the NAT code to handle clients even when the address is IPv6.

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

ASTERISK-18032 #close
Reported by: Christoph Timm
patches:
  nat_with_ipv6.diff submitted by Valentin Vidić (License 6697)
........

Merged revisions 434288 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 434289 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-08 11:54:09 +00:00
Matthew Jordan b8fa8aa775 clang compiler warnings: Fix pointer-bool-converesion warnings
This patch fixes several warnings pointed out by the clang compiler.
* chan_pjsip: Removed check for data->text, as it will always be non-NULL.
* app_minivm: Fixed evaluation of etemplate->locale, which will always
  evaluate to 'true'. This patch changes the evaluation to use
  ast_strlen_zero.
* app_queue:
  - Fixed evaluation of qe->parent->monfmt, which always evaluates to
    true. Instead, we just check to see if the dereferenced pointer
    evaluates to true.
  - Fixed evaluation of mem->state_interface, wrapping it with a call to
    ast_strlen_zero.
* res_smdi: Wrapped search_msg->mesg_desk_term with calls to ast_strlen_zero.

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4541.patch submitted by dkdegroot (License 6600)
........

Merged revisions 434285 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 434286 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-08 11:45:05 +00:00
Matthew Jordan 016fba12e2 cel_pgsl: Add support for GMT timestamps
This patch adds a new option to cel_pgsl, "usegmtime", which causes timestamps
to be logged in GMT.

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

ASTERISK-23186 #close
Reported by: Rodrigo Ramirez Norambuena
patches:
  cel_pgsql.c_add_usegmtime2.patch submitted by Rodrigo Ramirez Norambuena (License 6577)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-08 11:35:53 +00:00
Scott Griepentrog d923ec80b9 pjsip: resolve compatibility problem with ast_sip_session
A change in r430179 inserted a variable near the top of a
structure caused a problem when running DPMA in a version
of Asterisk compiled across the change.  This patch moves
the new variable to the end of the structure, eliminating
the problem.

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

Merged revisions 433944 from http://svn.asterisk.org/svn/asterisk/branches/13
........

Merged revisions 434261 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-07 19:40:22 +00:00
Kevin Harwell 153c4044e4 bridge.c: Hangup attended transfer target after it has been swapped out
After completing an attended transfer the transfer target channel (the one that
gets swapped out) was not being hung up after leaving the bridge. This resulted
in a channel possibly being left around. Added an explicit softhangup for the
channel in question after the transfer is successfully completed in order to
make sure the channel is hung up.

ASTERISK-24782 #close
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/4575/
........

Merged revisions 434240 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-07 16:42:18 +00:00
Mark Michelson 1eba6abae5 Do not queue message requests that we do not respond to.
If we receive a MESSAGE request that we cannot send a response
to, we should not send the incoming MESSAGE to the dialplan.

This commit should help the bouncing message_retrans test to
pass consistently.
........

Merged revisions 434218 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434219 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-07 15:34:53 +00:00
Matthew Jordan c2f50ba6f4 ARI: Add the ability to intercept hold and raise an event
For some applications - such as SLA - a phone pressing hold should not behave
in the fashion that the Asterisk core would like it to. Instead, the hold
action has some application specific behaviour associated with it - such as
disconnecting the channel that initiated the hold; only playing MoH to channels
in the bridge if the channels are of a particular type, etc.

One way of accomplishing this is to use a framehook to intercept the
hold/unhold frames, raise an event, and eat the frame. Tasty. This patch
accomplishes that using a new dialplan function, HOLD_INTERCEPT.

In addition, some general cleanup of raising hold/unhold Stasis messages was
done, including removing some RAII_VAR usage.

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

ASTERISK-24922 #close
........

Merged revisions 434216 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434217 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-07 15:22:42 +00:00
Matthew Jordan af4d802773 clang compiler warnings: Fix sometimes-initialized warning in func_math
This patch fixes a bug in a unit test in func_math where a variable could be
passed to ast_free that wasn't allocated. This patch corrects the issue and
ensures that we only attempt to free a variable if we previously allocated
it.

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4552.patch submitted by dkdegroot (License 6600)
........

Merged revisions 434190 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 434191 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434192 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-07 02:10:31 +00:00
Matthew Jordan c1cfe3fae2 clang compiler warnings: Fix non-literal-null-conversion warnings
Clang will flag errors when a char pointer is set to '\0', as opposed to a
value that the char pointer points to. This patch fixes this warning
in a variety of locations.

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4551.patch submitted by dkdegroot (License 6600)
........

Merged revisions 434187 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 434188 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434189 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-07 02:03:48 +00:00
Mark Michelson 79fb8c32a6 Uncomment test case.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434170 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-06 21:54:53 +00:00
Mark Michelson fc314cb43f Add missing DNS NAPTR test file.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-06 21:13:36 +00:00
Kevin Harwell 87d7c90e4e res_pjsip: config option 'timers' can't be set to 'no'
When setting the configuration option 'timers' equal to 'no' the bit flag was
not properly negated. This patch clears all associated flags and only sets the
specified one. pjsip will handle any necessary flag combinations. Also went
ahead and did similar for the '100rel' option.

ASTERISK-24910 #close
Reported by: Ray Crumrine
Review: https://reviewboard.asterisk.org/r/4582/
........

Merged revisions 434131 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-06 19:23:57 +00:00
George Joseph e48f2e7897 build: Fixes for gcc 5 compilation
These are fixes for compilation under gcc 5.0...

chan_sip.c:    In parse_request needed to make 'lim' unsigned.
inline_api.h:  Needed to add a check for '__GNUC_STDC_INLINE__' to detect C99 
               inline semantics (same as clang).
ccss.c:        In ast_cc_set_parm, needed to fix weird comparison.
dsp.c:         Needed to work around a possible compiler bug.  It was throwing 
               an array-bounds error but neither
               sgriepentrog, rmudgett nor I could figure out why.
manager.c:     In action_atxfer, needed to correct an array allocation.

This patch will go to 11, 13, trunk.

Review: https://reviewboard.asterisk.org/r/4581/
Reported-by: Jeffrey Ollie
Tested-by: George Joseph
ASTERISK-24932 #close
........

Merged revisions 434113 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 434114 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-06 19:04:32 +00:00
Matthew Jordan 0543879228 clang compiler warnings: Remove large chunks of unused code from extconf
This patch fixes a warning caught by clang, in which it detected that large
chunks of extconf were unused. Frankly, I wish we could pretend that all of
extconf was unused, but alas, that is not yet the case.

A few extraneous functions in the parking tests were removed as well, for
the same reason.

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4553.patch submitted by dkdegroot (License 6600)
........

Merged revisions 434093 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 434097 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-06 18:18:32 +00:00
Matthew Jordan e309a91e2d clang compiler warnings: Fix sometimes-uninitialized warning in pbx_config
This patch fixes a warning caught by clang, in which a char pointer could be
assigned to before it was initialized. The patch re-organizes the code to
ensure that the pointer is always initialized, even on off nominal paths.

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4529.patch submitted by dkdegroot (License 6600)
........

Merged revisions 434090 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 434091 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-06 18:03:54 +00:00
Matthew Jordan ed3cf8761b clang compiler warnings: Fix format specified in framehook
This patch fixes an invalid format specifier used in the formatting of an
ERROR message in the framehook code. The format specifier specifies a
type of 'unsigned short', but the argument passed to it is of type 'int'.
The patch changes the format specifier to 'i'.

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4535.patch submitted by dkdegroot (License 6600)
........

Merged revisions 434087 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 434088 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-06 17:52:31 +00:00
Mark Michelson 0a26602b8c Merge NAPTR support into trunk.
This adds NAPTR record allocation and sorting, as well as
unit tests that verify that NAPTR records are parsed and
sorted correctly.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434068 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-06 17:05:47 +00:00
Mark Michelson edf9da4365 Ensure that a non-zero sample rate is returned for all formats.
Versions of Asterisk prior to 12 defaulted to 8000 as a sample rate
if one was not provided by a format. In Asterisk 13, this was removed.
The result was that some calculations which involve dividing by the
sample rate resulted in dividing by 0. The fix being put in place
here is to have the same default fallback that was present in previous
versions of Asterisk.

Asterisk-24914 #close
Reported by Marcello Ceschia
........

Merged revisions 434046 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434047 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-06 16:02:28 +00:00
Corey Farrell ffd7319df3 res_pjsip_phoneprov_provider: Revert 433996 / 433997.
res_pjsip_phoneprov_provider is using ao2_callback with OBJ_MULTIPLE, then
ignoring the return.  OBJ_NODATA flag was to prevent a reference leak, but
this caused the module to FRACK on unload.  Revert change until this can
be investigated further.

ASTERISK-24935
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4578/
........

Merged revisions 434025 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434026 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-06 15:17:18 +00:00
Mark Michelson 53af579d4c ParkedCall: Don't allow dialplan fallthrough after retrieving parked call.
This is a change to align behavior with that of Asterisk 11 and previous versions.
In those versions, if a parked call were retrieved, and the call ended, the parked
call retriever would be hung up after the ParkedCall application ran. Prior to this
patch, in Asterisk 13, the same situation would result in the parked call retriever
falling through to additional priorities in the extension where the ParkedCall
application was called. With this patch, the behavior between Asterisk 11 and 13
aligns.

ASTERISK-24899 #close
Reported by Malcolm Davenport
Patches:
	ASTERISK-24899.patch uploaded by Mark Michelson(license #5049)
........

Merged revisions 434022 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434023 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-06 14:51:21 +00:00
Corey Farrell e6f0410028 res_pjsip_phoneprov_provider: Fix leaked OBJ_MULTIPLE iterator.
res_pjsip_phoneprov_provider was using ao2_callback with OBJ_MULTIPLE, then
ignoring the return.  Added OBJ_NODATA flag to prevent a reference leak.

ASTERISK-24935 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4578/
........

Merged revisions 433996 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-05 12:55:21 +00:00
Mark Michelson 3439487a81 res_pjsip_messaging: Serialize outbound SIP MESSAGEs
Outbound SIP MESSAGEs had the potential to be sent out
of order from how they were specified in a set of
dialplan steps.

This change creates a serializer for sending outbound
MESSAGE requests on. This ensures that the MESSAGEs are
sent by Asterisk in the same order that they were sent
from the dialplan.

ASTERISK-24937 #close
Reported by Mark Michelson

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

Merged revisions 433968 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433969 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-03 21:54:36 +00:00
Scott Griepentrog 6e5efe04bd pjsip: resolve compatibility problem with ast_sip_session
A change in r430179 inserted a variable near the top of a
structure caused a problem when running DPMA in a version
of Asterisk compiled across the change.  This patch moves
the new variable to the end of the structure, eliminating
the problem.

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

Merged revisions 433944 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-02 14:56:39 +00:00
Corey Farrell 154ba47766 Tell menuselect that MALLOC_DEBUG conflicts with DEBUG_CHAOS.
DEBUG_CHAOS was marked as conflicting with MALLOC_DEBUG, but
for this to work correctly MALLOC_DEBUG must also be marked
as conflicting with DEBUG_CHAOS.

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

Merged revisions 433923 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-02 10:38:03 +00:00
Ashley Sanders a217d2d1db stasis: set a channel variable on websocket disconnect error
Resolve compile errors caused by r433863 by fixing the
documentation xml to comply with the schema.
........

Merged revisions 433888 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433891 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-01 16:30:25 +00:00
Joshua Colp 39824e3d01 dns: Add support for SRV record parsing and sorting.
This change adds support for parsing SRV records and consuming their values
in an easy fashion. It also adds automatic sorting of SRV records according
to RFC 2782.

Tests have also been included which cover parsing, sorting, and off-nominal
cases where the record is corrupted.

ASTERISK-24931 #close
Reported by: Joshua Colp

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433889 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-01 16:27:48 +00:00
Mark Michelson da13d15425 stasis: set a channel variable on websocket disconnect error
Resolve compile errors caused by r433839 by included the missing
header file, pbx.h.
........

Merged revisions 433863 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-04-01 13:35:10 +00:00
Ashley Sanders 06578ef407 stasis: set a channel variable on websocket disconnect error
When an error occurs while writing to a web socket, the web socket is
disconnected and the event is logged. A side-effect of this, however, is that
any application on the other side waiting for a response from Stasis is left
hanging indefinitely (as there is no mechanism presently available for
notifying interested parties about web socket error states in Stasis).

To remedy this scenario, this patch introduces a new channel variable:
STASISSTATUS.

The possible values for STASISSTATUS are:
SUCCESS         - The channel has exited Stasis without any failures
FAILED          - Something caused Stasis to croak. Some (not all) possible
                  reasons for this:
                    - The app registry is not instantiated;
                    - The app requested is not registered;
                    - The app requested is not active;
                    - Stasis couldn't send a start message

ASTERISK-24802
Reported By: Kevin Harwell
Review: https://reviewboard.asterisk.org/r/4519/
........

Merged revisions 433839 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-31 22:49:45 +00:00
Richard Mudgett 2d28fa678e chan_sip: Fix expression in unit test /channels/chan_sip/test_sip_rtpqos.
Fix misplaced parentheses in original fabs() expression.
........

Merged revisions 433816 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 433817 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-31 17:04:18 +00:00
Corey Farrell 076fc12afb Blocked revisions 433795
........
Re-add _ast_mem_backtrace_buffer variable for ABI compatibility.

Modules built prior to commit of r4502 expect to link at runtime
to the variable _ast_mem_backtrace_buffer.  This change re-adds
the variable to the C file only.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-31 11:55:29 +00:00
Corey Farrell 8d12288d8a Fix an ABI compatibility issue with ast_log_safe for modules.
Binary modules are sometimes built against the latest release of
Asterisk in each branch, and need to be compatible with all
releases of that branch.  This change ensures that utils.h only
uses ast_log_safe from the core.  For modules and utilities ast_log
is used instead.

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

Merged revisions 433772 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 433773 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-30 11:43:19 +00:00
Matthew Jordan 7bc2345fb1 clang compiler warnings: Fix -Wabsolute-value warnings
This patch fixes several warnings caught by clang - in this case, usage of the
abs function on non-integer values. This patch uses labs and fabs, as
appropriate, in the various affected files.

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4525.patch submitted by dkdegroot (License 6600)
........

Merged revisions 433749 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 433750 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-30 02:45:29 +00:00
Matthew Jordan ce59fabd5c clang compiler warnings: Fix invalid enum conversion
This patch fixes some invalid enum conversion warnings caught by clang. In
particular:
* chan_sip: Several functions mixed usage of the st_refresher_param
  enum and st_refresher enum. This patch corrects the functions to use the
  right enum.
* chan_pjsip: Fixed mixed usage of ast_sip_session_t38state and ast_t38_state.
* strings: Fixed incorrect usage of AO2 flags with strings container.
* res_stasis: Change a return enumeration to stasis_app_user_event_res.

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4535.patch submitted by dkdegroot (License 6600)
........

Merged revisions 433746 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 433747 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-30 02:39:57 +00:00
Matthew Jordan 61577cbee6 main/stdtime/localtime: Fix warning introduced in r433720
The patch in r433720 caused a warning to be kicked back by gcc. It occurred
due to this check in unistd.h:

    if (__nbytes > __bos0 (__buf))
        return __read_chk_warn (__fd, __buf, __nbytes, __bos0 (__buf));

That is, if __nbytes is greater than the result of GCC's built-in object size
for the struct, we'll kick back a warning.

As it turns out, this is because there is an error in the code in the patch.
We are passing the address of the pointer to the struct, not iev, which is a
pointer to the struct. Hence, the number of bytes is probably going to be lot
larger than the number of bytes that make up a pointer! This patch changes
the code just read from the pointer to the struct - which fixes the warning.

ASTERISK-24917
........

Merged revisions 433743 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 433744 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433745 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-30 02:29:39 +00:00
Matthew Jordan 072734692e clang compiler warnings: Ignore -Wunused-command-line-argument
Asterisk's build system has a tendency to pass include directives for libraries
to everything compiled within a particular group of source files. This means
we pass the header for libxml2 to things that don't necessarily need it. As a
result, we ignore this particular warning.

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4545.patch submitted by dkdegroot (License 6600)
........

Merged revisions 433720 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 433721 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-30 01:57:07 +00:00
Matthew Jordan 1cf949c489 clang compiler warnings: Fix warning for -Wgnu-variable-sized-type-not-at-end
This patch fixes a warning caught by clang, wherein a variable sized struct is
not located at the end of a struct. While the code in question actually
expected this, this is a good warning to watch for. Hence, this patch refactors
the code in question to not have two variable length elements in the same
struct.

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4530.patch submitted by dkdegroot (License 6600)
........

Merged revisions 433717 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 433718 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-30 01:53:15 +00:00
Matthew Jordan d2776d4d45 clang compiler warnings: Fix a variety of "unused" warnings
This patch fixes the -Wunused-value -Wunused-variable -Wunused-const-variable
errors caught by clang. Specifically:

* apps/app_queue.c: removed unused qpm_cmd_usage[], qum_cmd_usage[],
                    qsmp_cmd_usage[]
* cel/cel_sqlite3_custom.c: removed unused name[] = "cel_sqlite3_custom"
* channels/chan_pjsip.c: removed unused desc[] = "PJSIP Channel"
* codecs/gsm/src/gsm_create.c: removed unused ident[] = "$Header$"
* funcs/func_env.c:729: Fixed ast_str_append_substr.
* main/editline/np/strlcat.c: removed unused rcsid variable
* main/editline/np/strlcpy.c: removed unused rcsid variable
* main/security_events.c: removed unused TIMESTAMP_STR_LEN
* utils/conf2ael.c: removed unused cfextension_states
* utils/extconf.c: removed unused cfextension_states

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4526.patch submitted by dkdegroot (License 6600)
........

Merged revisions 433693 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 433694 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433695 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-28 12:56:43 +00:00
Matthew Jordan cb7b6bc4be clang compiler warnings: Fix -Wself-assign
Assigning a variable to itself isn't super useful. However, the WAV format
modules make use of this in order to perform byte endian checks. This patch
works around the warning by only performing the self assignment if we are
going to do more than just assign it to ourselves. Which is odd, but true.

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4544.patch submitted by dkdegroot (License 6600)
........

Merged revisions 433690 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 433691 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433692 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-28 12:48:45 +00:00
Matthew Jordan e9520dbe0d clang compiler warnings: Fix -Wparantheses-equality warnings
Clang will treat ((a == b)) as a warning, as it reasonably expects that the
developer may have intended to write (a == b) or ((a = b)). This patch cleans
up all instances where equality, not assignment, was intended between two
parantheses.

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

ASTERISK-24917
Repoted by: dkdegroot
patches:
  rb4531.patch submitted by dkdegroot (License 6600)
........

Merged revisions 433687 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 433688 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-28 12:41:24 +00:00
Matthew Jordan fd50e5bfb5 clang compiler warnings: Fix -Wbitfield-constant-conversion warning
In chan_iax2, we attempt to assign a -1 to a bitfield. This gets caught by
clang, as it will truncate the -1 to a 1 implicitly.

Instead, we just assign the value a '1'.

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4537.patch submitted by dkdegroot (License 6600)
........

Merged revisions 433683 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 433684 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433686 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-28 12:33:21 +00:00
Matthew Jordan c747b3b12a clang compiler warnings: Fix -Winitializer-overrides
This patch fixes clange compiler warnings for initializer overrides.
Specifically:

res_pjsip/config_transport maps PJSIP_TLSV1_METHOD to the same enumeration
value as PJSIP_SSL_DEFAULT_METHOD. When initializing an array containing
those enum values, we therefore initialize the value twice to two different
values, "tlsv1" and "default". This patch changes it to just initialize
the index in the array to "tlsv1".

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4539.patch submitted by dkdegroot (License 6600)
........

Merged revisions 433682 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-28 12:32:42 +00:00
Matthew Jordan d6173cd1d0 clang compiler warnings: Fix -Wunused-function; make inline function static
This patch fixes clang compilers warnings for unused functions. Specifically:
 * channels/chan_iax2: removed user_ref function
 * main/dsp.c: removed goertzel_update function
 * main/config.c: made variable_list_switch static

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

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4527.patch submitted by dkdegroot (License 6600)
........

Merged revisions 433678 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 433680 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433681 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-28 12:20:26 +00:00