Commit Graph

72 Commits

Author SHA1 Message Date
Mike Bradeen e8f548c155 app_macro: Remove deprecated module.
For most modules that interacted with app_macro, this change is limited
to no longer looking for the current context from the macrocontext when
set.  Additionally, the following modules are impacted:

app_dial - no longer supports M^ connected/redirecting macro
app_minivm - samples written using macro will no longer work.
The sample needs a re-write

app_queue - can no longer a macro on the called party's channel.
Use gosub which is currently supported

ccss - no callback macro, gosub only

app_voicemail - no macro support

channel  - remove macrocontext and priority, no connected line or
redirection macro options
options - stdexten is deprecated to gosub as the default and only
pbx - removed macrolock
pbx_dundi - no longer look for macro

snmp - removed macro context, exten, and priority

ASTERISK-30304

Change-Id: I830daab293117179b8d61bd4df0d971a1b3d07f6
2023-01-10 14:07:44 -06:00
George Joseph ca3c22c5f1 Scope Tracing: A new facility for tracing scope enter/exit
What's wrong with ast_debug?

  ast_debug is fine for general purpose debug output but it's not
  really geared for scope tracing since it doesn't present its
  output in a way that makes capturing and analyzing flow through
  Asterisk easy.

How is scope tracing better?

  Scope tracing uses the same "cleanup" attribute that RAII_VAR
  uses to print messages to a separate "trace" log level.  Even
  better, the messages are indented and unindented based on a
  thread-local call depth counter.  When output to a separate log
  file, the output is uncluttered and easy to follow.

  Here's an example of the output. The leading timestamps and
  thread ids are removed and the output cut off at 68 columns for
  commit message restrictions but you get the idea.

--> res_pjsip_session.c:3680 handle_incoming PJSIP/1173-00000001
	--> res_pjsip_session.c:3661 handle_incoming_response PJSIP/1173
		--> res_pjsip_session.c:3669 handle_incoming_response PJSIP/
			--> chan_pjsip.c:3265 chan_pjsip_incoming_response_after
				--> chan_pjsip.c:3194 chan_pjsip_incoming_response P
					    chan_pjsip.c:3245 chan_pjsip_incoming_respon
				<-- chan_pjsip.c:3194 chan_pjsip_incoming_response P
			<-- chan_pjsip.c:3265 chan_pjsip_incoming_response_after
		<-- res_pjsip_session.c:3669 handle_incoming_response PJSIP/
	<-- res_pjsip_session.c:3661 handle_incoming_response PJSIP/1173
<-- res_pjsip_session.c:3680 handle_incoming PJSIP/1173-00000001

  The messages with the "-->" or "<--" were produced by including
  the following at the top of each function:

  SCOPE_TRACE(1, "%s\n", ast_sip_session_get_name(session));

  Scope isn't limited to functions any more than RAII_VAR is.  You
  can also see entry and exit from "if", "for", "while", etc blocks.

  There is also an ast_trace() macro that doesn't track entry or
  exit but simply outputs a message to the trace log using the
  current indent level.  The deepest message in the sample
  (chan_pjsip.c:3245) was used to indicate which "case" in a
  "select" was executed.

How do you use it?

  More documentation is available in logger.h but here's an overview:

  * Configure with --enable-dev-mode.  Like debug, scope tracing
    is #ifdef'd out if devmode isn't enabled.

  * Add a SCOPE_TRACE() call to the top of your function.

  * Set a logger channel in logger.conf to output the "trace" level.

  * Use the CLI (or cli.conf) to set a trace level similar to setting
    debug level... CLI> core set trace 2 res_pjsip.so

Summary Of Changes:

  * Added LOG_TRACE logger level.  Actually it occupies the slot
    formerly occupied by the now defunct "event" level.

  * Added core asterisk option "trace" similar to debug.  Includes
	ability to specify global trace level in asterisk.conf and CLI
	commands to turn on/off and set levels.  Levels can be set
	globally (probably not a good idea), or by module/source file.

  * Updated sample asterisk.conf and logger.conf.  Tracing is
    disabled by default in both.

  * Added __ast_trace() to logger.c which keeps track of the indent
    level using TLS. It's #ifdef'd out if devmode isn't enabled.

  * Added ast_trace() and SCOPE_TRACE() macros to logger.h.
    These are all #ifdef'd out if devmode isn't enabled.

Why not use gcc's -finstrument-functions capability?

  gcc's facility doesn't allow access to local data and doesn't
  operate on non-function scopes.

Known Issues:

  The only know issue is that we currently don't know the line
  number where the scope exited.  It's reported as the same place
  the scope was entered.  There's probably a way to get around it
  but it might involve looking at the stack and doing an 'addr2line'
  to get the line number.  Kind of like ast_backtrace() does.
  Not sure if it's worth it.

Change-Id: Ic5ebb859883f9c10a08c5630802de33500cad027
2020-06-02 11:35:07 -05:00
George Joseph b76ab5e5c9 message.c: Add option to suppress the Message channel AMI and ARI events
In order to reduce the amount of AMI and ARI events generated,
the global "Message/ast_msg_queue" channel can be set to suppress
it's normal channel housekeeping events such as "Newexten",
"VarSet", etc. This can greatly reduce load on the manager
and ARI applications when the Digium Phone Module for Asterisk
is in use.  To enable, set "hide_messaging_ami_events" in
asterisk.conf to "yes"  In Asterisk versions <18, the default
is "no" preserving existing behavior.  Beginning with
Asterisk 18, the option will default to "yes".

NOTE:  This change does not affect UserEvents or the ARI
TextMessageReceived events.

* Added the "hide_messaging_ami_events" option to asterisk.conf.

* Changed message.c to set the AST_CHAN_TP_INTERNAL property on
  the "Message/ast_msg_queue" channel if the option is set in
  asterisk.conf.  This suppresses the reporting of the events.

Change-Id: Ia2e3516d43f4e0df994fc6598565d6bba2d7018b
2020-02-03 13:58:48 -06:00
Joshua Colp f03b984724 Merge "core: Remove additional symbols." 2018-03-20 11:44:06 -05:00
Jenkins2 60a06fbd1d Merge "core: Remove dead symbols from asterisk.exports.in." 2018-03-20 11:40:39 -05:00
Corey Farrell 040bb21771 core: Remove additional symbols.
Remove symbols that are depreacated and replaced:
* ast_channel_datastore_alloc
* ast_channel_datastore_free
* ast_channel_cmpwhentohangup
* ast_channel_setwhentohangup
* config_text_file_save
* devstate2str
* ast_device_state_changed
* ast_device_state_changed_literal
* ast_verbose_get_by_module

Remove unused symbols:
* channelreloadreason2txt (last used in Asterisk 12).

Remove unused ast_options flags:
* AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN / ast_opt_end_cdr_before_h_exten
* AST_OPT_FLAG_VERBOSE_MODULE / ast_opt_verb_module
* AST_OPT_FLAG_INITIATED_SECONDS

Change-Id: I841255995d195f8efc1ed47af9c7a2f131c08645
2018-03-19 18:00:20 -04:00
Corey Farrell de77cf8698 core: Remove dead symbols from asterisk.exports.in.
* dahdi_chan_name
* dahdi_chan_name_len
* dahdi_chan_mode
* __manager_event
* dialed_interface_info

Added comment about __progname and environ being needed for FreeBSD to
prevent accidental removal in the future.

Change-Id: I3ae026bc541cd9cb572be2ffa95fc359547642b5
2018-03-19 17:59:59 -04:00
George Joseph 5d097f8236 channel.c: Allow generic plc then channel formats are equal
If the two formats on a channel are equal, we don't transcode and since
the generic plc needs slin to work, it doesn't get invoked.

* A new configuration option "genericplc_on_equal_codecs" was added
  to the "plc" section of codecs.conf to allow generic packet loss
  concealment even if no transcoding was originally needed.
  Transcoding via SLIN is forced in this case.

ASTERISK-27743

Change-Id: I0577026a179dea34232e63123254b4e0508378f4
2018-03-19 15:36:09 -06:00
Richard Mudgett 1a36a452bd pjproject: Add cache_pools debugging option.
The pool cache gets in the way of finding use after free errors of memory
pool contents.  Tools like valgrind and MALLOC_DEBUG don't know when a
pool is released because it gets put into the cache instead of being
freed.

* Added the "cache_pools" option to pjproject.conf.  Disabling the option
helps track down pool content mismanagement when using valgrind or
MALLOC_DEBUG.  The cache gets in the way of determining if the pool
contents are used after free and who freed it.

To disable the pool caching simply disable the cache_pools option in
pjproject.conf and restart Asterisk.

Sample pjproject.conf setting:
[startup]
cache_pools=no

* Made current users of the caching pool factory initialization and
destruction calls call common routines to create and destroy cached pools.

ASTERISK-27704

Change-Id: I64d5befbaeed2532f93aa027a51eb52347d2b828
2018-02-28 11:41:30 -06:00
Richard Mudgett 90bb0a3e10 core: Add cache_media_frames debugging option.
The media frame cache gets in the way of finding use after free errors of
media frames.  Tools like valgrind and MALLOC_DEBUG don't know when a
frame is released because it gets put into the cache instead of being
freed.

* Added the "cache_media_frames" option to asterisk.conf.  Disabling the
option helps track down media frame mismanagement when using valgrind or
MALLOC_DEBUG.  The cache gets in the way of determining if the frame is
used after free and who freed it.  NOTE: This option has no effect when
Asterisk is compiled with the LOW_MEMORY compile time option enabled
because the cache code does not exist.

To disable the media frame cache simply disable the cache_media_frames
option in asterisk.conf and restart Asterisk.

Sample asterisk.conf setting:
[options]
cache_media_frames=no

ASTERISK-27413

Change-Id: I0ab2ce0f4547cccf2eb214901835c2d951b78c00
2017-11-11 14:46:15 -05:00
Kevin Harwell 9b103e7bea rtp_engine: allocate RTP dynamic payloads per session
Dynamic payload types were statically defined in Asterisk. This unfortunately
limited the number of dynamic payloads that could be registered. With this patch
dynamic payload type numbers are now assigned dynamically and per RTP instance.
However, in order to limit any issues where some clients expect the old
statically defined value this patch makes it so the value Asterisk used to pre-
designate is used for the dynamic assignment if available.

An option, "rtp_use_dynamic", has also been added (can be set in asterisk.conf)
that turns the new dynamic behavior on or off. When off it reverts back to using
statically defined payload values. This option defaults to "yes" in Asterisk 15.

ASTERISK-26515 #close
patches:
  ASTERISK-26515.diff submitted by jcolp (license 5000

Change-Id: I7653465c5ebeaf968f1a1cc8f3f4f5c4321da7fc
2017-03-22 15:43:33 -05:00
Richard Mudgett 6f3e8c8e01 PJPROJECT logging: Fix detection of max supported log level.
The mechanism used for detecting the maximum log level compiled into the
linked pjproject did not work.  The API call simply stores the requested
level into an integer and does no range checking.  Asterisk was assuming
that there was range checking and limited the new value to the allowable
range.  To get the actual maximum log level compiled into the linked
pjproject we need to get and save off the initial set log level from
pjproject.  This is the maximum log level supported.

* Get and save off the initial log level setting before altering it to the
desired level on startup.  This has to be done by a macro rather than
calling a core function to avoid incorrectly linking pjproject.

* Split the initial log level warning messages to warn if the linked
pjproject cannot support the requested startup level and if it is too low
to get the pjproject buildopts for "pjproject show buildopts".

* Adjust the CLI "pjproject set log level" to check the saved max log
level and to generate normal output messages instead of a warning message.

ASTERISK-26743 #close

Change-Id: I40aa76653e2a1dece66c3f8734594b4f0471cfb4
2017-01-24 11:25:19 -06:00
Richard Mudgett 1dfa11b65c PJPROJECT logging: Made easier to get available logging levels.
Use of the new logging is as simple as issuing the new CLI command or
setting the new pjproject.conf option.

Other options that can affect the logging are how you have the pjproject
log levels mapped to Asterisk log types in pjproject.conf and if you have
configured Asterisk to log the DEBUG type messages.  Altering the
pjproject.conf level mapping shouldn't be necessary for most installations
as the default mapping is sensible.  Configuring Asterisk to log the DEBUG
message type is standard practice for collecting debug information.

* Added CLI "pjproject set log level" command to dynamically adjust the
maximum pjproject log message level.

* Added CLI "pjproject show log level" command to see the currently set
maximum pjproject log message level.

* Added pjproject.conf startup section "log_level" option to set the
initial maximum pjproject log message level so all messages could be
captured from initialization.

* Set PJ_LOG_MAX_LEVEL to 6 to compile in all defined logging levels into
bundled pjproject.  Pjproject will use the currently set run time log
level to determine if a log message is generated just like Asterisk
verbose and debug logging levels.

* In log_forwarder(), made always log enabled and mapped pjproject log
messages.  DEBUG mapped log messages are no longer gated by the current
Asterisk debug logging level.

* Removed RAII_VAR() from res_pjproject.c:get_log_level().

ASTERISK-26630 #close

Change-Id: I6dca12979f482ffb0450aaf58db0fe0f6d2e5389
2016-11-30 13:11:48 -06:00
Alexander Traud 9ac53877f6 rtp_engine: Allow more than 32 dynamic payload types.
Since adding all remaining rates of Signed Linear (ASTERISK-24274), SILK
(Gerrit 3136) and Codec 2 (ASTERISK-26217), no RTP Payload Type is left in the
dynamic range (96-127). RFC 3551 section 3 allows to reassign other ranges.
Consequently, when the dynamic range is exhausted, this change utilizes payload
types in the range between 35 and 63 giving room for another 29 payload types.

ASTERISK-26311 #close

Change-Id: I7bc96ab764bc30098a178b841cbf7146f9d64964
2016-11-02 08:44:26 -05:00
Corey Farrell 57386dcb67 Allow command-line options to override asterisk.conf.
Previous versions of Asterisk processed command-line options before
processing asterisk.conf.  This meant that if an option was set in
asterisk.conf, it could not be overridden with the equivelent command
line option.  This change causes Asterisk to process the command-line
twice.  First it processes options that are needed to load asterisk.conf,
then it processes the remaining options after the config is read.

This changes the function of -X slightly.  Previously using -X without
disabling execincludes in asterisk.conf caused #exec to be usable in any
config.  Now -X only enables #exec for the load of asterisk.conf, if it
is wanted in the rest of the system it must be enabled with execincludes
in asterisk.conf.  Updated 'asterisk -h' and 'man asterisk' to reflect
the limited function of -X.

ASTERISK-25042 #close
Reported by: Corey Farrell

Change-Id: I1450d45c15b4467274b871914d893ed4f6564cd7
2015-05-12 12:44:12 -04:00
Corey Farrell 5c1d07baf0 Astobj2: Allow reference debugging to be enabled/disabled by config.
* The REF_DEBUG compiler flag no longer has any effect on code that uses
  Astobj2.  It is used to determine if reference debugging is enabled by
  default.  Reference debugging can be enabled or disabled in asterisk.conf.
* Caller information is provided in logger errors for ao2 bad magic numbers.
* Optimizes AO2 by merging internal functions with the public counterpart.
  This was possible now that we no longer require a dual ABI.

ASTERISK-24974 #close
Reported by: Corey Farrell

Change-Id: Icf3552721fe999365ba8a8cf00a965aa6b897cc1
2015-04-27 18:37:26 -04:00
Matthew Jordan 97834718c2 Remove many deprecated modules
Billing records are fair,
To get paid is quite bright,
You should really use ODBC;
Good-bye cdr_sqlite.

Microsoft did once push H.323,
Hell, we all remember NetMeeting.
But try to compile chan_h323 now
And you will take quite a beating.

The XMPP and SIP war was fierce,
And in the distant fray
Was birthed res_jabber/chan_jingle;
But neither to stay.

For everyone did care and chase what Google professed.
"Free Internet Calling" was what devotees cried,
But Google did change the specs so often
That the developers were happy the day chan_gtalk died.

And then there was that odd application
Dedicated to the Polish tongue.
app_saycountpl was subsumed by Say;
One could say its bell was rung.

To read and parse a file from the dialplan
You could (I guess) use an application.
app_readfile did fill that purpose, but I think
A function is perhaps better in its creation.

Barging is rude, I'm not sure why we do it.
Inwardly, the caller will probably sigh.
But if you really must do it,
Don't use app_dahdibarge, use ChanSpy.

We all despise the sound of tinny robots
It makes our queues so cold.
To control such an abomination
It's better to not use Wait/SetMusicOnHold.

It's often nice to know properties of a channel
It makes our calls right
We have a nice function called CHANNEL
And so SIPCHANINFO is sent off into the night.

And now things get odd;
Apparently one could delimit with a colon
Properties from the SIPPEER function!
Commas are in; all others are done.

Finally, a word on pipes and commas.
We're sorry. We can't say it enough.
But those compatibility options in asterisk.conf;
To maintain them forever was just too tough.

This patch removes:

* cdr_sqlite
* chan_gtalk
* chan_jingle
* chan_h323
* res_jabber
* app_saycountpl
* app_readfile
* app_dahdibarge

It removes the following applications/functions:

* WaitMusicOnHold
* SetMusicOnHold
* SIPCHANINFO

It removes the colon delimiter from the SIPPEER function.

Finally, it also removes all compatibility options that were configurable from
asterisk.conf, as these all applied to compatibility with Asterisk 1.4 systems.

Review: https://reviewboard.asterisk.org/r/3698/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-04 13:26:37 +00:00
Richard Mudgett 03beadb6e9 internal_timing: Remove the option and always make it enabled if a timing module is loaded.
The masquerade supertest frequently fails because either the local channel
chain doesn't completely optimize out or the DTMF handshake doesn't
completely get accross.  Local channel optimization requires frames
flowing to trigger when optimization can happen.  When optimization
happens the media frame that triggered the optimization is dropped.
Sending DTMF requires frames to flow in the other direction for timing
purposes while sending nothing.  If internal timing is not enabled when
MOH is playing, Asterisk switches to received timing when an audio frame
is received.  With optimization dropping media frames and MOH not sending
frames unless it receives frames, occasionaly there are no more frames
being passed and the test fails.

* The asterisk command line -I option and the asterisk.conf
internal_timing option are removed.  Asterisk now always uses internal
timing when needed if any timing module is loaded.  The issue
ASTERISK-14861 did this quite awhile ago in v1.4 but effectively is broken
if other internal timing modules besides DAHDI are used.  The
ast_read_generator_actions() now only does received timing if it has no
choice for frame generators like MOH, silence, and playback streaming.

* Cleaned up some code dealing with frame generators in
ast_deactivate_generator(), generator_write_format_change(),
ast_activate_generator(), and ast_channel_stop_silence_generator().

* Removed ast_internal_timing_enabled(), AST_OPT_FLAG_INTERNAL_TIMING, and
ast_opt_internal_timing.

ASTERISK-22846 #close
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/3414/
........

Merged revisions 411715 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 411716 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 411717 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-04 19:19:55 +00:00
David M. Lee 357b275239 Fix res_ari_asterisk load issue
The new res_ari_asterisk.so module presents several config options
from asterisk main. Unfortunately, they aren't exported, so the module
won't load on Linux.

This patch renames the variables, adding the ast_ prefix so they will
be exported.

Review: https://reviewboard.asterisk.org/r/2737


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-05 14:35:00 +00:00
Olle Johansson 7aa0c3c64b Make it possible to change the minimum DTMF duration in asterisk.conf
Asterisk has a setting for the minimum allowed DTMF. If we get shorter
DTMF tones, these will be changed to the minimum on the outbound call
leg. 

(closes issue ASTERISK-19772)

Review: https://reviewboard.asterisk.org/r/1882/
Reported by: oej
Tested by: oej
Patches by: oej

Thanks to the reviewers.

1.8 branch for this patch: agave-dtmf-duration-asterisk-conf-1.8



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-25 09:32:21 +00:00
Richard Mudgett a35c7ba8e7 Add option to invoke the extensions.conf stdexten using the legacy macro method.
ASTERISK-18809 eliminated the legacy macro invocation of the stdexten in
favor of the Gosub method without a means of backwards compatibility.

(issue ASTERISK-18809)
(closes issue ASTERISK-19457)
Reported by: Matt Jordan
Tested by: rmudgett

Review: https://reviewboard.asterisk.org/r/1855/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-12 16:29:52 +00:00
Mark Michelson 6bb45831eb Fix transcode_via_sln option with SIP calls and improve PLC usage.
From reviewboard:
The problem here is a bit complex, so try to bear with me...

It was noticed by a Digium customer that generic PLC (as configured in
codecs.conf) did not appear to actually be having any sort of benefit when
packet loss was introduced on an RTP stream. I reproduced this issue myself
by streaming a file across an RTP stream and dropping approx. 5% of the
RTP packets. I saw no real difference between when PLC was enabled or disabled
when using wireshark to analyze the RTP streams.

After analyzing what was going on, it became clear that one of the problems
faced was that when running my tests, the translation paths were being set
up in such a way that PLC could not possibly work as expected. To illustrate,
if packets are lost on channel A's read stream, then we expect that PLC will
be applied to channel B's write stream. The problem is that generic PLC can
only be done when there is a translation path that moves from some codec to
SLINEAR. When I would run my tests, I found that every single time, read
and write translation paths would be set up on channel A instead of channel
B. There appeared to be no real way to predict which channel the translation
paths would be set up on.

This is where Kevin swooped in to let me know about the transcode_via_sln
option in asterisk.conf. It is supposed to work by placing a read translation
path on both channels from the channel's rawreadformat to SLINEAR. It also
will place a write translation path on both channels from SLINEAR to the
channel's rawwriteformat. Using this option allows one to predictably set up
translation paths on all channels. There are two problems with this, though.
First and foremost, the transcode_via_sln option did not appear to be working
properly when I was placing a SIP call between two endpoints which did not
share any common formats. Second, even if this option were to work, for PLC
to be applied, there had to be a write translation path that would go from
some format to SLINEAR. It would not work properly if the starting format
of translation was SLINEAR.

The one-line change presented in this review request in chan_sip.c fixed the
first issue for me. The problem was that in sip_request_call, the
jointcapability of the outbound channel was being set to the format passed to
sip_request_call. This is nativeformats of the inbound channel. Because of this,
when ast_channel_make_compatible was called by app_dial, both channels already
had compatibly read and write formats. Thus, no translation path was set up at
the time. My change is to set the jointcapability of the sip_pvt created during
sip_request_call to the intersection of the inbound channel's nativeformats and
the configured peer capability that we determined during the earlier call to
create_addr. Doing this got the translation paths set up as expected when using
transcode_via_sln.

The changes presented in channel.c fixed the second issue for me. First and
foremost, when Asterisk is started, we'll read codecs.conf to see the value of
the genericplc option. If this option is set, and ast_write is called for a
frame with no data, then we will attempt to fill in the missing samples for
the frame. The implementation uses a channel datastore for maintaining the
PLC state and for creating a buffer to store PLC samples in. Even when we
receive a frame with data, we'll call plc_rx so that the PLC state will have
knowledge of the previous voice frame, which it can use as a basis for when
it comes time to actually do a PLC fill-in.

So, reviewers, now I ask for your help. First off, there's the one line change
in chan_sip that I have put in. Is it right? By my logic it seems correct, but
I'm sure someone can tell me why it is not going to work. This is probably the
change I'm least concerned about, though. What concerns me much more is the
set of changes in channel.c. First off, am I even doing it right? When I run
tests, I can clearly see that when PLC is activated, I see a significant increase
in RTP traffic where I would expect it to be. However, in my humble opinion, the
audio sounds kind of crappy whenever the PLC fill-in is done. It sounds worse to
me than when no PLC is used at all. I need someone to review the logic I have used
to be sure that I'm not misusing anything. As far as I can see my pointer arithmetic
is correct, and my use of AST_FRIENDLY_OFFSET should be correct as well, but I'm
sure someone can point out somewhere where I've done something incorrectly.

As I was writing this review request up, I decided to give the code a test run under
valgrind, and I find that for some reason, calls to plc_rx are causing some invalid
reads. Apparently I'm reading past the end of a buffer somehow. I'll have to dig around
a bit to see why that is the case. If it's obvious to someone reviewing, speak up!

Finally, I have one other proposal that is not reflected in my code review. Since
without transcode_via_sln set, one cannot predict or control where a translation
path will be up, it seems to me that the current practice of using PLC only when
transcoding to SLINEAR is not useful. I recommend that once it has been determined
that the method used in this code review is correct and works as expected, then
the code in translate.c that invokes PLC should be removed.

Review: https://reviewboard.asterisk.org/r/622/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-19 21:29:08 +00:00
Tilghman Lesher b5a629624a Merged revisions 264248 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r264248 | tilghman | 2010-05-19 12:41:29 -0500 (Wed, 19 May 2010) | 17 lines
  
  Internal timing is now on by default, if you're using DAHDI 2.3 or above.
  
  The reason for ensuring DAHDI 2.3 or above is that this version ensures that
  a timer is always available, whereas in previous versions, it was possible
  for DAHDI to be loaded, but have no drivers to actually generate timing.  If
  internal_timing was turned on in this circumstance, a complete lack of audio
  would result.  This is the reason why internal_timing was not on by default.
  However, now that DAHDI ensures the availability of a timer, there is no
  reason for this setting to be off (and in fact, it solves a great many initial
  user problems).
  
  (closes issue #15932)
   Reported by: dimas
   Patches: 
         20100519__issue15932.diff.txt uploaded by tilghman (license 14)
   Tested by: tilghman
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264249 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-19 17:48:31 +00:00
Kevin P. Fleming ae6008ef3a Change per-file debug and verbose levels to be per-module, the way
users expect them to work.

'core set debug' and 'core set verbose' can optionally change the
level for a specific filename; however, this is actually for a
specific source file name, not the module that source file is included
in. With examples like chan_sip, chan_iax2, chan_misdn and others
consisting of multiple source files, this will not lead to the
behavior that users expect. If they want to set the debug level for
chan_sip, they want it set for all of chan_sip, and not to have to
also set it for reqresp_parser and other files that comprise the
chan_sip module.

This patch changes this functionality to be module-name based instead
of file-name based.

To make this work, some Makefile modifications were required to ensure
that the AST_MODULE definition is present in each object file produced
for each module as well.

Review: https://reviewboard.asterisk.org/r/574/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-23 14:22:27 +00:00
Jeff Peeler a170cd28e0 Add new option to asterisk.conf (lockconfdir) to protect conf dir during reloads
(closes issue #16358)
Reported by: raarts
Patches: 
      lockconfdir.diff uploaded by raarts (license 937)
      modified by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-27 18:29:49 +00:00
Terry Wilson 7c6d9c7235 Add option to hide console connect messages
(closes issue #14222)
Reported by: jamesgolovich
Patches: 
      asterisk-hideconnect.diff.txt uploaded by jamesgolovich (license 176)
Tested by: otherwiseguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-13 23:00:27 +00:00
Tilghman Lesher 9335b3ad34 Allow people to select the old console behavior of white text on a black
background, by using the startup flag '-B'.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@147262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-07 17:44:32 +00:00
Steve Murphy 8953b0f359 (closes issue #13366)
Reported by: erousseau

This was a reasonable enhancement request, which was
easy to implement. Since it's an enhancement, it 
could only be applied to trunk.

Basically, for accounting where "initiated" seconds
are billed for, if the microseconds field on the end
time is greater than the microseconds field for the
answer time, add one second to the billsec field.

The implementation was requested by erousseau, and
I've implemented it as requested. I've updated the
CHANGES, the cdr.conf.sample, and the .h files
accordingly, to accept and set a flag for the
corresponding new option. cdr.c adds in the extra
second based on the usec fields if the option is
set. Tested, seems to be working fine.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@140057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-26 15:57:49 +00:00
Tilghman Lesher 6dd5b8609f Optional light colored background, for those who use black on white terminals.
(closes issue #13306)
 Reported by: Corydon76
 Patches: 
       20080814__bug13306__3.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76, pkempgen


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@139981 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-25 23:13:32 +00:00
Mark Michelson ed6323cb73 Merged revisions 133169 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r133169 | mmichelson | 2008-07-23 14:39:47 -0500 (Wed, 23 Jul 2008) | 12 lines

As suggested by seanbright, the PSEUDO_CHAN_LEN in 
app_chanspy should be set at load time, not at compile
time, since dahdi_chan_name is determined at load time.

Also changed the next_unique_id_to_use to have the 
static qualifier.

Also added the dahdi_chan_name_len variable so that
strlen(dahdi_chan_name) isn't necessary. Thanks to
seanbright for the suggestion.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@133171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-23 19:48:03 +00:00
Jeff Peeler ef3b214728 Goodbye Zaptel, hello DAHDI. Removes Zaptel driver support with DAHDI. Configuration file and dialplan backwards compatability has been put in place where appropiate. Release announcement to follow.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 17:27:55 +00:00
Tilghman Lesher 76506b7baa Move compatibility options into asterisk.conf, default them to on for upgrades,
and off for new installations.  This includes the translation from pipes to commas
for pbx_realtime and the EXEC command for AGI, as well as the change to the Set
application not to support multiple variables at once.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 22:05:16 +00:00
Joshua Colp 358ac2f76a Merged revisions 110628 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r110628 | file | 2008-03-25 11:37:35 -0300 (Tue, 25 Mar 2008) | 4 lines

Add an option (transmit_silence) which transmits silence during both Record() and DTMF generation. The reason this is an option is that in order to transmit silence we have to setup a translation path. This may not be needed/wanted in all cases.
(closes issue #10058)
Reported by: tracinet

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@110629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-25 14:39:45 +00:00
Russell Bryant f1f72312bb (closes issue #10192)
Reported by: bbryant
Patches:
      20070720__core_debug_by_file.patch uploaded by bbryant (license 36)
	  (with some modifications by me)
Tested by: russell, bbryant

This set of changes introduces the ability to set the core debug or verbose
levels on a per-file basis.  Interestingly enough, in 1.4, you have the ability
to set core debug for a single file, but that functionality was accidentally
lost in the conversion of the CLI commands to the new format.

This patch improves upon what was in 1.4 by letting you set it for more than 1
file, and by also supporting verbose.

*** Janitor Project ***

This patch also introduces a new macro, ast_verb(), which is similar
to ast_debug().  Setting the per file verbose value only works for messages that
use this macro.  Converting existing uses of ast_verbose() can be done like:

if (option_debug > 2)
   ast_verbose(VERBOSE_PREFIX_3 "Something useful\n");

...

ast_verb(3, "Something useful\n");



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76555 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23 14:21:41 +00:00
Tilghman Lesher 81bc1d7af5 Merge in ast_strftime branch, which changes timestamps to be accurate to the microsecond, instead of only to the second
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 19:47:20 +00:00
Russell Bryant 9e0458e9f1 Completely remove all of the code related to jumping to priority n + 101. yay!
(issue #9926, caio1982)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@68970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-12 15:58:28 +00:00
Olle Johansson 51f99c5265 - Add manager command CoreSettings
- Add missing option to options.h
- Add missing variables to asterisk.h
- Move manager version to manager.h include file


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@63030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-04 13:44:50 +00:00
Dwayne M. Hubbard 2151e532fe changed #if HAVE_SYSINFO to #if defined(HAVE_SYSINFO)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-11 21:13:44 +00:00
Dwayne M. Hubbard 6a5f3599bb added HAVE_SYSINFO preprocessor directives for portability and general happiness
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-11 20:59:08 +00:00
Dwayne M. Hubbard 62256ee410 added option_minmemfree for use in asterisk.conf to specify the amount of minimum free memory prior to accepting calls. added CLI 'core show sysinfo' to display system information
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-11 19:11:32 +00:00
Kevin P. Fleming 16b09ac48c Merged revisions 48998 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r48998 | kpfleming | 2006-12-27 15:08:30 -0600 (Wed, 27 Dec 2006) | 3 lines

move extern declaration for this option to a header file where it belongs
provide an initial value for 'languageprefix' option, instead of relying on randomness to provide a useful value

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48999 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 21:09:35 +00:00
Russell Bryant b04f059b4a As discussed and decided on the asterisk-dev mailing list ...
- Fix some breakage I introduced a while ago that made the timestamps option
  not functional for CLI verbose output.
- Remove the use of the timestamps option for log output, since it was not
  functional.
- clarify text referring to the timestamps option so that it is clear that it
  only applies to CLI verbose output


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38439 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28 19:17:56 +00:00
Russell Bryant 0f912e5926 Fix various problems in the addition of the ability to mute log/verbose
output to remove consoles. The prototypes added to logger.h still need
doxygen documentation, as well.

- Add the new command line option to the man page
- make the mute option a flag instead of an int since it is only a binary
  option
- remove useless extern keywords for prototypes added to logger.h
- rename ast_console_mute() to ast_console_toggle_mute() since that is what
  it actually does
- actually apply the mute option to newly created remote consoles instead of
  only working when the CLI command is used
- don't imply the NO_FORK option if the mute command line option is provided
- place the new CLI command in the correct place in the list which has to be
  in alphabetical order
- Finally, clean up a few spacing issues to conform to the coding guidelines


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@30630 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-05-26 21:47:52 +00:00
BJ Weschke 569ecaf5a2 use pid_t instead of long for pid variables. #7099 (casper)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@25488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-05-08 12:32:44 +00:00
Kevin P. Fleming eb38f13a2e add a command-line flag and option to force forking, even with -v or -d
rename a flag to have the proper name


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@23675 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-04-30 14:55:05 +00:00
Russell Bryant 03ce34e1aa convert internal timing to be stored as a flag in the ast_options flags
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@16477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-03-30 06:26:16 +00:00
Olle Johansson 50f0b12880 Issue #5374 - Enable internal timing of generators (cmantunes)
Thanks everyone involved for hard work, testing and testing!


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@16473 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-03-30 06:07:04 +00:00
Russell Bryant 4279bf18f8 clarify which global options are enabled by default
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@12897 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-03-14 16:57:35 +00:00
Russell Bryant 4e6af293f9 add an option to cdr.conf that enables ending CDRs before executing
the "h" extension as opposed to afterwards (issue #6193)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@12896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-03-14 16:49:34 +00:00
Russell Bryant d41c5918b2 - fix some doxygen errors
- add the flag definitions to the page about global options


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-12-31 19:45:30 +00:00