Commit Graph

28841 Commits

Author SHA1 Message Date
Joshua Colp b331cb84d5 Merge "res_pjsip_endpoint_identifier_ip: Ensure error defaults to 0." into 14 2017-01-26 07:48:25 -06:00
George Joseph 0cdd2f120e Merge "astobj2.c: Add excessive ref count trap." into 14 2017-01-26 07:28:11 -06:00
zuul 4a6f5fa595 Merge "main/app.c: Memory corruption from early format destruction." into 14 2017-01-25 15:01:37 -06:00
George Joseph 37a4260ffe Merge "chan_oss.c: Fix format ref leak in oss_read()." into 14 2017-01-25 13:50:34 -06:00
zuul 3837e994d9 Merge "stasis_bridge.c: Fix off-nominal stasis control ref leak." into 14 2017-01-25 13:39:21 -06:00
George Joseph 330d468e55 Merge "pjproject_bundled: Fix setting max log level" into 14 2017-01-24 22:29:45 -06:00
George Joseph e6957f561c Merge "res_pjsip_pubsub.c: Implement "pjsip show subscriptions" commands." into 14 2017-01-24 15:47:25 -06:00
Joshua Colp 60e54d69b9 res_pjsip_endpoint_identifier_ip: Ensure error defaults to 0.
When configuring a match using a netmask the error variable was
not defaulting to 0. For some people this would cause the code
to think an error occurred when adding the match when in reality
it added perfectly fine.

ASTERISK-26693

Change-Id: I850c250813742bddde65c84e739093c9e01dfe56
2017-01-24 15:41:27 -06:00
Richard Mudgett ebb78c5b24 astobj2.c: Add excessive ref count trap.
Change-Id: I32e6a589cf9009450e4ff7cb85c07c9d9ef7fe4a
2017-01-24 14:15:03 -06:00
Richard Mudgett 5db078273d main/app.c: Memory corruption from early format destruction.
* make_silence() created a malloced silence slin frame without adding a
slin format ref.  When the frame is destroyed it will unref the slin
format that never had a ref added.  Memory corruption is expected to
follow.

* Simplified and fixed counting the number of samples in a frame list for
make_silence().

* Eliminated an unnecessary RAII_VAR associated with the make_silence()
frame.

Change-Id: I47de3f9b92635b7f8b4d72309444d6c0aee6f747
2017-01-24 14:04:51 -06:00
Richard Mudgett 7206f5acd8 stasis_bridge.c: Fix off-nominal stasis control ref leak.
Change-Id: Ib17218343a6596832060180e19386da9df150ac8
2017-01-24 13:59:20 -06:00
Richard Mudgett 7f21d12d2d chan_oss.c: Fix format ref leak in oss_read().
Change-Id: I0a5d56c7dcf327d60f86a4c25a23571733709fd0
2017-01-24 13:39:15 -06:00
Joshua Colp 3ddf7da3a7 Merge "Free endpoint ACLs when destroying PJSIP endpoints." into 14 2017-01-24 12:45:11 -06:00
George Joseph 6f688fd0e9 Merge "res_pjsip_endpoint_identifier_ip: Read settings before resolving." into 14 2017-01-24 07:06:34 -06:00
Richard Mudgett 5d6469b209 res_pjsip_pubsub.c: Implement "pjsip show subscriptions" commands.
ASTERISK-23828 #close

Change-Id: Ifb8a3b61f447aedc58a8e6b36a810f7566018567
2017-01-23 18:06:55 -06:00
Mark Michelson 27c7d6d644 Free endpoint ACLs when destroying PJSIP endpoints.
If endpoint ACLs were specified, they were not being freed
when endpoints were destroyed. On systems with realtime endpoints, this
could add up quickly since each DB lookup would allocate the ACL without
freeing it.

ASTERISK-26731 #close
Reported by Ustinov Artem

Change-Id: Ie1f8bf5b7a0de628c975beba01e69c56893331ad
2017-01-23 16:22:45 -06:00
George Joseph 6c7dd69755 Merge "LISTFILTER: Remove outdated ERROR message." into 14 2017-01-23 15:05:39 -06:00
George Joseph 0a60bd8dd9 Merge "res_pjsip_pubsub.c: Fix incorrect message string wrapping." into 14 2017-01-23 15:00:50 -06:00
Joshua Colp 2974c83bcc Merge "res_pjsip_pubsub.c: Fix AMI event list counts." into 14 2017-01-23 11:09:37 -06:00
George Joseph da5e8b177c pjproject_bundled: Fix setting max log level
An earlier attempt to prevent pjsua from spitting out an extra 6795
lines of debug output every time the testsuite called it was also
turning off the ability for asterisk to output debug info when it
needed to.  This patch reverts the earlier fix and instead adds
a pjproject patch that sets the startup log level to 1 for pjsua
pjsystest and the pjsua python binding.  This is an asterisk-only
patch that does not affect pjproject functionality and will not be
submitted upstream.

Change-Id: I347a8b58b2626f2906ccfc1d339e907627a0c9e8
2017-01-23 10:32:19 -06:00
Joshua Colp 74577cf32d res_pjsip_endpoint_identifier_ip: Read settings before resolving.
An option has been added, srv_lookups, which controls whether
SRV lookups are performed on the provided match hosts or not.
It was possible for this option to be applied after resolution
had already happened.

This change makes it so hosts are stored away, settings are read
and applied, and then resolution is done. This ensures that no
matter the ordering the srv_lookups option is in effect.

ASTERISK-26735

Change-Id: I750378cb277be0140f8c5539450270afbfc43388
2017-01-23 10:10:18 -06:00
zuul dd92feb7fd Merge "res_pjsip_pubsub.c: Eliminate trivial SCOPED_LOCK usage." into 14 2017-01-23 10:04:49 -06:00
Joshua Colp 4b59025003 Merge "res_pjsip: alloca can never fail." into 14 2017-01-23 06:37:53 -06:00
Richard Mudgett d0c508d53e LISTFILTER: Remove outdated ERROR message.
Feeding LISTFILTER an empty variable results in an invalid ERROR message.
Earlier changes made the message useless because we can no longer tell if
the variable is empty or does not exist.  It is valid to try to remove a
value from an empty list just as it is valid to try to remove a value that
is not in a non-empty list.

* Removed the outdated ERROR message.

* Added more test cases to the LISTFILTER unit test.

Change-Id: Ided9040e6359c44a335ef54e02ef5950a1863134
2017-01-22 17:56:00 -06:00
zuul eef750d129 Merge "debug_utilities: Create ast_loggrabber" into 14 2017-01-20 14:24:34 -06:00
Richard Mudgett 93fcb615ba res_pjsip_pubsub.c: Fix AMI event list counts.
Fix the AMI PJSIPShowSubscriptionsInbound, PJSIPShowSubscriptionsOutbound,
and PJSIPShowResourceLists actions event counts.  The reported counts may
not necessarily be accurate depending on what happens.

The subscriptions count would be wrong if Asterisk ever has outbound
subscriptions.

The resource list count could be wrong if a list were added or removed
during the AMI action being processed.

Change-Id: I4344301827523fa174960a42c413fd19abe4aed5
2017-01-20 12:39:29 -06:00
Richard Mudgett 33c3d3c9dd res_pjsip_pubsub.c: Fix incorrect message string wrapping.
Change-Id: Id771e6fe56d89ce365ddcbb423f820af97211120
2017-01-20 12:37:07 -06:00
Richard Mudgett dc42c1ffff res_pjsip_pubsub.c: Eliminate trivial SCOPED_LOCK usage.
Change-Id: Ie0b69a830385452042fa19e7d267c6790ec6b6be
2017-01-20 12:33:41 -06:00
Richard Mudgett f9be81fc32 res_pjsip: alloca can never fail.
Change-Id: Ia2a6158e5fdf311bc2a1c0c43417978de504b1f1
2017-01-20 12:30:54 -06:00
Joshua Colp 997d71f1ca Merge "abstract/fixed/adpative jitter buffer: disallow frame re-inserts" into 14 2017-01-20 12:19:58 -06:00
George Joseph 84aadd4e81 debug_utilities: Create ast_loggrabber
ast_loggrabber gathers log files from customizable search patterns,
optionally converts POSIX timestamps to a readable format and
tarballs the results.

Also a few tweaks were made to ast_coredumper.

Change-Id: I8bfe1468ada24c1344ce4abab7b002a59a659495
(cherry picked from commit c709152878)
2017-01-20 11:21:05 -06:00
Richard Mudgett 4f655a7d59 res_pjsip_outbound_authenticator_digest.c: Fix spacing in warning messages.
Change-Id: I573f0343c0c63a785cd4da60d57cc9f8b9ce7f49
2017-01-20 07:21:58 -06:00
Kevin Harwell 434ae90d73 abstract/fixed/adpative jitter buffer: disallow frame re-inserts
It was possible for a frame to be re-inserted into a jitter buffer after it
had been removed from it. A case when this happened was if a frame was read
out of the jitterbuffer, passed to the translation core, and then multiple
frames were returned from said translation core. Upon multiple frames being
returned the first is passed on, but sebsequently "chained" frames are put
back into the read queue. Thus it was possible for a frame to go back into
the jitter buffer where this would cause problems.

This patch adds a flag to frames that are inserted into the channel's read
queue after translation. The abstract jitter buffer code then checks for this
flag and ignores any frames marked as such.

Change-Id: I276c44edc9dcff61e606242f71274265c7779587
2017-01-17 17:08:45 -06:00
Richard Mudgett 75c8536d74 taskprocessor.c: Change when high water warning logged.
The task processor queue reached X scheduled tasks message was originally
intended to get logged only once per task processor to prevent spamming
the log.  This is no longer necessary since high and low water thresholds
can better control when the message is logged.

It is beneficial to generate the warning each time a task processor
reaches the high water level because PJSIP stops processing new requests
while any high water alert is active.  Without this change you would have
to enable at least debug level 3 logging to know about a repeated alert
trigger.

* Made generate the warning message whenever a task is pushed into the
task processor that triggers the high water alert.

* Appended 'again' to the warning for a repeated high water alert trigger.

Change-Id: Iabf75a004f7edaf1e5e8c323099418e667cac999
2017-01-13 21:36:05 -06:00
zuul 1384f8453b Merge "res_rtp_asterisk: Fix bug in function CHANNEL(rtcp, all_rtt)" into 14 2017-01-12 19:47:34 -06:00
Aaron An 6877e626a1 res_rtp_asterisk: Fix bug in function CHANNEL(rtcp, all_rtt)
Function CHANNEL(rtcp,all_rtt) CHANNEL(rtcp,all_loss) CHANNEL(rtcp,all_jitter)
always return 0.0 due to wrong define of macro "AST_RTP_SATA_SET" and
"AST_RTP_STAT_STRCPY".
It should compare "combined" with "stat" not "current_stat".

ASTERISK-26710 #close
Reported-by: Aaron An
Tested-by: AaronAn

Change-Id: Id4140fafbf92e2db689dac5b17d9caa009028a15
2017-01-12 16:55:40 -06:00
George Joseph 676865c2fd debug_utilities: Create the ast_coredumper utility
This utility allows easy manipulation of asterisk coredumps.

* Configurable search paths and patterns for existing coredumps
* Can generate a consistent coredump from the running instance
* Can dump the lock_infos table from a coredump
* Dumps backtraces to separate files...
  - thread apply 1 bt full -> <coredump>.thread1.txt
  - thread apply all bt -> <coredump>.brief.txt
  - thread apply all bt full -> <coredump>.full.txt
  - lock_infos table -> <coredump>.locks.txt
* Can tarball corefiles and optionally delete them after processing
* Can tarball results files and optionally delete them after processing
* Converts ':' in coredump and results file names '-' to facilitate
  uploading.  Jira for instance, won't accept file names with colons
  in them.

Tested on Fedora24+, Ubuntu14+, Debian6+, CentOS6+ and FreeBSD9+[1].

[1] For *BSDs, the "devel/gdb" package might have to be installed to
get a recent gdb.  The utility will check all instances of gdb
it finds in $PATH and if one isn't found that can run python, it
prints a friendly error.

Change-Id: I935d37ab9db85ef923f32b05579897f0893d33cd
(cherry picked from commit cb47b45560)
2017-01-11 11:10:48 -07:00
zuul b08037cd8f Merge "res_pjsip_endpoint_identifier_ip: Add support for SRV lookups." into 14 2017-01-09 12:45:01 -06:00
zuul 8d4c188fda Merge "chan_sip: Remember SDP negotiation on SIP_CODEC_INBOUND." into 14 2017-01-09 08:45:49 -06:00
Joshua Colp 3e8d9a5b06 Merge "res_pjsip: Fix known compact header issues" into 14 2017-01-09 07:23:24 -06:00
George Joseph 846432013a pjproject_bundled: Fix compilation with MALLOC_DEBUG
When MALLOC_DEBUG was specified, make was failing.  Immediately
remaking would work.  The issues was in the ordering of the make
dependencies.

Change-Id: If6030b54fc693f3179f32bfd20c6b5d5f1b3f7cd
2017-01-08 10:37:34 -06:00
zuul c9825b26a9 Merge "res_rtp_asterisk.c: Fix uninitialized memory crash." into 14 2017-01-06 14:04:34 -06:00
zuul 06936fdf1d Merge "chan_rtp.c: Fix uninitialized memory crash." into 14 2017-01-06 13:51:04 -06:00
zuul 4bf7044332 Merge "res_rtp_asterisk.c: Initialize ourip passed to ast_find_ourip()." into 14 2017-01-06 13:51:01 -06:00
Joshua Colp a52598093d res_pjsip_endpoint_identifier_ip: Add support for SRV lookups.
This change implements SRV support for the IP based endpoint
identifier module. All possible addresses through SRV are looked
up and added as matches. If no SRV records are available a
fallback to normal host resolution is done. If an IP address
is provided then no SRV lookup occurs.

This is configured using the "srv_lookups" option on the
identify section and defaults to "yes".

ASTERISK-26693

Change-Id: I6b641e275bf96629320efa8b479737062aed82ac
2017-01-06 09:00:16 -06:00
Joshua Colp b1909a70a5 Merge "bridge_native_rtp.c: Minor code cleanups." into 14 2017-01-05 11:46:59 -06:00
zuul e37db9feb6 Merge "res_pjsip_session: Access SIPDOMAIN via Dialplan." into 14 2017-01-05 10:01:06 -06:00
George Joseph 17902a70cf Merge "acl.c: Improve ast_ouraddrfor() diagnostic messages." into 14 2017-01-04 22:06:56 -06:00
George Joseph 5f87e161f6 Merge "bridge_native_rtp.c: Fix native rtp bridge data race." into 14 2017-01-04 22:04:49 -06:00
George Joseph 79d75a850a Merge "res_pjsip_refer: Handle compact Refer-To header." into 14 2017-01-04 16:26:57 -06:00