Commit Graph

12543 Commits

Author SHA1 Message Date
Mark Michelson
89453ef4c1 Clarify a comment that was, well, just wrong. It turns out that
ignoring the way that macros expand. Instead, I have clarified in the
comment why the macro will work even if the scheduler id for the
task to be deleted changes during the execution of the macro.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-02 14:28:19 +00:00
Tilghman Lesher
291dd88595 Change the comment of deprecated to an actual compiler deprecation
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-01 23:20:25 +00:00
Tilghman Lesher
dceb0835da '#' is another reserved character for URIs that also needs to be escaped.
(closes issue #10543)
 Reported by: blitzrage
 Patches: 
       20080418__bug10543.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115017 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-01 18:59:08 +00:00
Russell Bryant
5f1f3ed473 Merge changes from team/russell/iax2_find_callno and iax2_find_callno_1.4
These changes address a critical performance issue introduced in the latest
release.  The fix for the latest security issue included a change that made
Asterisk randomly choose call numbers to make them more difficult to guess by
attackers.  However, due to some inefficient (this is by far, an understatement)
code, when Asterisk chose high call numbers, chan_iax2 became unusable after
just a small number of calls.  On a small embedded platform, it would not be
able to handle a single call.  On my Intel Core 2 Duo @ 2.33 GHz, I couldn't
run more than about 16 IAX2 channels.  Ouch.

These changes address some performance issues of the find_callno() function
that have bothered me for a very long time.  On every incoming media frame,
it iterated through every possible call number trying to find a matching
active call.  This involved a mutex lock and unlock for each call number
checked.  So, if the random call number chosen was 20000, then every media
frame would cause 20000 locks and unlocks.  Previously, this problem was
not as obvious since Asterisk always chose the lowest call number it could.

A second container for IAX2 pvt structs has been added.  It is an astobj2
hash table.  When we know the remote side's call number, the pvt goes into
the hash table with a hash value of the remote side's call number.  Then,
lookups for incoming media frames are a very fast hash lookup instead of an
absolutely insane array traversal.

In a quick test, I was able to get more than 3600% more IAX2 channels
on my machine with these changes.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114891 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30 16:30:01 +00:00
Olle Johansson
26fc3d5ac6 Don't crash on bad SIP replys.
Fix created in Huntsville together with Mark M (putnopvut)

(closes issue #12363)
Reported by: jvandal
Tested by: putnopvut, oej


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30 16:23:17 +00:00
Kevin P. Fleming
8b8a6f2486 use the ARRAY_LEN macro for indexing through the iaxs/iaxsl arrays so that the size of the arrays can be adjusted in one place, and change the size of the arrays from 32768 calls to 2048 calls when LOW_MEMORY is defined
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30 14:46:57 +00:00
Kevin P. Fleming
148bd701f0 pay attention to *all* header files for dependency tracking, not just the local ones (inspired by r578 of asterisk-addons by tilghman)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114875 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30 12:14:07 +00:00
Mark Michelson
b066825d56 Use the MACRO_CONTEXT and MACRO_EXTEN channel variables instead of the channel's macrocontext
and macroexten fields. This is needed because if macros are daisy-chained, the incorrect 
context and extension are placed on the new channel. I also added locking to the channel prior
to accessing these variables as noted in trunk's janitor project file.


(closes issue #12549)
Reported by: darren1713
Patches:
      app_queue.c.macroextenpatch uploaded by darren1713 (license 116)
	       (with modifications from me)
Tested by: putnopvut



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-29 19:40:06 +00:00
Jason Parker
06b0749cfd Change warning message to debug, since there are cases where 0 results is perfectly fine.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-29 17:08:55 +00:00
Kevin P. Fleming
2ddaeeaf59 Merged revisions 114822 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r114822 | kpfleming | 2008-04-29 07:52:32 -0500 (Tue, 29 Apr 2008) | 2 lines

stop script from appending source code if run multiple times

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-29 12:53:12 +00:00
Tilghman Lesher
a4732cfb3c When modules are embedded, they take on a different name, without the ".so"
extension.  Specifically check for this name, when we're checking if a module
is loaded.
(Closes issue #12534)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114708 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-28 04:47:39 +00:00
Sean Bright
eb8e9d5dc5 When we don't explicitly pass a path to the --with-tds configure option, we
may end up finding tds.h in /usr/local/include instead of /usr/include.  If
this happens, the grep that looks for the version (from tdsver.h) will fail
and we'll have some problems during the build.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114695 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-27 01:26:15 +00:00
Tilghman Lesher
13a438e295 Clicking forward without selecting a message leaves an errant .lock file.
(closes issue #12528)
 Reported by: pukepail
 Patches: 
       patch.diff uploaded by pukepail (license 431)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-26 13:15:21 +00:00
Russell Bryant
609ed327eb Use consistent logic for checking to see if a call number has been chosen yet.
Also, remove some redundant logic I recently added in a fix.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114673 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-25 21:54:40 +00:00
Mark Michelson
fcd288a33e Move the unlock of the spyee channel to outside the start_spying() function so that
the channel is not unlocked twice when using whisper mode.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114662 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-25 19:32:02 +00:00
Tilghman Lesher
6d2c05cbec Reference documentation files that actually exist.
(closes issue #12516)
 Reported by: linuxmaniac
 Patches: 
       diff_rev114611.patch uploaded by linuxmaniac (license 472)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-25 15:53:52 +00:00
Mark Michelson
709502b119 Re-invite RTP during a masquerade so that, for instance, an AMI
redirect of two channels which are natively bridged will preserve audio
on both channels. This prevents a problem with Asterisk not re-inviting
due to one of the channels having being a zombie.

(closes issue #12513)
Reported by: mneuhauser
Patches:
      asterisk-1.4-114602_restore-RTP-on-fixup.patch uploaded by mneuhauser (license 425)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114632 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 21:35:08 +00:00
Mark Michelson
44c157b36a Output of channel variables when eventwhencalled=vars was set
was being truncated two characters. This patch corrects the
problem.

(closes issue #12493)
Reported by: davidw



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 20:43:03 +00:00
Mark Michelson
8eee7feb2b Resolve a deadlock in chan_local by releasing the channel lock
temporarily.

(closes issue #11712)
Reported by: callguy
Patches:
      11712.patch uploaded by putnopvut (license 60)
Tested by: acunningham



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114624 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 20:04:24 +00:00
Tilghman Lesher
0cd455c19b Ensure that when we set the accountcode, it actually shows up in the CDR.
(Fix for AMI Originate)
(Closes issue #12007)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 19:53:36 +00:00
Russell Bryant
57c68bcb3a Fix a silly mistake in a change I made yesterday that caused chan_iax2 to blow
up very quickly.
(issue #12515)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 15:55:21 +00:00
Olle Johansson
2acde60c29 Only have one max-forwards header in outbound REFERs.
Discovered in the Asterisk SIP Masterclass in Orlando. Thanks Joe!


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 14:55:18 +00:00
Russell Bryant
2f6cbc76ec Improve some broken cookie parsing code. Previously, manager login over HTTP
would only work if the mansession_id cookie was first.  Now, the code builds
a list of all of the cookies in the Cookie header.  This fixes a problem
observed by users of the Asterisk GUI.
(closes AST-20)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23 22:18:12 +00:00
Russell Bryant
74694c686d Fix an issue that caused getting the correct next channel to not always work.
Also, remove setting the amount of time to wait for a digit from 5 seconds back
down to 1/10 of a second.  I believe this was so the beep didn't get played over
and over really fast, but a while back I put in another fix for that issue.

(closes issue #12498)
Reported by: jsmith
Patches:
      app_chanspy_channel_walk.trunk.patch uploaded by jsmith (license 15)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114597 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23 20:49:18 +00:00
Jason Parker
02bd4cbebc Fix reload/unload for res_musiconhold module.
(closes issue #11575)
Reported by: sunder
Patches:
      M11575_14_rev3.diff uploaded by junky (license 177)
      bug11575_trunk.diff.txt uploaded by jamesgolovich (license 176)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114594 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23 18:28:44 +00:00
Russell Bryant
f8848a7fe8 Store the manager session ID explicitly as 4 byte ID instead of a ulong. The
mansession_id cookie is coded to be limited to 8 characters of hex, and this
could break logins from 64-bit machines in some cases.
(inspired by AST-20)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114591 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23 17:55:31 +00:00
Russell Bryant
694a6b4abb Fix find_callno_locked() to actually return the callno locked in some more cases.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23 17:16:32 +00:00
Olle Johansson
5980514bb0 Add 502 support for both directions, not only one... (see r114571)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23 16:51:41 +00:00
Joshua Colp
d4ebf1dff1 Instead of stopping dialplan execution when SayNumber attempts to say a large number that it can not print out a message informing the user and continue on.
(closes issue #12502)
Reported by: bcnit


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23 14:54:11 +00:00
Tilghman Lesher
0c777767c9 Treat a 502 just like a 503, when it comes to processing a response code
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 23:51:44 +00:00
Russell Bryant
5648feb3e9 When we receive a full frame that is supposed to contain our call number,
ensure that it has the correct one.
(closes issue #10078)
(AST-2008-006)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 22:15:36 +00:00
Russell Bryant
b3a211bdc3 I thought I was going to be able to leave 1.4 alone, but that was not the case.
I ran into some problems with G.722 in 1.4, so I have merged in all of the fixes
in this area that I have made in trunk/1.6.0, and things are happy again.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114550 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 21:14:55 +00:00
Russell Bryant
e4ed5a76f1 Trivial change to read the number of samples from a frame before calling ast_write()
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 19:45:00 +00:00
Russell Bryant
d87023aef0 After a parked call times out, allow the call back to the parker to time out.
(closes issue #10890)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 18:29:56 +00:00
Russell Bryant
0f59f5491d If the dial string passed to the call channel callback does not indicate an
extension, then consider the extension on the channel before falling back
to the default.

(closes issue #12479)
Reported by: darren1713
Patches:
      exten_dial_fix_chan_iax2.c.patch uploaded by darren1713 (license 116)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114537 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 18:03:33 +00:00
Russell Bryant
39d1303e14 Merge changes from team/russell/issue_9520
These changes make sure that the reference count for sip_peer objects properly
reflects the fact that the peer is sitting in the scheduler for a scheduled
callback for qualifying peers or for expiring registrations.  Without this, it
was possible for these callbacks to happen at the same time that the peer was
being destroyed.  This was especially likely to happen with realtime peers, and
for people making use of the realtime prune CLI command.

(closes issue #9520)
Reported by: kryptolus
Committed patch by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 15:20:37 +00:00
Joshua Colp
3053679ade Only drop audio if we receive it without a progress indication. We allow other frames through such as DTMF because they may be needed to complete the call.
(closes issue #12440)
Reported by: aragon


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114322 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-21 14:39:32 +00:00
Tilghman Lesher
5955dbc3c1 Ensure that help text terminates with a newline
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-19 13:57:17 +00:00
Tilghman Lesher
0dc35f4e26 MOH usage information needs a terminating newline, or else
"asterisk -rx 'help moh reload'" will hang.  Reported via
-dev list, fixed by me.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-19 13:49:50 +00:00
Russell Bryant
c8c2c33550 Don't destroy a manager session if poll() returns an error of EAGAIN.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-18 21:48:06 +00:00
Russell Bryant
992264a77f ensure directories are created before we try to install stuff into them
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-18 20:01:09 +00:00
Russell Bryant
87aea83bdc SUBDIRS_INSTALL is already listed as a subtarget for bininstall
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-18 19:58:55 +00:00
Mark Michelson
f32e7af11a Clearing up error messages so they make a bit more sense. Also removing a redundant error
message.

Issue AST-15



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-18 17:44:29 +00:00
Russell Bryant
de529ba5f7 Ensure that we don't ast_strdupa(NULL)
(closes issue #12476)
Reported by: davidw
Patch by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114248 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-18 15:24:09 +00:00
Sean Bright
da91e55eaf Only complete the SIP channel name once for 'sip show channel <channel>'
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114245 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-18 13:33:32 +00:00
Tilghman Lesher
9f6634f7c1 For consistency sake, ensure that the values that ${CALLINGPRES} returns are valid as an
input to SetCallingPres.  (Closes issue #12472)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114242 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-18 06:49:16 +00:00
Russell Bryant
46c685af6c Remove redundant safety net. The check for the autoservice channel list state
accomplishes the same goal in a better way.

(issue #12470)
Reported By: atis


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114230 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-17 22:15:43 +00:00
Mark Michelson
2dbf0778b3 Declaration of the peer channel in this scope was making it so the peer variable defined
in the outer scope was never set properly, therefore making iterating through the channel
list always restart from the beginning. This bug would have affected anyone who called
chanspy without specifying a first argument.

(closes issue #12461)
Reported by: stever28



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-17 21:03:29 +00:00
Mark Michelson
171a6a24bb Add prototype for ast_dsp_frame_freed. I'm not sure how this was
compiling before...



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-17 16:50:46 +00:00
Mark Michelson
71b704ef78 It was possible for a reference to a frame which was part of a freed DSP to still be
referenced, leading to memory corruption and eventual crashes. This code change ensures
that the dsp is freed when we are finished with the frame. This change is very similar
to a change Russell made with translators back a month or so ago.

(closes issue #11999)
Reported by: destiny6628
Patches:
      11999.patch uploaded by putnopvut (license 60)
Tested by: destiny6628, victoryure



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114207 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-17 16:28:03 +00:00