Commit Graph

30575 Commits

Author SHA1 Message Date
Kevin Harwell 62f862e2cd res_pjsip_session: Check if sequence header is missing
The pjsip_msg_find_hdr function can return NULL. This patch adds a check
when searching for the sequence header to make sure a NULL pointer is never
de-referenced.

Change-Id: I19af23aeeded65be016be92360e8cb7ffe51fad2
2018-01-03 10:46:25 -06:00
Jenkins2 84d0871380 Merge "core: Use macros to generate ao2_container callbacks where possible." 2018-01-03 07:50:36 -06:00
Jenkins2 9efcaf5eb0 Merge "astobj2: Create case-insensitive variants of container function macros." 2018-01-03 07:32:15 -06:00
Joshua Colp f77ca95418 Merge "aco: Add missing aco_option_type_string for OPT_TIMELEN_T." 2018-01-03 07:09:38 -06:00
Jenkins2 5a1525345e Merge "cdr: submit: fix logic of test for batch mode" 2018-01-03 06:43:47 -06:00
Joshua Colp 72e77539ee Merge "cdr_mysql: Make sure connection charset is always set" 2018-01-02 07:48:24 -06:00
Jenkins2 6480777005 Merge "stasis_channels.c: Misc cleanup." 2018-01-02 07:38:44 -06:00
Tzafrir Cohen 9b5d1454b4 cdr: submit: fix logic of test for batch mode
ASTERISK-27539 #close

Change-Id: I33cdf329d2bb4486dcae975c450f6aae94c515f7
2018-01-02 15:36:04 +02:00
Sungtae Kim ffbf5be116 res_pjsip: Add AMI action 'PJSIPShowAors'
Add an AMI action which provides information on all
configured AORs.

ASTERISK-27537

Change-Id: If8b990a00909e5b6c0f04a3b8dccd9903dc445eb
2018-01-02 12:24:38 +00:00
Corey Farrell f298178583 aco: Add missing aco_option_type_string for OPT_TIMELEN_T.
ASTERISK-27117

Change-Id: I8f6c34bb30830be9f7a40823723eb4dcaaa91c61
2018-01-02 01:26:10 -05:00
Sean Bright 15f8b9b8bf ice: Increase foundation buffer size
Per RFC 5245, the foundation specified with an ICE candidate can be up
to 32 characters but we are only allowing for 31.

ASTERISK-27498 #close
Reported by: Michele Prà

Change-Id: I05ce7a5952721a76a2b4c90366168022558dc7cf
2017-12-31 11:34:41 -05:00
Corey Farrell b32d6d5e2d astobj2: Create case-insensitive variants of container function macros.
* AO2_STRING_FIELD_CASE_HASH_FN
* AO2_STRING_FIELD_CASE_CMP_FN
* AO2_STRING_FIELD_CASE_SORT_FN

Change-Id: I11af8c6a0c43380a42732553f519c667abb842cf
2017-12-30 13:39:24 -05:00
Corey Farrell bc73337e07 core: Use macros to generate ao2_container callbacks where possible.
This uses AO2_STRING_FIELD_HASH_FN and AO2_STRING_FIELD_CMP_FN where
possible in the Asterisk core.

This removes CMP_STOP from the result of CMP_FN callbacks for the
following structure types:
* ast_bucket_metadata
* ast_bucket_scheme
* generic_monitor_instance_list (ccss.c)
* ast_bucket_file (media_cache.c)
* named_acl

Change-Id: Ide4c1449a894bce70dea1fef664dade9b57578f1
2017-12-30 13:20:16 -05:00
Corey Farrell 0fe7df641a datastore: Add automatic module references.
Add a reference to the calling module when it is active to protect
access to datastore->info.  Remove module references done by
func_periodic_hook as the datastore now handles it.

ASTERISK-25128 #close

Change-Id: I8357a3711e77591d0d1dd8ab4211a7eedd782c89
2017-12-29 16:16:11 -05:00
Jenkins2 80e6b2eff5 Merge "func_channel.c: Update MASTER_CHANNEL documentation" 2017-12-29 13:40:31 -06:00
Richard Mudgett 2dde5bef47 stasis_channels.c: Misc cleanup.
* Use current OBJ_SEARCH_xxx defines instead of the deprecated versions.

* Fix hash_cb and cmp_cb container functions to correctly use the
OBJ_SEARCH_xxx values.

* Remove incorrect usage of CMP_STOP.  Most uses in the system have no
effect.  This allows the collapse of channel_role_single_cmp_cb() and
channel_role_multi_cmp_cb() into channel_role_cmp_cb().

* Remove unnecessary usage of RAII_VAR().

Change-Id: I02c405518cab22aa2a082b61e2353bf7cd629a70
2017-12-28 13:53:27 -06:00
Jenkins2 0d9968e001 Merge "manager.c: Update AMI Status event documentation" 2017-12-28 13:46:22 -06:00
Richard Mudgett 9931976130 Merge "menuselect: Fix check for running configure." 2017-12-28 11:51:21 -06:00
Jenkins2 43e70525de Merge "astobj.h: Remove from Asterisk core." 2017-12-28 11:15:11 -06:00
Jenkins2 50cf373be5 Merge "cdr: Missing NULL check and unlock." 2017-12-28 10:42:17 -06:00
Sean Bright 898b3b080a cdr_mysql: Make sure connection charset is always set
When the MYSQL_OPT_RECONNECT option is enabled, the MySQL client API
will transparently reconnect when it needs to. Ideally this simplifies
our code, but when this reconnection occurs all connection state is
lost. Because we are not notified that this has happened, we don't know
to set our character set again (with "SET NAMES 'xyz'").

Rather than calling SET NAMES, we instead set the MYSQL_SET_CHARSET_NAME
option which will do it for us under the hood on each connect. This
option has been present in the MySQL C API for at least 15 years, so it
should be safe for most installations.

I also snuck a few other changes into this patch:

* Default the MySQL port to MYSQL_PORT (3306) instead of 0 if it's not
  defined.

* Fix some erroneous and/or silly checks on the contents of the
  configuration ast_str values.

ASTERISK-27366 #close
Reported by: Halil İbrahim YILDIZ

Change-Id: I36bf8dc5d5f83584e803b3b1a151dea9396ab8f5
2017-12-28 09:38:37 -06:00
Richard Mudgett d69b7c6c6d manager.c: Update AMI Status event documentation
The AMI Status event had linkedid listed twice and was missing the
effective connected line name and number headers.

NOTE: The linkedid and other standard channel snapshot fields in the XML
documentation are part of the <channel_snapshot/> XML template defined in
doc/appdocsxml.xslt.

Change-Id: I004c4c4f9e7b40ef55035c831702721bec82496c
2017-12-28 09:21:36 -06:00
Richard Mudgett fa36f9c01b bridge_native_rtp.c: Fix reentrancy framehook crash.
If two channels enter different native rtp bridges at the same time it is
possible that the framehook interface data pointer can be corrupted
because the struct variable was declared static.

* Fixed the reentrancy corruption by changing the framehook interface
struct static variable to a stack local variable.

* Moved the hook.data assignment outside of the channel lock.  It did not
need the lock's protection.  It probably was giving a false sense of
security.

The testsuite
channels/pjsip/basic_calls/two_parties/nominal/alice_initiated/bob_hangs_up
test caught this with MALLOC_DEBUG and DO_CRASH enabled.

Change-Id: If9e35b97d19209b0f984941c1d8eb5f7c55eea91
2017-12-27 23:17:01 -06:00
Richard Mudgett 1d3dc9aea2 func_channel.c: Update MASTER_CHANNEL documentation
Be more explicit in what is meant by the master channel to eliminate
misunderstanding.

ASTERISK-23133

Change-Id: I453bcaf4b99404a5a3e345dbf093ac6c1afcfc72
2017-12-27 21:15:16 -06:00
Corey Farrell 6338a03ce9 menuselect: Fix check for running configure.
menuselect/Makefile checks that autoconfig.h and makeopts were newer
than the '.in' files.  Unfortunately running ./configure does not touch
autoconfig.h unless the contents will change.

Instead of looking at autoconfig.h we just need to ensure that makeopts
is newer than configure.

Also make change to configure.ac so bootstrap.sh doesn't re-add the
extra trailing line-feed.

Change-Id: Ief1f831d6717007f9cebb668c14e92782cd2b794
2017-12-27 20:17:15 -06:00
Corey Farrell 94eb12ca56 cdr: Missing NULL check and unlock.
* handle_dial_message: Missing a check for NULL peer.
* cdr_generic_register: Missing unlock on allocation failure.

cdr_generic_register is fixed by reordering so the new structure is
allocated and initialized before locking the list.

Change-Id: I5799b99270d1a7a716a555c31ac85f4b00ce8686
2017-12-25 21:34:32 -05:00
Corey Farrell 23aa20bf20 loader: Add volatile to resource_being_loaded.
Some compiler optimizers seem to assume that dlopen will not use
__attribute__((constructor)) functions to call back to the program.
This was causing resource_being_loaded to be optimized away completely.

ASTERISK-27531 #close
Tested By: abelbeck

Change-Id: If17a3b889e06811a0e7119f0539d052494d6ece9
2017-12-23 23:44:12 -06:00
Kevin Harwell 553306548c AST-2017-014: res_pjsip - Missing contact header can cause crash
Those SIP messages that create dialogs require a contact header to be present.
If the contact header was missing from the message it could cause Asterisk to
crash.

This patch checks to make sure SIP messages that create a dialog contain the
contact header. If the message does not and it is required Asterisk now returns
a "400 Missing Contact header" response. Also added NULL checks when retrieving
the contact header that were missing as a "just in case".

ASTERISK-27480 #close

Change-Id: I1810db87683fc637a9e3e1384a746037fec20afe
2017-12-22 15:34:39 -06:00
Corey Farrell c2529a352c astobj.h: Remove from Asterisk core.
This is the old ASTOBJ macro's which are no longer used except by the
deprecated netsock.c.  Move it to the chan_iax2 include folder so it
does not get used elsewhere.

Change-Id: I7e4ae96678b36b9f41d3cae14b167f110eb5d349
2017-12-22 15:00:14 -05:00
Sean Bright fd0ca1c3f9 Remove as much trailing whitespace as possible.
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-12-22 09:23:22 -05:00
Jenkins2 9ef97b5a91 Merge "Fix some invalid Unicode characters" 2017-12-22 07:36:07 -06:00
Jenkins2 667296c907 Merge "app_voicemail: Fix file copy error handling." 2017-12-22 07:32:58 -06:00
Sean Bright a1a179c09d Fix some invalid Unicode characters
configs/samples/minivm.conf.sample contains invalid UTF-8, but that
appears to be intentional.

Change-Id: I7b1e0d332f3380fd0425962a3c9c55f9b200c8cc
2017-12-21 10:26:53 -06:00
Jenkins2 0100c9267e Merge "Fix Common Typo's." 2017-12-21 08:40:22 -06:00
Joshua Colp b0b2b79cb4 Merge "docs: Remove old API changes documentation" 2017-12-21 07:06:26 -06:00
Jenkins2 cc2557e3e0 Merge "app_festival: Fix fd leak on connection failure." 2017-12-21 06:35:06 -06:00
Joshua Colp c7a0ad8b99 Merge "bridge: Old channel video source not set to NULL after unref." 2017-12-21 06:15:44 -06:00
Jenkins2 fd7a263ac5 Merge "core: Fix unused variable error in handle_show_sysinfo." 2017-12-21 05:51:26 -06:00
Corey Farrell f2f51ff4ea app_voicemail: Fix file copy error handling.
Fix error where input/output file descriptors would be closed multiple
times.

Change-Id: Iba5140b60cb7de79e3d5d92be3c256947aa99da9
2017-12-20 22:19:29 -05:00
Sean Bright 9415ec2877 docs: Remove old API changes documentation
Change-Id: I1bc7957121cc7ae27dca04acc3613f4e1858476a
2017-12-20 14:55:13 -06:00
Corey Farrell 1b80ffa495 Fix Common Typo's.
Fix instances of:
* Retreive
* Recieve
* other then
* different then
* Repeated words ("the the", "an an", "and and", etc).
* othterwise, teh

ASTERISK-24198 #close

Change-Id: I3809a9c113b92fd9d0d9f9bac98e9c66dc8b2d31
2017-12-20 12:40:01 -05:00
Richard Mudgett 3625e91586 manager.h: Bump AMI version
Change-Id: I62e6ddeb261ef012687e1fb6734c554e2499b6bf
2017-12-20 11:34:42 -06:00
Corey Farrell aaa3884d4a bridge: Old channel video source not set to NULL after unref.
The bridge holds onto the old channel video source after it's been
released.  This can lead to use after free errors.

ASTERISK-27229 #close

Change-Id: Ib2dab61677dd8a21f7ad53cdc9b8ca93297838b3
2017-12-20 11:23:08 -05:00
Corey Farrell c2850bfebc core: Fix unused variable error in handle_show_sysinfo.
Apparently in OSX it's possible for OSX to HAVE_SYSCTL but not
HAVE_SYSINFO or HAVE_SWAPCTL.  In this case freeswap caused an unused
variable error.

ASTERISK-26563 #close

Change-Id: I8ec5b1897b786cc1abaf62264aa75039eea05510
2017-12-20 11:13:13 -05:00
Jenkins2 4815be9aeb Merge "CLI: Address multiple issues." 2017-12-20 08:54:58 -06:00
Jenkins2 0b9396720a Merge "bridge: Stop music on hold on adding an arbitrary channel to a bridge" 2017-12-20 08:34:51 -06:00
Jenkins2 a711ac25f1 Merge "dns_core: Protect against array index violation." 2017-12-20 08:00:29 -06:00
Jenkins2 78fb99e5a3 Merge "res_rtp_asterisk: Avoid close the rtp/rtcp fd twice." 2017-12-20 07:55:33 -06:00
Corey Farrell fff7782cf5 app_festival: Fix fd leak on connection failure.
Change-Id: If5efaddcf735ff7d17e55c36cc1388946cee9e0f
2017-12-20 01:53:17 -05:00
Jenkins2 968993a297 Merge "chan_sip: Fix memory leaks." 2017-12-19 19:42:13 -06:00