dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

9261 Commits

Author SHA1 Message Date
russell 173525f1d6 Add the function attribute "pure" or "const" to various functions that perform
int to string or string to int operations.

"pure" essentially says that this function has no side effects aside from its
result, and the result depends on nothing else other than its arguments and
global variables.  "const" is a more strict form of "pure", where the function
also doesn't access any global variables.

From the gcc manual: "Such a function can be subject to common subexpression 
elimination and loop optimization just as an arithmetic operator would be."
This also tells the compiler that it is safe to call the function fewer times
than the code says to, given the same arguments, since the result will always
be the same.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38452 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-28 22:14:49 +00:00
kpfleming f768188647 just for fun, let's lock the whisper buffer for writing AND reading :-)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38441 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-28 19:58:53 +00:00
russell a4784fa28c As discussed and decided on the asterisk-dev mailing list ...
- Fix some breakage I introduced a while ago that made the timestamps option
  not functional for CLI verbose output.
- Remove the use of the timestamps option for log output, since it was not
  functional.
- clarify text referring to the timestamps option so that it is clear that it
  only applies to CLI verbose output


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38439 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-28 19:17:56 +00:00
kpfleming e2c714c0cf move slinfactory structure definition back to header... it's just easier to use this way
add infrastructure for whispering onto a channel


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38422 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-28 18:59:59 +00:00
file 1b8e8e1633 Merged revisions 38420 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38420 | file | 2006-07-28 14:49:00 -0400 (Fri, 28 Jul 2006) | 2 lines

Make a copy of the request URI in check_user_full instead of modifying the one on the structure, and also strip params properly from the user portion of the SIP URI so as to preserve the domain (issue #7552 reported by dan42)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38421 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-28 18:53:43 +00:00
kpfleming 950e4373b5 more slinfactory structure definition to inside implementation module
make read/write/hold work on samples, not bytes
add an API call to find out how many samples are available in a slinfactory


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38418 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-28 18:03:57 +00:00
kpfleming 3bae4f9508 more simplification, and correct a bug i introduced in the last commit
fix prototype for a channel walking function to use a const input pointer
use existing channel walk by name prefix instead of reproducing that code in this app


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38389 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27 23:16:08 +00:00
kpfleming fafa6738a3 remove local channel finding wrappers
move guts of dialplan application into separate function, so it can be shared bythe new application i'm about to add :-)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38374 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27 23:00:27 +00:00
kpfleming 87c1d75227 block this patch from 1.2, it's already fixed here as part of a larger commit
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38371 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27 22:24:19 +00:00
kpfleming bf5386d160 restore infinite timeout for ast_waitfor() call
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38369 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27 22:21:46 +00:00
kpfleming fc7e7d52fe various cleanups:
use API call for finding channel by name prefix
  code formatting to match guidelines (lost about half the of the indenting)
  remove useless automatic variable initializations
  don't set the spying channel's read format to SLINEAR when we don't do anything with the voice frames we read from it anyway
  use proper option argument checking for volume argument



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38368 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27 22:20:52 +00:00
kpfleming 4e0adb6ecc Merged revisions 38347 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38347 | kpfleming | 2006-07-27 10:40:03 -0500 (Thu, 27 Jul 2006) | 2 lines

do a better job avoiding translation path teardown/setup when not needed

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38348 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27 15:42:49 +00:00
russell 13af22e0f4 fix seg fault when the parked call that timed out was the last one in the list
of parked calls (fixes issue #7565)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38330 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27 04:44:49 +00:00
russell 0fdbca7bd0 Merged revisions 38328 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38328 | russell | 2006-07-27 00:25:41 -0400 (Thu, 27 Jul 2006) | 4 lines

Fix crash when using the "regexten" option with MALLOC_DEBUG enabled.  This was
not reported in the bug tracker but the same bug has been demonstrated in other
places in the code.

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38329 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27 04:28:09 +00:00
kpfleming b8fa8202c2 Merged revisions 38310 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38310 | kpfleming | 2006-07-26 21:43:49 -0500 (Wed, 26 Jul 2006) | 2 lines

don't do useless translation destroy/build when the channel is already in the correct format

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38311 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27 02:46:22 +00:00
russell 03ab15e918 Merged revisions 38288 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38288 | russell | 2006-07-26 21:58:41 -0400 (Wed, 26 Jul 2006) | 3 lines

fix a crash when MALLOC_DEBUG is enabled and the regexten is enabled. The crash
would occur when the extension got removed. (fixes issue #7484)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38291 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27 02:00:20 +00:00
russell 2328f30da7 fix crashes with MALLOC_DEBUG enabled that were a result of my recent thread
storage changes (fixes issue #7595)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38286 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27 01:49:57 +00:00
russell 3336dbf985 fix some breakage of ast_cli() that resulted in seg faults on Josh's machine.
I'm not sure why this never caused problems for me ...


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38283 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27 01:29:57 +00:00
russell f6647e8d22 fix setting the CFLAGS for building codec libs so that they are built with
astmm support and astmm doesn't get really upset and complain that it is being
asked to free memory that was never allocated


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38271 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-26 23:12:47 +00:00
tilghman b3bce897f9 Typo found on the -dev list
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38258 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-26 19:59:25 +00:00
tilghman 19b0c704b1 Only unlock these if they were locked on entry
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38250 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-26 17:43:17 +00:00
file 98aa2809e2 Merged revisions 38234 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38234 | file | 2006-07-26 11:26:06 -0400 (Wed, 26 Jul 2006) | 2 lines

Put default callerid into contact when the one specified is either NULL or has a zero string length. (issue #7590 reported by key2)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38235 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-26 15:27:45 +00:00
russell 2c80253492 merge the changes from my ast_cli_tls branch ...
Instead of having a static buffer size of 16k, start out with 256 bytes and
increase the size of the buffer as needed.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38223 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-26 07:48:48 +00:00
russell ea73c30141 This exact deadlock situation that I observed can't happen in trunk due to the
recent hold changes so that MOH is not started on the bridged channel directly.
However, the change is still not a bad idea.

Merged revisions 38200 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38200 | russell | 2006-07-25 15:43:38 -0400 (Tue, 25 Jul 2006) | 6 lines

This resolves a deadlock that a tech support customer was getting frequently
when his users would answer call waiting. If another thread is currently
holding the zt_pvt lock for the first channel, unlock both channels and let
asterisk retry the native bridge, just like what is done for the second channel
directly below these changes.

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38201 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-25 19:51:31 +00:00
murf 81146a9f92 Added a small fix to exclude the AMD optimized assembly file from being included in the compile.
I don't particular like the approach, which basically tries to exclude the file based on
NOT being in a list of arches. This, IMHO, is backwards, it should be a list of AMD arches 
instead. "Better to light a candle, than to curse the darkness", is apropo here. But since I don't
have an exhaustive list of what those arches could be, I leave as-is for now.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38187 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-24 20:58:27 +00:00
murf 1aaedf2f44 blocked rev 38167 on the 1.2 branch from trunk, because it's
coded differently on trunk, would conflict and have to be hand-merged
anyway.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38168 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-24 17:24:47 +00:00
file 08461b3aa5 Start out with cleared RTP payload structures instead of defaults. This should prevent issues where if a stream (audio/stream) is not present and it's RTP payload structure is combined with the overall capability then the capability would be every codec that Asterisk supports.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38158 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-24 15:47:59 +00:00
rizzo b62f6079aa move middle-of-the-block declaration at the top.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38149 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-24 11:46:27 +00:00
rizzo 6257b00195 fix uninitialized variable
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38148 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-24 11:45:06 +00:00
file 0fdd92b70f Only deal with getting the supported payloads on audio if an audio RTP stream exists
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38139 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-24 03:42:27 +00:00
russell 8b4490a133 ast_malloc is sufficient here, since snprintf is called on the buffer
immediately after it gets allocated, which will automatically NULL terminate
the string


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38129 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-23 15:21:44 +00:00
russell 54da881b93 Merge team/russell/ast_cli_tls into the trunk.
This improves the performance of ast_cli() by not doing a heap memory
allocation and deallocation every single time the function is called. Instead,
a thread-specific buffer is allocatted the first time the function is called
and automatically free'd when the thread exits. Also note that this buffer will
only be allocatted in threads that actually call this function, which is 
probably only the threads spawned to service connected asterisk consoles.

This does introduce a new limitation on the maximum length of the resulting
string from the arguments passed to ast_cli. Previously there was no limit
since it was just allocating a buffer big enough every time the function was
called. The current buffer size is 16kB. If there is ever a case where we want
to print more than 16k characters in a single call to ast_cli(), this will have
to be increased.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38127 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-23 15:19:16 +00:00
russell ec5e68f253 fix a seg fault in this application if no context paramater is given
(issue #7571)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38118 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-23 05:20:59 +00:00
russell 5d15612a72 resolve another XXX comment by implementing proper handling of control frames
in ast_write(), which is to call the channel's indicate function if it exists


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38117 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-23 05:06:47 +00:00
russell 7388c7ee99 take the advice of an XXX comment and use an atomic operation to decrement a
variable.  Also, change a use of strdup to ast_strdup and remove a duplicated
error message.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38108 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-23 04:58:56 +00:00
russell 1ace17079b remove a stray newline
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38099 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-23 03:29:19 +00:00
russell 1e98de70e7 update to mention svn instead of cvs
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38089 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-23 02:50:25 +00:00
russell 809c05e800 various cleanups regarding coding guidelines issues
- malloc to ast_malloc
 - malloc + memset to ast_calloc
 - sizeof(struct foo) to sizeof(*bar)
 - remove indentation of the entire body of a function by returning immediately
   on an allocation failure
(issue #7581, tempest1)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38088 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-23 02:41:02 +00:00
russell e7125a119a ast_pbx_outgoing_cdr_failed() is not used outside of pbx.c so make it static
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38078 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-22 00:38:30 +00:00
russell ffb56d9d39 use ast_atomic_fetchadd_int in chan_zap, sip, and iax2 for usecount handling
and fix a couple little things in passing
 - usecnt was not initialized in chan_iax2
 - ast_update_use_count() was not called after incrementing the count in chan_sip


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38077 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-22 00:33:56 +00:00
russell 593233e983 remove an XXX comment and document that ast_autoservice_start() will return -1
if the channel is already in the autoservice list.

Why is this a valid case to return -1, you ask?  Well, there should never be
any code where it is not clear if the channel is in autoservice or not because
trying to read frames from a channel that is in the autoservice list will lead
to bad results because more than one thread will be waiting on frames to arrive
on the channel and then trying to read them.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38076 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-22 00:08:21 +00:00
russell 89e3199543 slightly simplify a loop and replace an open coded version of ast_skip_blanks
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38068 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-21 23:58:14 +00:00
russell 17d5d2fdb7 make ast_state2str thread safe by using thread local storage instead of a
static buffer for storing the result when the state value is unknown


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38060 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-21 22:36:25 +00:00
bweschke e4561310c6 This corrects the crash condition present in #7575, but I'm not really sure if it's the "right" fix. Please review and make any adjustments you see necessary.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38051 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-21 19:10:58 +00:00
russell f395a52a02 Merge a new implementation of ast_inet_ntoa, our thread safe replacement for
inet_ntoa, which uses thread specific data (aka thread local storage) instead
of stack allocatted buffers to store the result.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38042 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-21 17:31:28 +00:00
file c7eeabcdd2 Only bitmaskify the RTP payload structure for video if an RTP structure exists for it... otherwise the default values will cause codec combination madness
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38030 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-20 18:42:22 +00:00
russell bdeac3f78f add a verbose message to the AGI command, STREAM FILE, similar to the
verbose messages when using Playback, Background, or the GET DATA command
(issue #7297, softins)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38021 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-20 16:18:07 +00:00
north d417e51f78 Remove "initialization from incompatible pointer type" warnings.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38010 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-19 22:48:00 +00:00
north 3898789c02 Fix a few doxygen warnings.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38009 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-19 22:40:36 +00:00
russell e0a9b2f295 add menuselect_stub.c to deps list
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38000 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-19 21:52:59 +00:00