Commit Graph

29305 Commits

Author SHA1 Message Date
Joshua Colp 49535c17fc Merge "modules: change module LOAD_FAILUREs to LOAD_DECLINES (14)" 2017-04-13 07:06:51 -05:00
zuul e803eafb65 Merge "modules: change module LOAD_FAILUREs to LOAD_DECLINES" 2017-04-13 07:03:42 -05:00
Joshua Colp f4ed700ca2 Merge "strings.h: Avoid overflows in the string hash functions" 2017-04-12 19:46:06 -05:00
George Joseph 6db0939b96 modules: change module LOAD_FAILUREs to LOAD_DECLINES (14)
Change-Id: If99e3b4fc2d7e86fc3e61182aa6c835b407ed49e
2017-04-12 15:57:39 -06:00
George Joseph 747beb1ed1 modules: change module LOAD_FAILUREs to LOAD_DECLINES
In all non-pbx modules, AST_MODULE_LOAD_FAILURE has been changed
to AST_MODULE_LOAD_DECLINE.  This prevents asterisk from exiting
if a module can't be loaded.  If the user wishes to retain the
FAILURE behavior for a specific module, they can use the "require"
or "preload-require" keyword in modules.conf.

A new API was added to logger: ast_is_logger_initialized().  This
allows asterisk.c/check_init() to print to the error log once the
logger subsystem is ready instead of just to stdout.  If something
does fail before the logger is initialized, we now print to stderr
instead of stdout.

Change-Id: I5f4b50623d9b5a6cb7c5624a8c5c1274c13b2b25
2017-04-12 15:57:21 -06:00
zuul 60fd01f7f4 Merge "bridging: Ensure successful T.38 negotation" 2017-04-12 11:22:19 -05:00
zuul 1d15e95440 Merge "res_rtp_asterisk.c: Add stun_blacklist option" 2017-04-12 09:55:42 -05:00
Torrey Searle 7819f95791 bridging: Ensure successful T.38 negotation
When a T.38 happens immediatly after call establishment, the control
frame can be lost because the other leg is not yet in the bridge.

This patch detects this case an makes sure T.38 negotation happens
when the 2nd leg is being made compatible with the negotating
first leg

ASTERISK-26923 #close

Change-Id: If334125ee61ed63550d242fc9efe7987e37e1d94
2017-04-12 07:57:22 -05:00
Joshua Colp c5536eaee9 Merge "stun.c: Fix ast_stun_request() erratic timeout." 2017-04-12 04:54:33 -05:00
zuul 3c32680a8a Merge "sorcery.c: Speed up ast_sorcery_retrieve_by_id()" 2017-04-11 20:12:55 -05:00
zuul ecde4f1593 Merge "res_pjsip: Fix pointer use after unref." 2017-04-11 20:12:53 -05:00
zuul a0220877fa Merge "res_pjsip_sdp_rtp.c: Don't use deprecated transport struct member." 2017-04-11 20:12:50 -05:00
Torrey Searle 7901225261 strings.h: Avoid overflows in the string hash functions
On 2's compliment machines abs(INT_MIN) behavior is undefined and
results in a negative value still being returnd.  This results in
negative hash codes that can result in crashes.

ASTERISK-26528 #close

Change-Id: Idff550145ca2133792a61a2e212b4a3e82c6517b
2017-04-11 13:34:28 -05:00
Richard Mudgett 7312cbe803 res_rtp_asterisk.c: Add stun_blacklist option
Added the stun_blacklist option to rtp.conf.  Some multihomed servers have
IP interfaces that cannot reach the STUN server specified by stunaddr.
Blacklist those interface subnets from trying to send a STUN packet to
find the external IP address.  Attempting to send the STUN packet
needlessly delays processing incoming and outgoing SIP INVITEs because we
will wait for a response that can never come until we give up on the
response.  Multiple subnets may be listed.

ASTERISK-26890 #close

Change-Id: I3ff4f729e787f00c3e6e670fe6435acce38be342
2017-04-11 12:58:35 -05:00
Richard Mudgett 7c37365f03 stun.c: Fix ast_stun_request() erratic timeout.
If ast_stun_request() receives packets other than a STUN response then we
could conceivably never exit if we continue to receive packets with less
than three seconds between them.

* Fix poll timeout to keep track of the time when we sent the STUN
request.  We will now send a STUN request every three seconds regardless
of how many other packets we receive while waiting for a response until we
have completed three STUN request transmission cycles.

Change-Id: Ib606cb08585e06eb50877f67b8d3bd385a85c266
2017-04-11 12:58:35 -05:00
Richard Mudgett 8d323c74fa sorcery.c: Speed up ast_sorcery_retrieve_by_id()
Return early if ast_sorcery_retrieve_by_id() is not passed an id to find.
Also eliminated the RAII_VAR() usage in the function.

Change-Id: I871dbe162a301b5ced8b4393cec27180c7c6b218
2017-04-11 12:58:35 -05:00
Richard Mudgett 5b4e2ec267 res_pjsip: Fix pointer use after unref.
Change-Id: I4b6e1b0070563eeaee223cb58326f1b962ed5bc1
2017-04-11 12:58:35 -05:00
Richard Mudgett 6f793ac149 res_pjsip_sdp_rtp.c: Don't use deprecated transport struct member.
* create_rtp(): Eliminate use of deprecated transport struct member.  That
member and several others in the transport structure were deprecated
because of an infinite loop created when using realtime configuration.
See 2451d4e455

ASTERISK-26851

Change-Id: I0533aa13c9ce3c6cc394e0fd2b5bf1cd1b2ef3bc
2017-04-11 12:58:35 -05:00
Richard Mudgett d76bc0565c tcptls.c: Cleanup TCP/TLS listener thread on abnormal exit.
Temporarily running out of file descriptors should not terminate the
listener thread.  Otherwise, when there becomes more file descriptors
available, nothing is listening.

* Added EMFILE exception to abnormal thread exit.

* Added an abnormal TCP/TLS listener exit error message.

* Closed the TCP/TLS listener socket on abnormal exit so Asterisk does not
appear dead if something tries to connect to the socket.

ASTERISK-26903 #close

Change-Id: I10f2f784065136277f271159f0925927194581b5
2017-04-11 11:13:39 -05:00
Walter Doekes 2b8dbc9e00 samples: Undo removal of include from canonicalize-app-names commit.
This include was accidentally removed in changeset
Ia79aea64de89531362e993e34230c2044a70aa93. My bad.

Change-Id: I1d716c7f9590b4e97909fb8bca1f2ed9bd0e4082
2017-04-08 03:16:26 -05:00
Joshua Colp 62386dd1df Merge "pjproject_bundled: Crash on pj_ssl_get_info() while ioqueue_on_read_complete()." 2017-04-07 17:33:12 -05:00
zuul 6ac1c686ca Merge "pjsip: Add Alembic for PUBLISH support." 2017-04-07 15:26:01 -05:00
Joshua Colp a1a2e16f67 Merge "samples: Canonicalize app names in extensions.conf.sample." 2017-04-07 14:49:12 -05:00
Joshua Colp 0e7d29501d Merge "core: Improve/simplify handling of required headers." 2017-04-07 14:48:36 -05:00
Joshua Colp 270b485f04 pjsip: Add Alembic for PUBLISH support.
This change adds database tables for the PUBLISH support so it
can be configured using realtime. A minor fix to the
res_pjsip_publish_asterisk module was done so that it read the
sorcery configuration from the correct section. Finally the
sample configuration files have been updated.

ASTERISK-26928

Change-Id: I81991ae5c75af98d247f7eacd1c0b0a763675952
2017-04-07 08:44:49 -05:00
Alexander Traud 7a46cd7433 pjproject_bundled: Crash on pj_ssl_get_info() while ioqueue_on_read_complete().
When the Asterisk channel driver res_pjsip offers SIP-over-TLS, sometimes, not
reproducible, Asterisk crashed in pj_ssl_sock_get_info() because a NULL pointer
was read. This change avoids this crash.

ASTERISK-26927 #close

Change-Id: I24a6011b44d1426d159742ff4421cf806a52938b
2017-04-07 15:06:11 +02:00
Walter Doekes e6ae3651b8 samples: Canonicalize app names in extensions.conf.sample.
This takes care of warnings by ossobv/asterisklint.

Change-Id: Ia79aea64de89531362e993e34230c2044a70aa93
2017-04-06 15:57:17 -05:00
Joshua Colp 33f29240da Merge "pjproject_bundled: Add 3 upstream patches" 2017-04-06 12:23:47 -05:00
Joshua Colp b12eeddb35 Merge "chan_sip: Session Timers required but refused wrongly." 2017-04-06 11:39:41 -05:00
zuul 71e25ad7ad Merge "app_queue: Log reason for PAUSEALL/UNPAUSEALL" 2017-04-06 10:19:33 -05:00
Joshua Colp b9ae54a8ff Merge "sample_config: Add samples for pubsub to pjsip.conf.sample" 2017-04-06 08:29:39 -05:00
zuul d2e6eb2afe Merge "Unused realtime MOH classes not purged on 'moh reload'" 2017-04-05 19:14:28 -05:00
zuul a385db5333 Merge "res_pjsip_session: Allow BYE to be sent on disconnected session." 2017-04-05 19:04:25 -05:00
George Joseph 01e9eaf3a6 pjproject_bundled: Add 3 upstream patches
0035-r5572-svn-backport-dialog-transaction-deadlock.patch
0036-r5573-svn-backport-ua-pjsua-transaction-deadlock.patch
0037-r5576-svn-backport-session-timer-crash.patch

Also removed the progress bar from wget download to stdout.

ASTERISK-26905 #close
Reported-by: Ross Beer

Change-Id: I268fb3cf71a3bb24283ff0d24bd8b03239d81256
2017-04-05 17:17:24 -05:00
Troy Bowman fac5115c43 app_queue: Log reason for PAUSEALL/UNPAUSEALL
We needed the reason for our reporting when agents pause/unpause all of
their queues at once.  This is a small, simple patch that adds a reason
for PAUSEALL and UNPAUSEALL.  I have been using it in production for years.

ASTERISK-26920 #close

Change-Id: Ifb3f0d1a0abd5194253d9794023546e1395baf3d
2017-04-05 15:22:00 -05:00
George Joseph 40e9d5e8b7 sample_config: Add samples for pubsub to pjsip.conf.sample
Added:
 * outbound-publish
 * resource_list
 * inbound-publication
 * asterisk-publication

Change-Id: I65043a896c35483f30a92d30b5b118359af7ba5a
2017-04-05 14:53:20 -05:00
Richard Mudgett f2ee8ac21e res_pjsip_sdp_rtp.c: Don't alter global addr variable.
* create_rtp(): Fix unexpected alteration of global address_rtp if a
transport is bound to an address.

* create_rtp(): Fix use of uninitialized memory if the endpoint RTP media
address is invalid or the transport has an invalid address.

ASTERISK-26851

Change-Id: Icde42e65164a88913cb5c2601b285eebcff397b7
2017-04-04 13:38:07 -05:00
Corey Farrell 380973cc47 CDR: Protect from data overflow in ast_cdr_setuserfield.
ast_cdr_setuserfield wrote to a fixed length field using strcpy. This could
result in a buffer overrun when called from chan_sip or func_cdr. This patch
adds a maximum bytes written to the field by using ast_copy_string instead.

ASTERISK-26897 #close
patches:
  0001-CDR-Protect-from-data-overflow-in-ast_cdr_setuserfie.patch submitted
    by Corey Farrell (license #5909)

Change-Id: Ib23ca77e9b9e2803a450e1206af45df2d2fdf65c
2017-04-04 10:14:26 +00:00
Daniel Journo 6c3ae397cb Unused realtime MOH classes not purged on 'moh reload'
Purge Realtime MOH classes on 'moh reload' even when musiconhold.conf
hasn't changed.

ASTERISK-25974 #close

Change-Id: I42c78ea76528473a656f204595956c9eedcf3246
2017-04-03 17:43:50 -05:00
Corey Farrell 8e36064109 core: Improve/simplify handling of required headers.
* Report failures if configure finds a required header is missing.
* Deduplicate includes between asterisk.h, astmm.h and compat.h.
* Unconditionally include headers in compat.h if required elsewhere.

Change-Id: Ie67d0185ca71fbfb81c9bdfaebe46a49e3c56dc5
2017-04-03 16:16:09 -04:00
Richard Mudgett a889621b14 res_pjsip: Fix transport ref leak.
We were leaking a transport ref in multihomed_on_rx_message() which
resulted in the FRACK about excessive ref counts.

ASTERISK-26916 #close

Change-Id: I7a96658a9614a060565bb9ad51cb1c9c11ee145f
2017-04-03 14:03:24 -05:00
Mark Michelson cf4dd32bef Merge "sdp: Add support for setting connection address and clean up state." 2017-04-03 09:32:08 -05:00
Alexander Traud 4fc22c7673 chan_sip: Session Timers required but refused wrongly.
SIP user-agents indicate which protocol extensions are allowed in headers
like Supported and Required. Such protocol extensions are Session Timers
(RFC 4028) for example. Session Timers are supported since Mantis-10665.
Since ASTERISK-21721, not only the first but multiple Supported/Required
headers in a message are parsed. In that change, an existing variable was
re-used within a newly added do-loop. Currently, at the end of that loop,
that variable is an empty string always. Previously, that variable was used
within log output. However, the log output was not changed.

ASTERISK-26915 #close

Change-Id: I09315f31b4d78fb214bb2a9fb6c0f5e143eae990
2017-04-03 09:30:43 +02:00
zuul 9c80796d6f Merge "Forward declare 'struct ast_json' in asterisk.h" 2017-04-01 08:46:14 -05:00
Joshua Colp 48be02c5d8 res_pjsip_session: Allow BYE to be sent on disconnected session.
It is perfectly acceptable for a BYE to be sent on a disconnected
session. This occurs when we respond to a challenge to the BYE
for authentication credentials.

ASTERISK-26363

Change-Id: I6ef0ddece812fea6665a1dd2549ef44fb9d90045
2017-04-01 06:02:04 -05:00
Richard Mudgett e8b1bb3041 chan_vpb.cc: Fix compiler error.
Added missing channel technology read/write stream callback
initialization.

Change-Id: I829043a327d987e0d964485dd3d27964bebbd623
2017-03-31 13:14:05 -05:00
zuul 19e2a2802f Merge "cdr_pgsql: Fix buffer overflow calling libpq" 2017-03-31 09:01:23 -05:00
George Joseph 6a43a76ddc Merge "build: Fix deb build issues with fakeroot" 2017-03-31 08:20:30 -05:00
Corey Farrell f9695dc057 Forward declare 'struct ast_json' in asterisk.h
The ast_json structure is used in many Asterisk headers and is often the
only part of json.h used.  This adds a forward declaration to asterisk.h
and removes the include of json.h from many headers.  The declaration
has been left in endpoints.h and stasis.h to avoid problems with source
files that use ast_json functions without directly including json.h.

ari.h continues to include json.h as it uses enum
ast_json_encoding_format.

Change-Id: Id766aabce6bed56626d27e8d29f559b5e687b769
2017-03-30 22:59:59 -05:00
zuul 0a06d39716 Merge "CEL: Remove header declarations of non-existant functions." 2017-03-30 18:29:09 -05:00