Commit Graph

28715 Commits

Author SHA1 Message Date
zuul 1ecb4f9e2b Merge "utils.c: Fix ast_set_default_eid for multiple platforms" into 14 2016-10-19 17:35:54 -05:00
zuul 63f2a7d007 Merge "res_rtp_asterisk: Add ice_blacklist option" into 14 2016-10-19 14:58:26 -05:00
zuul e2cf981a1c Merge "chan_sip: Support nat=auto_comedia or nat=force_rport,auto_comedia." into 14 2016-10-19 11:23:16 -05:00
Michael Walton 494bebeb6f 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:13 -05:00
Mark Michelson 0abc71dfd6 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:38 -05:00
zuul ab030fcc1f Merge "cli: Auto-complete File not Module for core set debug." into 14 2016-10-18 14:10:45 -05:00
Joshua Colp 3892d8d18f Merge "ari: Update model validator based on addition of asterisk_id." into 14 2016-10-18 12:16:02 -05:00
Joshua Colp e285643a9c Merge "chan_rtp: Set a sane default rtp engine for unicast." into 14 2016-10-18 12:07:09 -05:00
Joshua Colp 8bd6f695dc ari: Update model validator based on addition of asterisk_id.
ASTERISK-26470

Change-Id: I9c386f7a1c7d969161b28f189eb6298bbc5b7541
2016-10-18 16:51:20 +00:00
Joshua Colp 082078de3e Merge "res/ari: Add the Asterisk EID field to outgoing events" into 14 2016-10-18 05:38:35 -05:00
Alexander Traud 3938e3320f cli: Auto-complete File not Module for core set debug.
Since Asterisk 1.8, the command "core set debug" on the command-line interface
asks not for a file (.c) but a module name. This change shows modules (.so) on
the auto-completion via a tabulator or the question mark. Now, when you
partially type a module name, TAB or ?, you get the correct candidiates.

ASTERISK-26480

Change-Id: I1213f1dd409bd4ff8de08ad80cb0c73cafb1bae0
2016-10-18 03:35:14 -05:00
zuul 243633d26d Merge "menuselect: invalid test for GTK2" into 14 2016-10-17 23:55:30 -05:00
zuul ec79e97c38 Merge "app_queue: Added initialization for "context" parameter" into 14 2016-10-17 16:27:47 -05:00
Tzafrir Cohen 47ba379e4c menuselect: invalid test for GTK2
configuire.ac was only checking for the existence of pkg-config
and not the gtk2 package itself.  Now it calls AST_PKG_CONFIG_CHECK
for gtk+-2.0.

ASTERISK-26356 #close

Change-Id: I8079d515d6ea99f9ab320a7eaa71c2aaa101ccd5
2016-10-17 12:36:02 -05:00
George Joseph 230dd6f9af pjproject_bundled: Add patch to address SSL crash
Addresses crashes when an attempt is made to operate on an SSL socket
after the socket has been closed.

ASTERISK-26477 #close

Change-Id: I421305b357558b4f9e690210dc0f4831ef4b3002
2016-10-17 11:55:46 -05:00
Leandro Dardini ef8c54238c app_queue: Added initialization for "context" parameter
When using Asterisk Realtime Architecture, empty fields are skipped and the
default values are used. If the "context" parameter in queue was set and then
cleared from the database, the old value remains in memory and it continues
to be used. This change initialize the "context" parameter with an empty value,
allowing clearing the parameter.

ASTERISK-26462 #close

Change-Id: I64be73d5044ce38dd02408bd0e53de965ef65905
2016-10-17 08:15:13 -05:00
Matt Jordan ebcbc9ee34 res/ari: Add the Asterisk EID field to outgoing events
This patch adds the Asterisk EID field to all outgoing ARI events.
Because this field should be added to all events as they are
transmitted, it is appended to the JSON message just prior to it being
handed off to the application message handler. This makes it somewhat
resilient to both new events being added to ARI, as well as other
potential event transport mechanisms.

ASTERISK-26470 #close

Change-Id: Ieff0ecc24464e83f3f44e9c3e7bd9a5d70b87a1d
2016-10-17 08:14:40 -05:00
Moises Silva 3135b15a54 chan_rtp: Set a sane default rtp engine for unicast.
ASTERISK-26439

Change-Id: I7f5ee2eeba8906e9ecb3293dbe3a747770bb5011
2016-10-17 08:14:12 -05:00
George Joseph 13aa241b9c utils.c: Fix ast_set_default_eid for multiple platforms
ast_set_default_eid was searching for ethX, emX, enoX, ensX and even
pciD#U interface names.  While this was a good attempt, it wasn't
inclusive enough to capture interfaces like enp6s0 or ens6d1, etc.

Rather than relying on interface names, we now simply find the first
interface returned by the OS that has a hardware address and that
address isn't all 0x00 or all 0xff.  The code IS different for BSD,
Solaris and Linux based on what method is available for enumerating
interfaces.

Tested on:
FreeBSD9
CentOS6
Ubuntu14
Fedora24

I was unable to test on Solaris at this time but the code for Solaris
is used elsewhere at Digium.

Change-Id: Iaa6db87ca78a9a375e47d70e043ae08c1448cb72
2016-10-16 18:35:33 -05:00
Michael Kuron 60c84bbad5 chan_sip: Only send video on outgoing channel if incoming channel supports it
Previously, the settings videosupport=always and videosupport=yes behaved
identically and unconditionally caused a video offer to be sent in the SDP on
an outgoing call. This was a regression introduced with commit
5a1d90e1fb in Asterisk 1.6.1.

This commit restores correct behavior: videosupport=always causes a video offer
to be sent unconditionally, while videosupport=yes will only offer video on an
outbound channel if the incoming channel it is bridged to also supports video.
That way, the device receiving the outgoing call can display the correct user
interface elements for audio or video and will not unnecessarily show a blank
video window on an audio-only call.

ASTERISK-17470 #close

Change-Id: I782f4409d436114dbc97061c3570c0cd24f7c3ae
2016-10-15 05:17:46 -05:00
Joshua Colp 1cfc5119f7 Merge "Fix issues with bundled pjproject cached download." into 14 2016-10-14 18:03:43 -05:00
Joshua Colp 839766f5e1 Merge "Audit ast_json_pack() calls for needed UTF-8 checks." into 14 2016-10-14 14:15:51 -05:00
Joshua Colp 465ba82ea2 Merge "json: Check party id name, number, subaddresses for UTF-8." into 14 2016-10-14 14:15:47 -05:00
Joshua Colp 6d5e11dc91 Merge "json: Add UTF-8 check call." into 14 2016-10-14 14:15:44 -05:00
zuul e4590e61e6 Merge "res_config_mysql: Fix several issues related to recent table changes" into 14 2016-10-14 12:46:46 -05:00
zuul 527d7de647 Merge "aoc.c: Whitespace cleanup" into 14 2016-10-14 11:01:24 -05:00
zuul 22094b267d Merge "app_queue.c: Fix clearing of pause reason string." into 14 2016-10-14 09:41:07 -05:00
Corey Farrell 11bc810c86 Fix issues with bundled pjproject cached download.
Previously when testing I had a preexisting makeopts in ASTTOPDIR.  The
ordering of configure.ac causes --with-externals-cache to be processed
after third-party configure.  In cases where the Asterisk clone is
cleaned it would cause pjproject to be downloaded to /tmp.  This
moves processing of the externals cache and sounds cache to happen
before third-party configure.

This also addresses a possible issue with the third-party Makefile.  If
TMPDIR is set by the environment it would override the path given to
--with-externals-cache.

ASTERISK-26416

Change-Id: Ifab7f35bfcd5a31a31a3a4353cc26a68c8c6592d
2016-10-14 07:47:31 -05:00
Richard Mudgett aba27b5a60 Audit ast_json_pack() calls for needed UTF-8 checks.
Added needed UTF-8 checks before constructing json objects in various
files for strings obtained outside the system.  In this case string values
from a channel driver's peer and not from the user setting channel
variables.

* aoc.c: Fixed type mismatch in s_to_json() for time and granularity json
object construction.

ASTERISK-26466
Reported by: Richard Mudgett

Change-Id: Iac2d867fa598daba5c5dbc619b5464625a7f2096
2016-10-13 18:12:16 -05:00
Richard Mudgett beae5022bf json: Check party id name, number, subaddresses for UTF-8.
* Updated unit test as ast_json_name_number() is now NULL tolerant.

ASTERISK-26466 #close
Reported by: Richard Mudgett

Change-Id: I7d4e14194f8f81f24a1dc34d1b8602c0950265a6
2016-10-13 18:12:16 -05:00
Richard Mudgett 2433a9d0c0 json: Add UTF-8 check call.
Since the json library does not make the check function public we
recreate/copy the function in our interface module.

ASTERISK-26466
Reported by: Richard Mudgett

Change-Id: I36d3d750b6f5f1a110bc69ea92b435ecdeeb2a99
2016-10-13 18:12:16 -05:00
Richard Mudgett b288b8b997 aoc.c: Whitespace cleanup
* In s_to_json() removed unnecessary ast_json_ref() to ast_json_null()
when creating the type json object.  The ref is a noop.

Change-Id: I2be8b836876fc2e34a27c161f8b1c53b58a3889a
2016-10-13 15:59:44 -05:00
Richard Mudgett 857a9936f4 app_minivm.c: Fix malformed ast_json_pack() call.
Change-Id: I082b239022fac462666e52a14a44304748908dc0
2016-10-13 15:58:35 -05:00
Richard Mudgett 030852e1b3 app_queue.c: Fix clearing of pause reason string.
The pause reason is not always cleared when it should be cleared.

* Made set_queue_member_pause() always clear pause reason if not pausing
with a reason string.

Change-Id: I993dad19626ec017478a230e980989438b778c53
2016-10-13 15:55:36 -05:00
George Joseph bb08fae6a9 res_config_mysql: Fix several issues related to recent table changes
Unlike any of the other database drivers, res_config_mysql checks that
the table definition matches the requirements for every insert and
update statement.  Since all requirements are forced to 'char', any
column that isn't a char, like ps_contacts' expiration_time,
qualify_timeout, etc., will throw a warning.  It's kinda harmless but
very misleading.  Since no other driver does those checks on insert
or update, they've been removed from res_config_mysql.  Also, all
the logic that actually attempted to ALTER the table to fix the issue
has been removed.  With the move to alembic, the auto-alter
functionality is not only unnecessary, it's also dangerous.

The other issue is that res_config_mysql calls the mysql_insert_id
function inside store_mysql.  Presumably the intention was to return
the number of rows inserted DESPITE A NOTE IN THE CODE THAT THE VALUE
IS NON_PORTABLE AND MAY CHANGE.  That value is then returned to
config realtime as the number of rows inserted.  Guess what?  The value
changed.  It now only returns the number of rows inserted if there's an
auto increment column on the table, which ps_contacts doesn't have.
Otherwise it returns 0.  So now, the insert worked but we tell config
realtime and sorcery that no rows were inserted.  That call to
mysql_insert_id was removed and we now always return 1 if the insert
succeeded.  We're only inserting 1 row at a time anyway.  If the insert
fails, we still return -1.

ASTERISK-26362 #close
Reported-by: Carlos Chavez

Change-Id: I83ce633efdb477b03c8399946994ee16fefceaf4
2016-10-12 16:48:52 -05:00
zuul 8ff4d75e9e Merge "bundled_pjproject: Add tests for programs used by the Makefile, et al." into 14 2016-10-12 11:15:22 -05:00
Torrey Searle 8d2d6361ff res_fax: Fix a tight race condition causing fax to crash in audio fallback
When T.38 gets rejected and G711 failback occurs there is a period of
time where neither AST_FAX_TECH_T38 nor AST_FAX_TECH_AUDIO is set,
leading to a crash.

Change-Id: Icc3f457b2292d48a9d7843dac0028347420cc982
2016-10-12 06:54:02 -05:00
zuul 07a84b39fe Merge "Add text of cdr directory into README.md for ast-db-manage" into 14 2016-10-11 22:10:59 -05:00
zuul 357134fef1 Merge "audiohooks: Remove redundant codec translations when using audiohooks" into 14 2016-10-11 18:09:13 -05:00
zuul 615f911f2d Merge "vector: After remove element recheck index" into 14 2016-10-11 17:39:55 -05:00
Rodrigo Ramírez Norambuena bbbd43924f Add text of cdr directory into README.md for ast-db-manage
Change-Id: I68321c4bea50730c39fdb486e5f23aeadd1ad636
2016-10-11 17:07:07 -05:00
zuul 7a74c649a0 Merge "app_dial: Add the "Q" option to set the cause on unanswered channels" into 14 2016-10-11 15:36:58 -05:00
zuul dd6d6a55fe Merge "astobj2: Add backtrace to log_bad_ao2." into 14 2016-10-11 13:22:39 -05:00
George Joseph 90f8ba8800 app_dial: Add the "Q" option to set the cause on unanswered channels
The "Q" option will set the cause on the unanswered channels when
another channel answers.  It overrides the default of
ANSWERED_ELSEWHERE.

NOTE:  chan_sip does not support setting the cause on a CANCEL to
anything other than ANSWERED_ELSEWHERE.

ASTERISK-26446 #close

Change-Id: I71742e0919aaa16784c30a2b2e73fbeed7672e47
2016-10-11 12:05:48 -05:00
Joshua Colp 1da75f9f78 Merge "res_rtp_asterisk: Fix infinite DTMF issue when switching to P2P bridge" into 14 2016-10-11 07:32:02 -05:00
Alexander Traud ca1b197765 chan_sip: Support nat=auto_comedia or nat=force_rport,auto_comedia.
In the SIP channel driver chan_sip, auto_comedia was expected to be used in
tandem with auto_force_rport. Or stated differently: Only when auto_force_rport
was chosen (the default), auto_comedia worked. This change allows auto_comedia
to be set independently of the state of (auto_)force_rport. For example,
nat=force_rport,auto_comedia is useful for IPv4/IPv6 Dual Stack deployments
when IPv6 clients are behind a Firewall.

ASTERISK-26457 #close

Change-Id: Ib29d66c6dbb61648e371e01fc36c6978ddae5bc2
2016-10-11 07:09:03 -05:00
Badalyan Vyacheslav 012074d46b vector: After remove element recheck index
Small fix. It is necessary to double-check
the index that we just removed because there
is a new element.

ASTERISK-26453 #close

Change-Id: Ib947fa94dc91dcd9341f357f1084782c64434eb7
2016-10-11 06:43:27 -05:00
Joshua Colp 1347384b67 Merge "cel_odbc: Fix memory leak on module unload" into 14 2016-10-11 05:36:29 -05:00
zuul 2f4fa4f545 Merge "logger: Prevent output of verbose messages initiated from rasterisk." into 14 2016-10-10 22:43:23 -05:00
Torrey Searle e193217f1a res_rtp_asterisk: Fix infinite DTMF issue when switching to P2P bridge
If a bridge switched to P2P when a DTMF was in progress it
was possible for the DTMF to continue being sent indefinitely.

Change-Id: I7e2a3efe0d59d4b214ed50cd0b5d0317e2d92e29
2016-10-10 17:00:10 -05:00