Commit Graph

5838 Commits

Author SHA1 Message Date
Richard Mudgett 2ca3dbb197 codec.c: Defensively check the returned samples.
Earlier versions of the codec_opus samples_count callback can return
negative error values on undecodable frames.  This resulted in a divide by
zero exception.

* Added a defensive check in ast_codec_samples_count() for a "negative"
samples count return value.  Log the event and set the count to zero.

ASTERISK-27194

Change-Id: Icf69350307ecbbc80a3d74de46af9bd80ea17819
2017-10-26 11:48:20 -05:00
Joshua Colp 4f2717bab0 Merge "Single API for ast_store_lock_info and ast_remove_lock_info." 2017-10-25 18:09:16 -05:00
Ben Ford 3821be1c68 http.c: Fix http header send content.
Currently ast_http_send barricades a portion of the content that
needs to be sent in order to establish a connection for things
like the ARI client. The conditional and contents have been changed
to ensure that everything that needs to be sent, will be sent.

ASTERISK-27372

Change-Id: I8816d2d8f80f4fefc6dcae4b5fdfc97f1e46496d
2017-10-25 10:36:21 -05:00
Joshua Colp 61aeeb6d52 Merge "hashtab: Use ast_free." 2017-10-25 07:34:23 -05:00
Corey Farrell 569e9a8391 Single API for ast_store_lock_info and ast_remove_lock_info.
This makes the 'bt' parameter unconditional for ast_store_lock_info and
ast_remove_lock_info.  The 'bt' parameter is unused when HAVE_BKTR is
undefined.

Change-Id: Ieced0e920928b735a39c3b5952b806c473d67453
2017-10-24 16:11:39 -04:00
Corey Farrell 841ac3ded6 hashtab: Use ast_free.
A few places in hashtab use free instead of ast_free, remove declaration
of ASTMM_LIBC from hashtab.c as it's no longer needed.

Change-Id: I2ff089bad71640c03c3ce97f1b00fc962ef79427
2017-10-23 20:25:19 -04:00
Corey Farrell ee21076151 main/Makefile: Remove rule for non-existant testexpr2.
Change-Id: Ibb3e47f27a395d74d8c5263db015b05434f5969b
2017-10-23 13:46:11 -05:00
Richard Mudgett 73164d0d7f cdr.c: Rename the Party A CDR container.
* Rename the Party A CDR container from active_cdrs_by_channel to
active_cdrs_master.

* Renamed the support functions associated with active_cdrs_master
appropriately.

ASTERISK-27335

Change-Id: I6104bb3edc3a0b7243ce502e45e8832b0cff14f7
2017-10-16 12:26:17 -05:00
Richard Mudgett fe1120cf88 cdr.c: Add container to key off of Party B channel names.
The CDR performance gets worse the further it gets behind in processing
stasis messages.  One of the reasons is because of a n*m loop used when
processing Party B information.

* Added a new CDR container that is keyed to Party B so we don't need such
a large loop when processing Party B information.

NOTE: To reduce the size of the patch I deferred to another patch the
renaming of the Party A active_cdrs_by_channel container to
active_cdrs_master and renaming the container's hash and cmp functions
appropriately.

ASTERISK-27335

Change-Id: I0bf66e8868f8adaa4b5dcf9e682e34951c350249
2017-10-16 12:26:17 -05:00
Jenkins2 3a2b132411 Merge "declare optional openssl dependencies in moduleinfo" 2017-10-16 09:19:56 -05:00
Joshua Colp 975d07248d Merge "cdr.c: Eliminated many calls to ao2_global_obj_ref()." 2017-10-16 05:45:11 -05:00
Joshua Colp 87123c90b2 Merge "cdr.c: Defer getting ao2_global_obj_ref() until needed." 2017-10-16 05:45:01 -05:00
Jenkins2 e08ac95e49 Merge "ast_bt_get_symbols: Prevent double-free." 2017-10-15 14:52:57 -05:00
Joshua Colp 8c09eeabce Merge "tcptls: NULL-check the parameter of ast_ssl_teardown before accessing it." 2017-10-15 14:29:39 -05:00
Jenkins2 89796eaef2 Merge "cdr.c: Set stringfields only if they are different." 2017-10-13 17:42:49 -05:00
Kevin Harwell 85bdfe2df7 Merge "cdr.c: Fix setting dnid, callingsubaddr, and calledsubaddr" 2017-10-13 17:11:53 -05:00
Corey Farrell ee65d5ac7c ast_bt_get_symbols: Prevent double-free.
It's possible for bfdobj to be created but syms not created.  If syms
was not allocated in the current loop iteration but was allocated in the
previous iteration it would crash.

ASTERISK-27340

Change-Id: I5b110c609f6dfe91339f782a99a431bca5837363
2017-10-13 10:33:04 -05:00
Alexander Traud 44d9446eb5 tcptls: NULL-check the parameter of ast_ssl_teardown before accessing it.
This avoids a crash on stopping a chan_sip which failed to start its TLS server.

ASTERISK-27339 #close

Change-Id: I327fc70db68eaaca5b50a15c7fd687fde79263d5
2017-10-13 15:12:07 +02:00
Richard Mudgett f369be21a8 cdr.c: Eliminated many calls to ao2_global_obj_ref().
The CDR performance gets worse the further it gets behind in processing
stasis messages.  One of the reasons is we were getting the global config
to determine if we needed to log a debugging message.

* Many calls to ao2_global_obj_ref() were just so we could determine if
debug mode is enabled.  Made a global flag to check instead.

* Eliminated many RAII_VAR() usages associated with the remaining
ao2_global_obj_ref() calls.

* Added missing NULL checks for the returned ao2_global_obj_ref() value.

ASTERISK-27335

Change-Id: Iceaad93172862f610cad0188956634187bfcc7cd
2017-10-12 19:12:07 -05:00
Richard Mudgett 2eea087401 cdr.c: Defer getting ao2_global_obj_ref() until needed.
The CDR performance gets worse the further it gets behind in processing
stasis messages.  One of the reasons is we were getting the global config
even if we didn't need it.

* Most uses of the global config were only needed on off nominal code
paths so it makes sense to not get it until absolutely needed.

ASTERISK-27335

Change-Id: I00c63b7ec233e5bfffd5d976f05568613d3c2365
2017-10-12 19:12:07 -05:00
Richard Mudgett 7c7a917874 cdr.c: Set stringfields only if they are different.
The CDR performance gets worse the further it gets behind in processing
stasis messages.  One of the reasons is we were repeatedly setting string
fields to potentially the same string in base_process_party_a().  Setting
a string field involves allocating room for the new string out of a memory
pool which may have to allocate even more memory.

* Check to see if the string field is already set to the desired string.

ASTERISK-27335

Change-Id: I3ccb7e23f1488417e08cafe477755033eed65a7c
2017-10-12 19:12:07 -05:00
Richard Mudgett c80c8f2ab9 cdr.c: Fix setting dnid, callingsubaddr, and calledsubaddr
The string comparisons for setting these CDR variables was inverted.  We
were repeatedly setting these CDR variables only if the channel snapshots
had the same value.

ASTERISK-27335

Change-Id: I9482073524411e7ea6c03805b16de200cb1669ea
2017-10-12 19:12:07 -05:00
Thomas Sevestre 21c0283b78 features, manager : Add CancelAtxfer AMI action
Add action to cancel feature attended transfer with AMI interface

ASTERISK-27215 #close

Change-Id: Iab8a81362b5a1757e2608f70b014ef863200cb42
2017-10-12 13:31:34 -05:00
Jenkins2 6058b1ef3e Merge "sorcery: Use ao2_weakproxy to hold list of instances." 2017-10-12 11:25:12 -05:00
Jenkins2 0b1b5849ce Merge "named_locks: Use ao2_weakproxy_find." 2017-10-12 10:16:45 -05:00
Jenkins2 b94f2343a6 Merge "astobj2: Add ao2_weakproxy_find function." 2017-10-12 09:26:29 -05:00
Jenkins2 3affeac39d Merge "astobj2: Run weakproxy callbacks outside of lock." 2017-10-12 09:02:47 -05:00
Richard Mudgett e5b9eb0460 cdr.c: Defer misc checks.
Try to defer some checks until needed in case there is an early exit.

Change-Id: Ibc6b34c38a4f60ad4f9b67984b7d070a07257064
2017-10-11 13:28:51 -05:00
Corey Farrell b8dadccbe1 sorcery: Use ao2_weakproxy to hold list of instances.
* Store weak proxy objects in instances container.
* Remove special unreference function and replace with macro that calls
ao2_cleanup.
* Add REF_DEBUG information to ast_sorcery_open.

Change-Id: I5a150a4e13cee319d46b5a4654f95a4623a978f8
2017-10-10 20:47:49 -04:00
Corey Farrell 7774623804 named_locks: Use ao2_weakproxy_find.
Change-Id: I0ce8a1b7101b6caac6a19f83a89f00eaba1e9d9c
2017-10-10 20:15:31 -04:00
Corey Farrell b058f8673a astobj2: Add ao2_weakproxy_find function.
This function finds a weak proxy in an ao2_container and returns the
real object associated with it.

Change-Id: I9da822049747275f5961b5c0a7f14e87157d65d8
2017-10-10 20:15:25 -04:00
Corey Farrell fd3101e8ad astobj2: Run weakproxy callbacks outside of lock.
Copy the list of weakproxy callbacks to temporary memory so they can be
run without holding the weakproxy lock.

Change-Id: Ib167622a8a0f873fd73938f7611b2a5914308047
2017-10-10 18:23:00 -04:00
Richard Mudgett b0408d05c0 cdr.c: Eliminated simple RAII_VAR usages.
Change-Id: I150505db307249a962987e7b941bdd369bb91f35
2017-10-10 09:59:30 -05:00
Joshua Colp 49e6356620 Merge "tcptls: Do not re-bind to wildcard on client creation." 2017-10-10 07:53:04 -05:00
Tzafrir Cohen b228f5c5e6 declare optional openssl dependencies in moduleinfo
Declare optional openssl dependencies in:
* res_rtp_asterisk.c
* tcptls.c

ASTERISK-27328 #close

Change-Id: I2636f1c05b8104b4fe6f36cce0ebd9a98b9c78ab
2017-10-10 15:42:46 +03:00
Jenkins2 7d9fa0bea4 Merge "cdr.c: Replace redundant check with an ast_assert()" 2017-10-09 20:04:33 -05:00
Jenkins2 7002705940 Merge "cdr.h: Fix doxygen comments." 2017-10-09 19:01:19 -05:00
Joshua Colp 37297d2c0e Merge "cdr.c: Use current ao2 flag names" 2017-10-09 18:08:26 -05:00
Richard Mudgett fdf9aacca3 cdr.c: Replace redundant check with an ast_assert()
The only caller of cdr_object_fn_table.process_party_b() explicitly does
the check before calling.

Change-Id: Ib0c53cdf5048227842846e0df9d2c19117c45618
2017-10-09 13:34:32 -05:00
Richard Mudgett 2e4b5fadbd cdr.c: Replace inlined code with ao2_t_replace()
Change-Id: I9f424f5282ca7d833592f958d95f1b2bafb549b0
2017-10-09 13:30:16 -05:00
Richard Mudgett 62980eedc3 cdr.c: Use current ao2 flag names
Change-Id: Ib59d7d2f2a4a822754628f2c48a308d6791a6e6e
2017-10-09 13:28:04 -05:00
Richard Mudgett e769846f11 cdr.h: Fix doxygen comments.
* Also some misc formatting in cdr.c.

Change-Id: Ied89a28802a662c37c43326a1aafdce596e0df4a
2017-10-09 13:25:45 -05:00
Alexander Traud feeb0974eb tcptls: Do not re-bind to wildcard on client creation.
Since ASTERISK-26922, this issue affected only those chan_sip which were
* enabled for dual-stack (bindaddr=::), and
* enabled for TCP (tcpenable=yes) and/or TLS (tlsenable=yes), and
* tried to register and/or invite a IPv4-only service,
* via TCP and/or TLS.
Now, ast_tcptls_client_create does not re-bind to [::] anymore.

ASTERISK-27324 #close

Change-Id: I4b242837bdeb1ec7130dc82505c6180a946fd9b5
2017-10-08 16:11:10 +02:00
Corey Farrell 0f3e725503 main/strings: Fix uninitialized value.
ast_strings_match uses sscanf and checks for non-zero return to verify a
token was parsed. This is incorrect as sscanf returns EOF (-1) for errors.

ASTERISK-27318 #close

Change-Id: Ifcece92605f58116eff24c5a0a3b0ee08b3c87b1
2017-10-05 21:23:31 -04:00
Richard Mudgett 80097676e7 heap.c: No need to calloc heap pointer array.
Change-Id: I5ae2f316229f336eb90d99c7af7ed07a33097e68
2017-09-28 15:49:50 -05:00
Richard Mudgett 08e67f814b channel.c: Fix invalid reference in conditionaled out code.
ASTERISK-27289

Change-Id: I7a415948116493050614d9f4fa91ffbe0c21ec4c
2017-09-25 11:22:16 -05:00
Joshua Colp f77a2367e7 Merge "bridge: Change participant SFU streams when source streams change." 2017-09-21 15:56:47 -05:00
Joshua Colp 357a2f353b Merge "res_pjsip_session: Check for removed stream state." 2017-09-21 12:30:18 -05:00
Joshua Colp f2985e3106 bridge: Change participant SFU streams when source streams change.
Some endpoints do not like a stream being reused for a new
media stream. The frame/jitterbuffer can rely on underlying
attributes of the media stream in order to order the packets.
When a new stream takes its place without any notice the
buffer can get confused and the media ends up getting dropped.

This change uses the SSRC change to determine that a new source
is reusing an existing stream and then bridge_softmix renegotiates
each participant such that they see a new media stream. This
causes the frame/jitterbuffer to start fresh and work as expected.

ASTERISK-27277

Change-Id: I30ccbdba16ca073d7f31e0e59ab778c153afae07
2017-09-21 12:20:02 -05:00
Ben Ford e666051d79 res_pjsip_session: Check for removed stream state.
When a sip session is refreshed, the stream topology is looped
through, checking each stream for compatible formats. This would
cause a crash if the stream state was AST_STREAM_STATE_REMOVED,
since the formats would never be set for this stream, causing
a NULL value to be returned from ast_stream_get_formats. This
commit adds a check for streams with removed states.

Also removed a stray semicolon.

Change-Id: Ic86f8b65a4a26a60885b28b8b1a0b22e1b471d42
2017-09-20 12:14:45 -05:00