Commit Graph

27976 Commits

Author SHA1 Message Date
George Joseph
1f95c011c7 menuselect: Add an opaque "member_data" string to the acceptable xml
Change-Id: Id5ac43b95c8d7395f3be37f983632169db3d1afe
2016-08-01 15:13:17 -06:00
zuul
104b17eea9 Merge "Replace strdupa with more portable ast_strdupa" into 13 2016-08-01 15:36:50 -05:00
zuul
1e64f4a295 Merge "menuselect: Various menuselect enhancements" into 13 2016-08-01 15:26:10 -05:00
zuul
b8fb794e53 Merge "astconfigparser: Handle case where line is simply a comment." into 13 2016-08-01 15:05:04 -05:00
David M. Lee
df42f64d62 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-08-01 10:53:19 -06:00
George Joseph
56a07fbab9 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
(cherry picked from commit 90f445729d)
2016-08-01 11:46:36 -05:00
zuul
948a9b615f Merge "pbx.c: Fix handling of '-' in extension name and callerid" into 13 2016-08-01 10:25:19 -05:00
zuul
f2a93dc9f2 Merge "pjproject_bundled: Update for pjproject 2.5.5" into 13 2016-07-29 11:30:42 -05:00
zuul
c2aed1c6e0 Merge "pbx.c: Allow dangerous functions when adding a hint to dialplan." into 13 2016-07-29 06:27:20 -05:00
Joshua Colp
7f9369c1b6 astconfigparser: Handle case where line is simply a comment.
Change-Id: I2dea5815363f4d787d709228a04f33baee383ef5
2016-07-29 06:48:32 -03:00
Joshua Colp
cc5660406c Merge "dsp.c: Add fax and DTMF detection unit tests." into 13 2016-07-28 19:40:42 -05:00
Joshua Colp
cc825e54b0 Merge "dsp.c: Added descriptive comments to Goertzel calculations." into 13 2016-07-28 19:40:37 -05:00
Joshua Colp
323042d99d Merge "dsp.c: Fix incorrect format reference typo." into 13 2016-07-28 19:40:33 -05:00
zuul
d5e380b8fb Merge "dsp.c: Correct DTMF twist dsp.conf documentation." into 13 2016-07-28 19:34:53 -05:00
Joshua Colp
78de6eabbc Merge "astconfigparser.py: Update with realtime fixes." into 13 2016-07-28 19:18:00 -05:00
Corey Farrell
57e9c66819 pbx.c: Fix handling of '-' in extension name and callerid
This adds a two strings to ast_exten.  name to go with exten and
cidmatch_display to go with cidmatch.  The new fields contain input used
to add the extension in the first place.  The existing fields now
contain stripped input that excludes insignificant spaces and dashes.
These stripped fields should always be used for comparisons.  The
unstripped fields should normally be used for display, but displaying
stripped values will not cause runtime errors.

Note the actual string is only stored twice if it contains dashes.  If
no dashes are found then both 'char *' fields point to the same memory.
So this change has a minimum effect on memory usage.

The existing functions ast_get_extension_name and
ast_get_extension_cidmatch return unstripped values as they did before
this change.  Other similar bugs likely still exist where unstripped
extensions are saved outside pbx.c then passed back in.

ASTERISK-26233 #close

Change-Id: I6cd61ce57acc1570ca6cc14960c4c3b0a9eb837f
2016-07-28 20:00:23 -04:00
Richard Mudgett
873fc0fda5 pbx.c: Allow dangerous functions when adding a hint to dialplan.
We can allow dangerous functions when adding a hint since altering
dialplan is itself a privileged activity.  Otherwise, we could never
execute dangerous functions.

ASTERISK-25996 #close
Reported by: Andrew Nagy

Change-Id: I4929ff100ad1200a0198262d069a34f2296e77ba
2016-07-28 15:10:18 -05:00
zuul
7883f128d5 Merge "rtp_engine: Failed assertion and wrong name given for codec" into 13 2016-07-28 13:14:16 -05:00
Alexei Gradinari
f00525a6f6 pjproject: fixed a few bugs
This patch fixes the issue in pjsip_tx_data_dec_ref()
when tx_data_destroy can be called more than once,
and checks if invalid value (e.g. NULL) is passed to.

This patch updates array limit checks and docs
in pjsip_evsub_register_pkg() and pjsip_endpt_add_capability().

Change-Id: I4c7a132b9664afaecbd6bf5ea4c951e43e273e40
2016-07-28 11:04:55 -04:00
George Joseph
972cee2e4c pjproject_bundled: Update for pjproject 2.5.5
Add more --disable-* switches to Makefile.rules including
--disable-opus which was causing bundled pjproject to fail with
"undefined reference" errors in libasteriskpj.

Changed PJ_ENABLE_EXTRA_CHECK to 1.

Removed 2 obsolete patches and added a new one.
The new one was merged by Teluu on 6/27/2016.

ASTERISK-26148 #close

Change-Id: Ib8af6c6a9d31f7238ce65b336134c2efdc855063
2016-07-28 07:04:12 -06:00
David M. Lee
8902a51d59 Portably sscanf tv_usec
In a timeval, tv_usec is defined as a suseconds_t, which could be
different underlying types on different platforms. Instead of trying to
scanf directly into the timeval, scanf into a long int, then copy that
into the timeval.

Change-Id: I29f22d049d3f7746b6c0cc23fbf4293bdaa5eb95
2016-07-27 12:48:17 -05:00
Kevin Harwell
852e763571 rtp_engine: Failed assertion and wrong name given for codec
Fixed an assert check that would trigger when the passed in value was negative.
The negative value was being cast to an unsigned value. This resulted in the
check failing.

Also fixed another problem when loading formats in the engine. When setting the
mime type the format's name was being passed in instead of the codec's name.

Change-Id: I1a201cd419ba4d8e9a40d337e36b6fbe1737192c
2016-07-27 12:45:30 -05:00
Richard Mudgett
e8c34680ca dsp.c: Add fax and DTMF detection unit tests.
* Add fax amplitude and frequency sweep tests.
* Add DTMF amplitude and twist unit tests.

Change-Id: I8d77c9a1eec89e440d715f998c928687e870c3f7
2016-07-26 17:51:06 -05:00
Richard Mudgett
c1f240b818 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-26 17:51:05 -05:00
Richard Mudgett
003a52fd62 dsp.c: Fix incorrect format reference typo.
Change-Id: Ia131da3ec29acf385cb43a586a29ecc975eb3896
2016-07-26 17:51:05 -05:00
Richard Mudgett
4c0a0cbe02 dsp.c: Correct DTMF twist dsp.conf documentation.
Change-Id: Idf97e3a72f1edc5fca58f2fa7b20785922be0cae
2016-07-26 17:50:47 -05:00
Joshua Colp
87433c2566 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 19:29:52 -03:00
Richard Mudgett
159e437e5a 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-25 23:20:41 -05:00
zuul
7ec9819403 Merge "Fix sqlalchemy error regarding identifier length." into 13 2016-07-23 16:54:27 -05:00
zuul
17e0e058ca Merge "chan_sip: Enable Session-Timers for SIP over TCP (and TLS)." into 13 2016-07-22 16:55:13 -05:00
Mark Michelson
eda95236d1 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:44:50 -05:00
zuul
8d6a7b89bd Merge "res_pjsip: Whitespace and comment cleanup." into 13 2016-07-22 07:13:13 -05:00
Alexander Traud
66c9dfb272 chan_sip: Enable Session-Timers for SIP over TCP (and TLS).
Asterisk defaults to timers=accept/refresher=uas. In that scenario, only in that
scenario, Sessions-Timers (RFC 4028) had no effect via TCP. This change enables
Session-Timers for SIP over TCP (and for SIP over TLS).

However with longer international calls via TCP, the SIP channel might break,
because all hops on the Internet route must stay online (have not a single power
outage, for example). Therefore with Session-Timers enabled (which are enabled
at default), you might see dropped calls. Consequently even with this change,
you might be better-off going for session-timers=refuse in your sip.conf.

ASTERISK-19968 #close

Change-Id: I1cd33453c77c56c8e1394cd60a6f17bb61c1d957
2016-07-22 12:50:12 +02:00
Joshua Colp
0de05c2938 Merge "chan_sip: Prevent deadlock when issuing "sip show channels"" into 13 2016-07-22 04:47:13 -05:00
zuul
e3fbb4e099 Merge "res_pjsip_pubsub: fixed a bug when pjsip_tx_data_dec_ref is called twice." into 13 2016-07-22 02:22:03 -05:00
Richard Mudgett
33716106e0 res_pjsip: Whitespace and comment cleanup.
Change-Id: I11139a4a95df34e223ba622aa6227e33ab8f6c38
2016-07-21 23:30:57 -05:00
zuul
80a9899100 Merge "chan_dahdi.c: Fix deadlock potential in fax redirection." into 13 2016-07-21 19:27:12 -05:00
zuul
2b001fd6aa Merge "chan_sip.c: Fix deadlock potential in fax redirection." into 13 2016-07-21 19:18:20 -05:00
zuul
00ed6b74ea Merge "chan_pjsip.c: Fix deadlock potential in fax redirection." into 13 2016-07-21 19:07:05 -05:00
zuul
ffbaefa48f Merge "res_fax.c: Fix deadlock potential in FAXOPT(faxdetect) framehook." into 13 2016-07-21 18:35:12 -05:00
Joshua Colp
0b8448a74b Merge changes from topic 'ASTERISK-26214' into 13
* changes:
  res_fax: Fix FAXOPT(faxdetect) timeout option.
  chan_dahdi: Add faxdetect_timeout option.
2016-07-21 18:26:39 -05:00
George Joseph
52ab0bf258 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:06:35 -05:00
Joshua Colp
efebb1b9e0 Merge "res_pjsip: Add fax_detect_timeout endpoint option." into 13 2016-07-21 16:54:32 -05:00
zuul
dec1e31f45 Merge "Add conditional support for noreturn functions." into 13 2016-07-21 15:09:52 -05:00
Alexei Gradinari
5997ec7c9e 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 11:21:05 -04:00
zuul
d4242d6250 Merge "Makefile: Retain XML Declaration and DTD in docs." into 13 2016-07-20 12:14:41 -05:00
zuul
7dacb14c03 Merge "Unit tests: Use AST_TEST_DEFINE in conditional code only." into 13 2016-07-20 11:31:50 -05:00
zuul
290269bb23 Merge "res_rtp_asterisk: Count a roll-over of the sequence number even on lost packets." into 13 2016-07-20 09:58:05 -05:00
zuul
7ce180a754 Merge "res_pjsip_mwi: remove unneeded check on endpoint's contacts." into 13 2016-07-20 09:58:00 -05:00
Corey Farrell
7fdf7c3d4c 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-19 23:35:41 -04:00