Commit Graph

31538 Commits

Author SHA1 Message Date
Joshua Colp cbf082ed53 res_pjsip_registrar: Improve performance on inbound handling.
This change removes a sorcery lookup for retrieving all
contacts at the end of the registration process by keeping
track of the contacts that are added/updated/deleted.

This ensures at the end of the process the container of
contacts we have is the current state.

Pool usage has also been reduced by allocating one for
usage throughout the handling of a REGISTER and resetting
it to a clean state. This ensures that in most cases
we allocate once and just reuse it.

ASTERISK-28001

Change-Id: I1a78b2d46f9a2045dbbff1a3fd6dba84b612b3cb
2018-08-03 04:09:15 -05:00
Joshua Colp 9fcb3aeb07 Merge "thirdparty/pjproject: fix deadlock in response retransmissions" 2018-08-02 07:12:35 -05:00
Joshua Colp 8fa4d9e207 Merge "BuildSystem: Enable Jansson in Solaris 11." 2018-08-02 06:39:07 -05:00
Torrey Searle 3424795f3a thirdparty/pjproject: fix deadlock in response retransmissions
The tdata containing the response can be shared by both the dialog
object and the tsx object.  In order to prevent the race condition
between the tsx retransmission and the dialog sending a response,
clone the tdata before modifying it for the dialog send response.

ASTERISK-27966 #close

Change-Id: Ic381004a3a212fe1d8eca0e707fe09dba4a6ab4e
2018-08-01 11:12:16 -05:00
Corey Farrell a10a3aff6a Build System: Improve ccache matching for different menuselect options.
Changing any Menuselect option in the `Compiler Flags` section causes a
full rebuild of the Asterisk source tree.  Every enabled option causes
a #define to be added to buildopts.h, thus breaking ccache caching for
every source file that includes "asterisk.h".  In most cases each option
only applies to one or two files.  Now we only define those options for
the specific sources which use them, this causes much better cache
matching when working with multiple builds.  For example testing code
with an without MALLOC_DEBUG will now use just over half the ccache
size, only main/astmm.o will have two builds cached instead of every
file.

Reorder main/Makefile so _ASTCFLAGS set on specific object files are all
together, sorted by filename.  Stop adding -DMALLOC_DEBUG to CFLAGS of
bundled pjproject, this define is no longer used by any header so only
serves to break cache.

The only code change is a slight adjustment to how main/astmm.c is
initialized.  Initialization functions always exist so main/asterisk.c
can call them unconditionally.  Additionally rename the astmm
initialization functions so they are not exported.

Change-Id: Ie2085237a964f6e1e6fff55ed046e2afff83c027
2018-08-01 12:01:15 -04:00
Joshua Colp 44ff1e1675 Merge "res_rtp_asterisk: In Developer Mode, do not require OpenSSL." 2018-08-01 04:23:06 -05:00
Joshua Colp 17edf66341 Merge "res_pjsip_pubsub: Use ast_true for "prune_on_boot"." 2018-07-31 16:11:32 -05:00
Richard Mudgett 68a3d39a99 pjsip_wizard.conf.sample: Update remote_hosts description.
Remove the note that SRV records are not supported as that is no longer
true.

ASTERISK-27993

Change-Id: Id0dd6ef40e52702be9727a2b6122216cb00bb4ca
2018-07-31 11:29:24 -05:00
George Joseph a354599ecc CI: Add optional uninstall step before installing asterisk
Change-Id: I7dedf1e925eafc3a0adf01dd9dfbe44eb642aab7
2018-07-30 07:44:05 -06:00
Alexander Traud 7418dfa2c7 BuildSystem: Enable ncurses for menuselect in Solaris 11.
The check for the library ncurses should use not use the header <curses.h> but
<ncurses.h>, because on some platforms <curses.h> is not a drop-in replacement
for <ncurses.h>: For example in Solaris, the symbol initscr is a typedef in
<curses.h> to a symbol which does not exist in the library ncurses (initscr32).
Simply use <ncurses.h> when you link to ncurses.

Furthermore in Solaris, the header <ncurses.h> is in a subdirectory
/usr/include/ncurses and not available via pkg-config.

ASTERISK-15331
ASTERISK-14935
ASTERISK-12382
ASTERISK-9107

Change-Id: Ife367776b0ccf17d3fefed868245376bfb93745d
2018-07-29 03:17:43 -05:00
Joshua Colp 3aa6be6b51 res_pjsip_pubsub: Use ast_true for "prune_on_boot".
Change-Id: Iedec4e7390b3e821987681da24d0298632b9873d
2018-07-28 08:01:27 -05:00
Alexander Traud 0a4d58735f BuildSystem: Enable Jansson in Solaris 11.
In Solaris, the header <jansson.h> is in /usr/include/jansson. To find
Jansson even in such a subdirectory, the tool pkg-config is queried via
AST_PKG_CONFIG_CHECK. For those platforms, which do not list Jansson via
pkg-config, the previous check remains and is executed thereafter.

Because the check for the NetBSD Editline library uses the tool pkg-config
the code of PKG_PROG_PKG_CONFIG must be used. Because that check happens
earlier than Jansson, it must be placed in front of that.

ASTERISK-27991

Change-Id: I69ea0f379f87a50049654b2487c76ee1c04fa53a
2018-07-28 14:39:40 +02:00
Richard Mudgett e5ae04b48b res_pjsip_endpoint_identifier_ip.c: Added regex support to match_header
This patch adds regular expression support to make the identify section's
match_header option more useful when attempting to match complex headers
like the 'To' or 'From' headers.  The 'From' header has variable
components such as the tag parameter that you cannot predict.  To specify
a regular expression put slashes around the regular expression in place of
the header value.

[identify-alice]
type=identify
endpoint=alice
match_header=From: /<sip:alice@127\\.0\\.0\\.1>/

* Added regex support to match_header so you could match a 'To' header
among other complex headers.

Fixed reported crashes when trying to match special headers like 'Contact'.
The identify section's match_header method used code that assumed you were
matching a generic header.  Any other type of header could cause a crash
if the header structure variant did not match the generic header enough.

* Made use code that will work for any header type instead of code
specific to generic headers.

Other fixes while in the area:

* Made check all headers of the requested name.
* Added some more sanity checks to the configured identify matching
options when applying the configuration.

ASTERISK-27548

Change-Id: I27dfd4ff5e2259b906640e3c330681b76b4ed1f1
2018-07-27 10:58:38 -05:00
Joshua Colp 4265391859 res_pjsip_pubsub: Treat "prune_on_boot" as a yes / no.
The alembic for the PJSIP subscription persistence table has the
"prune_on_boot" field as a boolean. While in Asterisk we are
tolerant of many different definitions of true and false in the
database we only accept "yes" and "no". This change makes the
field treated as a yes/no instead of an integer, thus storing
"yes" and "no" instead of "1" and "0".

Change-Id: Ic8b9211b36babefe78f70def6828a135a6ae7ab6
2018-07-27 10:47:31 -05:00
Alexander Traud 870fe7f60c res_rtp_asterisk: In Developer Mode, do not require OpenSSL.
OpenSSL is an optional external library and should stay optional even when
Developer Mode is configured.

ASTERISK-27990

Change-Id: Ia68a4cd5474b26d45e0f43b04032ad598022853b
2018-07-27 08:40:32 -05:00
Joshua Colp 4febeaefa6 Merge "devicestate: Don't create topic when change isn't cached." 2018-07-27 06:09:50 -05:00
Joshua Colp 54a5de9c95 Merge "loader: Process dependencies for built-in modules." 2018-07-27 06:04:51 -05:00
Joshua Colp d7ebf716f8 Merge "Build System: Create 'make install-configs' target." 2018-07-27 05:51:44 -05:00
Joshua Colp 90129b9736 Merge "res_rtp_asterisk: Avoid merging command and regular T.140 text packets" 2018-07-27 05:35:17 -05:00
George Joseph 116a599b7e CI: Fix placement of job summary statments
Change-Id: Iace19e718f4e8fb48eb7dc9f98af53b115cc45f3
2018-07-26 17:55:41 -06:00
Corey Farrell 709f4b81e7 loader: Process dependencies for built-in modules.
With the new module loader it was missed that built-in modules never
parsed dependencies from mod->info into vectors of mod.  This caused
manager to be initialized before acl (named_acl).  If manager.conf
used any named ACL's they would not be found and result in no ACL being
applied to the AMI user.

In addition to the manager ACL fix this adds "extconfig" to all builtin
modules which support realtime configuration.  This only matters if one
of the builtin modules is configured with 'preload', depending on
"extconfig" will cause config.c to automatically be initialize during
the preload stage.

Change-Id: I482ed6bca6c1064b05bb538d7861cd7a4f02d9fc
2018-07-26 14:29:18 -05:00
neutrino88 cb276b5085 res_rtp_asterisk: Avoid merging command and regular T.140 text packets
When realtime text packets are to be sent, the text is accumulated in a
buffer and sent regularly by a timer.  It can happen that commands such as
a backspace, CR, or LF get merged with regular text.  This breaks some
UAs.

The proposed change:
* We test if the current packet contains a command.  If so we send the
buffer immediately.
* We test if the buffer contained a command.  If so we send the buffer
immediately.
* We accumulate the text (or the command) in the buffer.

ASTERISK-27970

Change-Id: Ifbe993311410fa855cb8aa4a12084db75f413462
2018-07-26 13:58:22 -05:00
Jenkins2 7e0e6fd123 Merge "CI: Add docker info to job summary" 2018-07-26 11:44:30 -05:00
George Joseph e55cad967e CI: Add docker info to job summary
Change-Id: I45d52005a9b692ad303c11792f226ace1e449901
2018-07-26 10:34:33 -06:00
Corey Farrell 852e157b19 Build System: Create 'make install-configs' target.
This target requires specifying CONFIG_SRC=path_to_configs.  This can be
used to install custom configs for the Asterisk build while still
performing directory replacements on asterisk.conf.

Modify internal INSTALL_CONFIGS so first argument requires full path to
the config sources relative to Asterisk source root.

Change-Id: Idcd841df3c8d5bfe23d566bb9e2e448e9df4f8ab
2018-07-26 11:19:39 -04:00
Kevin Harwell 783bff0637 json.c: improve ast_json_to_ast_variables performance
When converting from a json object to an ast variables list the conversion
algorithm was doing a complete traversal of the entire variables list for
every item appended from the json structure.

This patch makes it so the list is no longer traversed for each new ast
variable being appended.

Change-Id: I8bf496a1fc449485150d6db36bfc0354934a3977
2018-07-25 15:37:28 -05:00
Joshua Colp 66f581313f devicestate: Don't create topic when change isn't cached.
When publishing a device state the change can be marked as being
cachable or not. If it is not cached the change is just published
to all interested and not stored away for later query. This was not
fully taken into account when publishing in stasis. The act of
publishing would create a topic for the device even if it may be
ephemeral.

This change makes it so messages which are not cached won't create
a topic for the device. If a topic does already exist it will be
published to but otherwise the change will only be published to
the device state all topic.

ASTERISK-27591

Change-Id: I18da0e8cbb18e79602e731020c46ba4101e59f0a
2018-07-25 14:21:06 -05:00
Joshua Colp 1c8e6ecca3 Merge "res_pjsip: Change log message from error to warning for valid use cases" 2018-07-25 13:59:27 -05:00
George Joseph 8f479b1b40 Merge "Build System: Silence build of bundled jansson." 2018-07-25 13:59:22 -05:00
Jenkins2 15b58f879e Merge "CI: Explicitly pass BRANCH_NAME to buildAsterisk and installAsterisk" 2018-07-25 12:48:48 -05:00
Jenkins2 c530a88ec7 Merge "CI: Add options to initialize and cleanup database to runTestsuite.sh" 2018-07-25 12:48:18 -05:00
George Joseph 3dcf26cb94 CI: Explicitly pass BRANCH_NAME to buildAsterisk and installAsterisk
Change-Id: I652f4a0ea5107c778e27a78bccb67b18b0c4e087
2018-07-25 09:20:20 -06:00
George Joseph 797835c5b9 CI: Add options to initialize and cleanup database to runTestsuite.sh
Change-Id: I352333233bab5377723bf37d490ba84fc55bc853
2018-07-25 09:10:20 -06:00
Corey Farrell 05a4b448af CI: Do not `mkdir 2`.
Change-Id: Ib7377d26a6c98b38bad463f47c84f1875ac84eb7
2018-07-25 09:08:24 -05:00
Corey Farrell 2f275f8472 Build System: Silence build of bundled jansson.
Change-Id: I7392c79c0173057f5378010bf1fe65e300e8fc56
2018-07-25 07:34:53 -05:00
George Joseph ceb199e19f CI: RefDebug: Fix reference to testsuite URL
Change-Id: I0ee41d95a87f0d97b01f2757012b846bcfe6443d
2018-07-25 06:13:43 -06:00
Corey Farrell af5984d694 Build System: Fix bundled jansson install.
Update the bundled jansson Makefile to do nothing during Asterisk
install, use a target that is not phony to initiate the jansson make and
install.

Change-Id: I7643cc3d39af9feba8fc0da676b646efc5f8b3bb
2018-07-24 14:44:53 -05:00
Corey Farrell cdb725526e CI: Use bundled jansson if needed.
Use pkg-config to determine if jansson is at least 2.11, enabled bundled
version otherwise.

Change-Id: Ib555a8b72ff6f6925f9280ef035caa0b91ca4bd2
2018-07-24 11:45:27 -04:00
Jenkins2 8f890374cb Merge "Enable bundling of jansson, require 2.11." 2018-07-24 10:07:23 -05:00
George Joseph 9e47a7ffca Merge "res_pjsip: Update default keepalive interval to 90 seconds." 2018-07-24 08:30:13 -05:00
Florian Floimair c5bac9ed90 res_pjsip: Change log message from error to warning for valid use cases
If a SIP MESSAGE is triggered for an endpoint that is currently not registered
- and therefore has no valid contact associated - an error message was logged.
Since this is a valid request in a valid use cases this is now changed to a
warning, as discussed with Matt Fredrickson on the asterisk-dev mailing list.

Change-Id: I55eb62d2712818a58c7532119dec288bd98cf0c0
2018-07-24 07:20:25 -05:00
Jenkins2 c0270c2ec4 Merge "CI: Set correct user:group when publishing docs" 2018-07-24 06:03:03 -05:00
Jenkins2 6cc20174c0 Merge "CI: Add --privileged flag to docker options" 2018-07-24 06:03:01 -05:00
George Joseph a950fba895 Merge "core: AST_DEVMODE no longer affects ABI." 2018-07-24 05:41:39 -05:00
George Joseph f827f36ff3 CI: Add --privileged flag to docker options
Change-Id: If92d55f15306e55dd7091ac3c47b13ebbbb03488
2018-07-24 04:40:54 -06:00
George Joseph 4507855242 Merge "build_tools/make_version: Get MAINLINE_BRANCH from .gitreview." 2018-07-24 05:40:49 -05:00
George Joseph eed429c811 CI: Set correct user:group when publishing docs
Change-Id: Ibabeb9ac730d9755cf54318d0da74771c939b86b
2018-07-24 04:32:31 -06:00
George Joseph 1b7607922b Merge "asterisk.c: Make displayed copyright always consistent" 2018-07-24 04:32:09 -05:00
Richard Mudgett 0504594a3e core: AST_DEVMODE no longer affects ABI.
Remove AST_DEVMODE from the AST_BUILDOPTS list and the AST_BUILDOPTS_SUM
calculation as it no longer affects API/ABI compatibility.

Change-Id: Id5bd6dfade173a53b3a49f715586b86e3fb24acb
2018-07-23 14:03:24 -05:00
Jenkins2 849b96edd6 Merge "CI: Split --test-command argument." 2018-07-23 13:45:19 -05:00