Commit Graph

11383 Commits

Author SHA1 Message Date
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
Russell Bryant
f58354525f 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)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-03 02:04:22 +00:00
Jason Parker
6caf638f90 Make sure we actually allow 6 chars to be sent.
Also make note of the "A" option of date format.

Issue 9779, modifications by DEA, wedhorn, and myself.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77996 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 21:53:39 +00:00
Jason Parker
eb63c3eece If a device disconnects, the session will go away.
If this happens during call setup, we need to give up.

Issue 10325.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77993 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 20:22:40 +00:00
Russell Bryant
311841c1b3 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)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 19:25:14 +00:00
Jason Parker
4386df68d9 Make sure we clear the prompt status message on a hangup.
Also rearrange messages to better fit with what a wireshark trace shows it should be.

Issue 10299, initial patch and solution by sbisker, modified by me to fit with wireshark trace.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 18:42:36 +00:00
Steve Murphy
a181678820 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.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 18:21:40 +00:00
Russell Bryant
02f69d36f4 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)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 18:04:43 +00:00
Russell Bryant
847515b5c6 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)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 16:56:04 +00:00
Jason Parker
e3bf324023 Make sure that we show the correct extension if dialed from a macro
"From: 5555" rather than "From: s"

Issue 10358, initial patch by DEA, reworked by me to use S_OR, tested by sbisker


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 15:15:45 +00:00
Jason Parker
db137aca0f Put in some additional debug information for softkey/stimulus messages.
Issue 10291, patch by DEA.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 22:28:56 +00:00
Russell Bryant
5179aee53b 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)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 22:16:17 +00:00
Tilghman Lesher
9b71e8eef2 Voicemail with ODBC_STORAGE defined does not compile cleanly (missing def)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 22:14:47 +00:00
Jason Parker
d44d0a9a8c Fix an issue that caused one-way audio on some newer devices (specifically the 7921),
due to sending packets in the wrong order during hangup.

Also make sure we clear tones/messages on the correct line/instance.

Issue 10291, patch by DEA, tested by sbisker and myself.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 21:08:42 +00:00
Joshua Colp
97885fed58 (closes issue #10351)
Reported by: ftarz
Some platforms don't like it when you pass NULL to vsnprintf so pass "" instead.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77871 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 18:08:51 +00:00
Joshua Colp
68c221f69a Add some fixes for building on Solaris.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77869 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 17:56:59 +00:00
Joshua Colp
8e5dfb3cf9 Whoops, I meant R_5 not R5.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 17:52:11 +00:00
Joshua Colp
927a66c9ae And for my last trick... make sure that if gethostbyname_r is exported by a library that it is used.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77865 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 17:42:52 +00:00
Joshua Colp
bc7150c380 Extend autoconf logic to determine which version of gethostbyname_r is on the system.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77863 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 17:22:35 +00:00
Mark Michelson
5739eba48e 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!



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77854 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 14:08:57 +00:00
Mark Michelson
7e6f78d95e 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)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 13:59:59 +00:00
Jim Dixon
93c169da6f Much newer version, 0.70 with much additions
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31 21:09:39 +00:00
Jim Dixon
cd1614fcd8 Made VAST improvements in DTMF receiver in RADIO_RELAX mode (thanx Steve
W9SH), and oversight in logic in TONE_VERIFY/RELAX mode in chan_zap.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31 21:00:08 +00:00
Steve Murphy
fa7175eefb Merged revisions 77842 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r77842 | murf | 2007-07-31 13:19:35 -0600 (Tue, 31 Jul 2007) | 1 line

This probably isn't super-general, but it's a first stab at using kill -11 to generate a core file instead of gcore.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77844 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31 20:59:10 +00:00
Joshua Colp
35ceaca691 Add a flag to the speech API that allows an engine to set whether it received results or not.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77831 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31 16:17:09 +00:00
Kevin P. Fleming
e03bec2c16 DETECT_DEADLOCKS can't be enabled without DEBUG_THREADS or it does nothing
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77827 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31 15:53:42 +00:00
Mark Michelson
43b39d02ae 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)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77824 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31 15:21:22 +00:00
Jason Parker
25017ad181 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77795 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 20:17:08 +00:00
Russell Bryant
8ed859dfc0 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.  :)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77794 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 20:16:43 +00:00
Russell Bryant
0bc611f555 (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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77788 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 19:13:31 +00:00
Russell Bryant
0a2331cf26 file and I both committed changes for issue #10301. Remove a duplicated
assignment to restore the original value of the previous channel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 18:55:15 +00:00
Tilghman Lesher
834260a648 Merged revisions 77782 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r77782 | tilghman | 2007-07-30 13:40:54 -0500 (Mon, 30 Jul 2007) | 2 lines

Revert change in revision 71656, even though it fixed a bug, because many people were depending upon the (broken) behavior.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 18:43:55 +00:00
Russell Bryant
e533cabf1c (closes issue #10301)
Reported by: fnordian
Patches:
      asterisk-1.4.9-channel.c.patch uploaded by fnordian (license 110)
      Additional changes by me

Fix some problems in channel_find_locked() which can cause an infinite loop.
The reference to the previous channel is set to NULL in some cases.  These changes
ensure that the reference to the previous channel gets restored before needing
it again.

I'm not convinced that the code that is setting it to NULL is really the right
thing to do.  However, I am making these changes to fix the obvious problem
and just leaving an XXX comment that it needs a better explanation that what
is there now.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77780 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 17:29:43 +00:00
Joshua Colp
cd53ad9161 (closes issue #10327)
Reported by: kkiely
Instead of directly mucking with the extension/context/priority of the channel we are transferring when it has a PBX simply call ast_async_goto on it. This will ensure that the channel gets handled properly and sent to the right place.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 17:11:02 +00:00
Joshua Colp
33abae518a (closes issue #10301)
Reported by: fnordian
Patches:
      asterisk-1.4.9-channel.c.patch uploaded by fnordian (license 110)
Restore previous behavior where if we failed to lock the channel we wanted we would return to exactly the same point as if we had just reentered the function.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 15:47:52 +00:00
Joshua Colp
ef742da9a6 Merged revisions 77767 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r77767 | file | 2007-07-30 11:50:02 -0300 (Mon, 30 Jul 2007) | 4 lines

(closes issue #10334)
Reported by: ramonpeek
Pass through the return value from macro_exec through the MacroIf application.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 14:51:44 +00:00
Tilghman Lesher
548f3e339e Missing newline
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-27 18:15:58 +00:00
Joshua Colp
c28511d8ba (closes issue #10310)
Reported by: prashant_jois
Patches:
      cdr_pgsql.patch uploaded by prashant (license 114)
Finish the Postgresql connection after the log messages are printed so we don't access invalid memory.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-27 17:04:08 +00:00
Joshua Colp
20d0b01607 (closes issue #10323)
Reported by: julianjm
Patches:
      chan_sip_device_state_hold_fix.v1.diff.txt uploaded by julianjm (license 99)
Clear ONHOLD flag when decrementing the onHold peer count. If we did not do this the count may keep decreasing.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-27 16:27:16 +00:00
Mark Michelson
7a09244181 "re-invite" was misspelled
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-27 14:30:43 +00:00
Joshua Colp
8fa7c1e9b0 (closes issue #10302)
Reported by: litnialex
If a DTMF end frame comes from a channel without a begin and it is going to a technology that only accepts end frames (aka INFO) then use the minimum DTMF duration if one is not in the frame already.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77460 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26 23:19:04 +00:00
Kevin P. Fleming
e87baf1c81 change protocol for downloads as well
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26 22:16:42 +00:00
Kevin P. Fleming
02a3e0d1c7 use new canonical name for download server
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77424 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26 22:14:21 +00:00
Russell Bryant
536ef99117 AST_DEVMODE was defined in trunk, but not in 1.4. When Asterisk is compiled
under dev mode, AST_DEVMODE will get defined in buildopts.h.  Change 1.4 to
define it in the same way that trunk does.  Also, revert the change that added
this define in the Makefile

The advantage to doing it this way is that buildopts.h gets installed when
you install Asterisk.  Then, when building any out of tree modules, or
building asterisk-addons, these modules know which options the rest of Asterisk
was built with.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26 21:23:23 +00:00
Mark Michelson
dbfdbbf4cc Fixes to get ast_backtrace working properly. The AST_DEVMODE macro was never defined so the majority of ast_backtrace never
attempted compilation. The makefile now defines AST_DEVMODE if configure was run with --enable-dev-mode. Also, changes were 
made to acccomodate 64 bit systems in ast_backtrace.

Thanks to qwell, kpfleming, and Corydon76 for their roles in allowing me to get this committed



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26 20:35:17 +00:00