Commit Graph

13065 Commits

Author SHA1 Message Date
Tilghman Lesher
648d21d098 If an entry is added to the directory during a scan when another entry expires,
then that new entry will not be processed promptly, but must wait for either a
future entry to start or a current entry's retry to occur.  If no other entries
exist in the directory (other than the new entries) when a bunch expire, then
the new entries must wait until another new entry is added to be processed.
This was a rather weird race condition, really.  Fixes AST-147.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 17:34:34 +00:00
Tilghman Lesher
6326f47ce5 Don't start scanning the directory until all modules are loaded, because some
required modules (channels, apps, functions) may not yet be in memory yet.
Fixes AST-149.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 16:58:34 +00:00
Tilghman Lesher
cc3b3e68f0 Jon Bonilla (Manwe) pointed out on the -dev list:
"I guess that having only ip-phones in mind is not a good approach. Since it is
possible to have a sip proxy connected to asterisk we could receive a 407
(unauthorized) or 483 (too many hops) as response and dialog ending would not be
a good behavior."
So modified.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160480 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 14:09:35 +00:00
Terry Wilson
de2bff02a1 Channel is masqueraded, don't keep alive
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160411 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-02 23:58:08 +00:00
Terry Wilson
cedbee5b75 A situation like A calls B, A builtin_atxfers B to C, C parks B would lead to a crash. Thanks to file for telling me how to fix it!
(closes issue #13854)
Reported by: Adam Lee
Tested by: otherwiseguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160390 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-02 23:04:23 +00:00
Tilghman Lesher
a8736b03e9 When the text does not match exactly (e.g. RTP/SAVP), then the %n conversion
fails, and the resulting integer is garbage.  Thus, we must initialize the
integer and check it afterwards for success.
(closes issue #14000)
 Reported by: folke
 Patches: 
       asterisk-sipbg-sscanf-1.4.22.diff uploaded by folke (license 626)
       asterisk-sipbg-sscanf-1.6.0.1.diff uploaded by folke (license 626)
       asterisk-sipbg-sscanf-trunk-r159896.diff uploaded by folke (license 626)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-02 17:42:09 +00:00
Terry Wilson
a3724485b4 make compile with dev mode and malloc debug
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-02 01:16:30 +00:00
Tilghman Lesher
1653a9ef65 Ensure that Asterisk builds with --enable-dev-mode, even on the latest gcc
and glibc.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160207 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-02 00:25:16 +00:00
Russell Bryant
dfec3b69d6 Apply some logic used in iax2_indicate() to iax2_setoption(), as well, since they
both have the potential to send control frames in the middle of call setup.  We
have to wait until we have received a message back from the remote end before
we try to send any more frames.  Otherwise, the remote end will consider it
invalid, and we'll get stuck in an INVAL/VNAK storm.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-01 17:27:30 +00:00
Michiel van Baak
8f27432e76 Get rid of the useless format string and argument in the Bogus/ manager channelname.
Noted by kpfleming and name Bogus/manager suggested by eliel


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-01 16:08:36 +00:00
Russell Bryant
380e2abf27 Force a "make clean" to avoid a bizarre build issue ...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159900 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-01 14:52:56 +00:00
Michiel van Baak
1a6c64660d make manager compile on OpenBSD.
The last (10th) argument to ast_channel_alloc here should be a pointer
and NULL is not really a pointer.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159897 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-01 14:05:41 +00:00
Kevin P. Fleming
50515ed372 update dev-mode compiler flags to match the ones used by default on Ubuntu Intrepid, so all developers will see the same warnings and errors
since this branch already had some printf format attributes, enable checking for them and tag functions that didn't have them

format attributes in a consistent way



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-29 16:58:29 +00:00
Kevin P. Fleming
a738a1f6e7 rename these files so as to avoid conflicts when users update their working copies and have unversioned files already in place
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-26 20:21:04 +00:00
Kevin P. Fleming
7459a56dbb simplify (and slightly bug-fix) the recent developer-oriented COMPILE_DOUBLE mode
add channels/busy.h and channels/ringtone.h to the repository instead of generating them repeatedtly; most users do not change the settings to build them, but the Makefile rules are still there if they wish to do so

ensure that 'make clean' removes dependency files for .i files that are created in COMPILE_DOUBLE mode



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-26 18:36:24 +00:00
Steve Murphy
141ab56b86 (closes issue #12694)
Reported by: yraber
Patches:
      12694.2nd.diff uploaded by murf (license 17)
Tested by: murf, laurav

Thanks to file (Joshua Colp) for his IAX fix.

the change to cdr.c allows no-answer to percolate
up into CDR's, and feels like the right place to
locate this fix; if BUSY is done here, no-answer
should be, too.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25 22:41:10 +00:00
Tilghman Lesher
10e70eaecf Don't try to send a response on a NULL pvt.
(closes issue #13919)
 Reported by: barthpbx
 Patches: 
       chan_iax2.c.patch uploaded by eliel (license 64)
 Tested by: barthpbx


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25 21:56:48 +00:00
Tilghman Lesher
dd5a228991 Merged revisions 159245 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
  r159245 | tilghman | 2008-11-25 15:37:06 -0600 (Tue, 25 Nov 2008) | 7 lines
  
  Regression fix for last security fix.  Set the iseqno correctly.
  (closes issue #13918)
   Reported by: ffloimair
   Patches: 
         20081119__bug13918.diff.txt uploaded by Corydon76 (license 14)
   Tested by: ffloimair
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25 21:40:28 +00:00
Russell Bryant
07741a3261 Add ao2_trylock() to go along with ao2_lock() and ao2_unlock()
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25 17:34:50 +00:00
Terry Wilson
e8f9274ca7 Add missing variable declaration in the PPC code
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159096 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25 16:23:38 +00:00
Tilghman Lesher
929c14e432 System call ioperm is non-portable, so check for its existence in autoconf.
(Closes issue #13863)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159025 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25 04:50:00 +00:00
Jeff Peeler
c7dcb086dd (closes issue #13786)
Reported by: tzafrir

When compiling against Zaptel dahdi_compat will now only define all the DAHDI defines if the Zaptel define is present. Also, there is no such thing as DAHDI_PRI.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-22 00:04:36 +00:00
Steve Murphy
890386410a In reference to the fix made for 13871, I was
merging the fix into 1.6.0 and realized I missed
the code in the h-exten block, and didn't catch it
because my test case had the h-exten commented out.

So, this corrects the code I missed, as a 
preventative against another crash report.
Tested with the h-exten defined, all is well.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-21 23:14:50 +00:00
Tilghman Lesher
cd4b144fb0 The passed extension may not be the same in the list as the current entry,
because we strip spaces when copying the extension into the structure.
Therefore, use the copied item to place the item into the list.
(found by lmadsen on -dev, fixed by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-21 23:07:46 +00:00
Russell Bryant
a0bf88537a When compiling with DEBUG_THREADS, report the real file/func/line for ao2_lock/ao2_unlock
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-21 22:05:55 +00:00
Steve Murphy
596f31a1a1 (closes issue #13871)
Reported by: mdu113

This one is totally my fault. The code doesn't even
create a bridge if the channel CDR has POST_DISABLED.
I didn't check for that at the end of the bridge.
Fixed with a few small insertions. Tested. Looks
good. No cdr generated, no crash, no unnecc. data
objects created either.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158483 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-21 21:19:47 +00:00
Mark Michelson
72a8661580 This change had somehow gotten reverted due to a
completely unrelated commit. Thanks to Theo Belder
on the Asterisk-dev list for pointing this out.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-21 15:24:19 +00:00
Mark Michelson
6a632a5a2b There was an issue when attempting to reference an embedded
frame in a freed ast_filestream. This patch makes use of the
ao2 functions to make sure that we do not free an ast_filestream
structure until the embedded ast_frame has been "freed" as well.

(closes issue #13496)
Reported by: fst-onge
Patches:
      filestream_frame_1_4.diff uploaded by putnopvut (license 60)
Tested by: putnopvut

Closes AST-89



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 18:06:48 +00:00
Mark Michelson
3668ba67ab We don't handle 4XX responses to BYE well. According to
section 15 of RFC 3261, we should terminate a dialog if we
receive a 481 or 408 in response to our BYE. Since I am aware
of at least one phone manufacturer who may sometimes send a 
404 as well, I am being liberal and saying that any 4XX response
to a BYE should result in a terminated dialog.


(closes issue #12994)
Reported by: pabelanger
Patches:
      12994.patch uploaded by putnopvut (license 60)

Closes AST-129



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 17:48:42 +00:00
Mark Michelson
3a1a981e2e Make sure to set the hangup cause on the calling channel in the case
that ast_call() fails. For incoming SIP channels, this was causing
us to send a 603 instead of a 486 when the call-limit was reached on
the destination channel.

(closes issue #13867)
Reported by: still_nsk
Patches:
      13867.diff uploaded by putnopvut (license 60)
Tested by: blitzrage



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 17:33:06 +00:00
Richard Mudgett
238cd9ea24 Merged revision 157977 from
https://origsvn.digium.com/svn/asterisk/team/group/issue8824

........
Fixes JIRA ABE-1726

The dial extension could be empty if you are using MISDN_KEYPAD
to control ISDN provider features.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 01:46:09 +00:00
Kevin P. Fleming
187f6d485a the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).

while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@157859 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-19 21:34:47 +00:00
Mark Michelson
a6fac748de Add some missing invite state changes necessary in the sip_write
function. Not setting the invite state correctly on the call was
resulting in the Record application leaving empty files. I also
have updated the doxygen comment next to the declaration of the
INV_EARLY_MEDIA constant to reflect that we also use this state
when we *send* a 18X response to an INVITE.

(closes issue #13878)
Reported by: nahuelgreco
Patches:
      sip-early-media-recording-1.4.22.patch uploaded by nahuelgreco (license 162)
	  Tested by: putnopvut


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@157503 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-18 22:47:57 +00:00
Jeff Peeler
161a05a3d1 (closes issue #13899)
Reported by: akkornel

This fix is the result of a bug fix in ast_app_separate_args r124395. If an argument does not exist it should always be set to a null string rather than a null pointer.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@157365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-18 19:13:33 +00:00
Mark Michelson
3429c9de5e Fix a crash in the end_bridge_callback of app_dial and
app_followme which would occur at the end of an attended
transfer. The error occurred because we initially stored
a pointer to an ast_channel which then was hung up due
to a masquerade.

This commit adds a "fixup" callback to the bridge_config
structure to allow for end_bridge_callback_data to be
changed in the case that a new channel pointer is needed
for the end_bridge_callback.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@157305 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-18 18:25:55 +00:00
Kevin P. Fleming
9bfbfb5496 when an individual directory dist-clean is run, run clean in that directory first, and when running top-level dist-clean, do not run subdirectory clean operations twice
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@157163 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-15 19:31:03 +00:00
Kevin P. Fleming
eeae8abc61 dist-clean should remove dependency information files as well
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@157162 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-15 19:24:24 +00:00
Kevin P. Fleming
dda8791081 major update to doxygen configuration file:
1) update to doxygen 1.5.x style file, as used in trunk

2) tell doxygen where are header files are, so include-file processing can be done

3) make all macros that are used to define variables/functions be expanded, so that doxygen will properly document the resulting variable/function

4) make all macros that are used to provide the contents of a variable (structure) be expanded, so that doxygen will be able to document the resulting fields

5) suppress compiler attributes (__attribute__(xxx)) from being seen by doxygen, so it will properly match up function definition and usage (for an example of th effect of this, look at the doxygen docs for ast_log() from before and afte this commit)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@157104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-15 18:00:32 +00:00
Mark Michelson
b753654cbd If the prompt to reenter a voicemail password timed out, it
resulted in the password not being saved, even if the input matched
what you gave when first prompted to enter a new password. This is
because the return value of ast_readstring was checked, but not checked
properly.

This bug was discovered by Jared Smith during an Asterisk training course.
Thanks for reporting it!



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156816 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-14 15:18:59 +00:00
Tilghman Lesher
bc208d63c2 ast_waitfordigit() requires that the channel be up, for no good logical
reason.  This prevents While/EndWhile from working within the "h"
extension.
Reported by: jgalarneau (for ABE C.2)
Fixed by: me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156755 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-14 00:41:37 +00:00
Tilghman Lesher
ad1cd04005 Provide more space for all the data which can appear in an originating
channel name.
(closes issue #13398)
 Reported by: bamby
 Patches: 
       manager.c.diff uploaded by bamby (license 430)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-13 21:24:00 +00:00
Kevin P. Fleming
53c3cdab37 revert this change... non-functional changes don't belong here
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156510 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-13 11:58:41 +00:00
Kevin P. Fleming
350cec723a correct minor syntax error... no functional change
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-13 11:51:27 +00:00
Tilghman Lesher
382459fac8 When using call limits under 1 second, infinite call lengths are allowed,
instead.
(closes issue #13851)
 Reported by: ruddy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 21:18:57 +00:00
Steve Murphy
3557bc1b4d It turns out that the 0x0XX00 codes being returned for
N, X, and Z are off by one, as per conversation with
jsmith on #asterisk-dev;  he was teaching a class
and disconcerted that this published rule was not
being followed, with patterns _NXX, _[1-8]22 and
_[2-9]22... and NXX was winning, but [1-8] should
have been. 

This change, tested on these 3 patterns now 
picks the proper one.

However, this change may surprise users who
set up dialplans based on previous behavior,
which has been there for what, 2 and half 
years or so now.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 19:36:16 +00:00
Tilghman Lesher
7e353eeaa1 If the SLA thread is not started, then reload causes a memory leak.
(closes issue #13889)
 Reported by: eliel
 Patches: 
       app_meetme.c.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 19:26:45 +00:00
Jeff Peeler
738ec1fb71 For whatever reason, gcc only warned me about the possible use of an uninitialized variable when compiling 1.6.1.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 19:10:12 +00:00
Tilghman Lesher
1d023ca457 Revert revision 132506, since it occasionally caused IAX2 HANGUP packets not
to be sent, and instead, schedule a task to destroy the iax2 pvt structure
10 seconds later.  This allows the IAX2 HANGUP packet to be queued,
transmitted, and ACKed before the pvt is destroyed.
(closes issue #13645)
 Reported by: dzajro
 Patches: 
       20081111__bug13645__3.diff.txt uploaded by Corydon76 (license 14)
 Tested by: vazir
 Reviewed: http://reviewboard.digium.com/r/51/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 18:39:21 +00:00
Jeff Peeler
c9cec47bf0 (closes issue #13173)
Reported by: pep

This change adds an announce_thread responsible for playing announcements to an existing conference. This allows all announcing to be immediately stopped if necessary but more importantly allows other threads that need to play something to not block. There are multiple benefits to this, but the actual bug is for solving the scenario for a channel to be unusable after hang up for the entire duration of the parting announcement. The parting announcement can be extremely long depending on what the user recorded upon joining the conference.

Reviewed by Russell on Review Board:
http://reviewboard.digium.com/r/25/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156178 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 17:53:44 +00:00
Mark Michelson
bd9001e16b When doing some tests, I was having a crash at the end of every call
if an attended transfer occurred during the call. I traced the cause to
the CDR on one of the channels being NULL. murf suggested a check in
the end bridge callback to be sure the CDR is non-NULL before proceeding,
so that's what I'm adding.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 17:38:33 +00:00