]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
7 years agoAST-2018-008: Fix enumeration of endpoints from ACL rejected addresses. certified/13.18
Richard Mudgett [Mon, 30 Apr 2018 22:38:58 +0000 (17:38 -0500)] 
AST-2018-008: Fix enumeration of endpoints from ACL rejected addresses.

When endpoint specific ACL rules block a SIP request they respond with a
403 forbidden.  However, if an endpoint is not identified then a 401
unauthorized response is sent.  This vulnerability just discloses which
requests hit a defined endpoint.  The ACL rules cannot be bypassed to gain
access to the disclosed endpoints.

* Made endpoint specific ACL rules now respond with a 401 unauthorized
which is the same as if an endpoint were not identified.  The fix is
accomplished by replacing the found endpoint with the artificial endpoint
which always fails authentication.

ASTERISK-27818

Change-Id: Icb275a54ff8e2df6c671a6d9bda37b5d732b3b32

7 years agotranslate: generic plc not filled in after translation
Kevin Harwell [Wed, 18 Apr 2018 20:59:38 +0000 (15:59 -0500)] 
translate: generic plc not filled in after translation

If during translation a codec could not handle a given frame the translation
core would return NULL, thus not passing along the "missing" frame. Due to this
there was no frame to apply generic plc to, thus rendering it useless.

This patch makes it so the translation core produces an interpolated slin frame
in the cases where an attempt was made to translate to slin, but failed. This
interpolated frame is then passed along and can be used by the generic plc
algorithms to fill in the frame.

ASTERISK-27814 #close

Change-Id: I133d084da87adef913bf2ecc9c9240e3eaf4f40a

7 years agoMerge "bridge_softmix: Clear "talking" when a channel is put on hold" into certified...
Joshua Colp [Thu, 22 Mar 2018 13:41:53 +0000 (08:41 -0500)] 
Merge "bridge_softmix: Clear "talking" when a channel is put on hold" into certified/13.18

7 years agochannel.c: Allow generic plc then channel formats are equal
George Joseph [Fri, 16 Mar 2018 15:19:11 +0000 (09:19 -0600)] 
channel.c:  Allow generic plc then channel formats are equal

If the two formats on a channel are equal, we don't transcode and since
the generic plc needs slin to work, it doesn't get invoked.

* A new configuration option "genericplc_on_equal_codecs" was added
  to the "plc" section of codecs.conf to allow generic packet loss
  concealment even if no transcoding was originally needed.
  Transcoding via SLIN is forced in this case.

ASTERISK-27743

Change-Id: I0577026a179dea34232e63123254b4e0508378f4

7 years agobridge_softmix: Clear "talking" when a channel is put on hold
Kevin Harwell [Tue, 20 Mar 2018 20:28:12 +0000 (15:28 -0500)] 
bridge_softmix: Clear "talking" when a channel is put on hold

This patch clears the talking flag from the channel (if already set), and
notifies listeners when that channel is put on hold. Note however, if the
endpoint continues to send audio frames and these are received by the bridge
then that channel will be put back into a "talking" state even though they
are on hold.

ASTERISK-27755 #close

Change-Id: I930e16c4662810f9f02043d69062f88173c5e2ef

7 years agoMerge "chan_sip: Emit a second ringing event to ensure channel is found." into certif...
Jenkins2 [Mon, 5 Mar 2018 15:07:22 +0000 (09:07 -0600)] 
Merge "chan_sip: Emit a second ringing event to ensure channel is found." into certified/13.18

7 years agores_pjsip_refer.c: Fix attended transfer race condition crash.
Richard Mudgett [Thu, 22 Feb 2018 19:53:20 +0000 (13:53 -0600)] 
res_pjsip_refer.c: Fix attended transfer race condition crash.

The transferrer's session channel was destroyed by the transferrer's
serializer thread in a race condition with the transfer target's
serializer thread during an attended transfer.  The transfer target's
serializer was attempting to clean up a deferred end status on behalf of
the transferrer's channel when it should have passed the action to the
transferrer's serializer.  When the transfer target's serializer lost the
race then both threads wind up trying to end the transferrer's session.

* Push the ast_sip_session_end_if_deferred() call onto the transferrer's
serializer to avoid a race condition that results in a crash.  The
session_end() function that could be called by
ast_sip_session_end_if_deferred() really must be executed by the
transferrer's serializer to avoid this kind of crash.

ASTERISK-27568

Change-Id: Iacda724e7cb24d7520e49b2fd7e504aa398d7238

7 years agoast_coredumper: Minor fixes
George Joseph [Fri, 23 Feb 2018 20:58:54 +0000 (13:58 -0700)] 
ast_coredumper:  Minor fixes

* Fix --tarball-config so the option doesn't cause an error.

* Allow for missing /etc/os-release.

* Add a sleep between tarballing the coredump and removing the
  output directory to allow the filesystem to settle.

Change-Id: I73e03b13087978bcc7f6bc9f45753990f82d9d77

7 years agoUpdate for certified/13.18-cert3 certified/13.18-cert3
Kevin Harwell [Wed, 21 Feb 2018 19:00:52 +0000 (14:00 -0500)] 
Update for certified/13.18-cert3

7 years agoMerge "AST-2018-003: Crash with an invalid SDP fmtp attribute" into certified/13.18
Kevin Harwell [Wed, 21 Feb 2018 18:12:47 +0000 (12:12 -0600)] 
Merge "AST-2018-003: Crash with an invalid SDP fmtp attribute" into certified/13.18

7 years agoMerge "AST-2018-002: Crash with an invalid SDP media format description" into certifi...
Kevin Harwell [Wed, 21 Feb 2018 18:09:09 +0000 (12:09 -0600)] 
Merge "AST-2018-002: Crash with an invalid SDP media format description" into certified/13.18

7 years agoMerge "AST-2018-005: res_pjsip_transport_management: Move to core" into certified...
George Joseph [Wed, 21 Feb 2018 16:41:52 +0000 (10:41 -0600)] 
Merge "AST-2018-005: res_pjsip_transport_management:  Move to core" into certified/13.18

7 years agoMerge "AST-2018-005: Fix tdata leaks when calling pjsip_endpt_send_response(2)" into...
George Joseph [Wed, 21 Feb 2018 16:41:44 +0000 (10:41 -0600)] 
Merge "AST-2018-005: Fix tdata leaks when calling pjsip_endpt_send_response(2)" into certified/13.18

7 years agoAST-2018-003: Crash with an invalid SDP fmtp attribute
Kevin Harwell [Wed, 31 Jan 2018 19:37:54 +0000 (13:37 -0600)] 
AST-2018-003: Crash with an invalid SDP fmtp attribute

pjproject's fmtp retrieval function failed to catch invalid fmtp attributes.
Because of this Asterisk would crash if given an SDP with an invalid fmtp
attribute.

When retrieving the format this patch now makes sure the fmtp attribute is
available. If not available it now returns an error status.

ASTERISK-27583 #close

Change-Id: I5cebe000ce2d846cae3af33b6d72c416e51caf2f

7 years agoAST-2018-002: Crash with an invalid SDP media format description
Kevin Harwell [Wed, 31 Jan 2018 19:33:16 +0000 (13:33 -0600)] 
AST-2018-002: Crash with an invalid SDP media format description

pjproject's media format parsing algorithm failed to catch invalid values.
Because of this Asterisk would crash if given an SDP with a invalid media
format description.

When parsing the media format description this patch now properly parses the
value and returns an error status if it can't successfully parse/convert the
value.

ASTERISK-27582 #close

Change-Id: I883b3a4ef85b6972397f7b56bf46c5779c55fdd6

7 years agoAST-2018-005: res_pjsip_transport_management: Move to core
George Joseph [Tue, 6 Feb 2018 18:07:18 +0000 (11:07 -0700)] 
AST-2018-005: res_pjsip_transport_management:  Move to core

Since res_pjsip_transport_management provides several attack
mitigation features, its functionality moved to res_pjsip and
this module has been removed.  This way the features will always
be available if res_pjsip is loaded.

ASTERISK-27618
Reported By: Sandro Gauci

Change-Id: I21a2d33d9dda001452ea040d350d7a075f9acf0d

7 years agoAST-2018-005: Fix tdata leaks when calling pjsip_endpt_send_response(2)
George Joseph [Tue, 6 Feb 2018 17:28:49 +0000 (10:28 -0700)] 
AST-2018-005: Fix tdata leaks when calling pjsip_endpt_send_response(2)

pjsip_distributor:
   authenticate() creates a tdata and uses it to send a challenge or
   failure response.  When pjsip_endpt_send_response2() succeeds, it
   automatically decrements the tdata ref count but when it fails, it
   doesn't.  Since we weren't checking for a return status, we weren't
   decrementing the count ourselves on error and were therefore leaking
   tdatas.

res_pjsip_session:
   session_reinvite_on_rx_request wasn't decrementing the ref count
   if an error happened while sending a 491 response.
   pre_session_setup wasn't decrementing the ref count if
   while sending an error after a pjsip_inv_verify_request failure.

res_pjsip:
   ast_sip_send_response wasn't decrementing the ref count on error.

ASTERISK-27618
Reported By: Sandro Gauci

Change-Id: Iab33a6c7b6fba96148ed465b690ba8534ac961bf

7 years agoAST-2018-004: Restrict the number of Accept headers in a SUBSCRIBE.
Joshua Colp [Wed, 7 Feb 2018 14:09:14 +0000 (14:09 +0000)] 
AST-2018-004: Restrict the number of Accept headers in a SUBSCRIBE.

When receiving a SUBSCRIBE request the Accept headers from it are
stored locally. This operation has a fixed limit of 32 Accept headers
but this limit was not enforced. As a result it was possible for
memory outside of the allocated space to get written to resulting
in a crash.

This change enforces the limit so only 32 Accept headers are
processed.

ASTERISK-27640
Reported By: Sandro Gauci

Change-Id: I99a814b10b554b13a6021ccf41111e5bc95e7301

7 years agochan_sip: Emit a second ringing event to ensure channel is found.
Joshua Colp [Tue, 20 Feb 2018 16:33:43 +0000 (12:33 -0400)] 
chan_sip: Emit a second ringing event to ensure channel is found.

When constructing a dialog-info+xml NOTIFY message a ringing channel
is found if the state is ringing and further information is placed into
the message. Due to the migration to the Stasis message bus this did
not always work as expected.

This change raises a second ringing event in such a way to guarantee
that the event is received by chan_sip and another lookup is done to
find the ringing channel.

ASTERISK-24488

Change-Id: I547a458fc59721c918cb48be060cbfc3c88bcf9c

7 years agoapp_confbridge: ConfbridgeList event has standard channel shapshot headers.
Richard Mudgett [Wed, 31 Jan 2018 23:48:46 +0000 (17:48 -0600)] 
app_confbridge: ConfbridgeList event has standard channel shapshot headers.

* Made the AMI ConfbridgeList action's ConfbridgeList events output all
the standard channel snapshot headers instead of a few hand-coded channel
snapshot headers.  The benefit is that the CallerIDName gets disruptive
characters like CR, LF, Tab, and a few others escaped.  However, an empty
CallerIDName is now output as "<unknown>" instead of "<no name>".

ASTERISK-27651

Change-Id: Iaf7d54a9d40194c2db060bc9b4979fab6720d977

7 years agoapp_confbridge: Add the Muted header to ConfbridgeJoin AMI event.
Richard Mudgett [Wed, 31 Jan 2018 21:45:42 +0000 (15:45 -0600)] 
app_confbridge: Add the Muted header to ConfbridgeJoin AMI event.

ASTERISK-27651

Change-Id: Idef2ca54d242d1b894efd3fc7b360bc6fd5bdc34

7 years agobridge_softmix.c: Report not talking immediately when muted.
Richard Mudgett [Wed, 31 Jan 2018 01:22:51 +0000 (19:22 -0600)] 
bridge_softmix.c: Report not talking immediately when muted.

Currently in app_confbridge if someone mutes a channel while that channel
is talking, the talk detection code is suspended while the channel is
muted.  As far an an external observer is concerned, the muted channel's
talk status is still "talking" even though the channel is not contributing
audio to the conference bridge.  When the channel is later unmuted, it
takes the usual 'dsp_silence_threshold' option time to clear the talking
status even though the channel may have stopped talking while the channel
was muted.

* In bridge_softmix.c, clear the talking status and report talking stopped
if the channel was talking when the channel is muted.  When the channel is
unmuted and the channel is still talking then report the channel as
talking since it is contributing audio to the bridge again.

ASTERISK-27647

Change-Id: Ie4fdbc05a0bc7343c2972bab012e2567917b3d4e

7 years agoMerge "Remove as much trailing whitespace as possible." into certified/13.18
Joshua Colp [Thu, 28 Dec 2017 00:51:37 +0000 (18:51 -0600)] 
Merge "Remove as much trailing whitespace as possible." into certified/13.18

7 years agoUpdate for certified/13.18-cert2 certified/13.18-cert2
Kevin Harwell [Fri, 22 Dec 2017 22:30:54 +0000 (17:30 -0500)] 
Update for certified/13.18-cert2

7 years agoAST-2017-014: res_pjsip - Missing contact header can cause crash
Kevin Harwell [Wed, 20 Dec 2017 22:17:40 +0000 (16:17 -0600)] 
AST-2017-014: res_pjsip - Missing contact header can cause crash

Those SIP messages that create dialogs require a contact header to be present.
If the contact header was missing from the message it could cause Asterisk to
crash.

This patch checks to make sure SIP messages that create a dialog contain the
contact header. If the message does not and it is required Asterisk now returns
a "400 Missing Contact header" response. Also added NULL checks when retrieving
the contact header that were missing as a "just in case".

ASTERISK-27480 #close

Change-Id: I1810db87683fc637a9e3e1384a746037fec20afe

7 years agoRemove as much trailing whitespace as possible.
Sean Bright [Fri, 22 Dec 2017 14:14:07 +0000 (09:14 -0500)] 
Remove as much trailing whitespace as possible.

Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0

7 years agoUpdate for certified/13.18-cert1 certified/13.18-cert1
Richard Mudgett [Thu, 21 Dec 2017 18:38:43 +0000 (13:38 -0500)] 
Update for certified/13.18-cert1

7 years agoREADME: Remove outdated references to tex docs
George Joseph [Wed, 13 Dec 2017 20:26:04 +0000 (13:26 -0700)] 
README: Remove outdated references to tex docs

Added links to the wiki to replace references to outdated
tex docs.

ASTERISK-27430
Reported by: Corey Farrell

Change-Id: I5007e732b30bc7b63d124c530ae8857c89991209

7 years agoREADME-SERIOUSLY.bestpractices.txt: Convert to markdown
Corey Farrell [Fri, 1 Dec 2017 22:18:31 +0000 (17:18 -0500)] 
README-SERIOUSLY.bestpractices.txt: Convert to markdown

Follow-up to conversion of README.md.

Change-Id: I17ee7cf25bc027ece844efa2c1dfe613aff1e35b

7 years agoREADME: Convert to README.md.
Corey Farrell [Tue, 21 Nov 2017 15:16:24 +0000 (10:16 -0500)] 
README: Convert to README.md.

Convert the README file to markdown format, remove the old README.  This
causes websites like github to display the README in a much nicer
format with live links.  The raw file is still very readable from
plain text editors and terminals.

Change-Id: I7d13131764a9a9026e5f8a6ddb245a01bbd788e7

7 years agoREADME: Send people to secure websites where available.
Corey Farrell [Sat, 18 Nov 2017 01:36:40 +0000 (20:36 -0500)] 
README: Send people to secure websites where available.

We should be sending people to secure web URL's where available.
Update README's and docs.

Change-Id: Id5b1e049b0b18b49a784f1254605aefa244ce19a

7 years agoUpdate for certified/13.18-cert1-rc3 certified/13.18-cert1-rc3
George Joseph [Wed, 13 Dec 2017 19:23:22 +0000 (14:23 -0500)] 
Update for certified/13.18-cert1-rc3

7 years agoMerge "pjsip_options: dynamic contact's fields not updated on reload" into certified...
George Joseph [Wed, 13 Dec 2017 19:07:38 +0000 (13:07 -0600)] 
Merge "pjsip_options: dynamic contact's fields not updated on reload" into certified/13.18

7 years agoMerge "pjsip_options: contacts sometimes not being updated on reload" into certified...
Jenkins2 [Wed, 13 Dec 2017 19:02:22 +0000 (13:02 -0600)] 
Merge "pjsip_options: contacts sometimes not being updated on reload" into certified/13.18

7 years agoMerge "chan_pjsip/res_pjsip: Add CHANNEL(pjsip,request_uri)" into certified/13.18
Jenkins2 [Wed, 13 Dec 2017 16:40:20 +0000 (10:40 -0600)] 
Merge "chan_pjsip/res_pjsip: Add CHANNEL(pjsip,request_uri)" into certified/13.18

7 years agoAST-2017-012: Place single RTCP report block at beginning of report.
Joshua Colp [Thu, 30 Nov 2017 16:12:55 +0000 (16:12 +0000)] 
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

7 years agochan_pjsip/res_pjsip: Add CHANNEL(pjsip,request_uri)
Richard Mudgett [Thu, 7 Dec 2017 23:51:08 +0000 (17:51 -0600)] 
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

7 years agopjsip_options: contacts sometimes not being updated on reload
Kevin Harwell [Fri, 8 Dec 2017 00:22:34 +0000 (18:22 -0600)] 
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

7 years agopjsip_options: dynamic contact's fields not updated on reload
Kevin Harwell [Fri, 8 Dec 2017 00:18:00 +0000 (18:18 -0600)] 
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

7 years agoCDR: Fix deadlock setting some CDR values.
Richard Mudgett [Wed, 6 Dec 2017 00:04:47 +0000 (18:04 -0600)] 
CDR: Fix deadlock setting some CDR values.

Setting channel variables with the AMI Originate action caused a deadlock
when you set CDR(amaflags) or CDR(accountcode).  This path has the channel
locked when the CDR function is called.  The CDR function then
synchronously passes the job to a stasis thread.  The stasis handling
function then attempts to lock the channel.  Deadlock results.

* Avoid deadlock by making the CDR function handle setting amaflags and
accountcode directly on the channel rather than passing it off to the CDR
processing code under a stasis thread to do it.

* Made the CHANNEL function and the CDR function process amaflags the same
way.

* Fixed referencing the wrong message type in cdr_prop_write().

ASTERISK-27460

Change-Id: I5eacb47586bc0b8f8ff76a19bd92d1dc38b75e8f

7 years agoMerge "res_rtp_asterisk.c: Fix rtp source address learning for broken clients" into...
Jenkins2 [Wed, 6 Dec 2017 02:08:38 +0000 (20:08 -0600)] 
Merge "res_rtp_asterisk.c: Fix rtp source address learning for broken clients" into certified/13.18

7 years agores_rtp_asterisk.c: Fix rtp source address learning for broken clients
Pirmin Walthert [Thu, 16 Nov 2017 08:47:39 +0000 (09:47 +0100)] 
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

7 years agores_rtp_asterisk.c: Increase strictrtp learning timeout time.
Richard Mudgett [Thu, 30 Nov 2017 18:50:58 +0000 (12:50 -0600)] 
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

7 years agoMerge "res_http_post: Not all versions of gmime have GMIME_MAJOR_VERSION." into certi...
Jenkins2 [Mon, 4 Dec 2017 12:54:23 +0000 (06:54 -0600)] 
Merge "res_http_post: Not all versions of gmime have GMIME_MAJOR_VERSION." into certified/13.18

7 years agoAST-2017-013: chan_skinny: Call pthread_detach when sess threads end
George Joseph [Thu, 30 Nov 2017 20:38:50 +0000 (13:38 -0700)] 
AST-2017-013: chan_skinny: Call pthread_detach when sess threads end

chan_skinny creates a new thread for each new session.  In trying
to be a good cleanup citizen, the threads are joinable and the
unload_module function does a pthread_cancel() and a pthread_join()
on any sessions that are active at that time.  This has an
unintended side effect though. Since you can call pthread_join on a
thread that's already terminated, pthreads keeps the thread's
storage around until you explicitly call pthread_join (or
pthread_detach()).   Since only the module_unload function was
calling pthread_join, and even then only on the ones active at the
tme, the storage for every thread/session ever created sticks
around until asterisk exits.

* A thread can detach itself so the session_destroy() function
  now calls pthread_detach() just before it frees the session
  memory allocation.  The module_unload function still takes care
  of the ones that are still active should the module be unloaded.

ASTERISK-27452
Reported by: Juan Sacco

Change-Id: I9af7268eba14bf76960566f891320f97b974e6dd

7 years agores_http_post: Not all versions of gmime have GMIME_MAJOR_VERSION.
Joshua Colp [Fri, 1 Dec 2017 12:07:52 +0000 (08:07 -0400)] 
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

7 years agotests: Fix warnings found on Mac.
Corey Farrell [Sun, 19 Nov 2017 03:13:32 +0000 (22:13 -0500)] 
tests: Fix warnings found on Mac.

test_pbx used raise without explicitly including signal.h.  On Mac for
some reason nothing else includes it.

test_logger checked if an unsigned int was negative.  Switch the
variable to 'int' so that error check can be effective.

Change-Id: Ie1db5dd1818ac25cc2ae41b644f848b5865b1362
(cherry picked from commit 5fe2e7bfdcd06935594823faba67c71ead7ebcf5)

7 years agoUpdate for certified/13.18-cert1-rc2 certified/13.18-cert1-rc2
George Joseph [Wed, 15 Nov 2017 17:02:30 +0000 (12:02 -0500)] 
Update for certified/13.18-cert1-rc2

7 years agoMerge "bundled_pjproject: Update to 2.7.1" into certified/13.18
George Joseph [Wed, 15 Nov 2017 16:46:59 +0000 (10:46 -0600)] 
Merge "bundled_pjproject: Update to 2.7.1" into certified/13.18

7 years agobundled_pjproject: Update to 2.7.1
Ben Ford [Mon, 13 Nov 2017 20:35:14 +0000 (14:35 -0600)] 
bundled_pjproject: Update to 2.7.1

Update from 2.7 to 2.7.1 for bundled pjproject. Changed version
and removed patch files included in the update.

Change-Id: I55cea8e734b318c2df9daf86aa0802c559ec8357
(cherry picked from commit e6ada55430c3df603f12cb20a56149dac61ce450)

7 years agobundled_pjproject: sip_parser: Fix return code in pjsip_find_msg
George Joseph [Fri, 10 Nov 2017 16:37:16 +0000 (09:37 -0700)] 
bundled_pjproject: sip_parser:  Fix return code in pjsip_find_msg

The default return code for pjsip_find_msg was PJ_SUCCESS so if
a Content-Length header wasn't found at all, pjsip_find_msg was
returning PJ_SUCCESS instead of PJSIP_EMISSINGHDR.

Also added the volatile keyword to a few variables that are used
both inside and outside the PJ_TRY/PJ_CATCH block.

Partial fix for ASTERISK_27408

Change-Id: If82ba9de921e3d57df9c68cf96ee45ccc1491f7a
(cherry picked from commit b5f2779a23aa6042893c2bdf6bebfcc5150b5300)

7 years agopjsip: Add patch to allow all transports to be destroyed.
Joshua Colp [Fri, 10 Nov 2017 13:06:38 +0000 (13:06 +0000)] 
pjsip: Add patch to allow all transports to be destroyed.

If a transport is created with the same transport type, source
IP address, and source port as one that already exists the old
transport is moved into a linked list called "tp_list".

If this old transport is later shutdown it will not be destroyed
as the process checks whether the transport is valid or not. This
check does not look at the "tp_list" when making the determination
causing the transport to not be destroyed.

This change updates the logic to query not just the main storage
method for transports but also the "tp_list".

Upstream issue https://trac.pjsip.org/repos/ticket/2061

ASTERISK-27411

Change-Id: Ic5c2bb60226df0ef1c8851359ed8d4cd64469429

7 years agoMerge "res_pjsip_registrar.c: Fix named AOR and pjproject group deadlock." into certi...
Kevin Harwell [Thu, 9 Nov 2017 17:49:23 +0000 (11:49 -0600)] 
Merge "res_pjsip_registrar.c: Fix named AOR and pjproject group deadlock." into certified/13.18

7 years agoUpdate for certified/13.18-cert1-rc1 certified/13.18-cert1-rc1
Kevin Harwell [Wed, 8 Nov 2017 21:18:41 +0000 (16:18 -0500)] 
Update for certified/13.18-cert1-rc1

7 years agoMerge "AST-2017-009: pjproject: Add validation of numeric header values" into certifi...
George Joseph [Wed, 8 Nov 2017 15:52:31 +0000 (09:52 -0600)] 
Merge "AST-2017-009: pjproject: Add validation of numeric header values" into certified/13.18

7 years agoMerge "AST-2017-011 - res_pjsip_session: session leak when a call is rejected" into...
George Joseph [Wed, 8 Nov 2017 15:44:15 +0000 (09:44 -0600)] 
Merge "AST-2017-011 - res_pjsip_session: session leak when a call is rejected" into certified/13.18

7 years agoAST-2017-011 - res_pjsip_session: session leak when a call is rejected
Kevin Harwell [Thu, 19 Oct 2017 18:35:16 +0000 (13:35 -0500)] 
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

7 years agoAST-2017-010: Fix cdr_object_update_party_b_userfield_cb() buf overrun
Richard Mudgett [Tue, 3 Oct 2017 21:19:52 +0000 (16:19 -0500)] 
AST-2017-010: Fix cdr_object_update_party_b_userfield_cb() buf overrun

cdr_object_update_party_b_userfield_cb() could overrun the fixed buffer if
the supplied string is too long.  The long string could be supplied by
external means using the CDR(userfield) function.

This may seem reminiscent to AST-2017-001 (ASTERISK_26897) and it is.  The
earlier patch fixed the buffer overrun for Party A's userfield while this
patch fixes the same thing for Party B's userfield.

ASTERISK-27337

Change-Id: I0fa767f65ecec7e676ca465306ff9e0edbf3b652

7 years agoAST-2017-009: pjproject: Add validation of numeric header values
George Joseph [Thu, 19 Oct 2017 18:53:32 +0000 (12:53 -0600)] 
AST-2017-009: pjproject: Add validation of numeric header values

Parsing the numeric header fields like cseq, ttl, port, etc. all
had the potential to overflow, either causing unintended values to
be captured or, if the values were subsequently converted back to
strings, a buffer overrun.  To address this, new "strto" functions
have been created that do range checking and those functions are
used wherever possible in the parser.

 * Created pjlib/include/limits.h and pjlib/include/compat/limits.h
   to either include the system limits.h or define common numeric
   limits if there is no system limits.h.

 * Created strto*_validate functions in sip_parser that take bounds
   and on failure call the on_str_parse_error function which prints
   an error message and calls PJ_THROW.

 * Updated sip_parser to validate the numeric fields.

 * Fixed an issue in sip_transport that prevented error messages
   from being properly displayed.

 * Added "volatile" to some variables referenced in PJ_CATCH blocks
   as the optimizer was sometimes optimizing them away.

 * Fixed length calculation in sip_transaction/create_tsx_key_2543
   to account for signed ints being 11 characters, not 9.

ASTERISK-27319
Reported by: Youngsung Kim at LINE Corporation

Change-Id: I48de2e4ccf196990906304e8d7061f4ffdd772ff

7 years agores_pjsip_registrar.c: Fix named AOR and pjproject group deadlock.
Richard Mudgett [Mon, 6 Nov 2017 22:37:49 +0000 (16:37 -0600)] 
res_pjsip_registrar.c: Fix named 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 named AOR lock to avoid the deadlock.

ASTERISK-27391

Change-Id: I89a90f87cb7a02facbafb44c75d8845f93417364

7 years agoMerge "res_pjsip: Add to list of valid characters for from_user." into certified...
Joshua Colp [Mon, 6 Nov 2017 19:45:58 +0000 (13:45 -0600)] 
Merge "res_pjsip: Add to list of valid characters for from_user." into certified/13.18

7 years agores_pjsip: Add to list of valid characters for from_user.
Ben Ford [Wed, 1 Nov 2017 16:12:45 +0000 (11:12 -0500)] 
res_pjsip: Add to list of valid characters for from_user.

Fixes a regression where some characters were unable to be used in
the from_user field of an endpoint. Additionally, the backtick was
removed from the list of valid characters, since it is not valid,
and it was replaced with a single quote, which is a valid character.

ASTERISK-27387

Change-Id: Id80c10a644508365c87b3182e99ea49da11b0281
(cherry picked from commit ffcb7e2a2540181ea41062ca0e1bc3e4fed9b3a5)

7 years agores_pjproject.c: Upgrade bundled PJPROJECT to 2.7
Richard Mudgett [Tue, 17 Oct 2017 15:53:52 +0000 (10:53 -0500)] 
res_pjproject.c: Upgrade bundled PJPROJECT to 2.7

Update patches included in bundled PJPROJECT for the new version.

ASTERISK-27355

Change-Id: I9ac5dbbffaadca25ad24fac8b9ab615e5ace6083

7 years agoInitialize 13.18-cert branch
Kevin Harwell [Mon, 30 Oct 2017 20:24:53 +0000 (15:24 -0500)] 
Initialize 13.18-cert branch

A new branch was created for what will be Asterisk certified 13.18. A couple
of things needed to be done to the branch in order to complete initialization:

Modified the version file to reflect the certified version.
Updated all extended modules to be disabled by default.

Change-Id: Ie1dd3cb146391dea92c9e3ef906dde8d7241fee2

7 years agoUpdate for 13.18.0 13.18.0
Kevin Harwell [Mon, 30 Oct 2017 15:33:07 +0000 (10:33 -0500)] 
Update for 13.18.0

7 years agoUpdate for 13.18.0-rc2 13.18.0-rc2
Kevin Harwell [Wed, 25 Oct 2017 20:01:55 +0000 (15:01 -0500)] 
Update for 13.18.0-rc2

7 years agoMerge "http.c: Fix http header send content." into 13.18
George Joseph [Wed, 25 Oct 2017 18:05:30 +0000 (13:05 -0500)] 
Merge "http.c: Fix http header send content." into 13.18

7 years agores_xmpp: Ensure the connection filter is available.
Joshua Colp [Sun, 22 Oct 2017 22:32:20 +0000 (19:32 -0300)] 
res_xmpp: Ensure the connection filter is available.

Users of the API that res_xmpp provides expect that a
filter be available on the client at all times. When
OAuth authentication support was added this requirement
was not maintained.

This change merely moves the OAuth authentication to
after the filter is created, ensuring users of res_xmpp
can add things to the filter as needed.

ASTERISK-27346

Change-Id: I4ac474afe220e833288ff574e32e2b9a23394886
(cherry picked from commit 07e17fd04ffcf204400898660a4c118666596d5d)

7 years agohttp.c: Fix http header send content.
Ben Ford [Mon, 23 Oct 2017 18:42:27 +0000 (13:42 -0500)] 
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

7 years agoUpdate for 13.18.0-rc1 13.18.0-rc1
Kevin Harwell [Fri, 13 Oct 2017 17:46:56 +0000 (12:46 -0500)] 
Update for 13.18.0-rc1

7 years agoAMI: Increase version number
Kevin Harwell [Fri, 13 Oct 2017 17:09:13 +0000 (12:09 -0500)] 
AMI: Increase version number

Bump the AMI patch number since the following new addition was made:

* Added a new CancelAtxfer action that cancels an attended transfer.

Change-Id: I9bac528791bd62ef0e99243903b6bc7a6c7ab182

7 years agoMerge "features, manager : Add CancelAtxfer AMI action" into 13
Joshua Colp [Fri, 13 Oct 2017 12:44:39 +0000 (07:44 -0500)] 
Merge "features, manager : Add CancelAtxfer AMI action" into 13

7 years agoMerge "res_pjsip_session: Prevent user=phone being added to anonimized URIs." into 13
Jenkins2 [Thu, 12 Oct 2017 17:22:10 +0000 (12:22 -0500)] 
Merge "res_pjsip_session: Prevent user=phone being added to anonimized URIs." into 13

7 years agofeatures, manager : Add CancelAtxfer AMI action
Thomas Sevestre [Fri, 25 Aug 2017 13:19:00 +0000 (13:19 +0000)] 
features, manager : Add CancelAtxfer AMI action

Add action to cancel feature attended transfer with AMI interface

ASTERISK-27215 #close

Change-Id: Iab8a81362b5a1757e2608f70b014ef863200cb42

7 years agores_pjsip_session: Prevent user=phone being added to anonimized URIs.
Daniel Tryba [Fri, 6 Oct 2017 09:55:38 +0000 (11:55 +0200)] 
res_pjsip_session: Prevent user=phone being added to anonimized URIs.

Move ast_sip_add_usereqphone to be called after anonymization of URIs,
to prevent the user_eq_phone adding "user=phone" to URIs containing a
username that is not a phonenumber (RFC3261 19.1.1). An extra call to
ast_sip_add_usereqphone on the saved version before anonymization is
added to add user=phone" to the PAI.

ASTERISK-27047 #close

Change-Id: Ie5644bc66341b86dc08b1f7442210de2e6acdec6

7 years agoMerge "cdr.c: Defer misc checks." into 13
Jenkins2 [Thu, 12 Oct 2017 12:12:59 +0000 (07:12 -0500)] 
Merge "cdr.c: Defer misc checks." into 13

7 years agoMerge "res_pjsip: Prevent "user=phone" being added multiple times to header" into 13
Joshua Colp [Thu, 12 Oct 2017 12:01:18 +0000 (07:01 -0500)] 
Merge "res_pjsip: Prevent "user=phone" being added multiple times to header" into 13

7 years agoMerge "cdr_mysql: avoid releasing a config string" into 13
Jenkins2 [Thu, 12 Oct 2017 00:09:52 +0000 (19:09 -0500)] 
Merge "cdr_mysql: avoid releasing a config string" into 13

7 years agoMerge "chan_vpb: Fix a gcc 7 out-of-bounds complaint" into 13
Jenkins2 [Wed, 11 Oct 2017 21:28:29 +0000 (16:28 -0500)] 
Merge "chan_vpb:  Fix a gcc 7 out-of-bounds complaint" into 13

7 years agores_pjsip: Prevent "user=phone" being added multiple times to header
Daniel Tryba [Fri, 6 Oct 2017 10:14:40 +0000 (12:14 +0200)] 
res_pjsip: Prevent "user=phone" being added multiple times to header

ast_sip_add_usereqphone adds "user=phone" to the header every time is is
called without checking whether the param already exists. Preventing
this by searching to string representation of header for "user=phone".

ASTERISK-26988 #close

Change-Id: Ib84383b07254de357dc6a98d91fc1d2c2c3719e6

7 years agocdr_mysql: avoid releasing a config string
Tzafrir Cohen [Tue, 10 Oct 2017 14:49:15 +0000 (17:49 +0300)] 
cdr_mysql: avoid releasing a config string

Fixes a memory corruption issue after a reload of cdr_mysql.

Issue was accidentally included in 747beb1ed159f89a3b58742e4257740b3d6d6bba .

ASTERISK-27270 #close

Change-Id: I90b6a9d18710c0f9009466370bd5f4bac5d5d12e

7 years agoMerge "app_originate: Set ORIGINATE_STATUS correctly on failure" into 13
Jenkins2 [Wed, 11 Oct 2017 20:03:46 +0000 (15:03 -0500)] 
Merge "app_originate: Set ORIGINATE_STATUS correctly on failure" into 13

7 years agocdr.c: Defer misc checks.
Richard Mudgett [Thu, 5 Oct 2017 23:12:04 +0000 (18:12 -0500)] 
cdr.c: Defer misc checks.

Try to defer some checks until needed in case there is an early exit.

Change-Id: Ibc6b34c38a4f60ad4f9b67984b7d070a07257064

7 years agoMerge "cdr.c: Eliminated simple RAII_VAR usages." into 13
Jenkins2 [Wed, 11 Oct 2017 17:18:55 +0000 (12:18 -0500)] 
Merge "cdr.c: Eliminated simple RAII_VAR usages." into 13

7 years agoMerge "app_queue.c: clear moh field in init_queue" into 13
Joshua Colp [Wed, 11 Oct 2017 16:05:27 +0000 (11:05 -0500)] 
Merge "app_queue.c: clear moh field in init_queue" into 13

7 years agochan_vpb: Fix a gcc 7 out-of-bounds complaint
George Joseph [Wed, 11 Oct 2017 12:03:41 +0000 (06:03 -0600)] 
chan_vpb:  Fix a gcc 7 out-of-bounds complaint

chan_vpb was trying to use sizeof(*p->play_dtmf), where
p->play_dtmf is defined as char[16], to get the length of the array
but since p->play_dtmf is an actual array, sizeof(*p->play_dtmf)
returns the size of the first array element, which is 1.  gcc7
validly complains because the context in which it's used could
cause an out-of-bounds condition.

Change-Id: If9c4bfdb6b02fa72d39e0c09bf88900663c000ba

7 years agoMerge "res_pjsip_registrar.c: Update remove_existing AOR contact handling." into 13
Jenkins2 [Wed, 11 Oct 2017 11:34:00 +0000 (06:34 -0500)] 
Merge "res_pjsip_registrar.c: Update remove_existing AOR contact handling." into 13

7 years agoapp_queue.c: clear moh field in init_queue
Nathan Bruning [Fri, 6 Oct 2017 07:39:42 +0000 (09:39 +0200)] 
app_queue.c: clear moh field in init_queue

ASTERISK-27301 #close

Change-Id: Ic31361f34e2de3b6470e68fc37205a7711082eba

7 years agoMerge "contrib/thirdparty/sip_to_pjsip: add additional flag mappings" into 13
Jenkins2 [Tue, 10 Oct 2017 17:24:37 +0000 (12:24 -0500)] 
Merge "contrib/thirdparty/sip_to_pjsip: add additional flag mappings" into 13

7 years agoapp_originate: Set ORIGINATE_STATUS correctly on failure
Sean Bright [Tue, 10 Oct 2017 17:01:05 +0000 (13:01 -0400)] 
app_originate: Set ORIGINATE_STATUS correctly on failure

We were ignoring the return value from ast_pbx_outgoing_exten() and
ast_pbx_outgoing_app() which could fail before setting the reason code.
This resulted in failures being reported as success.

ASTERISK-25266 #close
Reported by: Allen Ford

Change-Id: Idf16237b7e41b527d2c69c865829128686beeb3b

7 years agocdr.c: Eliminated simple RAII_VAR usages.
Richard Mudgett [Mon, 2 Oct 2017 21:46:19 +0000 (16:46 -0500)] 
cdr.c: Eliminated simple RAII_VAR usages.

Change-Id: I150505db307249a962987e7b941bdd369bb91f35

7 years agoMerge "res_pjproject: Fix cleanup of buildopts vector." into 13
Jenkins2 [Tue, 10 Oct 2017 13:12:38 +0000 (08:12 -0500)] 
Merge "res_pjproject: Fix cleanup of buildopts vector." into 13

7 years agoMerge "tcptls: Do not re-bind to wildcard on client creation." into 13
Jenkins2 [Tue, 10 Oct 2017 12:41:42 +0000 (07:41 -0500)] 
Merge "tcptls: Do not re-bind to wildcard on client creation." into 13

7 years agores_pjproject: Fix cleanup of buildopts vector.
Corey Farrell [Tue, 10 Oct 2017 03:51:03 +0000 (23:51 -0400)] 
res_pjproject: Fix cleanup of buildopts vector.

ASTERISK-27306

Change-Id: I3bed0edf3f55b1d4adcbabb25ec14f11dc766c72

7 years agoMerge "cdr.h: Fix doxygen comments." into 13
Joshua Colp [Tue, 10 Oct 2017 00:52:22 +0000 (19:52 -0500)] 
Merge "cdr.h: Fix doxygen comments." into 13

7 years agoMerge "cdr.c: Replace redundant check with an ast_assert()" into 13
Jenkins2 [Tue, 10 Oct 2017 00:30:50 +0000 (19:30 -0500)] 
Merge "cdr.c: Replace redundant check with an ast_assert()" into 13

7 years agoMerge "cdr.c: Use current ao2 flag names" into 13
Jenkins2 [Mon, 9 Oct 2017 23:33:29 +0000 (18:33 -0500)] 
Merge "cdr.c: Use current ao2 flag names" into 13

7 years agoMerge "res_pjsip: Fix issues that prevented shutdown of modules." into 13
Jenkins2 [Mon, 9 Oct 2017 22:46:11 +0000 (17:46 -0500)] 
Merge "res_pjsip: Fix issues that prevented shutdown of modules." into 13

7 years agoMerge "cdr.c: Replace inlined code with ao2_t_replace()" into 13
Jenkins2 [Mon, 9 Oct 2017 21:37:28 +0000 (16:37 -0500)] 
Merge "cdr.c: Replace inlined code with ao2_t_replace()" into 13

7 years agoMerge "res_config_sqlite: Don't enable SQLite CDRs when running 'make samples'" into 13
Jenkins2 [Mon, 9 Oct 2017 20:40:53 +0000 (15:40 -0500)] 
Merge "res_config_sqlite: Don't enable SQLite CDRs when running 'make samples'" into 13