Commit graph

32160 commits

Author SHA1 Message Date
Friendly Automation
e5ee1b04c9 Merge "res_musiconhold: Use a vector instead of custom array allocation" 2019-08-06 10:27:16 -05:00
George Joseph
97fd008562 Merge "main/udptl.c: correctly handle udptl sequence wrap around" 2019-08-06 09:48:01 -05:00
Sean Bright
1f8ae708a0 res_musiconhold: Use a vector instead of custom array allocation
Change-Id: Ic476a56608b1820ca93dcf68d10cd76fc0b94141
2019-08-01 13:44:24 -06:00
Joshua Colp
86452c9fa4 res_pjsip: Fix multiple of the same contact in "pjsip show contacts".
The code for gathering contacts could result in the same contact
being retrieved and added to the list multiple times. The container
which stores the contacts to display will now only allow a contact
to be added to it once instead of multiple times.

ASTERISK-28228

Change-Id: I805185cfcec03340f57d2b9e6cc43c49401812df
2019-08-01 04:12:00 -06:00
Friendly Automation
4018e88369 Merge "res_musiconhold: Use ast_pipe_nonblock() wrapper" 2019-07-31 08:09:29 -05:00
Friendly Automation
ae2ddaa496 Merge "manager: Send fewer packets" 2019-07-31 07:29:00 -05:00
Torrey Searle
084901d548 main/udptl.c: correctly handle udptl sequence wrap around
incorrect handling of UDPTL squence number wrap arounds causes
loss of packets every time the wrap around occurs

ASTERISK-28483 #close

Change-Id: I33caeb2bf13c574a1ebb81714b58907091d64234
2019-07-30 10:10:16 -06:00
Friendly Automation
f983b80605 Merge "loader.c: Fix possible SEGV when a module fails to register" 2019-07-30 07:53:23 -05:00
Sean Bright
5f66fb5139 manager: Send fewer packets
The functions that build manager message headers do so in a way that
results in a single messages being split across multiple packets. While
this doesn't matter to the remote end, it makes network captures noisier
and harder to follow, and also means additional system calls.

With this patch, we build up more of the message content into the TLS
buffer before flushing to the network. This change is completely
internal to the manager code and does not affect any of the existing
API's consumers.

Change-Id: I50128b0769060ca5272dbbb5e60242d131eaddf9
2019-07-29 12:09:56 -06:00
Asterisk Development Team
5e6e1175d5 Update CHANGES and UPGRADE.txt for 17.0.0 2019-07-29 11:38:30 -05:00
George Joseph
8d10028b98 Update master for Asterisk 18
Change-Id: I8b8ed97001446fab0c14d7c89391ee572fb29dd6
2019-07-29 10:04:48 -06:00
Sean Bright
7ce9ee7f2e res_musiconhold: Use ast_pipe_nonblock() wrapper
Change-Id: Ib0a4b41e5ececbe633079e2d8c2b66c031d2d1f2
2019-07-29 09:04:44 -06:00
George Joseph
8e44d823c1 loader.c: Fix possible SEGV when a module fails to register
When a module fails to register itself (usually a coding error
in the module), dlerror() can return NULL.  We weren't checking
for that in load_dlopen() before trying to strdup the error message
so a SEGV was thrown.  dlerror() is now surrounded with an S_OR
so we don't SEGV.

Change-Id: Ie0fb9316f08a321434f3f85aecf3c7d2ede8b956
2019-07-29 07:39:38 -06:00
George Joseph
32642b83ea Merge "contrib/scripts: Make spandspflow2pcap.py Python 2.7+/3.3+ compatible" 2019-07-26 12:03:04 -05:00
George Joseph
dd80db10a9 Merge "CI: Don't enable non-core modules in Certified branches" 2019-07-26 09:47:18 -05:00
George Joseph
03813e51f0 CI: Don't enable non-core modules in Certified branches
We don't support non-core modules for Certified releases but we
were enabling them for CI builds which was causing lots of test
failures.  Now we don't.

Change-Id: I0b3254c08a2479f3d39151690350cce5ce5ad766
2019-07-24 14:24:06 -06:00
Sean Bright
2424ecaf66 res_config_sqlite3: Only join threads that we started
ASTERISK-28477 #close
Reported by: Dennis

ASTERISK-28478 #close
Reported by: Dennis

Change-Id: I77347ad46a86dc5b35ed68270cee56acefb4f475
2019-07-24 04:51:43 -06:00
Friendly Automation
7646f4196b Merge "openr2(6/6): Set hangup cause" 2019-07-23 19:32:57 -05:00
George Joseph
96a2ce1a0d Merge "openr2(5/6): added cli command -- mfcr2 destroy link <index>" 2019-07-23 18:43:00 -05:00
George Joseph
64b6d0fc28 Merge "openr2(4/6): added new cli command -- mfcr2 show links" 2019-07-23 17:28:59 -05:00
Friendly Automation
d24d94beba Merge "openr2(3/6): Convert r2links to standard Asterisk AST_LIST*" 2019-07-23 15:26:30 -05:00
George Joseph
8c3ed46829 Merge "openr2(2/6): Stop polling channels when DAHDI returns -ENODEV (e.g: plug-out)" 2019-07-23 14:26:00 -05:00
George Joseph
497308b5d9 Merge "openr2(1/6): bugfix in configuration saving" 2019-07-23 13:02:42 -05:00
George Joseph
799c4cf494 Merge "chan_pjsip: Transmit REFER waits for the REFER result setting TRANSFERSTATUS" 2019-07-23 09:18:42 -05:00
Leonid Fainshtein
098797628e openr2(6/6): Set hangup cause
Change-Id: I94dc38920e6e77cc73062648f62fdd613d0d1452
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
2019-07-22 21:11:12 +03:00
Tzafrir Cohen
f67094503d openr2(5/6): added cli command -- mfcr2 destroy link <index>
Change-Id: I452d6a853bcd8c6e194455b19e5e017713e9c0fe
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
2019-07-22 21:11:12 +03:00
Tzafrir Cohen
64bf3e3e82 openr2(4/6): added new cli command -- mfcr2 show links
* This command show the MFC/R2 links

Change-Id: I213822e1b7ef9c05bd89a2ba62df8e0856ce9f84
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
2019-07-22 21:11:12 +03:00
Tzafrir Cohen
f61adf2cf5 openr2(3/6): Convert r2links to standard Asterisk AST_LIST*
Change-Id: Ibcb2401515a58782a1488c0b9efbed201c3f3a17
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
2019-07-22 21:11:12 +03:00
Tzafrir Cohen
97d2549bb1 openr2(2/6): Stop polling channels when DAHDI returns -ENODEV (e.g: plug-out)
Otherwise, OpenR2 threads go crazy and consume almost all CPU resources

Change-Id: I10a41f617613fe7399c5bdced5c64a2751173f28
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
2019-07-22 21:11:12 +03:00
Tzafrir Cohen
2f0a8e12f9 openr2(1/6): bugfix in configuration saving
Details:
  - The memcpy() call copied part of "dahdi_conf" and not "dahdi_conf.mfcr2"
  - As a result, the memcmp() in dahdi_r2_get_link() always fails
  - This cause dahdi_r2_get_link() to create new link for every channel
    (instead of a new link for every ~30 channels)
  - With the fix, far less links are generated -- so we use far less threads

Change-Id: I7259dd6272f5e46e8a6c7f5bf3e8c2ec01b8c132
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
2019-07-22 21:11:12 +03:00
Walter Doekes
4304c6534a
contrib/scripts: Make spandspflow2pcap.py Python 2.7+/3.3+ compatible
Change-Id: Ica182a891743017ff3cda16de3d95335fffd9a91
2019-07-22 17:43:48 +02:00
George Joseph
be8d41bd24 CI: Add cleanWs to cleanup steps in jenkinsfiles
We're at the point where there are enough Jenkins jobs for
Asterisk branches than even cleaned checkouts of Asterisk
will add up to more disk space than is available on the
in-memory workspace mount.  Since we archive all relevent
artifacts anyway, there's no need to keep the workspace
around after the job finishes, whether it succeeds or fails.

Change-Id: I1cd3b73ebb045a987df0f62526d152a510210c39
2019-07-19 10:25:03 -06:00
George Joseph
2ba7d3c2b9 Merge "CI: Add install-headers to the install make targets" 2019-07-19 11:04:50 -05:00
George Joseph
960e6dd065 Merge "README.md: Update year" 2019-07-19 09:48:27 -05:00
George Joseph
5167555f8e Merge "sched: Don't allow ast_sched_del to deadlock ast_sched_runq from same thread" 2019-07-19 08:46:21 -05:00
George Joseph
8b88994b18 CI: Add install-headers to the install make targets
The testsuite actually needs the headers installed to run
it's self_test.

Change-Id: Ice41d331131b876ad4a9c056085fe6aac34b32b2
2019-07-19 07:38:39 -06:00
George Joseph
b565fd9cf8 Merge "Build: Separate header install/uninstall" 2019-07-19 07:54:28 -05:00
Joshua Colp
54c1645c29 Merge "manager: Log AMI actions" 2019-07-19 07:42:07 -05:00
Walter Doekes
3c6f11992b sched: Don't allow ast_sched_del to deadlock ast_sched_runq from same thread
When fixing ASTERISK~24212, a change was done so a scheduled callback could not
be removed while it was running. The caller of ast_sched_del would have to wait.

However, when the caller of ast_sched_del is the callback itself (however wrong
this might be), this new check would cause a deadlock: it would wait forever
for itself.

This changeset introduces an additional check: if ast_sched_del is called
by the callback itself, it is immediately rejected (along with an ERROR log and
a backtrace). Additionally, the AST_SCHED_DEL_UNREF macro is adjusted so the
after-ast_sched_del-refcall function is only run if ast_sched_del returned
success.

This should fix the following spurious race condition found in chan_sip:
- thread 1: schedule sip_poke_peer_now (using AST_SCHED_REPLACE)
- thread 2: run sip_poke_peer_now
- thread 2: blank out sched-ID (too soon!)
- thread 1: set sched-ID (too late!)
- thread 2: try to delete the currently running sched-ID

After this fix, an ERROR would be logged, but no deadlocks (in do_monitor) nor
excess calls to sip_unref_peer(peer) (causing double frees of rtp_instances and
other madness) should occur.

(Thanks Richard Mudgett for reviewing/improving this "scary" change.)

Note that this change does not fix the observed race condition: unlocked
access to peer->pokeexpire (and potentially other scheduled items in chan_sip),
causing AST_SCHED_DEL_UNREF to look at a changing id. But it will make the
deadlock go away. And in the observed case, it will not have adverse affects
(like memory leaks) because the scheduled item is removed through a different
path.

ASTERISK-28282

Change-Id: Ic26777fa0732725e6ca7010df17af77a012aa856
2019-07-18 01:22:55 -06:00
George Joseph
c781806e26 Build: Separate header install/uninstall
Asterisk headers are no longer installed and uninstalled
automatically when performing a "make install" or a
"make uninstall".  To install/uninstall the headers, use
"make install-headers" and "make uninstall-headers".
The headers also continue to be uninstalled when performing a
"make uninstall-all".

Also corrects an issue where /usr/include/asterisk.h was never
being removed at all.

Change-Id: Ia7399f3a0203a4825fc4a9f43b9034dae9a2b643
2019-07-16 08:17:36 -06:00
Kevin Harwell
ba25038fd5 manager: Log AMI actions
When manager debugging is turned on, this patch makes it so incoming AMI actions
are now also logged.

Change-Id: I8047524510e7ac97d99482b2448f8e368f29cd47
2019-07-15 11:10:41 -05:00
Joshua Colp
2feac1d361 res_rtp_asterisk: Move where DTLS MTU variable is defined.
The DTLS MTU variable is not dependent on pjproject and should
not exist in its block.

Change-Id: I7e97d64dc192f2ac81bfe2b72b8229d321c7d026
2019-07-14 12:27:13 -06:00
Kevin Harwell
d8c207427d Merge "app_voicemail: Remove dependency on the stasis cache" 2019-07-12 09:21:15 -05:00
Kevin Harwell
857ee76f4b Merge "MWI: Update modules that subscribe to MWI to use new API calls" 2019-07-12 09:19:18 -05:00
Kevin Harwell
03cc8d16a3 Merge "mwi: Update the MWI core to use stasis_state API" 2019-07-12 09:18:15 -05:00
Kevin Harwell
49d4bd5c78 Merge "stasis_state: Make unsubscribes NULL tolerant" 2019-07-12 09:17:55 -05:00
Friendly Automation
7f76479b7f Merge "chan_sip: Handle invalid SDP answer to T.38 re-invite" 2019-07-11 16:35:03 -05:00
George Joseph
3c520147e1 res_pjsip_messaging: Check for body in in-dialog message
We now check that a body exists and it has a length > 0 before
attempting to process it.

ASTERISK-28447
Reported-by: Gil Richard

Change-Id: Ic469544b22ab848734636588d4c93426cc6f4b1f
2019-07-11 11:40:04 -05:00
Francesco Castellano
8438d19b81 chan_sip: Handle invalid SDP answer to T.38 re-invite
The chan_sip module performs a T.38 re-invite using a single media
stream of udptl, and expects the SDP answer to be the same.

If an SDP answer is received instead that contains an additional
media stream with no joint codec a crash will occur as the code
assumes that at least one joint codec will exist in this
scenario.

This change removes this assumption.

ASTERISK-28465

Change-Id: I8b02845b53344c6babe867a3f0a5231045c7ac87
2019-07-11 11:16:37 -05:00
Kevin Harwell
c93c579190 app_voicemail: Remove dependency on the stasis cache
app_voicemail utilized the stasis cache when polling mailboxes for MWI. This
caused a memory leak (items were not being appropriately removed from the
cache), and subsequent slowdown in system processing. This patch removes the
stasis cache dependency, thus alleviating the memory leak. It does this by
utilizing the new MWI API that better manages state lifetime.

ASTERISK-28443
ASTERISK-27121

Change-Id: Ie89fedaca81ea1fd03d150d9d3a1ef3d53740e46
2019-07-09 09:36:26 -05:00