Commit Graph

28253 Commits

Author SHA1 Message Date
Richard Mudgett
ebc2b7695d dsp.c: Added descriptive comments to Goertzel calculations.
* Added doxygen to describe some struct members and what is going on in
the code.

Change-Id: I2ec706a33b52aee42b16dcc356c2bd916a45190d
2016-07-27 11:03:19 -05:00
Richard Mudgett
a7e747918d dsp.c: Fix incorrect format reference typo.
Change-Id: Ia131da3ec29acf385cb43a586a29ecc975eb3896
2016-07-27 11:03:19 -05:00
Richard Mudgett
53b46428d1 dsp.c: Correct DTMF twist dsp.conf documentation.
Change-Id: Idf97e3a72f1edc5fca58f2fa7b20785922be0cae
2016-07-27 11:03:19 -05:00
David M. Lee
47689998a9 Replace strdupa with more portable ast_strdupa
The strdupa function is a GNU extension, and not widely portable. We
have an ast_strdupa function used within Asterisk which is preferred.
I pulled the definition up from menuselect.c into the menuselect.h
header file so it can be shared across menuselect.

Change-Id: I9593c97f78386b47dc1e83201e80cb2f62b36c2e
2016-07-27 10:02:15 -05:00
Joshua Colp
8ea9fd7fa4 astconfigparser.py: Update with realtime fixes.
When configuring SIP URIs in the pjsip.conf file it is
necessary to escape the semicolon so the parser does not
treat it as a comment. This change allows this to work in
the astconfigparser implementation.

A secondary bug where some data was lost if a configuration
option included a "=" in its value was also fixed.

A bug where sections would be considered equal despite
being different has also been fixed.

Change-Id: If229f656ef22050b50e7b34e90c4bffe796431f8
2016-07-26 17:31:11 -05:00
Richard Mudgett
ba449e0242 dsp.c: Fix erroneous fax tone detection.
The Goertzel calculations get less accurate the lower the signal level
being worked with becomes because there is less resolution remaining.
If it is too low we can erroneously detect a tone where none really
exists.  The searched for fax frequencies not only need to be so much
stronger than the background noise they must also be a minimum strength.

* Add needed minimum threshold test to tone_detect().

* Set TONE_THRESHOLD to allow low volume frequency spread detection.

ASTERISK-26237 #close
Reported by: Richard Mudgett

Change-Id: I84dbba7f7628fa13720add6a88eae3b129e066fc
2016-07-26 11:43:16 -05:00
zuul
e7fc209b26 Merge "codecs: Add iLBC 20." into 14 2016-07-26 10:38:10 -05:00
zuul
37e6db2eac Merge "menuselect: Various menuselect enhancements" into 14 2016-07-26 06:39:31 -05:00
zuul
f85a16a681 Merge "asterisk.c: Add auto generation and persistence of UUID" into 14 2016-07-25 21:03:34 -05:00
George Joseph
90f445729d menuselect: Various menuselect enhancements
* Add 'external' as a support level.
* Add ability for module directories to add entries to the menu
  by adding members to the <module_prefix>/<module_prefix>.xml file.
* Expand the description field to 3 lines in the ncurses implementation.
* Allow the description field to wrap in the newt implementation.
* Add description field to the gtk implementation.

Change-Id: I7f9600a1984a42ce0696db574c1051bc9ad7c808
2016-07-25 13:30:54 -06:00
Joshua Colp
f75401b1e3 ari: Update version.
New functionality has been added so the version has been
bumped to one over the 13 version.

Change-Id: I5d30077f62640c0ac83599b4e9a9b657bf184f69
2016-07-24 18:51:25 -03:00
George Joseph
58759bd77c asterisk.c: Add auto generation and persistence of UUID
Upcoming features will require the generation and persistence
of a UUID.

Change-Id: I3ec0062427e133217db6ef496a4216f427c3b92d
2016-07-23 08:04:12 -06:00
Mark Michelson
46b4e673ae Fix sqlalchemy error regarding identifier length.
sqlalchemy was complaining:

sqlalchemy.exc.IdentifierError: Identifier
'ps_contacts_qualifyfreq_exptime' exceeds maximum length of 30
characters

This fixes the problem by changing the index name to be
"ps_contacts_qualifyfreq_exp" instead.

ASTERISK-26227 #close
Reported by Mark Michelson

Change-Id: I0ed784f87504be2a59ee8d3242ef6f625d5ed1a9
2016-07-22 14:46:54 -05:00
Joshua Colp
f8142aba27 Merge "build_tools: Update make_version for 14" into 14 2016-07-22 12:52:59 -05:00
Joshua Colp
804c3e6b9e Merge "res_srtp: Enable AES-256 and AES-GCM." into 14 2016-07-22 11:50:59 -05:00
zuul
5356e307dc Merge "res_pjsip: Whitespace and comment cleanup." into 14 2016-07-22 07:45:21 -05:00
George Joseph
633c34c411 build_tools: Update make_version for 14
Also remove svn stuff

Change-Id: I95d762f7cbbe5eb01117bde8779515d51a0bb06a
2016-07-22 06:02:34 -06:00
zuul
7d17164e6e Merge "chan_dahdi.c: Fix deadlock potential in fax redirection." into 14 2016-07-22 05:26:41 -05:00
zuul
c1bb8a202c Merge "chan_sip.c: Fix deadlock potential in fax redirection." into 14 2016-07-22 05:26:39 -05:00
zuul
50a02c4b83 Merge "chan_pjsip.c: Fix deadlock potential in fax redirection." into 14 2016-07-22 05:14:48 -05:00
zuul
0b4ceaead6 Merge "res_fax.c: Fix deadlock potential in FAXOPT(faxdetect) framehook." into 14 2016-07-22 05:14:44 -05:00
Joshua Colp
bf5a18f39b Merge "chan_sip: Prevent deadlock when issuing "sip show channels"" into 14 2016-07-22 04:47:40 -05:00
Joshua Colp
4a24c028be Merge "res_fax: Fix FAXOPT(faxdetect) timeout option." into 14 2016-07-22 04:46:43 -05:00
Joshua Colp
7f7211000a Merge "chan_dahdi: Add faxdetect_timeout option." into 14 2016-07-22 04:46:36 -05:00
Joshua Colp
e551636144 Merge "res_pjsip: Add fax_detect_timeout endpoint option." into 14 2016-07-22 04:46:29 -05:00
Alexander Traud
c82f24f36a codecs: Add iLBC 20.
Asterisk already supported iLBC 30. This change adds iLBC 20. Now, Asterisk
defaults to iLBC 20 but falls back to iLBC 30, when the remote party requests
this.

ASTERISK-26218 #close
ASTERISK-26221 #close
Reported by: Aaron Meriwether

Change-Id: I07f523a3aa1338bb5217a1bf69c1eeb92adedffa
2016-07-22 03:11:47 -05:00
Richard Mudgett
6e2e3915c8 res_pjsip: Whitespace and comment cleanup.
Change-Id: I11139a4a95df34e223ba622aa6227e33ab8f6c38
2016-07-21 23:26:48 -05:00
Richard Mudgett
5efb5b38e8 chan_dahdi.c: Fix deadlock potential in fax redirection.
The dahdi_handle_dtmf() and my_handle_dtmf() have the potential to
deadlock if an incoming fax happens during the Playback or similar
application.

* Fixed the potential deadlock by not calling ast_async_goto() with the
channel lock held.

ASTERISK-26216 #close
Reported by: Richard Mudgett

Change-Id: I9144b84ade5f96690996624ec8a2d40c56af40aa
2016-07-21 17:56:03 -05:00
Richard Mudgett
a1d36c89e0 chan_sip.c: Fix deadlock potential in fax redirection.
The sip_read() has the potential to deadlock if an incoming fax happens
during the Playback or similar application.

* Fixed the potential deadlock by not calling ast_async_goto() with the
channel lock held.

* Made always eat the fax detection frame whether there is a fax extension
or not.

ASTERISK-26216
Reported by: Richard Mudgett

Change-Id: I6d3f5cccd4b77c3aa6ffc1a54c0f6bde61c9278e
2016-07-21 17:56:03 -05:00
Richard Mudgett
4dfadcb025 chan_pjsip.c: Fix deadlock potential in fax redirection.
The chan_pjsip_cng_tone_detected() has the potential to deadlock if an
incoming fax happens during the Playback or similar application.

* Fixed the potential deadlock by not calling ast_async_goto() with the
channel lock held.

* Made always eat the fax detection frame whether there is a fax extension
or not.

ASTERISK-26216
Reported by: Richard Mudgett

Change-Id: I32aecbb4818af646dc5a619f0dc040e9b1f222e5
2016-07-21 17:56:03 -05:00
Richard Mudgett
964ae54ecf res_fax.c: Fix deadlock potential in FAXOPT(faxdetect) framehook.
The fax_detect_framehook() has the potential to deadlock if an incoming
fax happens during the Playback or similar application.

* Fixed the potential deadlock by not calling ast_async_goto() with the
channel lock held.

* Made always eat the fax detection frame whether there is a fax extension
or not.

* Made only detach the framehook if we detected a fax and not on other
possible frames.

ASTERISK-26216
Reported by: Richard Mudgett

Change-Id: I99da35c26d1cd802626ffb4c1b4eb5b015581b6d
2016-07-21 17:56:03 -05:00
Richard Mudgett
c3462adeb8 res_fax: Fix FAXOPT(faxdetect) timeout option.
The fax detection timeout option did not work because basically the wrong
variable was checked in fax_detect_framehook().  As a result, the timer
would timeout immediately and disable fax detection.

* Fixed ignoring negative timeout values.  We'd complain and then go right
on using the negative value.

* Fixed destroy_faxdetect() in the off-nominal case of an incomplete
object creation.

* Added more range checking to FAXOPT(gateway) timeout parameter.

ASTERISK-26214 #close
Reported by: Richard Mudgett

Change-Id: Idc5e698dfe33572de9840bc68cd9fc043cbad976
2016-07-21 17:53:49 -05:00
Richard Mudgett
c03e27c1c8 chan_dahdi: Add faxdetect_timeout option.
The new option allows the channel driver's faxdetect option to timeout on
a call after the specified number of seconds into a call.  The new feature
is disabled if the timeout is set to zero.  The option is disabled by
default.

* Don't clear dsp_features after passing them to the dsp code in
my_pri_ss7_open_media().  We should still remember them especially for the
new faxdetect_timeout option.

ASTERISK-26214
Reported by: Richard Mudgett

Change-Id: Ieffd3fe788788d56282844774365546dce8ac810
2016-07-21 17:53:49 -05:00
Richard Mudgett
d11731ac2f res_pjsip: Add fax_detect_timeout endpoint option.
The new endpoint option allows the PJSIP channel driver's fax_detect
endpoint option to timeout on a call after the specified number of
seconds into a call.  The new feature is disabled if the timeout is set
to zero.  The option is disabled by default.

ASTERISK-26214
Reported by: Richard Mudgett

Change-Id: Id5a87375fb2c4f9dc1d4b44c78ec8735ba65453d
2016-07-21 17:53:49 -05:00
Alexei Gradinari
56b4112659 res_pjsip_pubsub: fixed a bug when pjsip_tx_data_dec_ref is called twice.
This patch removed call of pjsip_tx_data_dec_ref in send_notify
if send_request failed.
The pjsip_dlg_send_request deletes the message on error by itself.

It seems this patch fixes next issues:
ASTERISK-26199
ASTERISK-26166
ASTERISK-26174

Change-Id: I8b05917c93d993f95d604c042ace5f1a5500f59a
2016-07-21 17:40:18 -05:00
George Joseph
52cbdf2393 chan_sip: Prevent deadlock when issuing "sip show channels"
sip_show_channels locks the dialogs container first then locks each
sip_pvt so it can spit out the details.  The rest of sip dialog
processing locks the sip_pvt first then locks the dialogs container
if it needs to.  Both lock in the order they need but deadlocks can
result.  To fix, sip_show_channels and sip_show_channelstats have
been converted to use an iterator rather than ao2_callback.  This way
the container is locked only while getting the next entry and is
unlocked when the callback is called.

ASTERISK-23013 #close

Change-Id: Id9980419909e811f89484950ed46ef117b9eb990
2016-07-21 17:10:14 -05:00
zuul
8551830abc Merge "pbx: Create pbx_sw.c for management of 'struct ast_sw'." into 14 2016-07-21 16:04:03 -05:00
Alexander Traud
2103ad1fec res_srtp: Enable AES-256 and AES-GCM.
ASTERISK-26190 #close

Change-Id: I11326d80edd656524a51a19450e586c583aa0a0b
2016-07-21 15:35:04 -05:00
Corey Farrell
05cfe1a76e Add conditional support for noreturn functions.
This adds support for tagging functions with the noreturn attribute.
If DO_CRASH is enabled then ast_do_crash never returns.  If AST_DEVMODE
and DO_CRASH are enabled then failed assertions never return.  This can
resolve a large number of false positives with static analyzers.

ASTERISK-26220 #close

Change-Id: Icfb61e5fe54574eced4c3e88b317244f467ec753
2016-07-21 13:21:00 -05:00
Corey Farrell
0c88fb460f pbx: Create pbx_sw.c for management of 'struct ast_sw'.
This changes context switches from a linked list to a vector, makes
'struct ast_sw' opaque to pbx.c.

Although ast_walk_context_switches is maintained the procedure is no
longer efficient except for the first call (inc==NULL).  This
functionality is replaced by two new functions implemented by vector
macros.
* ast_context_switches_count (AST_VECTOR_SIZE)
* ast_context_switches_get (AST_VECTOR_GET)

As with ast_walk_context_switches callers of these functions are
expected to have locked contexts.  Only a few places in Asterisk walked
the switches, they have been converted to use the new functions.

Change-Id: I08deb016df22eee8288eb03de62593e45a1f0998
2016-07-21 13:11:52 -05:00
zuul
3ca6407dab Merge "Makefile: Retain XML Declaration and DTD in docs." 2016-07-20 11:36:08 -05:00
zuul
7ff9bed7b0 Merge "Unit tests: Use AST_TEST_DEFINE in conditional code only." 2016-07-20 11:31:52 -05:00
zuul
b1c45dc815 Merge "pbx: Create pbx_ignorepat.c for management of 'struct ast_ignorepat'." 2016-07-20 10:57:41 -05:00
zuul
e51b40bd87 Merge "res_rtp_asterisk: Count a roll-over of the sequence number even on lost packets." 2016-07-20 10:29:19 -05:00
zuul
b93c602198 Merge "res_pjsip_mwi: remove unneeded check on endpoint's contacts." 2016-07-20 09:57:58 -05:00
zuul
333a0fed33 Merge "Makefile: Suppress echoing of target 'config' again." 2016-07-19 17:35:59 -05:00
Alexander Traud
6fca2b3bf0 Makefile: Retain XML Declaration and DTD in docs.
Since Asterisk 12, the documentation got an XML Stylesheet. Because of a typo,
the XML Declaration and DTD were overwritten by this.

ASTERISK-26212 #close

Change-Id: If5ee4625068042e98ab3fcb22a25e2f15d0c68bd
2016-07-19 12:06:10 +02:00
Corey Farrell
cf1188a1be Unit tests: Use AST_TEST_DEFINE in conditional code only.
If AST_TEST_DEFINE is not conditional to TEST_FRAMEWORK it produces dead
code.  This places all existing unit tests into a conditional block if
they weren't already.

ASTERISK-26211 #close

Change-Id: I8ef83ee11cbc991b07b7a37ecb41433e8c734686
2016-07-18 19:40:22 -04:00
Alexei Gradinari
e9daa34261 res_pjsip_mwi: remove unneeded check on endpoint's contacts.
The function create_mwi_subscriptions_for_endpoint checks
if there is active contacts by retrieving aors and contacts.

This function is used to create all unsolicited mwi subscriptions
on startup and is used when contact added.

In both cases it's not necessary to check if there are contacts.
The contacts are needed when asterisk sends mwi.

ASTERISK-26200 #close

Change-Id: I98e43bdc97f3c0829951cd9bf5f3c6348c6ac1fa
2016-07-18 10:24:05 -04:00
Joshua Colp
943bb48b59 Merge "pbx: Create pbx_include.c for management of 'struct ast_include'." 2016-07-18 07:07:36 -05:00