Commit Graph

29401 Commits

Author SHA1 Message Date
Jenkins2
e8cfd5a80f Merge "bridge_softmix.c: Remove always true test." into 13 2017-08-23 11:20:33 -05:00
Richard Mudgett
3f22b53349 bridge_softmix.c: Remove always true test.
Change-Id: I26238df2ff0d0f6dfe95c3aa35da588f1ee71727
2017-08-22 11:04:15 -05:00
Sungtae Kim
b88c3a4209 app_queue: Fix initial hold time queue statistic
Fixed to use correct initial value and fixed to use the
correct queue info to check the first value.

ASTERISK-27204

Change-Id: Ia9e36c828e566e1cc25c66f73307566e4acb8e73
2017-08-22 08:27:47 -05:00
Jenkins2
71753d67f4 Merge "res_xmpp: fix inverted return code check in OAuth" into 13 2017-08-22 07:43:35 -05:00
Torrey Searle
8e99969000 res/res_pjsip_session: allow SDP answer to be regenerated
If an SDP answer hasn't been sent yet, it's legal to change it.
This is required for PJSIP_DTMF_MODE to work correctly, and can
also have use in the future for updating codecs too.

ASTERISK-27209 #close

Change-Id: Idbbfb7cb3f72fbd96c94d10d93540f69bd51e7a1
2017-08-22 12:22:56 +00:00
Jenkins2
3fffa7ae86 Merge "res_calendar_icalendar: Properly handle recurring events" into 13 2017-08-22 05:07:03 -05:00
Michael Kuron
4faf77feec res_xmpp: fix inverted return code check in OAuth
fetch_access_token calls func_curl via ast_func_read. The latter returns 0 upon
success and -1 if the function is not available.
This commit inverts the return code check so that an error is printed if the
module is not loaded and not if it is loaded.

ASTERISK-27207 #close

Change-Id: I9ef903f80702d1218e8701f65a4e5e918e6548fb
2017-08-22 00:34:54 -05:00
Sean Bright
a6251ec373 res_calendar_icalendar: Properly handle recurring events
When looking for recurring events, use the correct end time based on the
configured 'timeframe.'

ASTERISK-27174 #close
Reported by: Mark Thompson

Change-Id: Id90c3cfc79d561a5521d79be176683e225f2edef
2017-08-17 13:14:54 -04:00
George Joseph
572b5307e0 Fix downloader not working with curl
The codec/dpma downloader wasn't handling curl correctly.  The logic
that transforms makeopts into a bash-sourceable file wasn't
handling the make 'or' command in DOWNLOAD_TIMEOUT so bash was
looking for an 'or' command.

That logic has been eliminated.  Instead of trying to transform
and source makeopts, the downloader now calls a make scriptlet
to print the value of a specific variable.  This way, make handles
the ors (or any other make construct that happens to creep into
that file).

ASTERISK-27202
Reported by: Sean McCord

Change-Id: Iadfb6693528e4d4da7b8bb201fa66da2c71c7f99
2017-08-16 15:04:12 -06:00
Jenkins2
b461fe8bcd Merge "configure: Check cache for valid pjproject tarball before downloading." into 13 2017-08-16 07:06:55 -05:00
Richard Mudgett
8594f73a81 configure: Check cache for valid pjproject tarball before downloading.
On a fresh Asterisk source directory, the bundled pjproject tarball is
unconditionally downloaded even if the tarball is already in a specified
cache directory.

* Made check if the pjproject tarball is valid in the cache directory
before downloading the tarball on a fresh source directory.

Change-Id: Ic7ec842d3c97ecd8dafbad6f056b7fdbce41cae5
2017-08-15 15:17:22 -05:00
Richard Mudgett
d08342b0cb res_pjsip: Fix prune_on_boot to remove only contacts for the host.
* Check that the contact's reg_server matches the host's name before
deleting any prune_on_boot contacts.  We don't want to delete reliable
transport contacts made with other servers if the ps_contacts database
table is shared with other servers.

Thanks to Ross Beer for pointing out that the original prune logic would
delete reliable transport contacts from other servers.

ASTERISK-27147

Change-Id: I8e439d0d1c266ffdfd7b73d1e5e466180a689bd0
2017-08-15 11:21:20 -05:00
Jenkins2
fa50a3def9 Merge "res_xmpp: Google OAuth 2.0 protocol support for XMPP / Motif" into 13 2017-08-15 08:18:29 -05:00
Andrey Egorov
54e3ac402f res_xmpp: Google OAuth 2.0 protocol support for XMPP / Motif
Add ability to use tokens instead of passwords according to Google OAuth 2.0
protocol.

ASTERISK-27169
Reported by: Andrey Egorov
Tested by: Andrey Egorov

Change-Id: I07f7052a502457ab55010a4d3686653b60f4c8db
2017-08-15 11:08:59 +00:00
George Joseph
b81de2c896 Merge "res_pjsip_outbound_registration.c: Re-REGISTER on transport shutdown." into 13 2017-08-14 14:56:29 -05:00
Jenkins2
1bfb4047ae Merge "res_pjsip: Remove ephemeral registered contacts on transport shutdown." into 13 2017-08-14 13:14:13 -05:00
Jenkins2
cc4735742c Merge "res_pjsip: PJSIP Transport state monitor refactor." into 13 2017-08-14 13:05:29 -05:00
Jenkins2
1ff6082da9 Merge "res_pjsip_transport_management.c: Rename some variables." into 13 2017-08-14 12:49:45 -05:00
Richard Mudgett
bac3e8c08b STUN/netsock2: Fix some valgrind uninitialized memory findings.
* netsock2.c: Test the addr->len member first as it may be the only member
initialized in the struct.

* stun.c:ast_stun_handle_packet(): The combinded[] local array could get
used uninitialized by ast_stun_request().  The uninitialized string gets
copied to another location and could overflow the destination memory
buffer.

These valgrind findings were found for ASTERISK_27150 but are not
necessarily a fix for the issue.

Change-Id: I55f8687ba4ffc0f69578fd850af006a56cbc9a57
2017-08-10 14:27:15 -05:00
Richard Mudgett
1cf2c79f37 res_pjsip_outbound_registration.c: Re-REGISTER on transport shutdown.
The fix for the issue is broken up into three parts.

This is part three which handles the client side of REGISTER requests.
The registered contact may no longer be valid on the server when the
transport used is reliable and the connection is broken.

* Re-REGISTER our contact if the reliable transport is broken after
registration completes.  We attempt to re-REGISTER immediately to minimize
the time we are unreachable.  Time may have already passed between the
connection being broken and the loss being detected.

* Reorder sip_outbound_registration_state_alloc() so the STATSD_GUAGE's
are still correct if an allocation failure happens.

ASTERISK-27147

Change-Id: I3668405b1ee75dfefb07c0d637826176f741ce83
2017-08-10 12:13:18 -05:00
Richard Mudgett
07d026b4cd res_pjsip: Remove ephemeral registered contacts on transport shutdown.
The fix for the issue is broken up into three parts.

This is part two which handles the server side of REGISTER requests when
rewrite_contact is enabled.  Any registered reliable transport contact
becomes invalid when the transport connection becomes disconnected.

* Monitor the rewrite_contact's reliable transport REGISTER contact for
shutdown.  If it is shutdown then the contact must be removed because it
is no longer valid.  Otherwise, when the client attempts to re-REGISTER it
may be blocked because the invalid contact is there.  Also if we try to
send a call to the endpoint using the invalid contact then the endpoint is
not likely to see the request.  The endpoint either won't be listening on
that port for new connections or a NAT/firewall will block it.

* Prune any rewrite_contact's registered reliable transport contacts on
boot.  The reliable transport no longer exists so the contact is invalid.

* Websockets always rewrite the REGISTER contact address and the transport
needs to be monitored for shutdown.

* Made the websocket transport set a unique name since that is what we use
as the ao2 container key.  Otherwise, we would not know which transport we
find when one of them shuts down.  The names are also used for PJPROJECT
debug logging.

* Made the websocket transport post the PJSIP_TP_STATE_CONNECTED state
event.  Now the global keep_alive_interval option, initially idle shutdown
timer, and the server REGISTER contact monitor can work on wetsocket
transports.

* Made the websocket transport set the PJSIP_TP_DIR_INCOMING direction.
Now initially idle websockets will automatically shutdown.

ASTERISK-27147

Change-Id: I397a5e7d18476830f7ffe1726adf9ee6c15964f4
2017-08-10 12:13:18 -05:00
Richard Mudgett
ca261d4b70 res_pjsip: PJSIP Transport state monitor refactor.
The fix for the issue is broken up into three parts.

This is part one which refactors the transport state monitor code to allow
more modules to be able to monitor transports.

* Pull the management of PJPROJECT's transport state callback code from
res_pjsip_transport_management.c into res_pjsip.  Now other modules can
dynamically add and remove themselves from transport monitoring without
worrying about breaking PJPROJECT's callback chain.

* Add the ability for other modules to get a callback whenever a specific
transport is shutdown.

ASTERISK-27147

Change-Id: I7d9a31371eb1487c9b7050cf82a9af5180a57912
2017-08-10 12:13:18 -05:00
Richard Mudgett
162f6ab845 res_pjsip_transport_management.c: Rename some variables.
* Use monitored instead of the misleading keepalive name.

Change-Id: I9e5bcbb4ab2b82d49bcd0f06dfe85d15e0b552b6
2017-08-10 12:13:18 -05:00
Jenkins2
7ad750477d Merge "res_pjsip_messaging: IPv6 receive address needs brackets" into 13 2017-08-10 11:00:44 -05:00
Scott Griepentrog
22575b6342 res_pjsip_messaging: IPv6 receive address needs brackets
When handling an incoming SIP MESSAGE, PJSIP
attaches the IP address that the message was
received from to the message in the variable
PJSIP_RECVADDR.  When the IP address is IPv6
the :PORT appended results in an unparseable
mess. By using an additional bit flag on the
pj_sockaddr_print call, the conventional use
of brackets around the address is achieved.

ASTERISK-27193 #close

Change-Id: I12342521f2ce87a5b6e4883d480a3fd957aa9fd9
2017-08-10 09:21:02 -05:00
Joshua Colp
0cf2e60161 Merge "configure: Add --with-download-cache option" into 13 2017-08-10 06:58:01 -05:00
Jenkins2
9bc114ffba Merge "res_rtp_asterisk: enable rtcp & QOS stats on native bridge" into 13 2017-08-09 15:48:42 -05:00
Joshua Colp
b5eca43b29 Merge "res_rtp_asterisk: Make P2P bridge Asymmetric codec aware" into 13 2017-08-09 14:54:26 -05:00
George Joseph
363d61ef58 configure: Add --with-download-cache option
To make building without an internet connection easier, a new
./configure option '--with-download-cache' was added that sets
the cache for externals (like pjproject, the codecs and the DPMA),
AND the sounds files.  It can also be specified as an environment
variable named "AST_DOWNLOAD_CACHE".  The existing
'--with-sounds-cache' option / SOUNDS_CACHE_DIR env variable and
'--with-externals-cache' option / EXTERNALS_CACHE_DIR env variable
remain and if specified, will override '--with-downloads-cache'.

Change-Id: I5c3cf15ee61e8fe191b52732303e969854f8d861
2017-08-09 07:01:33 -06:00
Jenkins2
0493f08468 Merge "res_pjsip_session: Release media resources on session end quicker." into 13 2017-08-07 18:48:14 -05:00
Jenkins2
f75f6c71f8 Merge "res_pjsip_nat.c: Remove unnecessary CMP_STOP." into 13 2017-08-07 08:28:18 -05:00
Jenkins2
3cf30b4544 Merge "Support GMIME 3.0" into 13 2017-08-07 08:05:45 -05:00
Torrey Searle
3608f96ea3 res_rtp_asterisk: enable rtcp & QOS stats on native bridge
Asterisk wasn't generating or forwarding RTCP packets when native
bridge was activated.  Also the stats weren't available via
CHANNEL(qos). Now the RTCP stats are always calculated.

ASTERISK-27158 #close

Change-Id: I46fb8f61c95e836b9d2dda6054b0cf205c16037b
2017-08-07 12:07:51 +00:00
Joshua Colp
0de7312fac res_pjsip_session: Release media resources on session end quicker.
A change was made long ago where the session was kept around
until the underlying INVITE session had been destroyed. This
had the side effect of also keeping the underlying media resources
around for this time as well.

This change ensures that when we know the session is ending we
release the media resources immediately.

ASTERISK-27110

Change-Id: I643e431d5c3bf05cda220c1d39e824a505a29b82
2017-08-05 11:39:55 +00:00
Corey Farrell
905c4ca3dc app_privacy: remove unused header asterisk/image.h
Change-Id: I56ed530633a642633b18383821069e806c92ae82
2017-08-04 14:17:16 -05:00
Jenkins2
6dd12aaacd Merge "Fix compile error for old versions of GCC." into 13 2017-08-04 12:37:05 -05:00
Jenkins2
672af3c0ea Merge "Correct some leaks in unit tests." into 13 2017-08-04 11:01:37 -05:00
Jenkins2
b1537ce7f6 Merge "res_pjsip_transport_websocket.c: Fix serializer ref leak." into 13 2017-08-04 10:14:49 -05:00
Tzafrir Cohen
38dbc708e7 Support GMIME 3.0
Support building the Asterisk httpd with version 3.0 of gmime as
well as earlier versions of that library.

ASTERISK-27173

Change-Id: I7e13dd05a3083ccb0df2dabf83110223f6a9fa8f
2017-08-04 09:44:27 -05:00
Jenkins2
bc097c4671 Merge "res_pjsip_outbound_registration.c: Misc fixes." into 13 2017-08-04 09:23:15 -05:00
Torrey Searle
c4f201cd73 res_rtp_asterisk: Make P2P bridge Asymmetric codec aware
Introduce a new property to rtp-engine to make it aware of
the desire for assymetric codecs or not.  If asymmetric codecs
is not allowed, the bridge will compare read/write formats
and shut down the p2p bridge if needed

ASTERISK-26745 #close

Change-Id: I0d9c83e5356df81661e58d40a8db565833501a6f
2017-08-04 10:38:12 +02:00
Corey Farrell
84b6a5efd7 Correct some leaks in unit tests.
* chan_sip: channel in test_sip_rtpqos_1.
* test_config: config hook, config info and global config holder.
* test_core_format: format in format_attribute_set_without_interface.
* test_stream: unneeded frame duplication.
* test_taskprocessor: task_data.

Change-Id: I94d364d195cf3b3b5de2bf3ad565343275c7ad31
2017-08-03 21:31:38 -05:00
Richard Mudgett
f9a823e9dc res_pjsip_transport_websocket.c: Fix serializer ref leak.
Change-Id: Ib5a19bfd597f63d9021baeb645fc11153b3afa57
2017-08-03 16:28:02 -05:00
Richard Mudgett
631180a0c3 res_pjsip_outbound_registration.c: Misc fixes.
* Remove unnecessary CMP_STOP.

* In handle_client_registration() use DEBUG_ATLEAST() to only do work
needed for the debug log message when the debug log message is needed.

* In sip_outbound_registration_state_destroy() check state->registration
for NULL.

Change-Id: I656d0fa11dda0b00048103efb1558e67a426fd80
2017-08-03 16:25:49 -05:00
Richard Mudgett
7b84c6693e res_pjsip_nat.c: Remove unnecessary CMP_STOP.
Change-Id: I6279b0d723bc3b75b8d65e81e02da9ea9bc0c3da
2017-08-03 16:23:13 -05:00
Richard Mudgett
a32614a2a8 res_pjsip_registrar.c: Remove unnecessary CMP_STOP.
Most uses of CMP_STOP are superfluous and are only respected when
OBJ_MULTIPLE is used to search the container.

Change-Id: I20571a202ec0aa1098bb2749eeba18de7ca110b8
2017-08-03 16:17:14 -05:00
Corey Farrell
d066758a4c Fix compile error for old versions of GCC.
Use -Wno-format-truncation only if supported by compiler.

ASTERISK-27171 #close

Change-Id: Iac0aed7a5bcaa16c21b7d62c4e4678d244c4ccb6
2017-08-03 12:30:31 -04:00
George Joseph
ed1bce956e Revert "res_pjsip_session: Release media resources on session end quicker."
This reverts commit 98709642d640b490f327d220fdcdea6d45fd65d7.

See the 15 branch review.

Change-Id: I8476b3cdacaad5157fa36b6247d0e4cdf1e8d5c6
2017-08-01 15:44:30 -06:00
Niklas Larsson
9a09f7dd5d app_queue: Add priority to AMI QueueStatus
Add priority to callers in AMI QueueStatus response

ASTERISK-27092 #close

Change-Id: I8d1f737a72c7c38f4cfe1a4ee3ecc0a4f85bd199
2017-08-01 15:44:30 -06:00
Joshua Colp
3418d8d145 res_pjsip_session: Release media resources on session end quicker.
A change was made long ago where the session was kept around
until the underlying INVITE session had been destroyed. This
had the side effect of also keeping the underlying media resources
around for this time as well.

This change ensures that when we know the session is ending we
release the media resources immediately.

ASTERISK-27110

Change-Id: I3c6a82fe7d2c50b9dc9197cb12ef22f20d337501
2017-08-01 15:44:30 -06:00