Russell Bryant [Thu, 9 Aug 2007 17:25:09 +0000 (17:25 +0000)]
Merged revisions 78749 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r78749 | russell | 2007-08-09 12:24:40 -0500 (Thu, 09 Aug 2007) | 9 lines
Fix subscriptions to multiple mailboxes for ODBC_STORAGE. Also, leave a
comment for this to be fixed for IMAP_STORAGE, as well. I left IMAP alone
since I know MarkM was working on this code right now for another reason.
This is broken even worse in trunk, but for a different reason. The fact
that the mailbox option supported multiple mailboxes is completely not obvious
from the code in the channel drivers. Anyway, I will fix that in another
commit ...
Russell Bryant [Thu, 9 Aug 2007 17:07:36 +0000 (17:07 +0000)]
Fix a problem that I had introduced into MWI handling. I had ignored
the mailbox context. Now, all related MWI event dealings pay attention
to the context as well.
Russell Bryant [Thu, 9 Aug 2007 16:13:26 +0000 (16:13 +0000)]
Merged revisions 78717 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r78717 | russell | 2007-08-09 11:12:57 -0500 (Thu, 09 Aug 2007) | 7 lines
Fix a problem with the combination of the 'F' option to pass DTMF through a
conference and options that use DTMF to activate various features. The problem
was that the BEGIN frame would be passed through, but the END frame would get
intercepted to activate a feature. Then, the other conference members would hear
DTMF for forever, which they didn't seem to like very much.
(closes issue #10400, reported by stevefeinstein, fixed by me)
Joshua Colp [Wed, 8 Aug 2007 22:05:45 +0000 (22:05 +0000)]
Regenerate configure script. This actually just updated the revision number... since my last merge changed it to an older number, while it was in fact generated from a much newer revision.
Joshua Colp [Wed, 8 Aug 2007 21:44:58 +0000 (21:44 +0000)]
Add support for using epoll instead of poll. This should increase scalability and is done in such a way that we should be able to add support for other poll() replacements.
Fixed some compiler warnings so that compiling with dev-mode and IMAP storage would not have any errors.
This section of code may get changed again shortly since my change uncovers a rather silly bit of logic.
Changing a bit of logic so that someone will NEVER exit the queue on timeout unless they have enabled the 'n' option.
This commit relates to issue #10320. Thanks to jfitzgibbon for detailing the idea behind this code change.
Joshua Colp [Tue, 7 Aug 2007 15:40:43 +0000 (15:40 +0000)]
(closes issue #10225)
Reported by: klaus3000
Clean up AST_FORMAT_LIST list. It may have mattered in the old days to have undefined entries but these days it does not.
Jason Parker [Mon, 6 Aug 2007 23:00:35 +0000 (23:00 +0000)]
Add a TalkingToChan to the response of the "agents" manager action.
This is similar to the existing "talking to" that you see what using the "agent show" CLI command.
Joshua Colp [Mon, 6 Aug 2007 21:52:30 +0000 (21:52 +0000)]
Extend the ast_senddigit and ast_dtmf_stream API calls to allow the duration of the DTMF digit(s) to be specified and make the SendDTMF application have the capability to use it.
Russell Bryant [Mon, 6 Aug 2007 20:45:09 +0000 (20:45 +0000)]
Merged revisions 78242 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r78242 | russell | 2007-08-06 15:44:09 -0500 (Mon, 06 Aug 2007) | 4 lines
Fix an issue where dynamic threads can get free'd, but still exist in the
dynamic thread list.
(closes issue #10392, patch from Mihai, with credit to his colleague, Pete)
Changed the behavior of sip's realtime_peer function to match the corresponding way of matching for non-realtime peers.
Now matches are made on both the IP address and port number, or if the insecure setting is set to "port" then just match on the
IP address.
In order to accomplish this, I also added a new API call, ast_category_root, which returns the first variable of an ast_category struct
Russell Bryant [Mon, 6 Aug 2007 16:51:30 +0000 (16:51 +0000)]
Merged revisions 78184 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r78184 | russell | 2007-08-06 11:50:54 -0500 (Mon, 06 Aug 2007) | 5 lines
Fix the return value of AST_LIST_REMOVE(). This shouldn't be causing any
problems, though, because the only code that uses the return value only checks
to see if it is NULL.
(closes issue #10390, pointed out by mihai)
It is possible for a transfer to occur before the remote device has our tag in which case they send none in the transfer. In this case we need to not fail the transfer dialog lookup.
(closes issue #10355)
Reported by: wdecarne
Now that we pass through RTP timestamp information we need to make the allowed timestamp skew considerably less. There are situations where a source may change and due to the timestamp difference the receiver will experience an audio gap since we did not indicate by setting the marker bit that the source changed.
Joshua Colp [Mon, 6 Aug 2007 14:37:52 +0000 (14:37 +0000)]
(closes issue #10381)
Reported by: yehavi
Use the filename we parsed using the standard parsing when launching the application specified to ExternalIVR.
Russell Bryant [Sun, 5 Aug 2007 03:14:24 +0000 (03:14 +0000)]
Fix building res_crypto on systems that init locks with constructors.
The problem was that res_crypto now has a RWLIST named "keys". The macro
for defining this list defines a function used as a constructor for the list
called "init_keys". However, there was another function called init_keys in
this module for a CLI command. The fix is just to prepend the generated
functions with underscores.
Fix a problem when you call Voicemail() with multiple mailboxes specified and
ODBC_STORAGE is in use. The audio part of the message was only given to the
first mailbox specified.
Russell Bryant [Fri, 3 Aug 2007 19:41:42 +0000 (19:41 +0000)]
Merged revisions 78095 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r78095 | russell | 2007-08-03 14:39:49 -0500 (Fri, 03 Aug 2007) | 28 lines
Add some improvements to lock debugging. These changes take effect
with DEBUG_THREADS enabled and provide the following:
* This will keep track of which locks are held by which thread as well as
which lock a thread is waiting for in a thread-local data structure. A
reference to this structure is available on the stack in the dummy_start()
function, which is the common entry point for all threads. This information
can be easily retrieved using gdb if you switch to the dummy_start() stack
frame of any thread and print the contents of the lock_info variable.
* All of the thread-local structures for keeping track of this lock information
are also stored in a list so that the information can be dumped to the CLI
using the "core show locks" CLI command. This introduces a little bit of a
performance hit as it requires additional underlying locking operations
inside of every lock/unlock on an ast_mutex. However, the benefits of
having this information available at the CLI is huge, especially considering
this is only done in DEBUG_THREADS mode. It means that in most cases where
we debug deadlocks, we no longer have to request access to the machine to
analyze the contents of ast_mutex_t structures. We can now just ask them
to get the output of "core show locks", which gives us all of the information
we needed in most cases.
I also had to make some additional changes to astmm.c to make this work when
both MALLOC_DEBUG and DEBUG_THREADS are enabled. I disabled tracking of one
of the locks in astmm.c because it gets used inside the replacement memory
allocation routines, and the lock tracking code allocates memory. This caused
infinite recursion.
Russell Bryant [Fri, 3 Aug 2007 17:02:00 +0000 (17:02 +0000)]
Merged revisions 78063 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r78063 | russell | 2007-08-03 12:01:07 -0500 (Fri, 03 Aug 2007) | 4 lines
Only pass through HOLD and UNHOLD control frames when the mohinterpret option
is set to "passthrough". This was pointed out by Kevin in the middle of a
training session.
Russell Bryant [Fri, 3 Aug 2007 02:05:02 +0000 (02:05 +0000)]
Merged revisions 78028 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r78028 | russell | 2007-08-02 21:04:22 -0500 (Thu, 02 Aug 2007) | 6 lines
Don't reuse the timespec that was set to 0 in the previous timedwait as it
will just return immediately. Also, fix some logic so the thread's lock
isn't unlocked twice in the weird case of dynamic threads getting acquired
right after a timeout.
(pointed out by SteveK)
Russell Bryant [Thu, 2 Aug 2007 19:26:12 +0000 (19:26 +0000)]
Merged revisions 77949 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r77949 | russell | 2007-08-02 14:25:14 -0500 (Thu, 02 Aug 2007) | 5 lines
Fix the case where a dynamic thread times out waiting for something to do
during the first time it runs. This shouldn't ever happen, but we should
account for it anyway.
(pointed out by pete, who works with mihai)
Merged revisions 77942 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r77942 | murf | 2007-08-02 11:56:37 -0600 (Thu, 02 Aug 2007) | 1 line
This patch hopefully solves 10141; The user is running with it, and it doesn't appear to harm asterisk's operation, and may prevent a crash. I'll store it in 1.2, as we have shut down support on 1.2, but since I developed the patch before support finished, and it might affect 1.4 and trunk, I'm going ahead with it.
........
Russell Bryant [Thu, 2 Aug 2007 18:05:23 +0000 (18:05 +0000)]
Merged revisions 77943 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r77943 | russell | 2007-08-02 13:04:43 -0500 (Thu, 02 Aug 2007) | 9 lines
Fix another race condition in the handling of dynamic threads. If the dynamic
thread timed out waiting for something to do, but was acquired to perform an
action immediately afterwords, then wait on the condition again to give the
other thread a chance to finish setting up the data for what action this thread
should perform. Otherwise, if it immediately continues, it will perform the
wrong action.
(reported on IRC by mihai, patch by me)
(related to issue #10289)
Russell Bryant [Thu, 2 Aug 2007 17:09:42 +0000 (17:09 +0000)]
Fix an issue that Simon pointed out to me on IRC. There were cases in the
trunk version of find_idle_thread() where the old full frame processing
information was not cleared out. This would have caused full frames to get
deferred for processing by threads that weren't actually processing frames for
that call. Nice catch!!
Russell Bryant [Thu, 2 Aug 2007 16:58:26 +0000 (16:58 +0000)]
Merged revisions 77939 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r77939 | russell | 2007-08-02 11:56:04 -0500 (Thu, 02 Aug 2007) | 4 lines
Add another sanity check to vnak_retransmit(). This check ensures that frames
that have already been marked for deletion don't get retransmitted.
(closes issue #10361, patch from mihai)
Russell Bryant [Wed, 1 Aug 2007 22:24:23 +0000 (22:24 +0000)]
Merged revisions 77887 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r77887 | russell | 2007-08-01 17:16:17 -0500 (Wed, 01 Aug 2007) | 23 lines
Fix some race conditions which have been causing weird problems in chan_iax2.
The most notable problem is that people have been seeing storms of VNAK frames
being sent due to really old frames mysteriously being in the retransmission
queue and never getting removed.
It was possible that a dynamic thread got created, but did not acquire its lock
before the thread that created it signals it to perform an action. When this
happens, the thread will sleep until it hits a timeout, and then get destroyed.
So, the action never gets performed and in some cases, means a frame doesn't
get transmitted and never gets freed since the scheduler never gets a chance
to reschedule transmission.
Another less severe race condition is in the handling of a timeout for a dynamic
thread. It was possible for it to be acquired to perform at action at the same
time that it hit a timeout. When this occurs, whatever action it was acquired
for would never get performed.
(patch contributed by Mihai and SteveK)
(closes issue #10289)
(closes issue #10248)
(closes issue #10232)
(possibly related to issue #10359)
Joshua Colp [Wed, 1 Aug 2007 19:37:59 +0000 (19:37 +0000)]
Instead of adding the SOLARIS check to each HAVE_SYSINFO check let's just make the sysinfo autoconf logic a bit pickier about what it considers a usable sysinfo.
Russell Bryant [Wed, 1 Aug 2007 15:39:54 +0000 (15:39 +0000)]
Convert code that checks the _softhangup member of ast_channel directory to use
the ast_check_hangup() funciton. This function takes scheduled hangups into
account.
(closes issue #10230, patch by Juggie)
Fixes an issue I introduced to queues wherein a queue with joinempty=yes would kick people out of the queue because of erroneously
thinking the 'n' option was in use.
(closes issue #10320, reported by jfitzgibbon, patched by me, tested by blitzrage and me)
Thank you blitzrage for all the testing you've done lately with queues! It's much appreciated!
If a queue uses dynamic realtime members, then the member list should be updated after each attempt to call the queue.
This fixes an issue where if a caller calls into a queue where no one is logged in, they would wait forever even if a member
logged in at some point.
(closes issue #10346, reported by and tested by blitzrage, patched by me)
This patch makes Asterisk send 100 Trying provisional responses upon receipt of re-invites. This makes it so that if there are two or more Asterisk
servers between endpoints, the Asterisk servers will not keep retransmitting the re-invites.
(closes issue #10274, reported by cstadlmann, patched by me with approval from file)
Kevin P. Fleming [Tue, 31 Jul 2007 15:01:27 +0000 (15:01 +0000)]
there is no use in having functions that have no code in them, and hide the locking info when DEBUG_THREADS is enabled... i could have fixed this to be dependent on DEBUG_THREADS, but it would be just as easy for someone to add their test/debugging code to the macros as it would have been to the functions
Kevin P. Fleming [Tue, 31 Jul 2007 14:55:37 +0000 (14:55 +0000)]
use a different method for overriding the send_digit_begin pointer, as the old one fails to compile on my 64-bit system with gcc-4.1 and --enable-dev-mode turned on
Steve Murphy [Tue, 31 Jul 2007 03:32:04 +0000 (03:32 +0000)]
Discovered in experiments on core files: if you wrap the lock and unlock calls with sip_pvt_lock and sip_pvt_unlock, you lose the tracing info you would normally get via DETECT_DEADLOCKS; so I turn these two functions into macros when DETECT_DEADLOCKS is called. This way, you get meaningful stuff in the file and func slots in the lock_info struct.
Fix an issue that could potentially cause corruption of the global iax frame
queue. In the network_thread() loop, it traverses the list using the
AST_LIST_TRAVERSE_SAFE macro. However, to remove an element of the list within
this loop, it used AST_LIST_REMOVE, instead of AST_LIST_REMOVE_CURRENT, which I
believe could leave some of the internal variables of the SAFE macro invalid.
Mihai says that he already made this change in his local copy and it didn't help
his VNAK storm issues, but I still think it's wrong. :)
Applications like SayAlpha() should not hang up the channel if you
request an "unknown" character such as a comma.
Instead, skip the character and move on.
Issue 10083, initial patch by jsmith, modified by me.
Russell Bryant [Mon, 30 Jul 2007 19:35:33 +0000 (19:35 +0000)]
Improve ast_agi_fdprintf() by using the ast_str() API.
* Use a thread local ast_str for building the string that will be written out
to the console for debug, and to the FD for the AGI itself, instead of allocating
a buffer on the heap every time the function is called.
* Use the information contained within the ast_str to determine how many bytes
need to be written instead of calling strlen().
Russell Bryant [Mon, 30 Jul 2007 19:31:27 +0000 (19:31 +0000)]
Remove an XXX comment noting that it would be nice for a declaration to be
inside of a function. (Yes, it would!) Replace it with a note that explains
why it can't be done using the way that the AST_THREADSTORAGE macro is
currently defined.
(closes issue #10279)
Reported by: seanbright
Patches:
res_agi.carefulwrite.1.4.07252007.patch uploaded by seanbright (license 71)
res_agi.carefulwrite.trunk.07252007.patch uploaded by seanbright (license 71)
Allow the "agi_network: yes" line to be printed out in the AGI debug output.
Also, allow partial writes to be handled when writing out this line just like
it is for all of the others.