Commit Graph

4443 Commits

Author SHA1 Message Date
Jenkins2 26e8de9453 Merge "coverity: Fix warnings in res_smdi" 2017-12-15 11:11:59 -06:00
Jenkins2 bcb4e6e608 Merge "res_musiconhold: Start playlist after initial announcement" 2017-12-15 10:31:21 -06:00
Jenkins2 dff0415b1e Merge "pjsip_options: wrongly applied "UNKNOWN" status" 2017-12-15 09:49:50 -06:00
Corey Farrell bf2d35931d aco: Minimize use of regex.
Remove nearly all use of regex from ACO users.  Still remaining:
* app_confbridge has a legitamate use of option name regex.
* ast_sorcery_object_fields_register is implemented with regex, all
  callers use simple prefix based regex.  I haven't decided the best
  way to fix this in both 13/15 and master.

Change-Id: Ib5ed478218d8a661ace4d2eaaea98b59a897974b
2017-12-15 10:14:31 -05:00
Corey Farrell 03c25a869f res_smdi: Fix shutdown ref.
When adding shutdown refs for OPTIONAL_API components I accidentally
added it to the unload_module function in res_smdi.  Move it to
load_module.

Change-Id: I2b9da38fbc11ef78ea23dbb2df92b684be7f647c
2017-12-15 08:56:13 -05:00
Sean Bright 9755eff46f res_hep: hepv3_is_loaded() should check if we are enabled
res_hep_pjsip.so and res_hep_rtcp.so will still load and do a lot of
unnecessary work even if 'enabled' is set to 'no' in hep.conf.

Change-Id: I3eddfeea09c6b5bc7c641952ee0ae487fd09b64b
2017-12-14 18:56:45 -06:00
Corey Farrell a8aa209901 res_clialiases: Fix completion pass-through.
Never ignore contents of line when generating completion options.

Change-Id: I74389efdfea154019d3b56a9f381610614c044c8
2017-12-14 16:27:45 -05:00
Jenkins2 a33207a91f Merge "res_pjsip_session: Reinvite using active stream topology if none requested." 2017-12-14 15:22:21 -06:00
Richard Mudgett 98f7e9251f res_rtp_asterisk.c: Disable packet flood detection for video streams.
We should not do flood detection on video RTP streams.  Video RTP streams
are very bursty by nature.  They send out a burst of packets to update the
video frame then wait for the next video frame update.  Really only audio
streams can be checked for flooding.  The others are either bursty or
don't have a set rate.

* Added code to selectively disable packet flood detection for video RTP
streams.

ASTERISK-27440

Change-Id: I78031491a6e75c2d4b1e9c2462dc498fe9880a70
2017-12-14 14:40:34 -06:00
George Joseph 283d2df680 res_pjsip_sdp_rtp: Add NULL check in add_crypto_to_stream
add_crypto_to_stream wasn't checking for a NULL
session->inv_session->neg before calling pjmedia_sdp_neg_get_state.
This was causing a crash if the negotiation hadn't already been
completed and asterisk was compiled with --enable-dev-mode.

Change-Id: I57c6229954a38145da9810fc18657bfcc4d9d0c9
2017-12-14 13:05:23 -07:00
Sean Bright c387beb456 res_musiconhold: Start playlist after initial announcement
Reset the samples counter to zero when we are done playing an
announcement so that we don't skip into the middle of the first file in
the playlist.

Also add the selected annoucement to the output of 'moh show classes.'

ASTERISK-24329 #close
Reported by: Thomas Frederiksen

Change-Id: I2a5f986a31279c981592f49391409ebf38d6f6d0
2017-12-14 12:17:19 -06:00
Sean Bright 7a8a187a56 coverity: Fix warnings in res_smdi
ASTERISK-19657 #close
Reported by: Matt Jordan III, Esq.

Change-Id: I59a5e6ef3e7d9e848bec1f4b40cb73321bc7956a
2017-12-14 10:52:25 -06:00
Kevin Harwell 30954337a0 Merge "pjsip_options: contacts sometimes not being updated on reload" 2017-12-13 16:50:56 -06:00
Jenkins2 588be919cb Merge "res_pjsip: Assign support levels to a few modules" 2017-12-13 15:33:41 -06:00
Jenkins2 8a281776d5 Merge "pjsip_options: dynamic contact's fields not updated on reload" 2017-12-13 14:27:52 -06:00
Joshua Colp c50905756b Merge "chan_pjsip/res_pjsip: Add CHANNEL(pjsip,request_uri)" 2017-12-13 11:21:15 -06:00
Joshua Colp 62f2860c39 AST-2017-012: Place single RTCP report block at beginning of report.
When the RTCP code was transitioned over to Stasis a code change
was made to keep track of how many reports are present. This count
controlled where report blocks were placed in the RTCP report.

If a compound RTCP packet was received this logic would incorrectly
place a report block in the wrong location resulting in a write
to an invalid location.

This change removes this counting logic and always places the report
block at the first position. If in the future multiple reports are
supported the logic can be extended but for now keeping a count
serves no purpose.

ASTERISK-27382
ASTERISK-27429

Change-Id: Iad6c8a9985c4b608ef493e19c421211615485116
2017-12-13 07:36:39 -06:00
Joshua Colp 3370cd21df res_pjsip_session: Reinvite using active stream topology if none requested.
When a connected line update is sent to an endpoint we do not request
a specific stream topology to be used. Previously this resulted in the
configured stream topology being used which may actually differ from the
currently negotiated topology. PJSIP is helpful in this regard in that
it will fill in any missing streams with removed ones. This results in
our own state not matching the SDP, though, and we do not apply the
negotiated SDP.

This change tweaks the code to use the actively negotiated stream
topology if it is present with a fallback to the configured one. This
results in the SDP and the state having matching information and the
world is happy.

ASTERISK*27397

Change-Id: I7a57117f0183479e6884b7bf3a53bb8c7464f604
2017-12-13 06:58:49 -06:00
Richard Mudgett 22810fc635 chan_pjsip/res_pjsip: Add CHANNEL(pjsip,request_uri)
This patch does three things associated with the initial incoming INVITE
request URI.

1) Add access to the full initial incoming INVITE request URI.

2) We were not setting DNID on incoming PJSIP channels.  The DNID is the
user portion of the initial incoming INVITE Request-URI.  The value is
accessed by reading CALLERID(dnid).

3) Fix CHANNEL(pjsip,target_uri) documentation.

* The initial incoming INVITE request URI is now available using
CHANNEL(pjsip,request_uri).

* Set the DNID on PJSIP channel creation so CALLERID(dnid) can return the
initial incoming INVITE request URI user portion.

* CHANNEL(pjsip,target_uri) now correctly documents that the target URI is
the contact URI.

* Refactored print_escaped_uri() out of channel_read_pjsip() to handle
pjsip_uri_print() error condition when the buffer is too small.

ASTERISK-27478

Change-Id: I512e60d1f162395c946451becb37af3333337b33
2017-12-12 13:46:42 -06:00
Sean Bright ec1f4bf48d res_pjsip: Add TLSv1.1 and TLSv1.2 support
Support for these protocols was added in the same commit as the 'proto'
field, so we can safely use the same ./configure check.

For reference: https://trac.pjsip.org/repos/changeset/4968

Change-Id: Icf4975d785d6bfb8f30ac7ffa695a0adf9382dac
2017-12-12 11:45:44 -06:00
Sean Bright 0b9d2135a9 res_pjsip: Assign support levels to a few modules
Change-Id: I51f6945c4023cb93fc7b87be5ab4c50e9e6ee27d
2017-12-12 11:07:33 -06:00
Kevin Harwell b088cddc03 pjsip_options: wrongly applied "UNKNOWN" status
A couple of places were setting the status to "UNKNOWN" when qualifies were
being disabled. Instead this should be set to the "CREATED" status that
represents when a contact is given (uri available), but the qualify frequency
is set to zero so we don't know the status.

This patch updates the relevant places with "CREATED". It also updates the
"CREATED" status description (value shown in CLI/AMI/ARI output) to a value
of "NonQualified"/"NonQual" as this description is hopefully less confusing.

ASTERISK-27467

Change-Id: Id67509d25df92a72eb3683720ad2a95a27b50c89
2017-12-11 15:27:29 -06:00
Jenkins2 b7e79d7baf Merge "astdb: Improve prefix searches in astdb" 2017-12-11 12:12:58 -06:00
Joshua Colp 5d43a4d4ff Merge "res_stasis and res_speech: Fix load order." 2017-12-11 11:12:25 -06:00
Jenkins2 710b3a29c3 Merge "utils: Add convenience function for setting fd flags" 2017-12-11 10:13:09 -06:00
Jenkins2 cd741136c5 Merge "pjsip: Improve CLI completion performance" 2017-12-11 09:36:54 -06:00
Sean Bright 521f741b04 pjsip: Improve CLI completion performance
Use the new ast_cli_completion_add() function to improve completion
performance for commands like 'pjsip show endpoint.'

Change-Id: I76d802294d2ac1766110dc75f7d117c8541ce348
2017-12-10 12:57:24 -06:00
Sean Bright 9a9edc6c9e astdb: Improve prefix searches in astdb
Using the LIKE operator requires a full table scan of 'astdb', whereas a
comparison operation is able to use the primary key index.

This patch adds a new function to the AstDB API for quick prefix matches
and updates res_sorcery_astdb to utilize it. This showed substantial
performance improvement in my test environment.

Related to ASTERISK~26806, but does not completely resolve it.

Change-Id: I7d37f9ba2aea139dabf2ca72d31fbe34bd9b2fa1
2017-12-10 12:51:16 -06:00
Sean Bright dbb376f166 pjsip_configuration: Add correct file header
Change-Id: I25348c386a222bb704aff07f54375108a6402906
2017-12-08 14:59:05 -06:00
Sean Bright 2ffe52a116 utils: Add convenience function for setting fd flags
There are many places in the code base where we ignore the return value
of fcntl() when getting/setting file descriptior flags. This patch
introduces a convenience function that allows setting or clearing file
descriptor flags and will also log an error on failure for later
analysis.

Change-Id: I8b81901e1b1bd537ca632567cdb408931c6eded7
2017-12-08 13:28:04 -06:00
Corey Farrell e2dbc26376 res_stasis and res_speech: Fix load order.
res_stasis was missing AST_MODFLAG_LOAD_ORDER.  Set res_stasis and
res_speech to start at (AST_MODPRI_APP_DEPEND - 1) so they are ready for
dependent modules.

Change-Id: I27f4f3810a95b6be8a5bfbf62be2ace6bfab6ff3
2017-12-07 19:39:04 -06:00
Kevin Harwell 0e4d31eb9c pjsip_options: contacts sometimes not being updated on reload
For both dynamic and static contacts it was possible that potential AOR
changes were not being applied to all contacts. This was because the qualify
and schedule code was only retrieving AOR's, and contacts with frequencies
greater than zero.

For instance the following could happen: and AOR/contact has a frequency of 5,
it then gets set to 0, and then a reload occurs. All scheduled OPTIONS are
stopped, a list of AOR's is retrieved with frequency > 0, but none are
selected since in this scenario all are 0. The contact for the one previously
set to 5 though does not get updated, so it's status remains "AVAILABLE".

This patch makes it so all contacts (static and dynamic) are selected, and
appropriately updated if need be.

ASTERISK-27467 #close

Change-Id: I7a920170f89c683af9505d4723a44fc6841decdb
2017-12-07 18:40:34 -06:00
Kevin Harwell bd2218ce63 pjsip_options: dynamic contact's fields not updated on reload
Dynamic contacts were not being properly updated on reload. As a matter of
fact any changes to the AOR that a dynamic contact was associated with were
not being applied.

On reload, this patch makes it so for each dynamic contact, the associated
AOR is now retrieved and the AOR's fields are applied to the contact.

ASTERISK-27467

Change-Id: I8e3165dc6a745218c1c9db837f77fafa0516985d
2017-12-07 18:38:23 -06:00
Joshua Colp 628a0af6de Merge "res_rtp_asterisk.c: Increase strictrtp learning timeout time." 2017-12-05 19:31:14 -06:00
Richard Mudgett 8536a09b86 security-events: Fix SuccessfulAuth using_password declaration.
The SuccessfulAuth using_password field was declared as a pointer to a
uint32_t when the field was later read as a uint32_t value.  This resulted
in unnecessary casts and a non-portable field value reinterpret in
main/security_events.c:add_json_object().  i.e., It would work on a 32 bit
architecture but not on a 64 bit big endian architecture.

Change-Id: Ia08bc797613a62f07e5473425f9ccd8d77c80935
2017-12-04 17:21:27 -06:00
Richard Mudgett ab63448fa6 res_rtp_asterisk.c: Increase strictrtp learning timeout time.
More complicated direct media reinvite negotiations can result in longer
delays before direct media flows.  The strictrtp learning timeout time
was too short.  One log showed that the first RTP packet came in just
after three seconds.

* Increase the strictrtp learning timeout time from 1.5 to 5 seconds.

ASTERISK-27453

Change-Id: Ic5e711164cbb91b4d1c1e40c83697755640f138c
2017-12-04 10:45:01 -06:00
Joshua Colp 892df22ccd res_http_post: Not all versions of gmime have GMIME_MAJOR_VERSION.
This change makes the presence of the GMIME_MAJOR_VERSION
definition optional, as not all versions of gmime actually
define it.

ASTERISK-27454

Change-Id: I01d99590045971ed6787899147170a5954077238
2017-12-01 06:08:42 -06:00
Joshua Colp 8bf1a5c46a Merge "res_ari: Fix inverted test giving wrong error message." 2017-11-27 17:24:24 -06:00
Jenkins2 a7227d6a19 Merge "res_rtp_asterisk.c: Fix rtp source address learning for broken clients" 2017-11-27 16:33:38 -06:00
Richard Mudgett 55c4d8e008 res_ari: Fix inverted test giving wrong error message.
The patch for ASTERISK_24560 inverted a test checking if the bridge name
is being updated to a different name.

* Fix the test to return "Changing bridge name is not implemented" when
someone attempts to change the bridge name.

ASTERISK-27445

Change-Id: I4b70bf08b0e02e016108b077ff75b345dec12fc9
2017-11-26 09:51:59 -06:00
Joshua Colp 16381e54e4 Merge "res_parking: Set load_pri more appropriately." 2017-11-23 12:06:32 -06:00
Joshua Colp 2a783b86d1 Merge "res_mwi_external_ami: Remove incorrect load priority." 2017-11-23 12:02:00 -06:00
Joshua Colp 509e713333 Merge "Loader: Remove unneeded load_pri declarations." 2017-11-23 11:15:19 -06:00
Alexander Traud 1a349d832d res_rtp_asterisk: ICE server-reflexive candidates (srflx) with Dual-Stack.
Previously, Asterisk sent srflx only when configured exclusively for IPv4. Now,
srflx is gathered and sent via SDP, even when Asterisk is enabled for
Dual Stack (IPv4+IPv6) and an IPv4 interface is available/used.

ASTERISK-27437

Change-Id: Ie07d8e2bfa7b6fe06fcdc73d390a7a9a4d8c0bc1
2017-11-22 03:06:45 -06:00
Corey Farrell 8e1506154f res_parking: Set load_pri more appropriately.
res_parking had an inplicit load_pri of 0 meaning it was one of the very
first modules loaded after modules with global symbols.  Set it to
AST_MODPRI_DEVSTATE_PROVIDER as it provides device state for parking
lots.

Change-Id: I297b6fb3ff6993ec004e667b22a74f5925906259
2017-11-21 15:26:49 -05:00
Joshua Colp a2caade298 Merge "res_pjsip: Use sorcery prefix operation for contact lookup" 2017-11-20 16:48:23 -06:00
Joshua Colp 7c3bf5af20 Merge "res_fax: Remove checks for unsigned values being >= 0." 2017-11-20 13:33:35 -06:00
Corey Farrell d6bbcec571 res_mwi_external_ami: Remove incorrect load priority.
res_mwi_external_ami specified AST_MODFLAG_LOAD_ORDER but didn't set
load_pri, resulting in an actual load priority of 0.  This module only
provides AMI actions so it has no reason to load early.

Change-Id: I82987fcf10d3ea42716b2f9df915b16687fd5839
2017-11-20 13:19:09 -06:00
Corey Farrell 58fa3885cc Loader: Remove unneeded load_pri declarations.
Instead of specifying AST_MODFLAG_LOAD_ORDER with load_pri
AST_MODPRI_DEFAULT just use AST_MODFLAG_DEFAULT.

Change-Id: I0123258eafce324249433a69df15a85cc16e509f
2017-11-20 13:17:55 -06:00
Joshua Colp c2d97a98b2 Merge "res_snmp: Declare RONLY if net-snmp headers do not." 2017-11-20 12:13:01 -06:00
Joshua Colp e6438dabd0 Merge "res_pjsip: Fix warning by deferring implicit type cast." 2017-11-20 09:44:12 -06:00
Corey Farrell 53f42cc052 res_pjsip: Fix warning by deferring implicit type cast.
Mac doesn't like the comparison of -1 to an enum, so store the result of
ast_sip_str_to_dtmf to an int so we can check for the negative return
value.  ast_sip_str_to_dtmf returns an int so this is only delaying the
implicit type cast.

Change-Id: I0c262c1719ee951aae1f437d733a301cf5f8ad29
2017-11-19 13:31:58 -06:00
Corey Farrell 83a2c4d2ae res_snmp: Declare RONLY if net-snmp headers do not.
Some net-snmp builds do not provide the RONLY declare, only
NETSNMP_OLDAPI_RONLY.  Map RONLY to NETSNMP_OLDAPI_RONLY to get around
this error.

Change-Id: Ida5c7ad9406515825485c4d3b4a34fd6ad0da577
2017-11-18 21:25:50 -05:00
Corey Farrell 5a899fc503 res_fax: Remove checks for unsigned values being >= 0.
It's impossible for gwtimeout or fdtimeout to be less than 0 because
they are unsigned int's.  Remove checks and unreachable branches.

Change-Id: Ib2286960621e6ee245e40013c84986143302bc78
2017-11-18 21:02:17 -05:00
Pirmin Walthert 0ca406c202 res_rtp_asterisk.c: Fix rtp source address learning for broken clients
Some clients do not send rtp packets every ptime ms. This can lead to
situations in which the rtp source learning algorithm will never learn
the address of the client. This has been discovered on a Mac mini with
a pjsip based softphone after updating to Sierra: as soon as USB
headsets are involved, the softphone will send the second packet 30ms
after the first, the third 30ms after the second and the fourth 1ms
after the third. So in the old implmentation the rtp source learning
algorithm was repeatedly reset on the fourth packet.

The patch changes the algorithm in a way that doesn't take the arrival
time between two consecutive packets into account but the time between
the first and the last packet of a learning sequence.

The patch also fixes a second problem: when a user was using a wrong
value for the probation setting there was a LOG_WARNING output stating
that the value had been set to the default value instead. However
the code for setting the value back to defaults was missing.

ASTERISK-27421 #close

Change-Id: If778fe07678a6fd2041eaca7cd78267d0ef4fc6c
2017-11-18 03:53:50 -05:00
Sean Bright 1b6e4c1175 res_pjsip: Use reasonable buffer lengths for endpoint identification
Domains themselves can be up to 255 characters long (per RFC 1035), so
our current buffer sizes are wholly inadequate for many use cases.

Change-Id: If3f30a68307f1365a1fe06bc4b854c62842c9292
2017-11-17 11:22:04 -05:00
Sean Bright 7a735d45e2 res_pjsip_transport_websocket: Give transport a meaningful description
We were not \0 terminating this string, so any attempt to print it would
in the best case show an empty string and in the worst case potentially
crash.

Change-Id: I63d96ef8f7516ac02a0f91e22dfa8acdc615042c
2017-11-16 17:29:11 -05:00
Sean Bright 6c53fb5d21 res_pjsip: Use sorcery prefix operation for contact lookup
This improves performance for registrations assuming that
res_config_astdb is not in use.

Change-Id: I86f37aa9ef07a4fe63448cb881bbadd996834bb1
2017-11-16 16:49:09 -05:00
Joshua Colp a5918d300b Merge "pjsip / hep: Provide correct local address for Websockets." 2017-11-16 11:53:53 -06:00
Joshua Colp 29e0add14f pjsip / hep: Provide correct local address for Websockets.
Previously for PJSIP the local address of WebSocket connections
was set to the remote address. For logging purposes this is
not particularly useful.

The WebSocket API has been extended to allow the local
address to be queried and this is used in PJSIP to set the
local address to the correct value.

The PJSIP HEP support has also been tweaked so that reliable
transports always use the local address on the transport
and do not try to (wrongly) guess. As they are connection
based it is impossible for the source to be anything else.

ASTERISK-26758
ASTERISK-27363

Change-Id: Icd305fd038ad755e2682ab2786e381f6bf29e8ca
2017-11-14 11:53:07 -05:00
Sean Bright ffccce76d9 sorcery: Add ast_sorcery_retrieve_by_prefix()
Some consumers of the sorcery API use ast_sorcery_retrieve_by_regex
only so that they can anchor the potential match as a prefix and not
because they truly need regular expressions.

Rather than using regular expressions for simple prefix lookups, add
a new operation - ast_sorcery_retrieve_by_prefix - that does them.

Change-Id: I56f4e20ba1154bd52281f995c27a429a854f6a79
2017-11-13 15:15:33 -05:00
Jenkins2 939b484553 Merge "res_pjsip_pubsub: Ensure remote URI contains URI only." 2017-11-13 07:11:57 -06:00
Kevin Harwell 5f5c3cfa6f Merge "res_pjsip_registrar.c: Fix AOR and pjproject group deadlock." 2017-11-09 11:48:34 -06:00
Joshua Colp f4d37e0d03 Merge "res_pjsip_pubsub: Fix multiple leaks on failure to append vectors." 2017-11-09 03:44:56 -06:00
Joshua Colp fa684ffb22 Merge "res_pjsip_history: Fix multiple leaks on vector append failure." 2017-11-09 03:44:37 -06:00
Joshua Colp d83d96dba6 Merge "res_pjsip_session: Fix multiple leaks." 2017-11-09 03:43:58 -06:00
Joshua Colp fe23c48081 Merge "res_pjsip_session: Check for errors from ast_stream_topology_set_stream." 2017-11-09 03:42:34 -06:00
Joshua Colp 65ced11206 Merge "res_pjsip_t38: Better error checking for t38_create_media_state." 2017-11-08 13:11:27 -06:00
George Joseph 9c024497e9 Merge "AST-2017-011 - res_pjsip_session: session leak when a call is rejected" 2017-11-08 09:45:24 -06:00
Joshua Colp 698ff5b4cb Merge "res_pjproject.c: Fix ast_strdup() alloc failure." 2017-11-08 07:38:45 -06:00
Kevin Harwell dd1a914495 AST-2017-011 - res_pjsip_session: session leak when a call is rejected
A previous commit made it so when an invite session transitioned into a
disconnected state destruction of the Asterisk pjsip session object was
postponed until either a transport error occurred or the event timer
expired. However, if a call was rejected (for instance a 488) before the
session was fully established the event timer may not have been initiated,
or it was canceled without triggering either of the session finalizing states
mentioned above.

Really the only time destruction of the session should be delayed is when a
BYE is being transacted. This is because it's possible in some cases for the
session to be disconnected, but the BYE is still transacting.

This patch makes it so the session object always gets released (no more
memory leak) when the pjsip session is in a disconnected state. Except when
the method is a BYE. Then it waits until a transport error occurs or an event
timeout.

ASTERISK-27345 #close

Reported by: Corey Farrell

Change-Id: I1e724737b758c20ac76d19d3611e3d2876ae10ed
2017-11-08 05:49:59 -07:00
Joshua Colp d91d0e992d Merge "res_stasis: Fix multiple leaks." 2017-11-08 04:58:12 -06:00
Corey Farrell 2c4db2a3d5 res_pjsip_pubsub: Fix multiple leaks on failure to append vectors.
Change-Id: I68ece0073ea79667ca41eb10405f516f1d30d482
2017-11-07 22:38:16 -05:00
Corey Farrell 48e96aba6a res_pjsip_history: Fix multiple leaks on vector append failure.
Change-Id: I41e8d5183ace284095cc721f3b1fb32ade3f940f
2017-11-07 22:31:12 -05:00
Corey Farrell ecb81ae4de res_pjsip_session: Fix multiple leaks.
* Pre-initialize cloned media state vectors to final size to ensure
  vector errors cannot happen later in the clone initialization.
* Release session_media on vector replace failure in
  ast_sip_session_media_state_add.
* Release clone and media_state in ast_sip_session_refresh if we fail to
  append to the stream topology, return an error.

Change-Id: Ib5ffc9b198683fa7e9bf166d74d30c1334c23acb
2017-11-07 22:23:59 -05:00
Jenkins2 0129e396b2 Merge "res_pjsip_outbound_registration: Fix leak on vector add failure." 2017-11-07 20:39:31 -06:00
Jenkins2 ca5bffb305 Merge "res_pjsip_exten_state: Check for vector append failure." 2017-11-07 20:06:27 -06:00
Jenkins2 ebd9e5c8c3 Merge "res_pjsip_config_wizard: Fix leaks and add check for malloc failure." 2017-11-07 19:41:46 -06:00
Jenkins2 13ffdfd96a Merge "res_stasis_playback: Check for failure to append vector." 2017-11-07 19:02:20 -06:00
Jenkins2 d6213397f0 Merge "res_pjsip: Fix leak on error in ast_sip_auth_vector_init." 2017-11-07 18:14:28 -06:00
Jenkins2 759f4c1125 Merge "res_ari_events: Fix use after free / double-free of JSON message." 2017-11-07 16:10:11 -06:00
Jenkins2 fdba5fce58 Merge "res_pjsip: Avoid crash when contact uri is empty string" 2017-11-07 12:08:44 -06:00
Richard Mudgett 0cfc3cbf02 res_pjsip_registrar.c: Fix AOR and pjproject group deadlock.
One of the patches for ASTERISK_27147 introduced a deadlock regression.
When the connection oriented transport shut down, the code attempted to
remove the associated contact.  However, that same transport had just
requested a registration that we hadn't responded to yet.  Depending
upon timing we could deadlock.

* Made send the REGISTER response after we completed processing the
request contacts and released the AOR lock to avoid the deadlock.

ASTERISK-27391

Change-Id: I89a90f87cb7a02facbafb44c75d8845f93417364
2017-11-07 13:01:25 -05:00
Corey Farrell eba1179795 res_pjsip_session: Check for errors from ast_stream_topology_set_stream.
Free memory and return error if ast_stream_topology_set_stream fails.

Change-Id: I9f4dbf44bed627243d2f1dd8aea2eab6c38a028d
2017-11-07 12:40:08 -05:00
Corey Farrell 4ac6dd4e95 res_pjsip_t38: Better error checking for t38_create_media_state.
Change-Id: I81b2587427c6982aa3e2a3f9ad69cce8d316eb10
2017-11-07 12:34:19 -05:00
Jenkins2 06746b0af5 Merge "res_pjsip: Ignore empty TLS configuration" 2017-11-07 11:05:13 -06:00
Corey Farrell 801094da7b res_stasis: Fix multiple leaks.
* res/stasis/app.c JSON passed to app_send needs to be released.
* res/stasis_message.c: objects leak if vector append fails.

Change-Id: I8dd5385b9f50a5cadf2b1d16efecffd6ddb4db4a
2017-11-07 11:24:48 -05:00
Joshua Colp a576d7c2e4 Merge "stasis/app.c: Optimize stasis_app_get_debug_by_name()" 2017-11-07 07:57:39 -06:00
Joshua Colp e7c52d1b61 Merge "Fix ast_(v)asprintf() malloc failure usage conditions." 2017-11-07 07:18:12 -06:00
Richard Mudgett 02329b9a34 res_pjproject.c: Fix ast_strdup() alloc failure.
Change-Id: I74688038e7afe3a279359cce53aadb28ade51ead
2017-11-07 08:11:32 -05:00
Aaron An a36d8cc533 res_pjsip: Avoid crash when contact uri is empty string
Asterisk will crash if contact uri is invalid, so contact_apply_handler
should check if the uri is NULL or empty.

ASTERISK-27393 #close
Reported-by: Aaron An
Tested-by: AaronAn

Change-Id: Ia0309bdc6b697c73c9c736e1caec910b77ca69f5
2017-11-07 08:01:08 -05:00
Corey Farrell 7ef38d399a res_pjsip_outbound_registration: Fix leak on vector add failure.
Change-Id: I774b88b3c9da41edd4dc8d78f095481f52f2bd46
2017-11-06 18:55:00 -05:00
Corey Farrell 8684219f79 res_pjsip_exten_state: Check for vector append failure.
Release reference to publisher if we fail to add it to the vector.

Change-Id: I64dff3f481b67b9884f37cadba7a5ccf23d084f3
2017-11-06 18:48:06 -05:00
Corey Farrell f899368cd6 res_pjsip_config_wizard: Fix leaks and add check for malloc failure.
wizard_apply_handler():
- Free host if we fail to add it to the vector.

wizard_mapped_observer():
- Check for otw allocation failure.
- Free otw if we fail to add it to the vector.

Change-Id: Ib5d3bcabbd9c24dd8a3c9cc692a794a5f60243ad
2017-11-06 18:44:01 -05:00
Corey Farrell 4016884ef3 res_stasis_playback: Check for failure to append vector.
Free resources and return error if we fail to append the vector in
stasis_app_control_play_uri.

Change-Id: I22c4a90dd859b253f2850c6511de48b25609422b
2017-11-06 18:38:35 -05:00
Corey Farrell 29205e7adc res_pjsip: Fix leak on error in ast_sip_auth_vector_init.
Change-Id: Ib0fc7a18f3135ca8990c3984c9e15f6d26e556e8
2017-11-06 18:28:35 -05:00
Corey Farrell 70fcc043bb res_pjproject: Handle error from adding to the buildopts vector.
Change-Id: I076c7bd207c7989a23005395ce1735392657be65
2017-11-06 18:17:13 -05:00
Corey Farrell 5247ba4b88 res_ari_events: Fix use after free / double-free of JSON message.
When stasis_app_message_handler needs to queue a message for a later
connection it needs to bump the message reference so it doesn't get
freed when the caller releases it's reference.

Change-Id: I82696df8fe723b3365c15c3f7089501da8daa892
2017-11-06 18:11:08 -05:00
Joshua Colp 637b37fb98 Merge "dtls: Add support for ephemeral DTLS certificates." 2017-11-06 12:22:38 -06:00
Joshua Colp 36fedea8c1 res_pjsip_pubsub: Ensure remote URI contains URI only.
This change makes it so that any user of the pubsub
API that requests the remote URI receives only the URI.
Previously the entire string was returned, which could
contain a display name.

ASTERISK-27290

Change-Id: If1d0cd6630f0a264856d31d2a67933109187a017
2017-11-06 13:02:43 -05:00