Commit Graph

29958 Commits

Author SHA1 Message Date
Jenkins2
58f6d0320e Merge "alembic: Fix typo in add_auto_info_to_endpoint_dtmf_mode" into 15 2017-09-12 14:19:49 -05:00
Richard Mudgett
9b8957ed8a res_rtp_asterisk.c: Add doxygen to RTCP payload types.
Change-Id: I3f20ce428777cc4ce9c13b2f808d29ff8c873998
2017-09-11 12:36:05 -05:00
Jenkins2
3576d4f33a Merge "alembic: Add support for MS-SQL" into 15 2017-09-11 06:47:49 -05:00
George Joseph
3552cb511d alembic: Fix typo in add_auto_info_to_endpoint_dtmf_mode
The downgrade function was missing "_v2" at the end of the
alter column type.

Change-Id: Iaa9bcef48d6f3590ce07a61342d8e66f00263d8e
2017-09-11 05:54:46 -05:00
Walter Doekes
1d2e58705e res/res_pjsip: Fix localnet checks in pjsip, part 2.
In 45744fc53, I mistakenly broke SDP media address rewriting by
misinterpreting which address was checked in the localnet comparison.

Instead of checking the remote peer address to decide whether we need
media address rewriting, we check our local media address: if it's
local, then we rewrite. This feels awkward, but works and even made
directmedia work properly if you set local_net. (For the record: for
local peers, the SDP media rewrite code is not called, so the
comparison does no harm there.)

ASTERISK-27248 #close

Change-Id: I566be1c33f4d0a689567d451ed46bab9c3861d4f
2017-09-10 06:19:14 -05:00
Florian Floimair
9620a2bd20 alembic: Add support for MS-SQL
MS-SQL has no native Enum-type support and therefore
needs to work with constraints.
Since these constraints need unique names the suggested approach
referenced in the following alembic documentation has been applied:
http://bit.ly/2x9r8pb

ASTERISK-27255 #close

Change-Id: I8b579750dae0c549f1103ee50172644afb9b2f95
2017-09-08 11:50:53 -05:00
Jenkins2
a8aff0be47 Merge "app_waitforsilence: Cleanup & don't treat missing frames as 'noise'" into 15 2017-09-08 10:34:43 -05:00
Jenkins2
dbb606ba17 Merge "chan_sip: when getting sip pvt return failure if not found" into 15 2017-09-08 09:51:21 -05:00
Jenkins2
e5fdee036e Merge "res_srtp: Add support for libsrtp2.1." into 15 2017-09-07 14:01:08 -05:00
Joshua Colp
ecb1c297d2 Merge "chan_sip: Do not change IP address in SDP origin line (o=) in SIP reINVITE" into 15 2017-09-07 13:36:19 -05:00
Jenkins2
04f9357a5d Merge "res_pjsip_session: Preserve stream name during renegotiation." into 15 2017-09-07 12:32:42 -05:00
Jenkins2
ed2920dcc0 Merge "func_cdr: honour 'u' flag on dummy channel" into 15 2017-09-07 11:13:20 -05:00
Joshua Colp
4d70cc5db7 Merge "stasis/control.c: Fix set_interval_hook() ref leak." into 15 2017-09-07 10:41:54 -05:00
Sean Bright
4418fae58b app_waitforsilence: Cleanup & don't treat missing frames as 'noise'
* WaitForSilence completes successfully if it receives no media in the
  specified timeout, but when acting as WaitForNoise that logic needs
  to be reversed.

* Use standard argument parsing macros and add some error checking for
  invalid values.

* The documentation indicated that the first argument to both
  WaitForSilence and WaitForNoise was required when it was not. Update
  the documentation to reflect that.

* Wrap up some behavior in structs to avoid boolean checks all over the
  place.

ASTERISK-24066 #close
Reported by: M vd S

Change-Id: I01d40adc5b63342bb5018a1bea2081a0aa191ef9
2017-09-06 17:15:41 -04:00
Scott Griepentrog
6dd4ee8926 chan_sip: when getting sip pvt return failure if not found
In handle_request_invite, when processing a pickup, a call
is made to get_sip_pvt_from_replaces to locate the pvt for
the subscription. The pvt is assumed to be valid when zero
is returned indicating no error, and is dereferenced which
can cause a crash if it was not found.

This change checks the not found case and returns -1 which
allows the calling code to fail appropriately.

ASTERISK-27217 #close
Reported-by: Bryan Walters

Change-Id: I6bee92b8b8b85fcac3fd66f8c00ab18bc1765612
2017-09-06 16:13:27 -05:00
Richard Mudgett
55b0dad30a stasis/control.c: Fix set_interval_hook() ref leak.
Change-Id: Ia0edb7dc0dbbb879c079ff7000f1b722d86ce7dc
2017-09-06 13:40:01 -05:00
George Joseph
a824fcc8e8 stasis/control: Fix possible deadlock with swap channel
If an error occurs during a bridge impart it's possible that
the "bridge_after" callback might try to run before
control_swap_channel_in_bridge has been signalled to continue.
Since control_swap_channel_in_bridge is holding the control lock
and the callback needs it, a deadlock will occur.

* control_swap_channel_in_bridge now only holds the control
  lock while it's actually modifying the control structure and
  releases it while the bridge impart is running.
* bridge_after_cb is now tolerant of impart failures.

Change-Id: Ifd239aa93955b3eb475521f61e284fcb0da2c3b3
2017-09-06 13:00:42 -05:00
George Joseph
3a6291b534 Merge "alembic: Fix enum creation for dtls_fingerprint" into 15 2017-09-06 11:52:10 -05:00
Jenkins2
5f075cc280 Merge "alembic: fix erroneous commit for add_prune_on_boot" into 15 2017-09-06 10:53:23 -05:00
Joshua Colp
bf50223884 Merge "res/res_pjsip: Standardize/fix localnet checks across pjsip." into 15 2017-09-06 10:13:28 -05:00
Vitezslav Novy
07e62b4e0e chan_sip: Do not change IP address in SDP origin line (o=) in SIP reINVITE
If directmedia=yes is configured, when call is answered, Asterisk sends reINVITE
to both parties to set up media path directly between the endpoints.
In this reINVITE msg SDP origin line (o=) contains IP address of endpoint
instead of IP of asterisk. This behavior violates RFC3264, sec 8:
"When issuing an offer that modifies the session,
the "o=" line of the new SDP MUST be identical to that in the
previous SDP, except that the version in the origin field MUST
increment by one from the previous SDP."
This patch assures IP address of Asterisk is always sent in
SDP origin line.

ASTERISK-17540
Reported by:  saghul

Change-Id: I533a047490c43dcff32eeca8378b2ba02345b64e
2017-09-06 10:07:55 -05:00
Jenkins2
a5b49ff388 Merge "formats: Restore previous fread() behavior" into 15 2017-09-06 09:10:48 -05:00
George Joseph
2d9aac9f28 alembic: Fix enum creation for dtls_fingerprint
Change-Id: Ic061c5066a146616a68376881c7e4cf6d6e7e7db
2017-09-06 07:57:17 -05:00
Jenkins2
64c27976ca Merge "res_pjsip_t38: Make t38_reinvite_response_cb tolerant of NULL channel" into 15 2017-09-06 07:19:00 -05:00
Joshua Colp
a9de04ce7d Merge "res_calendar*, res_smdi: Move to "extended" support" into 15 2017-09-06 06:45:52 -05:00
Jacek Konieczny
64f8445c0b func_cdr: honour 'u' flag on dummy channel
Fixes ${CDR(...,u)} when used in cdr_custom.conf

ASTERISK-27165 #close

Change-Id: Ia4e0b6ba93e03d27886354c279737790e2cd6a83
2017-09-06 13:39:03 +02:00
Florian Floimair
e5985c9abe alembic: fix erroneous commit for add_prune_on_boot
Added include for postgresql ENUM type and
redefined values in the same way as in the
other migration scripts.

ASTERISK-27254 #close

Change-Id: Id667304cdf3891b1c2f7d35fab3e2a84026159fa
2017-09-06 06:00:39 -05:00
Alexander Traud
3a418b7ca2 res_srtp: Add support for libsrtp2.1.
Asterisk is able to use libSRTP 2.0.x. However since libSRTP 2.1.x, the macro
SRTP_AES_ICM got renamed to SRTP_AES_ICM_128. Beside to still compile with
previous versions of libSRTP, this change allows libSRTP 2.1.x as well.

ASTERISK-27253 #close

Change-Id: I2e6eb3c3bc844fee8a624060a2eb6f182dc70315
2017-09-06 03:05:45 -05:00
Ben Ford
b7d4a2e32e chan_pjsip: Suppress frame warnings.
When rtp_keepalive is on for a PJSIP endpoint dialing to another
Asterisk instance also using PJSIP, Asterisk will continue to print
warning messages about not being able to send frames of a certain
type. This suppresses that warning message.

Change-Id: I0332a05519d7bda9cacfa26d433909ff1909be67
2017-09-05 17:20:39 -05:00
Sean Bright
46bd1290a0 formats: Restore previous fread() behavior
Some formats are able to handle short reads while others are not, so
restore the previous behavior for the format modules so that we don't
have spurious errors when playing back files.

ASTERISK-27232 #close
Reported by: Jens T.

Change-Id: Iab7f52b25a394f277566c8a2a4b15a692280a300
2017-09-05 10:10:22 -05:00
Walter Doekes
329e111947 res/res_pjsip: Standardize/fix localnet checks across pjsip.
In 2dee95cc (ASTERISK-27024) and 776ffd77 (ASTERISK-26879) there was
confusion about whether the transport_state->localnet ACL has ALLOW or
DENY semantics.

For the record: the localnet has DENY semantics, meaning that "not in
the list" means ALLOW, and the local nets are in the list.

Therefore, checks like this look wrong, but are right:

    /* See if where we are sending this request is local or not, and if
       not that we can get a Contact URI to modify */
    if (ast_apply_ha(transport_state->localnet, &addr) != AST_SENSE_ALLOW) {
        ast_debug(5, "Request is being sent to local address, "
                     "skipping NAT manipulation\n");

(In the list == localnet == DENY == skip NAT manipulation.)

And conversely, other checks that looked right, were wrong.

This change adds two macro's to reduce the confusion and uses those
instead:

    ast_sip_transport_is_nonlocal(transport_state, addr)
    ast_sip_transport_is_local(transport_state, addr)

ASTERISK-27248 #close

Change-Id: Ie7767519eb5a822c4848e531a53c0fd054fae934
2017-09-05 09:17:24 -05:00
Joshua Colp
11d013a9df res_pjsip_session: Preserve stream name during renegotiation.
Stream names within Asterisk can have meaning so when an externally
initiated renegotiation occurs we need to preserve the name of
the stream if it already exists.

Change-Id: I29f50d0cc7f3238287d6d647777e76e1bdf8c596
2017-09-05 13:40:38 +00:00
Jenkins2
9d79c39be2 Merge "app_directory: Handle a NULL mailbox without crashing" into 15 2017-09-05 08:37:39 -05:00
George Joseph
3c8b1f40fa res_calendar*, res_smdi: Move to "extended" support
Change-Id: I31eee8be30c6b0fc3dadb31111dd47742da8892d
2017-09-05 06:50:36 -06:00
Jenkins2
3e24a7ed7a Merge "chan_ooh323: Fix confusing indentation warning" into 15 2017-09-05 07:01:44 -05:00
George Joseph
9cc4620376 res_pjsip_t38: Make t38_reinvite_response_cb tolerant of NULL channel
t38_reinvite_response_cb can get called by res_pjsip_session's
session_inv_on_tsx_state_changed in situations where session->channel
is NULL.  If it is, the ast_log warning segfaults because it tries
to get the channel name from a NULL channel.

* Check session->channel and print "unknown channel" when it's NULL.

ASTERISK-27236
Reported by: Ross Beer

Change-Id: I4326e288d36327f6c79ab52226d54905cdc87dc7
2017-09-05 04:57:38 -06:00
Sean Bright
1d33757aa0 rtp_engine: Prevent possible double free with DTLS config
ASTERISK-27225 #close
Reported by: Richard Kenner

Change-Id: I097b81734ef730f8603c0b972909d212a3a5cf89
2017-09-01 17:59:58 -05:00
Sean Bright
1a4c58d1d9 chan_ooh323: Fix confusing indentation warning
ASTERISK-27177 #close
Reported by: Tzafrir Cohen

Change-Id: I40311c404edb2302a7543ad5ca7a06b2a38f2d97
2017-09-01 13:17:06 -05:00
Sean Bright
2872cdfce6 app_directory: Handle a NULL mailbox without crashing
ASTERISK-27241 #close
Reported by: David Moore

Change-Id: Ibbbca85517b04c315406ebfe3b6f7e0763daedc6
2017-09-01 10:28:07 -05:00
Jenkins2
53458b30ea Merge "chan_pjsip: Add tag info in CHANNEL function" into 15 2017-08-31 17:28:47 -05:00
Jenkins2
07f33f1637 Merge "res_rtp_asterisk: Allow remote SSRC to change on an RTP instance." into 15 2017-08-31 16:52:24 -05:00
Joshua Colp
d6f5e475ce Merge "AST-2017-006: Fix app_minivm application MinivmNotify command injection" into 15 2017-08-31 07:57:15 -05:00
Joshua Colp
b006220ebc Merge "res_rtp_asterisk: Only learn a new source in learn state." into 15 2017-08-31 07:52:44 -05:00
Joshua Colp
eb8ce92afe Merge "pjsip_message_ip_updater: Fix issue handling "tel" URIs" into 15 2017-08-31 07:52:20 -05:00
Joshua Colp
62578e02d0 Merge "confbridge: Handle user hangup during name recording" into 15 2017-08-30 13:54:15 -05:00
George Joseph
5180e2ba27 pjsip_message_ip_updater: Fix issue handling "tel" URIs
sanitize_tdata was assuming all URIs were SIP URIs so when a non
SIP uri was in the From, To or Contact headers, the unconditional
cast of a non-pjsip_sip_uri structure to pjsip_sip_uri caused
a segfault when trying to access uri->other_param.

* Added PJSIP_URI_SCHEME_IS_SIP(uri) || PJSIP_URI_SCHEME_IS_SIPS(uri)
  checks before attempting to cast or use the returned uri.

ASTERISK-27152
Reported-by: Ross Beer

Change-Id: Id380df790e6622c8058a96035f8b8f4aa0b8551f
2017-08-30 18:45:30 +00:00
Corey Farrell
0372157a48 AST-2017-006: Fix app_minivm application MinivmNotify command injection
An admin can configure app_minivm with an externnotify program to be run
when a voicemail is received.  The app_minivm application MinivmNotify
uses ast_safe_system() for this purpose which is vulnerable to command
injection since the Caller-ID name and number values given to externnotify
can come from an external untrusted source.

* Add ast_safe_execvp() function.  This gives modules the ability to run
external commands with greater safety compared to ast_safe_system().
Specifically when some parameters are filled by untrusted sources the new
function does not allow malicious input to break argument encoding.  This
may be of particular concern where CALLERID(name) or CALLERID(num) may be
used as a parameter to a script run by ast_safe_system() which could
potentially allow arbitrary command execution.

* Changed app_minivm.c:run_externnotify() to use the new ast_safe_execvp()
instead of ast_safe_system() to avoid command injection.

* Document code injection potential from untrusted data sources for other
shell commands that are under user control.

ASTERISK-27103

Change-Id: I7552472247a84cde24e1358aaf64af160107aef1
2017-08-30 18:42:58 +00:00
Joshua Colp
222d655a2e res_rtp_asterisk: Only learn a new source in learn state.
This change moves the logic which learns a new source address
for RTP so it only occurs in the learning state. The learning
state is entered on initial allocation of RTP or if we are
told that the remote address for the media has changed. While
in the learning state if we continue to receive media from
the original source we restart the learning process. It is
only once we receive a sufficient number of RTP packets from
the new source that we will switch to it. Once this is done
the closed state is entered where all packets that do not
originate from the expected source are dropped.

The learning process has also been improved to take into
account the time between received packets so a flood of them
while in the learning state does not cause media to be switched.

Finally RTCP now drops packets which are not for the learned
SSRC if strict RTP is enabled.

ASTERISK-27013

Change-Id: I56a96e993700906355e79bc880ad9d4ad3ab129c
2017-08-30 18:38:42 +00:00
Joshua Colp
6c2c74492d res_rtp_asterisk: Allow remote SSRC to change on an RTP instance.
When SDP renegotiation occurs it is possible for an RTP
instance to be reused for a new stream, resulting in the remote
SSRC changing if it is part of a bundle group. This change
allows this and updates its mapping in the current bundle
group.

ASTERISK-27231

Change-Id: I6e3703974f236bc024c5dbe9bd43adae0c6fb490
2017-08-30 09:18:40 -05:00
Andre Nazario
033087ba1c chan_pjsip: Add tag info in CHANNEL function
Create local_tag and remote_tag in CHANNEL info to get tag from From and
To headers of a SIP dialog.

ASTERISK-27220

Change-Id: I59b16c4b928896fcbde02ad88f0e98922b15d524
2017-08-30 07:52:10 -05:00