Take into account the length of delimiters when calculating result string length.
(closes issue #12696)
Reported by: adomjan
Patches:
func_realtime.c-longdelimiter.patch uploaded by adomjan (license 487)
Michiel van Baak [Thu, 22 May 2008 16:29:54 +0000 (16:29 +0000)]
- revert change to ast_queue_hangup and create ast_queue_hangup_with_cause
- make data member of the ast_frame struct a named union instead of a void
Recently the ast_queue_hangup function got a new parameter, the hangupcause
Feedback came in that this is no good and that instead a new function should be created.
This I did.
The hangupcause was stored in the seqno member of the ast_frame struct. This is not very
elegant, and since there's already a data member that one should be used.
Problem is, this member was a void *.
Now it's a named union so it can hold a pointer, an uint32 and there's a padding in case someone
wants to store another type in there in the future.
This commit is so massive, because all ast_frame.data uses have to be
altered to ast_frame.data.data
Russell Bryant [Thu, 22 May 2008 13:40:52 +0000 (13:40 +0000)]
Store build-time options as a string in AST_BUILDOPTS in buildopts.h. Also,
display this information in the "core show settings" CLI command. This is
useful if you want to verify that you're running a build with DONT_OPTIMIZE,
DEBUG_THREADS, etc.
Tilghman Lesher [Thu, 22 May 2008 05:10:01 +0000 (05:10 +0000)]
Enhance ExternalIVR with new options and commands.
(closes issue #12705)
Reported by: ctooley
Patches:
new_externalivr_argument_format-v2.diff uploaded by ctooley (license 136)
new_externalivr_documentation.diff uploaded by ctooley (license 136)
and a few additional fixes by me
Mark Michelson [Wed, 21 May 2008 22:34:27 +0000 (22:34 +0000)]
This change makes it so that logs will report the correct source of verbose messages.
Until this change, all verbose messages in Asterisk's log files reported logger.c
as the source of the message.
Pass a pointer for the conf parameter to the function mkintf rather than the whole zt_chan_conf structure.
Another commit is following to make sure the zt_chan_conf structure is not modified.
Russell Bryant [Wed, 21 May 2008 18:29:05 +0000 (18:29 +0000)]
Merged revisions 117514 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r117514 | russell | 2008-05-21 13:28:46 -0500 (Wed, 21 May 2008) | 4 lines
Don't filter the magic character in the network verboser. It gets filtered
once it reaches the client.
(related to issue #12702, pointed out by tilghman)
Russell Bryant [Wed, 21 May 2008 18:12:19 +0000 (18:12 +0000)]
Merged revisions 117479 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r117479 | russell | 2008-05-21 13:11:51 -0500 (Wed, 21 May 2008) | 6 lines
Don't display the verbose marker for calls to ast_verbose() that do not include
a VERBOSE_PREFIX in front of the message.
(closes issue #12702)
Reported by: johnlange
Patched by me
Tilghman Lesher [Wed, 21 May 2008 13:39:41 +0000 (13:39 +0000)]
On socket-based connections, there is no error FD, so don't try waiting on one.
(closes issue #12697)
Reported by: ctooley
Patches:
fix_externalivr_waitfor_nandfds-v3.diff uploaded by ctooley (license 136)
Mark Michelson [Wed, 21 May 2008 02:20:31 +0000 (02:20 +0000)]
Be sure that we cache included files for each source file which loads
a configuration file. As it was, only the first did so. This led to
a problem if the included file was changed (but not the configuration
file which includes it) and the second source file attempted to reload
the configuration. It would not see that the included file had changed.
In this particular example, res_phoneprov and chan_sip both loaded
sip.conf, which included a file call sip.peers.conf. Since res_phoneprov
was the first to load sip.conf, only it cached the fact that sip.conf
included sip.peers.conf. If sip.peers.conf were changed and sip.conf were
not and a sip reload were issued (meaning that chan_sip attempts to
reload sip.conf only if it and its included files have changed) the changes
made to sip.peers.conf would not be seen and therefore no action would be
taken.
Steve Murphy [Wed, 21 May 2008 01:00:28 +0000 (01:00 +0000)]
These changes were made via the comments atis_work made at 4:30am (Mountain Time zone- US)
in #asterisk-dev on 20 May 2008. He noted that a backslash was being inserted before commas
in app call arguments in the extensions.conf.aeldump file that you get from aelparse with the
-w arg. This was being generated from code left over from 1.4, where commas were substituted
with '|', and any remaining commas needed to be escaped.
Many thanks to atis for his comment; please let us know if these changes break anything!
Luigi Rizzo [Tue, 20 May 2008 18:07:24 +0000 (18:07 +0000)]
+ Implement a variant of astman_get_header() to return the first or
last match, and possibly skip empty fields. The function is useful
(and used here) when a form submits multiple 'Action' fields to the
Manager.
This change slightly modifies the current behaviour, but only in the
case the user supplies multiple 'Action: ' lines and the first
ones are empty, so the change is totally harmless.
+ Fix style on a couple of "if (displayconnects)" statements;
+ Expand a bit the 'Manager Test' interface, to make it slightly
more user friendly. But also comment that the HTML should not
be embedded in the C source.
Luigi Rizzo [Tue, 20 May 2008 17:48:43 +0000 (17:48 +0000)]
Document the possible presence of multiple variables with the
same name in http queries, which might confuse the manager.
Replace calls to ast_uri_decode() with a local function that also
replaces '+' with ' ', as this is the normal encoding for
spaces in http requests.
This allows passing cli commands to the manager through the
http interface.
Tilghman Lesher [Mon, 19 May 2008 20:06:38 +0000 (20:06 +0000)]
Change the default for the pridialplan parameter to the far more common case of
'unknown', and better document the use of each parameter.
(closes issue #12633)
Reported by: tzafrir
Patches:
pridialplan_unknown_2.diff uploaded by tzafrir (license 46)
Use the right pthread lock and condition when waiting.
(closes issue #12664)
Reported by: tomo1657
Patches:
res_smdi.c.patch uploaded by tomo1657 (license 484)
Joshua Colp [Mon, 19 May 2008 16:22:56 +0000 (16:22 +0000)]
Remove a premature mutex destroy (the destruction callback will end up destroying it) and use a callback to purge remaining classes.
(closes issue #12677)
Reported by: falves11
Joshua Colp [Mon, 19 May 2008 16:03:33 +0000 (16:03 +0000)]
The logger closes the files it is logging to when reloading so we have to read in the logger configuration even if it has not changed so that the logs get opened again.
(closes issue #12665)
Reported by: DennisD
Luigi Rizzo [Mon, 19 May 2008 14:22:04 +0000 (14:22 +0000)]
Some fixes to the code to support running on an externally
supplied window.
SDL (at least recent 1.2.x versions) has the ability to run the
graphic output into an externally supplied window, whose ID in the
environment variable SDL_WINDOWID. Ideally, applications should
run unchanged irrespective of who creates the window. Unfortunately,
SDL does not subscribe to mouse, key and resize events on externally
supplied windows, so we need to do ask for these events explicitly.
On passing, also add some code to handle SDL_ACTIVEEVENT so if
the X11 window is killed while we are active, we call
"stop now" to terminate the asterisk instance.
Russell Bryant [Mon, 19 May 2008 03:44:28 +0000 (03:44 +0000)]
Merged revisions 116978 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r116978 | russell | 2008-05-18 22:44:04 -0500 (Sun, 18 May 2008) | 4 lines
Avoid access of uninitialized memory. This caused a bunch of crashes for me
while doing load testing of development branch where I'm working on some
performance improvements.
Tilghman Lesher [Sun, 18 May 2008 21:15:58 +0000 (21:15 +0000)]
Add a set of text to the file astcanary uses to communicate back the main
Asterisk process, which explains the purpose for the file being there. This
should assist people who find the file and wonder why it exists.
Joshua Colp [Sat, 17 May 2008 19:39:35 +0000 (19:39 +0000)]
Improve native transfers when a chain of IAX2 connections are in use.
(closes issue #7567)
Reported by: tjd
Patches:
bug_7567_update_v2.diff uploaded by snuffy (license 35)
Jeff Peeler [Thu, 15 May 2008 21:54:18 +0000 (21:54 +0000)]
Fixes a problem I was having with two SIP phones using Packet2Packet bridging dropping audio nearly immediately. The problem was that the lock on the SIP dialog was not being unlocked while the bridge was still active. (Related to issue #12566)
Mark Michelson [Thu, 15 May 2008 15:40:29 +0000 (15:40 +0000)]
When counting urgent messages when using IMAP storage, take into account that
the urgent messages are not in their own folder but are actually "flagged" messages
in the INBOX.
Luigi Rizzo [Thu, 15 May 2008 10:56:29 +0000 (10:56 +0000)]
Use casts or intermediate variables to remove a number
of platform/compiler-dependent warnings when handing
struct timeval fields, both reading and printing them.
It is a lost battle to handle the different ways struct timeval
is handled on the various platforms and compilers, so try
to be pragmatic and go through int/long which are universally
supported.
Mark Michelson [Wed, 14 May 2008 22:15:12 +0000 (22:15 +0000)]
Adding a new option to Chanspy(). The 'd' option allows for the spy to
press DTMF digits to switch between spying modes. Pressing 4 activates spy mode,
pressing 5 activates whisper mode, and pressing 6 activates barge mode. Use of
this feature overrides the normal operation of DTMF numbers.
Russell Bryant [Wed, 14 May 2008 21:40:43 +0000 (21:40 +0000)]
Merged revisions 116463 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r116463 | russell | 2008-05-14 16:32:00 -0500 (Wed, 14 May 2008) | 4 lines
Add ast_assert(), which can be used to handle fatal errors. It is only compiled
in if dev-mode is enabled, and only aborts if DO_CRASH is defined.
(inspired by issue #12650)
Avoid zombies when the channel exits before the AGI.
(closes issue #12648)
Reported by: gkloepfer
Patches:
20080514__bug12648.diff.txt uploaded by Corydon76 (license 14)
Tested by: gkloepfer
Jason Parker [Wed, 14 May 2008 20:36:55 +0000 (20:36 +0000)]
Voicemail "* exit" should not require an exitcontext to be specified.
The behavior in 1.4 was that it would use the current context if an exitcontext existed.
Detect another way for a connection to have gone away.
(closes issue #12618)
Reported by: ctooley
Patches:
1.4-externalivr-test_fd.diff uploaded by ctooley (license 136)
trunk-externalivr-test_fd.diff uploaded by ctooley (license 136)
Jeff Peeler [Wed, 14 May 2008 16:52:30 +0000 (16:52 +0000)]
Fixed a few problems with multiparking: call not being parked in the correct parking spot, caller not being notified of parking spot position, and improperly hanging up the call during a transfer due to timing out (not providing the extension in which to transfer).
A change to the way channel locks are handled when DEBUG_CHANNEL_LOCKS is defined.
After debugging a deadlock, it was noticed that when DEBUG_CHANNEL_LOCKS
is enabled in menuselect, the actual origin of channel locks is obscured
by the fact that all channel locks appear to happen in the function
ast_channel_lock(). This code change redefines ast_channel_lock to be a
macro which maps to __ast_channel_lock(), which then relays the proper
file name, line number, and function name information to the core lock
functions so that this information will be displayed in the case that
there is some sort of locking error or core show locks is issued.
Russell Bryant [Tue, 13 May 2008 21:18:55 +0000 (21:18 +0000)]
Merged revisions 116038 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r116038 | russell | 2008-05-13 16:17:23 -0500 (Tue, 13 May 2008) | 24 lines
Fix a deadlock involving channel autoservice and chan_local that was debugged
and fixed by mmichelson and me.
We observed a system that had a bunch of threads stuck in ast_autoservice_stop().
The reason these threads were waiting around is because this function waits to
ensure that the channel list in the autoservice thread gets rebuilt before the
stop() function returns. However, the autoservice thread was also locked, so
the autoservice channel list was never getting rebuilt.
The autoservice thread was stuck waiting for the channel lock on a local channel.
However, the local channel was locked by a thread that was stuck in the autoservice
stop function.
It turned out that the issue came down to the local_queue_frame() function in
chan_local. This function assumed that one of the channels passed in as an
argument was locked when called. However, that was not always the case. There
were multiple cases in which this channel was not locked when the function was
called. We fixed up chan_local to indicate to this function whether this channel
was locked or not. The previous assumption had caused local_queue_frame() to
improperly return with the channel locked, where it would then never get unlocked.
Russell Bryant [Tue, 13 May 2008 21:07:59 +0000 (21:07 +0000)]
Merged revisions 115990 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r115990 | russell | 2008-05-13 16:05:57 -0500 (Tue, 13 May 2008) | 5 lines
Fix an issue that I noticed in autoservice while mmichelson and I were debugging
a different problem. I noticed that it was theoretically possible for two threads
to attempt to start the autoservice thread at the same time. This change makes the
process of starting the autoservice thread, thread-safe.
Tilghman Lesher [Mon, 12 May 2008 20:34:38 +0000 (20:34 +0000)]
Add a script which installs every package needed for a Debian install of
Asterisk, and includes possible support (to be contributed) for various other
distributions.
(closes issue #10523)
Reported by: tzafrir
Patches:
install_prereq_2 uploaded by tzafrir (license 46)
Olle Johansson [Mon, 12 May 2008 18:39:09 +0000 (18:39 +0000)]
Add support for playing an audio file for caller and callee at start and stop of monitoring (one-touch monitor).
Keep messages short, since the other party is waiting while one party hear the message...
If a thread holds no locks, do not print any information on the thread when issuing
a core show locks command. This will help to de-clutter output somewhat.
Russell said it would be fine to place this improvement in the 1.4 branch, so that's
why it's going here too.