Commit Graph

29154 Commits

Author SHA1 Message Date
zuul 3fe1d8afba Merge "core: Add stream topology changing primitives with tests." 2017-03-15 17:23:30 -05:00
Joshua Colp e536ef7afb Merge "res_pjsip_endpoint_identifier_ip: Add an option to match requests by header" 2017-03-15 14:49:13 -05:00
Joshua Colp 2cb449a621 Merge "configure: Don't use the progress bar with curl when downloading to stdout" 2017-03-15 13:01:16 -05:00
Matt Jordan 1475604eff res_pjsip_endpoint_identifier_ip: Add an option to match requests by header
This patch adds a new features to the endpoint identifier module,
'match_header'. When set, inbound requests are matched by a provided SIP
header: value pair. This option works in conjunction with the existing
'match' configuration option, such that if any 'match*' attribute
matches an inbound request, the request is associated with the specified
endpoint.

Since this module now identifies by more than just IP address,
appropriate renaming of the module and/or variables can be done in a
non-release branch.

ASTERISK-26863 #close

Change-Id: Icfc14835c962f92e35e67bbdb235cf0589de5453
(cherry picked from commit 30f52d79d7)
2017-03-15 07:51:35 -06:00
George Joseph 71cc3fd969 Merge "res_pjsip_endpoint_identifier_ip: Clean up a spaces/tabs issue" 2017-03-15 08:47:36 -05:00
Joshua Colp c5e1e85355 Merge "configs/samples/hep.conf.sample: Clarify how the HEP stack works" 2017-03-15 05:20:50 -05:00
Joshua Colp 2ffce60844 Merge "main/stasis_cache: Demote the ERROR message when removing a nonexistent item" 2017-03-15 05:19:33 -05:00
zuul c152329932 Merge "res_pjsip_transport_websocket: Add support for IPv6." 2017-03-14 21:22:26 -05:00
Matt Jordan 59130260e7 configure: Don't use the progress bar with curl when downloading to stdout
In some scenarios, such as when there may not be a terminal (such as
inside a Docker container), curl will apparently direct the progress bar
to stdout. This can cause extra data to be appended to a file curl'd
down to stdout, resulting in md5 verification failures.

This patch removes the progress bar, and tells curl to download the file
silently.

ASTERISK-26872 #close

Change-Id: Ie860b020f627d4372b3e7ce9453de5faafeebe6c
2017-03-14 14:14:15 -06:00
zuul 2b611a8d93 Merge "chan_pjsip: Don't assume a session will have a channel." 2017-03-14 14:07:51 -05:00
Joshua Colp 578bc33f6f Merge "chan_sip: Call not cancelled after receiving a 422 response" 2017-03-14 11:47:30 -05:00
Matt Jordan 05713c36ea configs/samples/hep.conf.sample: Clarify how the HEP stack works
This patch updates the documenation in hep.conf.sample to better specify
how the various HEP modules interact.

ASTERISK-26717 #close

Change-Id: I337fb742a89e3ec5edc7fc7a7a0295218d841124
2017-03-14 09:52:59 -06:00
Matt Jordan b03b72717f main/stasis_cache: Demote the ERROR message when removing a nonexistent item
This patch demotes the ERROR message that is displayed when a
nonexistent item is removed from the Stasis cache. The genesis of this
demotion is due to chan_sip's realtime peers and their interaction with
Asterisk's core ast_endpoint code, but ostensibly it could happen from
other channel drivers as well.

Since Mark Michelson already did an excellent job of explaining on this
issue, it is quoted here for posterity:

"Internally, when a realtime peer is retrieved, Asterisk creates an
ast_endpoint structure. When that peer is destroyed, the ast_endpoint is
destroyed as well. Part of the destruction of the ast_endpoint involves
clearing the Stasis cache of all information about that endpoint. The
problem here is that the act of creating the ast_endpoint is not enough
to actually put any information in the Stasis cache. Instead, something
has to happen, such as a state change, in order for the Stasis cache to
have any information about that endpoint. When a device registers,
chan_sip creates an ast_endpoint structure, processes the REGISTER, and
then destroys the ast_endpoint. When the ast_endpoint is destroyed,
there is nothing to destroy in the Stasis cache, so an error message is
emitted. When you use rtcachefriends, ast_endpoint structures persist
for the lifetime of the module and so you do not see this error
message."

ASTERISK-25237 #close

Change-Id: I53cebc6b4a897a1ab9564182b75c177780feff70
2017-03-14 08:40:54 -06:00
Matt Jordan 2d7e68c075 res_pjsip_endpoint_identifier_ip: Clean up a spaces/tabs issue
Tabs > spaces. Always.

Change-Id: I899ff662361c7ab0327173bd7851a67b53dd65f1
2017-03-14 07:00:02 -06:00
Joshua Colp 12460b05c1 chan_pjsip: Don't assume a session will have a channel.
When querying for PJSIP specific information using the dialplan
function CHANNEL() it is possible that the underlying session
will no longer have a channel associated with it. This is
most likely to occur when the RTCP HEP module attempts to get
the channel name. If this happens then a crash will occur.

This change just adds a check that the channel exists on the
session before querying it.

ASTERISK-26857

Change-Id: I113479cffff6ae64cf8ed089e9e1565223426f01
2017-03-13 12:37:55 -06:00
George Joseph d1ef127084 pjproject_bundled: Reduce the need for rebuilds
Bundled pjproject should now only rebuild if one of the menuselect
"Compiler Flags" options changes.

Change-Id: If114a2e16b9e77af371a600d6a5e197bbf28fe43
2017-03-10 20:31:30 -06:00
Joshua Colp 018e01543d Merge "pjsip/cli_commands: pjsip show channelstats shows wrong codec" 2017-03-10 16:02:08 -06:00
zuul 87aaaef8bb Merge "res_musiconhold: moh general section is a class and issues warning" 2017-03-09 18:32:03 -06:00
Joshua Colp 9250ddb8f2 Merge "media_cache: Prefer ast_file_is_readable() over access()" 2017-03-09 16:10:25 -06:00
Daniel Journo 36fed72614 pjsip/cli_commands: pjsip show channelstats shows wrong codec
* cli_commands.c Fixed CLI output

ASTERISK-26822 #close

Change-Id: I3889ef6a8f6738fc312fab42db5efacd6e452b01
2017-03-09 15:45:48 -06:00
Joshua Colp 6113bb470b Merge "pbx_spool: Set AST_OUTGOING_ATTEMPT variable on channel" 2017-03-09 14:29:02 -06:00
Daniel Journo b14724adb3 res_musiconhold: moh general section is a class and issues warning
* res_musiconhold.c: Ensure the general section is not treated as
a moh class.

ASTERISK-26353 #close

Change-Id: Ia3dbd11ea2b43ab3e6c820a9827811dd24bea82d
2017-03-09 10:36:35 -06:00
Sean Bright 35cfd2c0cc media_cache: Prefer ast_file_is_readable() over access()
Change-Id: Icc0dc6e61b2e68d5cdcb74b016b2726a388c7def
2017-03-08 17:26:41 -06:00
Sean Bright bc2c66b594 pbx_spool: Set AST_OUTGOING_ATTEMPT variable on channel
Set a variable on the channel that indicates which attempt number we
are currently performing to allow for attempt-specific behavior.

ASTERISK-26568 #close
Reported by: Roman Shubovich

Change-Id: Iacd7e8d43b0ed5b6cb021c62f41f1a1f5733dd89
2017-03-08 17:31:49 -05:00
Joshua Colp 4e3b0cedba res_pjsip_transport_websocket: Add support for IPv6.
This change adds a PJSIP patch (which has been contributed upstream)
to allow the registration of IPv6 transport types.

Using this the res_pjsip_transport_websocket module now registers
an IPv6 Websocket transport and uses it for the corresponding
traffic.

ASTERISK-26685

Change-Id: Id1f9126f995b31dc38db8fdb58afd289b4ad1647
2017-03-08 15:09:59 -06:00
Daniel Journo 60998371e3 app_voicemail: Cannot set fromstring on a per-mailbox basis
* apps/app_voicemail.c fromstring field added to mailbox which will
override the global fromstring if set.

ASTERISK-24562 #close

Change-Id: I5e90e3a1ec2b2d5340b49a0db825e4bbb158b2fe
2017-03-08 13:25:49 -06:00
zuul ff0569740a Merge "res_http_websocket: Fix faulty read logic." 2017-03-08 10:05:19 -06:00
zuul 9cd1a754a9 Merge "pbx_spool: Gracefully handle long lines in call files" 2017-03-07 17:54:30 -06:00
Mark Michelson 5d0371d743 res_http_websocket: Fix faulty read logic.
When doing some WebRTC testing, I found that the websocket would
disconnect whenever I attempted to place a call into Asterisk. After
looking into it, I pinpointed the problem to be due to the iostreams
change being merged in.

Under certain circumstances, a call to ast_iostream_read() can return a
negative value. However, in this circumstance, the websocket code was
treating this negative return as if it were a partial read from the
websocket. The expected length would get adjusted by this negative
value, resulting in the expected length being too large.

This patch simply adds an if check to be sure that we are only updating
the expected length of a read when the return from a read is positive.

ASTERISK-26842 #close
Reported by Mark Michelson

Change-Id: Ib4423239828a013d27d7bc477d317d2f02db61ab
2017-03-07 13:38:17 -06:00
Jean Aunis d51ca4b406 chan_sip: Call not cancelled after receiving a 422 response
When receiving a 422 response, the invitestate variable must be reset to
INV_CALLING.

ASTERISK-26841

Change-Id: Ia0502d6b02192664cefa4e75bafdd2645ce56099
2017-03-07 15:26:54 +01:00
Joshua Colp 3ed05badb9 core: Add stream topology changing primitives with tests.
This change adds a few things to facilitate stream topology changing:

1. Control frame types have been added for use by the channel driver
to notify the application that the channel wants to change the stream
topology or that a stream topology change has been accepted. They are
also used by the indicate interface to the channel that the application
uses to indicate it wants to do the same.

2. Legacy behavior has been adopted in ast_read() such that if a
channel requests a stream topology change it is denied automatically
and the current stream topology is preserved if the application is
not capable of handling streams.

Tests have also been written which confirm the multistream and
non-multistream behavior.

ASTERISK-26839

Change-Id: Ia68ef22bca8e8457265ca4f0f9de600cbcc10bc9
2017-03-07 12:08:51 +00:00
Daniel Journo 272259a2c6 Saynumber is trying to get "and" from "digits/" subfolder
* say.c Changed 'digits/and' to 'vm-and' for en_GB

ASTERISK-26598 #close

Change-Id: If1b713e5daea6f952b339f139178d292a6c4fcfe
2017-03-06 15:59:49 -06:00
Sean Bright 5a74abc53b pbx_spool: Gracefully handle long lines in call files
Per the linked issue, we aren't checking the buffer filled by fgets()
to determine if it contains a newline, so we will fail to correctly
parse the trailing portion of a long line.

This patch increases the buffer size from 256 to 1024, and skips any
line that exceeds that length, logging a warning in the process.

ASTERISK-17067 #close
Reported by: Dave Olszewski

Change-Id: I51bcf270c1b4347ba05b43f18dc2094c76f5d7b0
2017-03-06 15:29:52 -06:00
Richard Mudgett c9296b23d1 core: Cleanup ast_get_hint() usage.
* manager.c:manager_state_cb() Fix potential use of uninitialized hint[]
if a hint does not exist for the requested extension.  Ran into this when
developing a testsuite test.  The AMI event ExtensionStatus came out with
the hint header value containing garbage.  The AMI event PresenceStatus
also had the same issue.

* manager.c:action_extensionstate() no need to completely initialize the
hint[].  Only initialize the first element.

* pbx.c:ast_add_hint() Remove unnecessary assignment.

* chan_sip.c: Eliminate an unneeded hint[] local variable.  We only care
about the return value of ast_get_hint() there.

Change-Id: Ia9a8786f01f93f1f917200f0a50bead0319af97b
2017-03-02 21:46:51 -06:00
Joshua Colp e9b2360d17 Merge "res_pjsip WebRTC/websockets: Fix usage of WS vs WSS." 2017-03-01 17:24:43 -06:00
Joshua Colp fb11f038a3 Merge "stream: Unit tests for stream read and tweaks framework" 2017-03-01 14:58:45 -06:00
Joshua Colp 9b0e142a6a Merge "res_config_pgsql: Make 'require' return consistent with other backends" 2017-03-01 11:24:22 -06:00
Jørgen H 7922f26cb0 res_pjsip WebRTC/websockets: Fix usage of WS vs WSS.
According to the RFC[1] WSS should only be used in the Via header
for secure Websockets.

* Use WSS in Via for secure transport.

* Only register one transport with the WS name because it would be
ambiguous.  Outgoing requests may try to find the transport by name and
pjproject only finds the first one registered.  This may mess up unsecure
websockets but the impact should be minimal.  Firefox and Chrome do not
support anything other than secure websockets anymore.

* Added and updated some debug messages concerning websockets.

* security_events.c: Relax case restriction when determining security
transport type.

* The res_pjsip_nat module has been updated to not touch the transport
on Websocket originating messages.

[1] https://tools.ietf.org/html/rfc7118

ASTERISK-26796 #close

Change-Id: Ie3a0fb1a41101a4c1e49d875a8aa87b189e7ab12
2017-03-01 09:53:18 -06:00
George Joseph 0560c32375 stream: Unit tests for stream read and tweaks framework
* Removed the AST_CHAN_TP_MULTISTREAM tech property.  We now rely
  on read_stream being set to indicate a multi stream channel.
* Added ast_channel_is_multistream convenience function.
* Fixed issue where stream and default_stream weren't being set on
  a frame retrieved from the queue.
* Now testing for NULL being returned from the driver's read or
  read_stream callback.
* Fixed issue where the dropnondefault code was crashing on a
  NULL f.
* Now enforcing that if either read_stream or write_stream are
  set when ast_channel_tech_set is called that BOTH are set.
* Added the unit tests.

ASTERISK-26816

Change-Id: If7792b20d782e71e823dabd3124572cf0a4caab2
2017-03-01 07:30:49 -07:00
Sean Bright 1dacf317f3 res_config_pgsql: Make 'require' return consistent with other backends
res_config_pgsql should match the behavior of other realtime backend
drivers so that queue_log can disable adaptive logging.

ASTERISK-25628 #close
Reported by: Dmitry Wagin

Change-Id: Ic1fb1600c7ce10fdfb1bcdc43c5576b7e0014372
2017-03-01 07:27:50 -06:00
Mark Michelson 9c55a71798 SDP: Add initial SDP state machine.
This introduces and documents the various states in the state machine.
This also introduces API functions that induce state changes, and places
TODO comments telling what needs to be done in addition to what is
already there. Those TODOs will be replaced with real code in upcoming
changes.

Change-Id: I871c0eb480b4c84d83e91ac5628e7a673e8b89ed
2017-03-01 12:12:46 +00:00
Joshua Colp 26bf1846e2 Merge "media_cache: Mark cache entry stale if cache file is removed" 2017-03-01 04:47:59 -06:00
Joshua Colp 10d12b277c Merge "res_config_pgsql: Release table locks where appropriate" 2017-02-28 19:37:36 -06:00
Joshua Colp 063af910eb Merge "res_pjsip_outbound_registration: Subscribe to network change events" 2017-02-28 19:25:04 -06:00
Joshua Colp 6d3c1a4a21 Merge "build: Warn if asterisk is installed in both 32 and 64 bit sys dirs" 2017-02-28 17:47:46 -06:00
Joshua Colp 5e5aff04ec Merge "res_pjsip_pubsub: Remove unneeded endpoint unref" 2017-02-28 17:32:25 -06:00
zuul f41ace9042 Merge "bridge_native_rtp: Handle case where channel joins already suspended." 2017-02-28 17:14:25 -06:00
Sean Bright 60e9e4fcc0 media_cache: Mark cache entry stale if cache file is removed
In the event that a cache file is removed out from under us, we should
treat the cache entry as stale and force a refresh.

ASTERISK-26774 #close
Reported by: Igor Gamayunov

Change-Id: I3b1bd0c999d59d18664ef73a29823bc5b431dc52
2017-02-28 16:09:54 -06:00
Joshua Colp 0986998f2f Merge "config: Improve documentation and behavior of outbound_proxy option." 2017-02-28 14:44:29 -06:00
Joshua Colp 9c714b03f9 Merge "res_pjsip: Fix crash when contact has no status" 2017-02-28 10:24:45 -06:00