Commit Graph

29584 Commits

Author SHA1 Message Date
Jenkins2
c35fa1868e Merge "pjsip_options: contacts sometimes not being updated on reload" into 13 2017-12-13 14:22:18 -06:00
Jenkins2
53f1de6259 Merge "pjsip_options: dynamic contact's fields not updated on reload" into 13 2017-12-13 13:57:44 -06:00
Jenkins2
20ca06b1db Merge "CLI: Fix 'core show sysinfo' function ordering." into 13 2017-12-13 12:19:27 -06:00
Jenkins2
992b7197b7 Merge "chan_pjsip/res_pjsip: Add CHANNEL(pjsip,request_uri)" into 13 2017-12-13 10:18:37 -06:00
George Joseph
e40bffd53b Merge "AST-2017-012: Place single RTCP report block at beginning of report." into 13 2017-12-13 07:51:39 -06:00
Jenkins2
9b94e440ae Merge "chan_sip: Don't crash in Dial on invalid destination" into 13 2017-12-13 07:36:12 -06:00
Joshua Colp
5705e8ae0e 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
2017-12-13 13:11:48 +00:00
Jenkins2
2b8a152c69 Merge "chan_sip: Don't send trailing \0 on keep alive packets" into 13 2017-12-13 06:56:36 -06:00
Sean Bright
e1a358a6e4 chan_sip: Don't send trailing \0 on keep alive packets
This is a partial fix for ASTERISK~25817 but does not address the
comments regarding RFC 5626.

Change-Id: I227e2d10c0035bbfa1c6e46ae2318fd1122d8420
2017-12-12 15:51:41 -06:00
Sean Bright
ce2c89ce68 chan_sip: Don't crash in Dial on invalid destination
Stripping the DNID in a SIP dial string can result in attempting to call
the argument parsing macros on an empty string, causing a crash.

ASTERISK-26131 #close
Reported by: Dwayne Hubbard
Patches:
	dw-asterisk-master-dnid-crash.patch (license #6257) patch
	uploaded by Dwayne Hubbard

Change-Id: Ib84c1f740a9ec0539d582b09d847fc85ddca1c5e
2017-12-12 16:23:23 -05:00
Richard Mudgett
73b3390dbe 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
2017-12-12 13:45:58 -06:00
Sean Bright
ca448bf150 res_pjsip: Add TLSv1.1 and TLSv1.2 support
Support for these protocols was added in the same commit as the 'proto'
field, so we can safely use the same ./configure check.

For reference: https://trac.pjsip.org/repos/changeset/4968

Change-Id: Icf4975d785d6bfb8f30ac7ffa695a0adf9382dac
2017-12-12 12:44:20 -05:00
Corey Farrell
4decf4e492 CLI: Fix 'core show sysinfo' function ordering.
Handle CLI initialization before any processing occurs.

Change-Id: I598b911d2e409214bbdfd0ba0882be1d602d221c
2017-12-11 19:41:43 -06:00
Richard Mudgett
28eddc7ea6 stasis_channels.c: Don't set channel snapshot caller_dnid twice.
Change-Id: Ib8d45bbdfbda81e65045f6dff874d189b74e5471
2017-12-11 14:14:16 -06:00
Jenkins2
60acbeb431 Merge "codec_opus: Make libcurl a dependency in menuselect" into 13 2017-12-11 12:41:01 -06:00
Jenkins2
3bfddd9e73 Merge "astdb: Improve prefix searches in astdb" into 13 2017-12-11 11:42:27 -06:00
Jenkins2
84fe5f0219 Merge "loader: Refactor resource_name_match." into 13 2017-12-11 11:20:07 -06:00
Joshua Colp
8834a8eff9 Merge "res_stasis and res_speech: Fix load order." into 13 2017-12-11 10:39:36 -06:00
Jenkins2
90fe599e45 Merge "utils: Add convenience function for setting fd flags" into 13 2017-12-11 10:21:51 -06:00
Jenkins2
3b6fc78f4e Merge "pjsip: Improve CLI completion performance" into 13 2017-12-11 09:52:35 -06:00
Sean Bright
028f4320de codec_opus: Make libcurl a dependency in menuselect
ASTERISK-27475 #close

Change-Id: If7384bc6ed002ef140dec69798d14c52b7cfd800
2017-12-11 10:45:17 -05:00
Joshua Colp
ed089535d4 Merge "CDR: Fix deadlock setting some CDR values." into 13 2017-12-11 08:51:11 -06:00
Sean Bright
4838557132 pjsip: Improve CLI completion performance
Use the new ast_cli_completion_add() function to improve completion
performance for commands like 'pjsip show endpoint.'

Change-Id: I76d802294d2ac1766110dc75f7d117c8541ce348
2017-12-10 13:56:51 -05:00
Sean Bright
a4b291029f astdb: Improve prefix searches in astdb
Using the LIKE operator requires a full table scan of 'astdb', whereas a
comparison operation is able to use the primary key index.

This patch adds a new function to the AstDB API for quick prefix matches
and updates res_sorcery_astdb to utilize it. This showed substantial
performance improvement in my test environment.

Related to ASTERISK~26806, but does not completely resolve it.

Change-Id: I7d37f9ba2aea139dabf2ca72d31fbe34bd9b2fa1
2017-12-10 12:41:51 -06:00
Corey Farrell
9fc4f10e0e loader: Refactor resource_name_match.
Optimize resource_name_match.  This change eliminates use of
ast_strdupa, instead verifying that both basename's are the same length,
then using strncasecmp.

Change-Id: I477275c0e954c99d74be5abfc8bb6545b04e5a3d
2017-12-08 21:07:14 -06:00
Sean Bright
c3bc44fa1b pjsip_configuration: Add correct file header
Change-Id: I25348c386a222bb704aff07f54375108a6402906
2017-12-08 15:58:54 -05:00
Sean Bright
f726f11974 utils: Add convenience function for setting fd flags
There are many places in the code base where we ignore the return value
of fcntl() when getting/setting file descriptior flags. This patch
introduces a convenience function that allows setting or clearing file
descriptor flags and will also log an error on failure for later
analysis.

Change-Id: I8b81901e1b1bd537ca632567cdb408931c6eded7
2017-12-08 14:27:50 -05:00
Corey Farrell
3d79c34350 res_stasis and res_speech: Fix load order.
res_stasis was missing AST_MODFLAG_LOAD_ORDER.  Set res_stasis and
res_speech to start at (AST_MODPRI_APP_DEPEND - 1) so they are ready for
dependent modules.

Change-Id: I27f4f3810a95b6be8a5bfbf62be2ace6bfab6ff3
2017-12-07 20:41:58 -05:00
Kevin Harwell
ecdccb8071 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
2017-12-07 18:39:50 -06:00
Kevin Harwell
f20ab2b65f 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
2017-12-07 18:18:00 -06:00
Jenkins2
54a86779a3 Merge "translate: Skip matrix_rebuild during shutdown." into 13 2017-12-07 14:37:53 -06:00
Jenkins2
ac7501b15c Merge "CLI: Fix remote console completion." into 13 2017-12-07 14:19:53 -06:00
Jenkins2
9bf73ae1b3 Merge "sounds_index: Avoid repeatedly reindexing." into 13 2017-12-07 12:43:44 -06:00
Jenkins2
58addb1e38 Merge "media_index: Improve startup." into 13 2017-12-07 11:54:59 -06:00
Corey Farrell
5a0dcd9275 CLI: Fix remote console completion.
Duplicate checking was done incorrectly when parsing completion options
from a remote console causing all options to be ignored as duplicates.
Once fixed I had to separate processing of the best match to ensure it
was not identified as a duplicate when it is the only match.

ASTERISK-27465

Change-Id: Ibbdb29f88211742071836c9b3f4d2aa1221cd0f9
2017-12-07 11:26:50 -06:00
Corey Farrell
2691ee68ce translate: Skip matrix_rebuild during shutdown.
Change-Id: I1e5eef4029cba56e33d786c5a5ade8091e531a1e
2017-12-07 09:52:04 -06:00
Corey Farrell
db6602f6f7 sounds_index: Avoid repeatedly reindexing.
The sounds index is rebuilt each time a format is registered or
unregistered.  This causes the index to be repeatedly rebuilt during
startup and shutdown.

This patch significantly reduces the work done by delaying sound index
initialization until after modules are loaded.  This way a reindex only
occurs if a format module is loaded after startup.  We also skip
reindexing when format modules are unloaded during shutdown.

Change-Id: I585fd6ee04200612ab1490dc804f76805f89cf0a
2017-12-07 00:39:02 -05:00
Corey Farrell
289549d659 media_index: Improve startup.
This eliminates some wasteful operations in media_index startup.

* Replace statically set string-fields with char[0].
* Eliminate pointless RAII_VAR's.
* alloc_variant: Avoid pointless ao2_find on new info->variant.
* Stop trying find_variant before alloc_variant.
* process_media_file: replace ast_str with ast_asprintf.  This avoids
  reallocation of file_id_str.

Overall sounds_index.c is about 27% of Asterisk startup time when using
sample configs.  This patch reduces it to 20%.  This is a half-fix.  The
real problem is that the media_index is regenerated repeatedly - 68
times in my test.

Change-Id: Ia50b752f8efb356f852b05c4be495a6631af8652
2017-12-06 23:35:53 -06:00
Richard Mudgett
f59a75c6fa 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
2017-12-06 15:59:53 -06:00
Richard Mudgett
93859f9aca bridge_basic.c: Update transfer diagnostic messages addendum.
* Added start DTMF transfer verbose messages.
* Made associated transfer messages use a similar message format.
* Adjusted message verbose level as requested by initial reporter.

ASTERISK-27449

Change-Id: I2045714586414b3c5ef1f3cc56c1c4af4b31f551
2017-12-06 07:38:39 -06:00
Jenkins2
8e6aedbdcd Merge "bridge_basic.c: Update transfer diagnostic messages." into 13 2017-12-06 06:44:38 -06:00
Jenkins2
0ff3694979 Merge "Add new object for VoicemailUserEntry" into 13 2017-12-05 19:29:52 -06:00
Joshua Colp
c4fe9ff002 Merge "res_rtp_asterisk.c: Increase strictrtp learning timeout time." into 13 2017-12-05 18:46:28 -06:00
Joshua Colp
466f9035f5 Merge "pjproject: Clean up disabling of WebRTC support." into 13 2017-12-05 18:21:00 -06:00
Niklas Larsson
aacdbdcfd2 bridge_basic.c: Update transfer diagnostic messages.
* Add the channel name to diagnostic messages so you will know which
channel failed to transfer.

* Promoted some debug messages to verbose 4 messages.

ASTERISK-27449 #close

Change-Id: Idac66b7628c99379cc9269158377fd87dc97a880
2017-12-05 15:35:17 -06:00
Richard Mudgett
594faa192d security-events: Fix SuccessfulAuth using_password declaration.
The SuccessfulAuth using_password field was declared as a pointer to a
uint32_t when the field was later read as a uint32_t value.  This resulted
in unnecessary casts and a non-portable field value reinterpret in
main/security_events.c:add_json_object().  i.e., It would work on a 32 bit
architecture but not on a 64 bit big endian architecture.

Change-Id: Ia08bc797613a62f07e5473425f9ccd8d77c80935
2017-12-04 17:19:23 -06:00
Sungtae Kim
e7201c93cc Add new object for VoicemailUserEntry
Currently, when the app_voicemail sending VoicemailUserEntry AMI event, there's
no OldMessageCount info for default.
To check the OldMessageCount info, it required IMAP_STORAGE define, but this is
not correct.
Added OldMessageCount item as a default.

ASTERISK-27456

Change-Id: I5c71521c2d1daf8b7b161e31c34d28cca6aea4c7
2017-12-04 12:24:22 -06:00
Joshua Colp
c80595a852 Merge "res_rtp_asterisk: Correct default in sample configuration file." into 13 2017-12-04 11:42:26 -06:00
Richard Mudgett
9330eacc50 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
2017-12-04 10:40:39 -06:00
Jenkins2
43ffae44c7 Merge "README-SERIOUSLY.bestpractices.txt: Convert to markdown" into 13 2017-12-04 10:21:37 -06:00