Commit Graph

29188 Commits

Author SHA1 Message Date
Sean Bright
f3b1b64d21 pjproject: Patch to correct STUN FINGERPRINT usage
Change-Id: I0e453253dff1388b0186b36c754457c1d0d12db6
2017-09-25 14:09:33 -04:00
Joshua Colp
7977daa0cc Merge "build: A few gcc 7 error fixes" into 13 2017-09-25 12:29:14 -05:00
George Joseph
690f7f7c76 build: A few gcc 7 error fixes
Change-Id: I7b5300fbf1af7d88d47129db13ad6dbdc9b553ec
2017-09-25 06:25:06 -06:00
Sean Bright
f39af4d36d res_pjsip: Use ast_sip_is_content_type() where appropriate
Change-Id: If3ab0d73d79ac4623308bd48508af2bfd554937d
2017-09-22 11:04:31 -04:00
Jenkins2
9576ae0e7e Merge "res_config_pgsql: Fix removed support to previous for versions PostgreSQL 9.1" into 13 2017-09-22 05:31:51 -05:00
Jenkins2
fef8b6efec Merge "res_srtp: lower log level of auth failures" into 13 2017-09-21 11:35:06 -05:00
Rodrigo Ramírez Norambuena
c98e980fff res_config_pgsql: Fix removed support to previous for versions PostgreSQL 9.1
In PostgreSQL 9.1 the backslash are string literals and not the escape
of characters.

In previous issue ASTERISK_26057 was fixed the use of escape LIKE but the
support for old version of Postgresql than 9.1 was dropped. The sentence
before make was "ESCAPE '\'" but in version before than 9.1  need it to be
as follow "ESCAPE '\\'".

ASTERISK-27283

Change-Id: I96d9ee1ed7693ab17503cb36a9cd72847165f949
2017-09-21 11:25:39 -05:00
Joshua Colp
2f8e7be0d1 Merge "chan_sip: Expose read-only access to the full SIP INVITE Request-URI" into 13 2017-09-21 11:16:24 -05:00
Jean Aunis
da40976987 bridge : Fix one-way direct-media when early bridging with native_rtp
When two channels were early bridged in a native_rtp bridge, the RTP description
on one side was not updated when the other side answered.
This patch forbids non-answered channels to enter a native_rtp bridge, and
triggers a bridge reconfiguration when an ANSWER frame is received.

ASTERISK-27257

Change-Id: If1aaee1b4ed9658a1aa91ab715ee0a6413b878df
2017-09-20 10:19:07 -05:00
Jenkins2
4bde3d8634 Merge "res_pjsip_pubsub: Check for Content-Type header in rx_notify_request" into 13 2017-09-20 07:59:36 -05:00
George Joseph
828a0611bc res_pjsip_pubsub: Check for Content-Type header in rx_notify_request
pubsub_on_rx_notify_request wasn't checking for a null
Content-Type header before checking that it was
application/simple-message-summary.

ASTERISK-27279
Reported by: Ross Beer

Change-Id: Iec2a6c4d2e74af37ff779ecc9fd35644c5c4ea52
2017-09-19 12:49:06 -06:00
Jenkins2
2f11ea59db Merge "AST-2017-008: Improve RTP and RTCP packet processing." into 13 2017-09-19 10:37:10 -05:00
David J. Pryke
94f616e5e2 chan_sip: Expose read-only access to the full SIP INVITE Request-URI
Provide a way to get the contents of the the Request URI from the initial SIP
INVITE in dial plan function call. (In this case "${CHANNEL(ruri)}")

ASTERISK-27278
Reported by: David J. Pryke
Tested by: David J. Pryke

Change-Id: I1dd4d6988eed1b6c98a9701e0e833a15ef0dac3e
2017-09-19 10:34:01 -04:00
Joshua Colp
839c35adab Merge "res_calendar: On reload, update all configuration" into 13 2017-09-19 07:32:56 -05:00
Jenkins2
1a35e2b8c1 Merge "cdr_mysql.c: Apply cdrzone to start and answer" into 13 2017-09-19 06:25:59 -05:00
Alexander Traud
cfc0ca1fb5 tcptls: Fixed a white space error.
ASTERISK-26606

Change-Id: I81a7268ef7ba012d4d80d44c70b6276d48e397fa
2017-09-18 17:27:24 +02:00
Alexander Traud
99a08eb7ab res_srtp: lower log level of auth failures
Previously, sRTP authentication failures were reported on log level WARNING.
When such failures happen, each RT(C)P packet is affected, spamming the log.
Now, those failures are reported at log level VERBOSE 2. Furthermore, the
amount is further reduced (previously all two seconds, now all three seconds).
Additionally, the new log entry informs whether media (RTP) or statistics (RTCP)
are affected.

ASTERISK-16898 #close

Change-Id: I6c98d46b711f56e08655abeb01c951ab8e8d7fa0
2017-09-18 17:00:31 +02:00
alex
f1eb36ea51 cdr_mysql.c: Apply cdrzone to start and answer
Change-Id: I7de0a5adc89824a5f2b696fc22c80fc22dff36b0
2017-09-18 07:03:00 -05:00
Richard Mudgett
6d4b801c83 AST-2017-008: Improve RTP and RTCP packet processing.
Validate RTCP packets before processing them.

* Validate that the received packet is of a minimum length and apply the
RFC3550 RTCP packet validation checks.

* Fixed potentially reading garbage beyond the received RTCP record data.

* Fixed rtp->themssrc only being set once when the remote could change
the SSRC.  We would effectively stop handling the RTCP statistic records.

* Fixed rtp->themssrc to not treat a zero value as special by adding
rtp->themssrc_valid to indicate if rtp->themssrc is available.

ASTERISK-27274

Make strict RTP learning more flexible.

Direct media can cause strict RTP to attempt to learn a remote address
again before it has had a chance to learn the remote address the first
time.  Because of the rapid relearn requests, strict RTP could latch onto
the first remote address and fail to latch onto the direct media remote
address.  As a result, you have one way audio until the call is placed on
and off hold.

The new algorithm learns remote addresses for a set time (1.5 seconds)
before locking the remote address.  In addition, we must see a configured
number of remote packets from the same address in a row before switching.

* Fixed strict RTP learning from always accepting the first new address
packet as the new stream.

* Fixed strict RTP to initialize the expected sequence number with the
last received sequence number instead of the last transmitted sequence
number.

* Fixed the predicted next sequence number calculation in
rtp_learning_rtp_seq_update() to handle overflow.

ASTERISK-27252

Change-Id: Ia2d3aa6e0f22906c25971e74f10027d96525f31c
2017-09-15 15:46:30 -05:00
Jenkins2
b6e1b13de4 Merge "res_pjsip: Filter out non SIP(S) requests" into 13 2017-09-15 15:24:50 -05:00
Sean Bright
5075cc8eed res_calendar: On reload, update all configuration
This changes the behavior of res_calendar to drop all existing calendars
and re-create them whenever a reload is done. The Calendar API provides
no way for configuration information to be pushed down to calendar
'techs' so updated settings would not take affect until a module
unload/load was done or Asterisk was restarted.

Asterisk 15+ already has a configuration option 'fetch_again_at_reload'
that performs a similar function.

Also fix a tiny memory leak in res_calendar_caldav while we're at it.

ASTERISK-25524 #close
Reported by: Jesper

Change-Id: Ib0f8057642e9d471960f1a79fd42e5a3ce587d3b
2017-09-15 14:45:57 -05:00
Jenkins2
14109355f3 Merge "res_calendar: Various fixes" into 13 2017-09-15 08:10:22 -05:00
George Joseph
63900374fa res_pjsip: Filter out non SIP(S) requests
Incoming requests with non sip(s) URIs in the Request, To, From
or Contact URIs are now rejected with
PJSIP_SC_UNSUPPORTED_URI_SCHEME (416).  This is performed in
pjsip_message_filter (formerly pjsip_message_ip_updater) and is
done at pjproject's "TRANSPORT" layer before a request can even
reach the distributor.

URIs read by res_pjsip_outbound_publish from pjsip.conf are now
also checked for both length and sip(s) scheme.  Those URIs read
by outbound registration and aor were already being checked for
scheme but their error messages needed to be updated to include
scheme failure as well as length failure.

Change-Id: Ibb2f9f1d2dc7549da562af4cbd9156c44ffdd460
2017-09-14 13:08:38 -06:00
Jenkins2
77c6bab990 Merge "chan_rtp: Use μ-law by default instead of signed linear" into 13 2017-09-14 12:53:10 -05:00
Jenkins2
df7211421e Merge "res_pjsip: Add handling for incoming unsolicited MWI NOTIFY" into 13 2017-09-14 11:53:47 -05:00
Sean Bright
db785ddb92 res_calendar: Various fixes
* The way that we were looking at XML elements for CalDAV was extremely
  fragile, so use SAX2 for increased robustness.

* Don't complain about a 'channel' not be specified if autoreminder is
  not set. Assume that if 'channel' is not set, we don't want to be
  notified.

* Fix some truncated CLI output in 'calendar show calendar' and make the
  'Autoreminder' description a bit more clear

ASTERISK-24588 #close
Reported by: Stefan Gofferje

ASTERISK-25523 #close
Reported by: Jesper

Change-Id: I200d11afca6a47e7d97888f286977e2e69874b2c
2017-09-13 15:46:43 -04:00
Sean Bright
0688f61a01 chan_rtp: Use μ-law by default instead of signed linear
Multicast/Unicast RTP do not use SDP so we need to use a format that
cleanly maps to one of the static RTP payload types. Without this
change, an Originate to a Multicast or Unicast channel without a format
specified would produce no audio on the receiving device.

ASTERISK-21399 #close
Reported by: Tzafrir Cohen

Change-Id: I97e332b566e85da04b0004b9b0daae746cfca0e3
2017-09-13 10:38:11 -04:00
George Joseph
ed2a4ee81e res_pjsip: Add handling for incoming unsolicited MWI NOTIFY
A new endpoint parameter "incoming_mwi_mailbox" allows Asterisk to
receive unsolicited MWI NOTIFY requests and make them available to
other modules via the stasis message bus.

res_pjsip_pubsub has a new handler "pubsub_on_rx_mwi_notify_request"
that parses a simple-message-summary body and, if
endpoint->incoming_mwi_account is set, calls ast_publish_mwi_state
with the voice-message counts from the message.

Change-Id: I08bae3d16e77af48fcccc2c936acce8fc0ef0f3c
2017-09-13 08:21:36 -06:00
Jenkins2
1aef4fe9df Merge "alembic: Fix typo in add_auto_info_to_endpoint_dtmf_mode" into 13 2017-09-12 14:13:17 -05:00
Richard Mudgett
044674c0cd res_rtp_asterisk.c: Add doxygen to RTCP payload types.
Change-Id: I3f20ce428777cc4ce9c13b2f808d29ff8c873998
2017-09-11 12:34:46 -05:00
Jenkins2
55af8326b5 Merge "alembic: Add support for MS-SQL" into 13 2017-09-11 06:39:28 -05:00
George Joseph
5ff2d06aa6 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 04:52:51 -06:00
Walter Doekes
babb617f20 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 13:17:27 +02:00
Florian Floimair
ad606844be 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: I4a399ba3eed41a33ce8cb294968ad340221580ee
2017-09-08 11:48:00 -05:00
Jenkins2
63211cc0ff Merge "app_waitforsilence: Cleanup & don't treat missing frames as 'noise'" into 13 2017-09-08 10:42:37 -05:00
Joshua Colp
2971c2f333 Merge "chan_sip: when getting sip pvt return failure if not found" into 13 2017-09-08 09:37:51 -05:00
Jenkins2
584f6abc4e Merge "res_srtp: Add support for libsrtp2.1." into 13 2017-09-07 13:26:39 -05:00
Jenkins2
bab59a8190 Merge "chan_sip: Do not change IP address in SDP origin line (o=) in SIP reINVITE" into 13 2017-09-07 13:05:42 -05:00
Jenkins2
1161fce1a1 Merge "func_cdr: honour 'u' flag on dummy channel" into 13 2017-09-07 10:40:40 -05:00
Jacek Konieczny
2aefc6e5fe 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-07 04:36:59 -05:00
Scott Griepentrog
c0d4f1880e 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:14:26 -05:00
Sean Bright
e4797b2cbd 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:11:41 -04:00
George Joseph
186ef1a657 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 12:41:25 -05:00
Joshua Colp
9a366d2424 Merge "alembic: Fix enum creation for dtls_fingerprint" into 13 2017-09-06 11:23:19 -05:00
Jenkins2
f6d63a2539 Merge "alembic: fix erroneous commit for add_prune_on_boot" into 13 2017-09-06 10:19:28 -05:00
Jenkins2
47e8ffe40a Merge "res/res_pjsip: Standardize/fix localnet checks across pjsip." into 13 2017-09-06 09:43:32 -05:00
Jenkins2
ae5471e313 Merge "res_rtp_asterisk.c: Check RTP packet version earlier." into 13 2017-09-06 09:34:55 -05:00
Vitezslav Novy
597d1f8951 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 16:22:53 +02:00
Jenkins2
b55bab3237 Merge "formats: Restore previous fread() behavior" into 13 2017-09-06 09:03:04 -05:00
George Joseph
15ddc9acb3 alembic: Fix enum creation for dtls_fingerprint
Change-Id: Ic061c5066a146616a68376881c7e4cf6d6e7e7db
2017-09-06 06:56:13 -06:00