Commit Graph

11427 Commits

Author SHA1 Message Date
Russell Bryant
f2de04d1d1 Don't call find_peer in registry_authrequest with the pvt lock held to avoid a
deadlock.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79301 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 20:37:50 +00:00
Russell Bryant
68faf63811 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 20:18:30 +00:00
Russell Bryant
c06aba4c8a Don't call find_peer within update_registry with a pvt lock held. This can
cause a deadlock as the code will eventually call find_callno.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 20:02:57 +00:00
Russell Bryant
60bcd4e03c 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 19:27:39 +00:00
Steve Murphy
9020699e0a This patch fixes bug 10411. I added a new regression test, some regression test cleanups
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 17:49:54 +00:00
Russell Bryant
4f785d7d28 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79214 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 15:28:13 +00:00
Joshua Colp
4f8857d608 Add an API call to allow the engine to know that DTMF was received.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79207 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 14:51:09 +00:00
Joshua Colp
9a35428295 (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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 14:18:04 +00:00
Tilghman Lesher
d0489c9f50 Ensure the connection gets marked as used at allocation time (closes issue #10429, report and fix by mnicholson)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-11 05:23:04 +00:00
Steve Murphy
241769b53c From a user complaint on #asterisk, I have forced pbx_spool to explain what reason codes mean, when they are logged
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10 20:53:43 +00:00
Steve Murphy
0c21db3e79 Re bug behavior mentioned in #asterisk, made this tweak to code, to prevent hundreds of log messages from being generated
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10 18:25:51 +00:00
Steve Murphy
2544c0be73 This will help debug; from a question asked on #asterisk
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10 17:43:49 +00:00
Russell Bryant
d21e1596f8 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78995 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10 15:20:09 +00:00
Joshua Colp
c3ba2c8fc6 Don't bother having the core pass through or emulate begin DTMF frames when in an ast_waitstream. It only cares about the end of DTMF.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10 14:15:53 +00:00
Joshua Colp
8d0941cdfd (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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10 13:49:19 +00:00
Christian Richter
1f62b98d45 fixed a bug with the useruser information element. We send them now also in the disconnect message.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10 13:24:03 +00:00
Mark Michelson
7133eb1368 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.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09 23:47:00 +00:00
Steve Murphy
1e085b5dfb This fixes bug 10416; thanks to mvanbaak for the pretty output
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78891 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09 23:10:46 +00:00
Mark Michelson
48d9158cdd Removing some extra debug code I left in my last commit
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78860 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09 22:03:48 +00:00
Mark Michelson
fd5f948092 Quite a few changes regarding IMAP storage.
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.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78859 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09 21:51:17 +00:00
Mark Michelson
6c3d28a231 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.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78826 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09 19:52:43 +00:00
Russell Bryant
f2bf48ce42 add a comment to indicate that inboxcount for ODBC_STORAGE needs to be fixed to support multiple mailboxes
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09 17:58:31 +00:00
Russell Bryant
e019aff438 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 ...


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09 17:24:40 +00:00
Russell Bryant
1996c3a71d 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)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09 16:12:57 +00:00
Jason Parker
9b95a12570 Fix mogs email address.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-08 19:29:42 +00:00
Mark Michelson
c97cdff67d 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.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-08 18:16:49 +00:00
Mark Michelson
f8c70a5799 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.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-08 14:26:36 +00:00
Joshua Colp
c98e199fb2 (closes issue #10335)
Reported by: adamgundy
Update sip.conf to include another scenario where directrtpsetup will fail.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-08 13:51:01 +00:00
Russell Bryant
0db2a076e1 Fix the build of this module on 64-bit platforms
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-07 20:57:54 +00:00
Mark Michelson
dcfb651931 The logic behind inboxcount's return value was reversed in has_voicemail and message_count.
(closes issue #10401, reported by st1710, patched by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-07 19:43:57 +00:00
Tilghman Lesher
75a3499df0 Don't free the environment handle when the connection fails, because other connections might be depending upon it
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-07 19:34:25 +00:00
Jason Parker
cb0701052c Allow chan_sip to build in devmode
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-07 19:11:50 +00:00
Tilghman Lesher
57996e930e Reconnection doesn't happen automatically when a DB goes down (fixes issue #9389)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-07 19:09:38 +00:00
Jason Parker
1b58e7a828 Properly check the capabilities count to avoid a segfault.
(ASA-2007-019)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78375 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-07 18:25:15 +00:00
Russell Bryant
c40325aecc Merged revisions 78370 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r78370 | russell | 2007-08-07 12:44:04 -0500 (Tue, 07 Aug 2007) | 4 lines

Revert patch committed for issue #9660.  It broke E&M trunks.
(closes issue #10360)
(closes issue #10364)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78371 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-07 17:45:30 +00:00
Joshua Colp
d76d2c5214 Add additional DTMF log messages to help when debugging issues.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 21:41:13 +00:00
Russell Bryant
2e8439052f 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)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78242 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 20:44:09 +00:00
Russell Bryant
ad13307328 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)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 16:50:54 +00:00
Joshua Colp
03bcbd11c1 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.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 16:32:44 +00:00
Jason Parker
e4f15628bb Fix an issue with using UpdateConfig (manager action) where escaped semicolons
in a config would be converted to just semicolons (\; to ;)

Issue 9938


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 16:30:51 +00:00
Joshua Colp
88b982d7ff (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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78172 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 15:27:24 +00:00
Joshua Colp
3e3aedb3c9 (closes issue #10383)
Reported by: rizzo
Include stdlib.h so NULL gets defined for gethostbyname_r checks.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 14:18:20 +00:00
Mark Michelson
b463a8dcbb Fixed a mistake I made in realtime_peer which caused it to return NULL every time.
Thanks to Jon Fealy for emailing me the correction.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 13:33:07 +00:00
Tilghman Lesher
34f8812c64 Portability fix for devmode compiling (closes bug #10382)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-05 14:18:00 +00:00
Russell Bryant
38a51a53db Fix compilation failure when MALLOC_DEBUG is enabled, but DEBUG_THREADS is not
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-05 04:15:31 +00:00
Tilghman Lesher
a7ade6f213 If peer is not found, the error message is misleading (should be peer not found, not ACL failure)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78139 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-05 03:29:01 +00:00
Mark Michelson
05ba4d90d4 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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-03 20:25:22 +00:00
Russell Bryant
76f4f0218c (closes issue #10194)
Reported by: blitzrage
Patches:
      bug0010194 uploaded by vovochka
Tested by: blitzrage

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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-03 20:14:06 +00:00
Russell Bryant
2f41cceb1f 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-03 19:39:49 +00:00
Russell Bryant
9c3f16e023 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-03 17:01:07 +00:00