Commit Graph

28643 Commits

Author SHA1 Message Date
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
zuul 4361a24b63 Merge "chan_sip: Incorrect display option Outbound reg. retry 403" 2016-11-01 14:09:01 -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
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
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
Mark Michelson 3bd76dd679 ARI: Add duplicate channel ID checking for channel creation.
This is similar to what is done for origination, but for the 14 and up
channel creation method. When attempting to create a channel, if a
channel ID is specified and a channel already exists with that ID, then
a 409 is returned.

Change-Id: I77f9253278c6947939c418073b6b31065489187c
2016-10-20 13:00:10 -05:00
Mark Michelson e459b8dadf ARI: Detect duplicate channel IDs
ARI and AMI allow for an explicit channel ID to be specified
when originating channels. Unfortunately, there is nothing in
place to prevent someone from using the same ID for multiple
channels. Further complicating things, adding ID validation to channel
allocation makes it impossible for ARI to discern why channel allocation
failed, resulting in a vague error code being returned.

The fix for this is to institute a new method for channel errors to be
discerned. The method mirrors errno, in that when an error occurs, the
caller can consult the channel errno value to determine what the error
was. This initial iteration of the feature only introduces "unknown" and
"channel ID exists" errors. However, it's possible to add more errors as
needed.

ARI uses this feature to determine why channel allocation failed and can
return a 409 error during origination to show that a channel with the
given ID already exists.

ASTERISK-26421

Change-Id: Ibba7ae68842dab6df0c2e9c45559208bc89d3d06
2016-10-20 12:59:06 -05:00
snuffy e03364c40a Fix issue with CLI not returning to prompt after running "features show"
ASTERISK-26444 #close

Change-Id: I91d645b7e6e5dba35f8c410df2be77a8c0e3acb8
2016-10-20 09:53:24 +11:00
zuul 7c00b34372 Merge "utils.c: Fix ast_set_default_eid for multiple platforms" 2016-10-19 17:35:52 -05:00
zuul bc5fdbd10a Merge "res_rtp_asterisk: Add ice_blacklist option" 2016-10-19 14:58:23 -05:00
Joshua Colp 1843b7fa0c Merge "chan_sip: Support nat=auto_comedia or nat=force_rport,auto_comedia." 2016-10-19 11:06:41 -05:00
Michael Walton 3e96d491d0 res_rtp_asterisk: Add ice_blacklist option
Introduces ice_blacklist configuration in rtp.conf. Subnets listed in the
form ice_blacklist = <subnet spec>, e.g. ice_blacklist =
192.168.1.0/255.255.255.0, are excluded from ICE host, srflx and relay
discovery. This is useful for optimizing the ICE process where a system
has multiple host address ranges and/or physical interfaces and certain
of them are not expected to be used for RTP. Multiple ice_blacklist
configuration lines may be used. If left unconfigured, all discovered
host addresses are used, as per previous behavior.

Documention in rtp.conf.sample.

ASTERISK-26418 #close

Change-Id: Ibee88f80d7693874fda1cceaef94a03bd86012c9
2016-10-19 07:15:20 -05:00
Mark Michelson f14ef51ead CDR: Alter destruction pattern for CDR chains.
CDRs form chains. When the root of the chain is destroyed, it then
unreferences the next CDR in the chain. That CDR is destroyed, and it
then unreferences the next CDR in the chain. This repeats until the end
of the chain is reached. While this typically does not cause any sort of
problems, it is possible in strange scenarios for the CDR chain to grow
way longer than expected. In such a scenario, the destruction pattern
can result in a stack overflow.

This patch fixes the problem by switching from a recursive pattern to an
iterative pattern for destruction. When the root CDR is destroyed, it is
responsible for iterating over the rest of the CDRs and unreferencing
each one. Other CDRs in the chain, since they are not the root, will
simply destroy themselves and be done. This causes the stack depth not
to increase.

ASTERISK-26421 #close
Reported by Andrew Nagy

Change-Id: I3ca90c2b8051f3b7ead2e0e43f60d2c18fb204b8
2016-10-18 17:14:43 -05:00
zuul 193a94a60f Merge "menuselect: invalid test for GTK2" 2016-10-18 14:57:08 -05:00
Joshua Colp d1bbef094c Merge "cli: Auto-complete File not Module for core set debug." 2016-10-18 13:22:02 -05:00
Joshua Colp f31772ec20 ari: Update model validator based on addition of asterisk_id.
ASTERISK-26470

Change-Id: I9c386f7a1c7d969161b28f189eb6298bbc5b7541
2016-10-18 11:52:44 -05:00