Commit Graph

12514 Commits

Author SHA1 Message Date
Russell Bryant
5e851ededb Don't exit the script if Asterisk is not running.
(closes issue #12611)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-08 15:32:08 +00:00
Russell Bryant
4a1081e590 Don't use a channel before checking for channel allocation failure.
(closes issue #12609)
Reported by: edantie


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-08 15:24:54 +00:00
Russell Bryant
1ae49dd240 Use the same method for executing Asterisk as the rest of the script.
(closes issue #12611)
Reported by: b_plessis


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-08 14:40:53 +00:00
Russell Bryant
f27d0168a2 Track peer references when stored in the sip_pvt struct as the peer related to
a qualify ping or a subscription.  This fixes some realtime related crashes.
(closes issue #12588)
(closes issue #12555)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-07 18:17:19 +00:00
Russell Bryant
e1c4c9e7b6 Merged revisions 115511 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r115511 | russell | 2008-05-07 11:22:49 -0500 (Wed, 07 May 2008) | 3 lines

Remove remnants of dlinkedlists.  I didn't actually use them in the final version
of my IAX2 improvements.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-07 16:24:09 +00:00
Jason Parker
38191b0908 Merged revisions 115421 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r115421 | qwell | 2008-05-06 14:54:57 -0500 (Tue, 06 May 2008) | 7 lines

read requires an argument on some non-bash shells

(closes issue #12593)
Reported by: bkruse
Patches:
      getilbc.sh_12593_v1.diff uploaded by bkruse (license 132)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-06 19:55:29 +00:00
Jason Parker
00415742a5 Switch to using ast_random() rather than just rand().
This does not fix the bug reported, but I believe it is correct.

(from issue #12446)
Patches:
      bug_12446.diff uploaded by snuffy (license 35)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-06 19:34:58 +00:00
Tilghman Lesher
273afe2080 Don't print the terminating NUL. (Closes issue #12589)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-06 19:31:39 +00:00
Joshua Colp
9c2bac0487 Add in missing argument.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-06 13:54:15 +00:00
Tilghman Lesher
869b7b2b4d Separate verbose output from CLI output, by using a preamble.
(closes issue #12402)
 Reported by: Corydon76
 Patches: 
       20080410__no_verbose_in_rx_output.diff.txt uploaded by Corydon76 (license 14)
       20080501__no_verbose_in_rx_output__1.4.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 22:50:31 +00:00
Joshua Colp
6e6849f1a0 Make sure that either the main speex library contains preprocess functions or that speexdsp does. If both fail then speex stuff can not be built.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 22:10:05 +00:00
Mark Michelson
1eee42a78a Don't consider a caller "handled" until the caller is bridged with
a queue member. There was too much of an opportunity for the member
to hang up (either during a delay, announcement, or overly long
agi) between the time that he answered the phone and the time when
he actually was bridged with the caller. The consequence of this
was that if the member hung up in that interval, then proper
abandonment details would not be noted in the queue log if the caller
were to hang up at any point after the member hangup.

(closes issue #12561)
Reported by: ablackthorn



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115320 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 21:41:34 +00:00
Tilghman Lesher
732e3bec3e Reverse order, such that user configs override default selections
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 20:17:55 +00:00
Tilghman Lesher
6142d1648c Err, the documentation on the return value of ast_odbc_backslash_is_escape is exactly backwards.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 19:55:55 +00:00
Russell Bryant
fbf07008d9 Avoid putting opaque="" in Digest authentication. This patch came from switchvox.
It fixes authentication with Primus in Canada, and has been in use for a very long
time without causing problems with any other providers.
(closes issue AST-36)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 19:49:25 +00:00
Russell Bryant
3cf37ba42e Blocked revisions 115296 via svnmerge
........
r115296 | russell | 2008-05-05 12:53:26 -0500 (Mon, 05 May 2008) | 28 lines

Merge changes from team/russell/iax2_find_callno_1.2

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@115297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 17:53:54 +00:00
Tilghman Lesher
70aedcea79 When starting Asterisk, bug out if Asterisk is already running.
(closes issue #12525)
 Reported by: explidous
 Patches: 
       20080428__bug12525.diff.txt uploaded by Corydon76 (license 14)
 Tested by: mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115285 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 03:22:25 +00:00
Joshua Colp
9ecb9277ad Expand the test function for GCC attributes so that more complex attributes are properly recognized.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115282 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-04 02:09:44 +00:00
Joshua Colp
a8c56a51d6 For my next trick I will make these work with what our autoconf header file gives us.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-04 01:50:59 +00:00
Joshua Colp
65e2b0a8fb Treat warnings as errors when checking if a GCC attribute exists. We have to do this as GCC will just ignore the attribute and pop up a warning, it won't actually fail to compile.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-04 01:43:26 +00:00
Brett Bryant
61bee5aa54 Add new "pri show version" command to show the libpri version for support reasons.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-02 20:25:42 +00:00
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