Don't allocate vmu for messagecount when we could just use the stack instead (closes issue #10490)
Also, remove a useless (and leaky) SQLAllocHandle (closes issue #10480)
Russell Bryant [Fri, 17 Aug 2007 21:04:33 +0000 (21:04 +0000)]
Merged revisions 79912 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r79912 | russell | 2007-08-17 16:01:43 -0500 (Fri, 17 Aug 2007) | 4 lines
Avoid a crash in the handling of DTMF based Caller ID. It is valid for
ast_read to return NULL in the case that the channel has been hung up.
(crash reported by anonymouz666 on IRC in #asterisk-dev)
Patch allows for more seamless transition from file storage voicemail to ODBC storage voicemail.
If a retrieval of a greeting from the database fails, but the file is found on the file system, then
we go ahead an insert the greeting into the database. The result of this is that people who
switch from file storage to ODBC storage do not need to rerecord their voicemail greetings.
Russell Bryant [Fri, 17 Aug 2007 14:07:44 +0000 (14:07 +0000)]
This commit adds a scheduler API call, ast_sched_replace that can be used
in place of a very common construct. I also used it in a number of places
in chan_sip.
if (id > -1)
ast_sched_del(sched, id);
id = ast_sched_add(sched, ...);
Russell Bryant [Fri, 17 Aug 2007 13:39:17 +0000 (13:39 +0000)]
Merged revisions 79857 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r79857 | russell | 2007-08-17 08:37:08 -0500 (Fri, 17 Aug 2007) | 5 lines
Fix some crashes in chan_sip. This patch changes various places that add items
to the scheduler to ensure that they don't overwrite the ID of a previously
scheduled item. If there is one, it should be removed.
(closes issue #10391, closes issue #10256, probably others, patch by me)
Merged revisions 79833 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r79833 | crichter | 2007-08-17 10:22:36 +0200 (Fr, 17 Aug 2007) | 1 line
sometimes we don't need to signal dtmf tones to asterisk, we just want them to go through as inband. Otherwise they might be generated by the other channel partner and then there is a double tone.
........
Russell Bryant [Thu, 16 Aug 2007 22:33:02 +0000 (22:33 +0000)]
Merged revisions 79792 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r79792 | russell | 2007-08-16 17:32:33 -0500 (Thu, 16 Aug 2007) | 4 lines
Fix a little race condition that could cause a crash if two channels had MOH
stopped at the same time that were using a class that had been marked for
deletion when its use count hits zero.
Russell Bryant [Thu, 16 Aug 2007 22:30:39 +0000 (22:30 +0000)]
Merged revisions 79778 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r79778 | russell | 2007-08-16 17:24:25 -0500 (Thu, 16 Aug 2007) | 14 lines
This patch fixes a bug where reloading the module with "module reload" did not
delete classes from memory that were no longer in the config. This patch fixes
that problem as well as another one. Previously, if you reloaded MOH using the
"moh reload" CLI command, which behaved differently than "module reload ...",
MOH had to be stopped on every channel and started again immediately. However,
there was no way to tell what class was being used, so they would all fall back
to the default class.
Russell Bryant [Thu, 16 Aug 2007 21:33:38 +0000 (21:33 +0000)]
Merged revisions 79756 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r79756 | russell | 2007-08-16 16:29:24 -0500 (Thu, 16 Aug 2007) | 11 lines
Fix more deadlocks in chan_iax2 that were introduced by making frame handling
and scheduling multi-threaded. Unfortunately, we have to do some expensive
deadlock avoidance when queueing frames on to the ast_channel owner of the IAX2
pvt struct. This was already handled for regular frames, but ast_queue_hangup
and ast_queue_control were still used directly. Making these changes introduced
even more places where the IAX2 pvt struct can disappear in the context of a
function holding its lock due to calling a function that has to unlock/lock it
to avoid deadlocks. I went through and fixed all of these places to account for
this possibility.
(issue #10362, patch by me)
Steve Murphy [Thu, 16 Aug 2007 16:50:58 +0000 (16:50 +0000)]
svn did me dirty for some reason. Left 5 files out of the commit; Tilghman copied them in from the branch, but I had made changes to these. Here they are.
Joshua Colp [Thu, 16 Aug 2007 15:29:44 +0000 (15:29 +0000)]
(closes issue #10467)
Reported by: lunn
Patches:
pbx_dundi.diff uploaded by lunn (license 179)
Don't print a warning saying an ethernet interface was found when it indeed was.
A fix for two critical problems detected while working with Daniel
McKeehan in issue #10184.
Upon priority change, the resource list is not NULL terminated when
moving an item to the end of the list. This makes Asterisk endlessy
loop whenever it needs to read the list. Jids with different resource and
priority values, like in Gmail's and GoogleTalk's jabber clients put
that problem in evidence.
Upon reception of a 'from' attribute with an empty resource string,
Asterisk crashes when trying to access the found->cap pointer if the
resource list for the given buddy is not empty. This situation is
perfectly valid and must be handled. The Gizmoproject's jabber client
put that problem in evidence.
Also added a few comments in the code as well as a handle for the
capabilities from Gmail's jabber client, which are stored in a caps:c tag
rather than the usual c tag.
Joshua Colp [Wed, 15 Aug 2007 19:34:42 +0000 (19:34 +0000)]
Remove properties that appeared from Steve's last branch merge. Automerge has already run so everyone's branches based off of trunk are probably toast by now.
Steve Murphy [Wed, 15 Aug 2007 19:21:27 +0000 (19:21 +0000)]
This commit closes bug 7605, and half-closes 7638. The AEL code has been redistributed/repartitioned to allow code re-use both inside and outside of Asterisk. This commit introduces the utils/conf2ael program, and an external config-file reader, for both normal config files, and for extensions.conf (context, exten, prio); It provides an API for programs outside of asterisk to use to play with the dialplan and config files.
(closes issue #10440)
Reported by: irroot
(closes issue #10454)
Reported by: flo_turc
Increase maximum timestamp skew to 120. 20 was apparently far too low.
(closes issue #10456)
Reported by: irroot
Patches:
sip_timeout.patch uploaded by irroot (license 52)
Change hardcoded timer value to defined value. I'm doing this in 1.4 as well so if it needs to be changed in the future this place would not have been forgotten.
Joshua Colp [Tue, 14 Aug 2007 14:17:43 +0000 (14:17 +0000)]
(closes issue #10427)
Reported by: pj
Two of the three places ast_waitfor_nandfds could branch off to did not clear outfd and exception. If the calling function did not clear these there was a chance they could get a false positive on testing to see whether they were set.
Russell Bryant [Mon, 13 Aug 2007 20:20:43 +0000 (20:20 +0000)]
Merged revisions 79276 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r79276 | russell | 2007-08-13 15:18:30 -0500 (Mon, 13 Aug 2007) | 4 lines
Release the pvt lock before calling find_peer in register_verify to avoid a
deadlock. Also, remove some unnecessary locking in auth_fail that was only done
recursively.
Russell Bryant [Mon, 13 Aug 2007 19:29:30 +0000 (19:29 +0000)]
Merged revisions 79272 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r79272 | russell | 2007-08-13 14:27:39 -0500 (Mon, 13 Aug 2007) | 9 lines
I am fighting deadlocks in chan_iax2. I have tracked them down to a single
core issue. You can not call find_callno() while holding a pvt lock as this
function has to lock another (every) other pvt lock. Doing so can lead to a
classic deadlock. So, I am tracking down all of the code paths where this
can happen and fixing them.
The fix I committed earlier today was along the same theme. This patch fixes
some code down the path of authenticate_reply.
Russell Bryant [Mon, 13 Aug 2007 15:32:05 +0000 (15:32 +0000)]
Merged revisions 79214 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r79214 | russell | 2007-08-13 10:28:13 -0500 (Mon, 13 Aug 2007) | 4 lines
Fix a potential deadlock in socket_process. check_provisioning can eventually
call find_callno. You can't hold a pvt lock while calling find_callno because
it goes through and locks every single one looking for a match.
(closes issue #10437)
Reported by: haklin
Don't set the callerid name and number a second time on a newly created channel. ast_channel_alloc itself already sets it and setting it twice would cause a memory leak.
Russell Bryant [Fri, 10 Aug 2007 16:24:11 +0000 (16:24 +0000)]
Merge a set of device state improvements from team/russell/events.
The way a device state change propagates is kind of silly, in my opinion. A
device state provider calls a function that indicates that the state of a
device has changed. Then, another thread goes back and calls a callback for
the device state provider to find out what the new state is before it can go
send it off to whoever cares.
I have changed it so that you can include the state that the device has changed
to in the first function call from the device state provider. This removes the
need to have to call the callback, which locks up critical containers to go find
out what the state changed to.
This change set changes the "simple" device state providers to use the new method.
This includes parking, meetme, and SLA.
I have also mostly converted chan_agent in my branch, but still have some more
things to think through before presenting the plan for converting channel drivers
to ensure all of the right events get generated ...
Russell Bryant [Fri, 10 Aug 2007 15:29:31 +0000 (15:29 +0000)]
Merged revisions 78995 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r78995 | russell | 2007-08-10 10:20:09 -0500 (Fri, 10 Aug 2007) | 4 lines
The last set of changes that I made to "core show locks" made it not able to
track mutexes unless they were declared using AST_MUTEX_DEFINE_STATIC. Locks
initialized with ast_mutex_init() were not tracked. It should work now.
(closes issue #10422)
Reported by: bhowell
Add note to sample configuration about module load order and how it can cause perfectly good queue members to be marked as invalid.
Improved a bit of logic regarding comma-separated mailboxes in has_voicemail. Also added some braces to some compound if statements
since unbraced if statements scare me in general.
1. instead of using inboxcount as the core message counting function, we use messagecount instead. This makes it possible to count messages in folders besides just INBOX and Old.
2. inboxcount and hasvoicemail now use messagecount as their means of determining return values.
3. Added a copy_message function for IMAP storage. Unfortunately I don't have the means to test it, but it seems like a pretty straightforward function.
4. Removed a #ifndef IMAP_STORAGE and matching #endif from leave_voicemail for a couple of reasons. One, we want to support copying mail to multiple IMAP boxes, and two, IMAP was
broken because a STORE macro had been moved into this section of code.
I broke canreinvite...Now I'm fixing it. I put some new code in the wrong place and so I've reverted the canreinvite section to how it was and put my new code where it should be.
Russell Bryant [Thu, 9 Aug 2007 19:11:53 +0000 (19:11 +0000)]
Restore the ability to have multiple mailboxes listed for the mailbox option
in sip.conf. chan_sip now maintains separate internal MWI subscriptions for
each one.
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.