Commit Graph

28804 Commits

Author SHA1 Message Date
Tzafrir Cohen 6a99f007d6 autoconf: more variants for OSARCH linux-gnu
There are quite a few odd GNU/Linux platforms. Just call all of them
linux-gnu.

Specifically this fixes building the Debian platforms mips64el and x32.
And maybe also others.

ASTERISK-26546 #close

Change-Id: I06ec4bd7f0ee1c84b6b24d81538223b07c4174b1
2016-11-02 12:05:18 +02:00
zuul bff5c27426 Merge "bundled pjproject: Fix DNS write to freed memory." 2016-11-02 01:21:45 -05:00
zuul de2c964e86 Merge "pjproject_bundled: Fix compile of pjsua so it handles audio" 2016-11-01 21:15:08 -05:00
Joshua Colp f0236b2d87 Merge "codecs.conf.sample: Add sample and option descriptions for codec_opus" 2016-11-01 18:58:28 -05:00
Joshua Colp d94e2250c2 Merge "res_pjsip_outbound_publish: Fix crash when publishing device state." 2016-11-01 18:32:54 -05:00
Joshua Colp a2dde4a543 Merge "res/stasis: Add CLI commands for displaying/debugging ARI apps" 2016-11-01 16:05:03 -05:00
Richard Mudgett f29b8d62bb bundled pjproject: Fix DNS write to freed memory.
PJPROJECT 2.5.5 introduced a race condition with the -r5349 IPv6 DNS
patch.

The patch below fixes a write to freed memory under cartain DNS lookup
conditions.

0006-r5477-svn-backport-Fix-DNS-write-on-freed-memory.patch

ASTERISK-26516
Reported by:  Richard Mudgett

Change-Id: Ifdfae9ecf1e41b53080f33aab44ce1a220f349c5
2016-11-01 14:36:53 -05:00
zuul 4361a24b63 Merge "chan_sip: Incorrect display option Outbound reg. retry 403" 2016-11-01 14:09:01 -05:00
Joshua Colp 6233e146c6 res_pjsip_sdp_rtp: Limit number of formats to defined maximum.
The res_pjsip_sdp_rtp module did not restrict the number of
formats added to a media stream in the SDP to the defined
limit. If allow=all was used with additional loaded codecs this
could result in the next media stream being overwritten some.

This change restricts the module to limit it to the defined
maximum and also increases the maximum in our bundled pjproject.

ASTERISK-26541 #close

Change-Id: I0dc5f59d3891246cafa2f3df5ec406f088559ee8
2016-11-01 13:21:12 -05:00
Kevin Harwell 8060cd1ec1 codecs.conf.sample: Add sample and option descriptions for codec_opus
codecs.conf.sample was missing codec opus's configuration options, descriptions,
and examples. This patch adds the configuration options and examples to
codecs.conf.sample that can be used with codec_opus.

ASTERISK-26538 #close

Change-Id: I1d89bb5e01d3e3b5bd78951b8dd0ff077a83dc8b
2016-11-01 11:02:49 -05:00
Matt Jordan c30d677333 res/stasis: Add CLI commands for displaying/debugging ARI apps
This patch adds three new CLI commands:
 - ari show apps: list the registered ARI applications
 - ari show app: show detailed information about an ARI application
 - ari set debug: dump events being sent to an ARI application

Note that while these CLI commands live in the res_stasis module, we use
the 'ari' family for these commands. This was done as most users of
Asterisk aren't aware of the semantic differences between ARI and
res_stasis, and some 'ari' CLI commands already exist.

ASTERISK-26488 #close

Change-Id: I51ad6ff0cabee0d69db06858c13f18b1c513c9f5
2016-11-01 09:43:46 -05:00
Grachev Sergey 2526dff94d chan_sip: Incorrect display option Outbound reg. retry 403
If in sip.conf (general section) set option register_retry_403=no,
the command "sip show settings" return value:
Outbound reg. retry 403:0
If in sip.conf (general section) set option register_retry_403=yes,
the command "sip show settings" return value:
Outbound reg. retry 403:-1

* In static char "sip show settings" for "Outbound.reg. retry 403"
option use AST_CLI_YESNO

ASTERISK-26476 #close

Change-Id: I3c14272f05f1067bd2aeaa8b3ef9cf8fcb12dcf9
2016-11-01 17:01:25 +03:00
Tzafrir Cohen ed08811e64 netsock.c: fix includes for HURD
ASTERISK-25070

Change-Id: I43bf94d2d36d3d8a8d0df40cd6c027d65a462814
2016-11-01 11:48:06 +02:00
Tzafrir Cohen 69fed26deb define PATH_MAX for HURD
PATH_MAX is not guaranteed to be defined. In parctice, all but the HURD
define it to a constant. It is indeed not safe to assume there won't be
longer paths and Asterisk generally does err safely on such cases.

So even for HURD we'll just pretend PATH_MAX is 4096.

ASTERISK-25070 #close

Change-Id: I53d10ba18c34c132bcb640a5fd8e0da1d9b22db3
2016-11-01 11:00:21 +02:00
George Joseph f27f837a9f pjproject_bundled: Fix compile of pjsua so it handles audio
In order for pjsua and its python binding to actually negotiate
audio for the testsuite tests, it needs g711 and resample.  The
pj* libraries themselves do not.  Unfortunately, pjproject relies
on a brand new libresample that most distros don't ship so we need
to use the libresample already bundled with pjproject.  Only the pjsua
executable and the _pjsua.so python library are linked with it so it
shouldn't interfere with asterisk itself.

Also it was pointed out that apply_patches couldn't handle multiple
patches that depended on each other during the dry-run, so the
dry-run was removed.

Change-Id: I24f397462b486dcdde0dcafe40e6c55a6593f098
2016-10-31 16:15:09 -05:00
Etienne Lessard 1648ca06c3 manager: Add documentation for NewConnectedLine event.
The NewConnectedLine event has been added by commit fe7671f, but the
documentation was missing.

ASTERISK-26537 #close

Change-Id: I7fc331f18caa28492da9303e576f70884ca8c9e6
2016-10-31 14:46:54 -04:00
zuul 3ad4719917 Merge "bundled pjproject: Crashes while resolving DNS names." 2016-10-31 12:44:45 -05:00
zuul d9cf38dc51 Merge "astobj2: Declare private variable data_size for AO2_DEBUG only." 2016-10-31 11:35:16 -05:00
Corey Farrell 273debd261 vector: Prevent NULL argument to memcpy.
Headers declare that memcpy does not accept NULL argument for the first
two parameters.  Add a conditional block to prevent memcpy and ast_free
from running on vectors with NULL element array.

ASTERISK-26526 #close

Change-Id: I988a476bb5fcfcbd3f6d6c6b3e7769e4f9629b71
2016-10-30 13:46:19 -05:00
Corey Farrell ad60927a40 astobj2: Declare private variable data_size for AO2_DEBUG only.
Every ao2 object contains storage for a private variable data_size,
though the value is never read if AO2_DEBUG is disabled.  This change
makes the variable conditional, reducing memory usage.

ASTERISK-26524 #close

Change-Id: If859929e507676ebc58b0f84247a4231e11da07f
2016-10-29 11:19:53 -04:00
Richard Mudgett 6feee22e09 bundled pjproject: Crashes while resolving DNS names.
PJPROJECT 2.5.5 introduced a race condition with the -r5349 IPv6 DNS
patch.

The patches below fix the DNS lookup race condition crash caused by
attempting to send the same message twice for the single DNS lookup.

0006-r5471-svn-backport-Various-fixes-for-DNS-IPv6.patch
0006-r5473-svn-backport-Fix-pending-query.patch

The patch below removes a cached DNS response from the hash table when
another thread is referencing the old entry.  The table still contained
the entry when it was destroyed which can result in inexplicable crashes.

0006-r5475-svn-backport-Remove-DNS-cache-entry.patch

ASTERISK-26344 #close
Reported by: Ian Gilmour

ASTERISK-26387 #close
Reported by: Harley Peters

Change-Id: I17fde80359e66f65a91341ceca58d914d0f61cc4
2016-10-28 17:15:32 -05:00
George Joseph 12bdde6a6c pjproject_bundled: Fix issue where "/version.mak" wasn't found
main/Makefile includes third-party/pjproject/build.mak but
doesn't set PJDIR beforehand so "include $(PJDIR)/version.mak"
evaluates to "/version.mak".  Fix is to set PJDIR in main/Makefile
before the include.

Change-Id: I0f7c67d60209049056fe9c4b041bf0463aa95604
2016-10-28 17:03:33 -05:00
zuul 2995b31d18 Merge "Fix shutdown crash caused by modules being left open." 2016-10-28 16:21:50 -05:00
mkrokosz 9d8b9b6ca5 res_pjsip_outbound_publish: Fix crash when publishing device state.
While publishing device state between multiple instances of Asterisk,
a crash will sporadically occur under high CPS which looks to be a
race condition operating on the publisher queue.

ASTERISK-26506

Change-Id: I28da25d346deb358eff1d563485cabc433ce1ed6
2016-10-28 14:30:02 -04:00
Corey Farrell d6ad867897 Fix shutdown crash caused by modules being left open.
It is only safe to run ast_register_cleanup callbacks when all modules
have been unloaded.  Previously these callbacks were run during graceful
shutdown, making it possible to crash during shutdown.

ASTERISK-26513 #close

Change-Id: Ibfa635bb688d1227ec54aa211d90d6bd45052e21
2016-10-28 10:24:26 -05:00
Rusty Newton badd38f031 SAC documentation: don't specify transports for endpoints and registrations
Removing explicit transport definition for endpoints and registrations. It
isn't necessary and isn't generally advised.

ASTERISK-26514 #close

Change-Id: Ifdec5e631962438a4683600968dfa4bfd15909fb
2016-10-28 09:50:32 -05:00
zuul 0ec5abe592 Merge "Remove ASTERISK_REGISTER_FILE." 2016-10-27 22:23:00 -05:00
zuul 0fc942e7cd Merge "res_pjsip_sdp_rtp: Fix address family of explicit media_address." 2016-10-27 22:22:57 -05:00
Joshua Colp 24d0907849 Merge "pjsip: Fix a few media bugs with reinvites and asymmetric payloads." 2016-10-27 19:37:47 -05:00
zuul 6f73da9c11 Merge "app_voicemail: Clear voice mailbox in MailboxExists and MAILBOX_EXISTS." 2016-10-27 16:48:07 -05:00
Tzafrir Cohen 0646b48ece chan_dahdi: remove by_name support
Support for referring to DAHDI channels by logical names was added in
(FIXME: when? Asterisk 11? 1.8?) and was intended to be part of support
of refering to channels by name.

While technically usable, it has never been properly supported in
dahdi-tools, as using it would require many changes at the Asterisk
level. Instead logical mapping was added at the kernel level.

Thus it seems that refering to DAHDI channels by name is not really used
by anyone, and therefore should probably be removed.

Change-Id: I7d50bbfd9d957586f5cd06570244ef87bd54b485
2016-10-27 23:46:00 +03:00
zuul 90d1b3262b Merge "res_pjsip_caller_id: Fix crash on session timers UPDATE on inbound calls." 2016-10-27 15:15:35 -05:00
George Joseph 4f45d62653 pjproject_bundled: Remove usage of tar's --strip-components option
Older versions of tar don't support the --strip-components option so
instead of doing 'tar --strip-components=1 -C source', we now just
untar to the tarball's root directory (pjproject-<version>) and
rename that directory to 'source'.

Also fixed an issue where the pjproject source directory is a hard
coded absolute pathname.

ASTERISK-26510 #close
ASTERISK-22480 #close

Change-Id: I9ec92952507a91ff4e4d01e0149e09fd8e8f32b0
2016-10-27 09:34:20 -05:00
Corey Farrell a6e5bae3ef Remove ASTERISK_REGISTER_FILE.
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
all traces of it.

Previously exported symbols removed:
* __ast_register_file
* __ast_unregister_file
* ast_complete_source_filename

This also removes the mtx_prof static variable that was declared when
MTX_PROFILE was enabled.  This variable was only used in lock.c so it
is now initialized in that file only.

ASTERISK-26480 #close

Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-10-27 09:53:55 -04:00
Joshua Colp 6993f3c9c3 res_pjsip_caller_id: Fix crash on session timers UPDATE on inbound calls.
The res_pjsip_caller_id module wrongly assumed that a
saved From header would always exist on sessions. This
is true until an inbound call is received and a session
timer causes an UPDATE to be sent. In this case there will
be no saved From header and a crash will occur. This change
makes it fall back to the From header of the outgoing request
if no saved From header is present.

ASTERISK-26307 #close

Change-Id: Iccc3bc8d243b5ede9b81abf960292930c908d4fa
2016-10-27 08:30:36 -05:00
zuul 211a1003e4 Merge "test_astobj2_thrash: Fix multithreaded issues" 2016-10-26 17:20:11 -05:00
zuul 761b32633c Merge "cdr_radius,cel_radius: Fix old memleak in unload" 2016-10-26 11:13:43 -05:00
Joshua Colp 95062fe220 app_voicemail: Clear voice mailbox in MailboxExists and MAILBOX_EXISTS.
When executing the MailboxExists dialplan application and
MAILBOX_EXISTS dialplan function the passed in temporary voice
mailbox was not cleared, causing it to try to free garbage.

ASTERISK-26503 #close

Change-Id: Ie21ccfa1b80b9c59318e596f6b8e17da2b5a7cb3
2016-10-26 07:54:25 -05:00
Joshua Colp aed6c219a3 pjsip: Fix a few media bugs with reinvites and asymmetric payloads.
When channel format changes occurred as a result of an RTP
re-negotiation the bridge was not informed this had happened.
As a result the bridge technology was not re-evaluated and the
channel may have been in a bridge technology that was incompatible
with its formats. The bridge is now unbridged and the technology
re-evaluated when this occurs.

The chan_pjsip module also allowed asymmetric codecs for sending
and receiving. This did not work with all devices and caused one
way audio problems. The default has been changed to NOT do this
but to match the sending codec to the receiving codec. For users
who want asymmetric codecs an option has been added, asymmetric_rtp_codec,
which will return chan_pjsip to the previous behavior.

The codecs returned by the chan_pjsip module when queried by
the bridge_native_rtp module were also not reflective of the
actual negotiated codecs. The nativeformats are now returned as
they reflect the actual negotiated codecs.

ASTERISK-26423 #close

Change-Id: I6ec88c6e3912f52c334f1a26983ccb8f267020dc
2016-10-26 12:48:57 +00:00
Joshua Colp 7925f60cd9 res_pjsip_sdp_rtp: Fix address family of explicit media_address.
When an explicit media_address is provided the address family
in the SDP needs to be set to reflect it.

ASTERISK-26309

Change-Id: Ib9350cc91c120eb2f96f0623d3907d12af67eb79
2016-10-26 06:33:18 -05:00
George Joseph 802bbf8752 test_astobj2_thrash: Fix multithreaded issues
The test uses 4 threads to grow, count, lookup and shrink 15K objects
in a container.  If there's only 1 execution engine available, the test
will complete in <50ms.  If each threads gets its own execution engine,
the test may timeout after 60 seconds because the count thread does a
locked ao2_callback on the whole container in a tight loop with only
a sched_yield to give up time.  The lock contention makes the test
execution times wildly variable and mostly timeout.  2 execution
engines are OK, 3 results in about 33% failure rate and >=4 causes
a 80% failure rate.

To fix, the sched_yield was changed to a usleep(500).

Also, the number of buckets specified for the container was an even
number so that was changed to the next prime number greater than
(MAX_HASH_ENTRIES / 100).  That's 151 currently.

Change-Id: I50cd2344161ea61bfe4b96d2a29a6ccf88385c77
2016-10-25 11:32:04 -05:00
Alexei Gradinari 2b9ad3a5f7 chan_pjsip: segfault on already disconnected session
On heavy loaded system the TCP/TLS incoming calls could be
disconnected by pjproject while these calls are being
processed by asterisk.

This patch uses functions pjsip_inv_add_ref/pjsip_inv_dec_ref
to inform pjproject that an INVITE session is in use.

ASTERISK-26482 #close

Change-Id: Ia2e3e2f75358cdb530252a9ce158af3d5d9fdf33
2016-10-25 10:21:28 -05:00
Badalyan Vyacheslav 01d1d3763f cdr_radius,cel_radius: Fix old memleak in unload
- Call "rc_openlog" optional. If you do not call,
you will simply NULL instead of a name.

- On the one PID can be only one syslog channel.
And it can already be run in logger.c

- Calling rc_openlog we assigns a new name for
the channel syslog. This unexpected behavior for logger.c.

Most lesser evil, is to agree on a NULL name syslog
if the channel was not launched in logger.c.

It also solves the problem of memory leaks.

ASTERISK-26455 #close

Change-Id: Ic17c38de67583e971d78fe18807d1a9faf8f0afd
2016-10-25 11:45:37 +00:00
Joshua Colp 7c79b057dd Merge "pjsip: Support dual stack automatically." 2016-10-25 05:29:45 -05:00
Joshua Colp 3972ab2e19 Merge "pjproject_bundled: Fixed various build issues" 2016-10-25 05:28:48 -05:00
Joshua Colp 0af69e4454 Merge "ARI: Add duplicate channel ID checking for channel creation." 2016-10-24 20:01:47 -05:00
Joshua Colp 51ae1046d0 Merge "ARI: Detect duplicate channel IDs" 2016-10-24 20:01:44 -05:00
George Joseph 16c23b57c7 pjproject_bundled: Fixed various build issues
* CFLAGS is now properly set when using older gcc.
* All third-party pjproject targets have been removed.  This fixes
  an issue with older libsrtp in some distros.
* Manually removing the source directory now causes a rebuild.
* EXTERNALS_CACHE_DIR is now properly checked.
* Whitespace fixes.

Change-Id: I98fec6847efc5602a9f41cb95096fd660a49fa60
2016-10-24 15:06:11 -05:00
Pascal Cadotte Michaud 1d277e7cb6
typo: s/paranthesis/parenthesis/ in a comment
Change-Id: I7c1f4eb051177ee22cbe97e063d4a3effe29be30
2016-10-24 15:13:43 -04:00
Joshua Colp 403c4f5833 pjsip: Support dual stack automatically.
This change adds support for dual stack automatically. No
configuration is required and the IP address and version
in the SIP messages and SDP will be automatically changed
based on the transport over which the message is being
sent. RTP usage has also been changed to listen on both
IPv4 and IPv6 simultaneously to allow media to flow, and
to allow ICE support on both simultaneously. This also
allows failover between IPv6 and IPv4 to work as expected.

ASTERISK-26309 #close

Change-Id: I235a421d8f9a326606d861b449fa6fe3a030572d
2016-10-23 13:53:55 +00:00