Commit Graph

9218 Commits

Author SHA1 Message Date
Joshua Colp 5837bed675 Blocked revisions 38501 via svnmerge
........
r38501 | file | 2006-07-29 19:18:00 -0400 (Sat, 29 Jul 2006) | 2 lines

How many attempts does it take to make a SIP URI parser that works well? I'm up to 5 personally. On to the good stuff - parse the domain first, user second, and get rid of port & options/params last. (issue #7616 reported by andrew)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38502 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-29 23:19:36 +00:00
Mark Spencer f2a6636210 Allow updates to match specific lines, allow specification of object or
no when appending.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-29 22:02:37 +00:00
Kevin P. Fleming 193aab348c update cleancount because the channel structure changed today
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-29 00:19:18 +00:00
Kevin P. Fleming 21e3c3a561 play a beep tone into the spied-on channel if we are about to whisper to them
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28 23:47:05 +00:00
Kevin P. Fleming 4bc6613648 add ExtenSpy variant of ChanSpy
implement whisper mode for ExtenSpy/ChanSpy



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28 23:36:06 +00:00
Russell Bryant 99f9d827c1 the pure attribute was not implemented before gcc 2.96. Since we have this
version check here anwyay, define attribute_pure to be empty if it's an earlier
version.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38464 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28 23:30:18 +00:00
Russell Bryant 450db95711 add macros for the pure and const attributes to compiler.h, in case they ever
need to be handled differently for a specific compiler


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38454 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28 22:50:54 +00:00
Russell Bryant d6246e579f 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: https://origsvn.digium.com/svn/asterisk/trunk@38452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28 22:14:49 +00:00
Kevin P. Fleming 88cea437ab just for fun, let's lock the whisper buffer for writing AND reading :-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38441 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28 19:58:53 +00:00
Russell Bryant b04f059b4a 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: https://origsvn.digium.com/svn/asterisk/trunk@38439 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28 19:17:56 +00:00
Kevin P. Fleming 3314ea0d59 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: https://origsvn.digium.com/svn/asterisk/trunk@38422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28 18:59:59 +00:00
Joshua Colp 48c09ef517 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: https://origsvn.digium.com/svn/asterisk/trunk@38421 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28 18:53:43 +00:00
Kevin P. Fleming d079b1c49f 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: https://origsvn.digium.com/svn/asterisk/trunk@38418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-28 18:03:57 +00:00
Kevin P. Fleming a8b85fda84 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: https://origsvn.digium.com/svn/asterisk/trunk@38389 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27 23:16:08 +00:00
Kevin P. Fleming 94fa23aaa1 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: https://origsvn.digium.com/svn/asterisk/trunk@38374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27 23:00:27 +00:00
Kevin P. Fleming 878e8fb901 block this patch from 1.2, it's already fixed here as part of a larger commit
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38371 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27 22:24:19 +00:00
Kevin P. Fleming 8af55b34ad restore infinite timeout for ast_waitfor() call
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27 22:21:46 +00:00
Kevin P. Fleming 22d37976f2 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: https://origsvn.digium.com/svn/asterisk/trunk@38368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27 22:20:52 +00:00
Kevin P. Fleming 01e006c33c 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: https://origsvn.digium.com/svn/asterisk/trunk@38348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27 15:42:49 +00:00
Russell Bryant 03356c2a4d 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: https://origsvn.digium.com/svn/asterisk/trunk@38330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27 04:44:49 +00:00
Russell Bryant 2842015aca 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: https://origsvn.digium.com/svn/asterisk/trunk@38329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27 04:28:09 +00:00
Kevin P. Fleming 8b603fe8a5 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: https://origsvn.digium.com/svn/asterisk/trunk@38311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27 02:46:22 +00:00
Russell Bryant 1df50be628 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: https://origsvn.digium.com/svn/asterisk/trunk@38291 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27 02:00:20 +00:00
Russell Bryant 7b8d8c9bb5 fix crashes with MALLOC_DEBUG enabled that were a result of my recent thread
storage changes (fixes issue #7595)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27 01:49:57 +00:00
Russell Bryant a43a350c3e 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: https://origsvn.digium.com/svn/asterisk/trunk@38283 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27 01:29:57 +00:00
Russell Bryant c1bd5cfe39 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: https://origsvn.digium.com/svn/asterisk/trunk@38271 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-26 23:12:47 +00:00
Tilghman Lesher cc3029e871 Typo found on the -dev list
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-26 19:59:25 +00:00
Tilghman Lesher a60a9b6637 Only unlock these if they were locked on entry
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38250 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-26 17:43:17 +00:00
Joshua Colp 6d52c0b559 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: https://origsvn.digium.com/svn/asterisk/trunk@38235 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-26 15:27:45 +00:00
Russell Bryant d3a4d776df 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: https://origsvn.digium.com/svn/asterisk/trunk@38223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-26 07:48:48 +00:00
Russell Bryant d86d8ebdff 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: https://origsvn.digium.com/svn/asterisk/trunk@38201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-25 19:51:31 +00:00
Steve Murphy 1bb760f347 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: https://origsvn.digium.com/svn/asterisk/trunk@38187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-24 20:58:27 +00:00
Steve Murphy 921336593b 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: https://origsvn.digium.com/svn/asterisk/trunk@38168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-24 17:24:47 +00:00
Joshua Colp cbf79ca489 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: https://origsvn.digium.com/svn/asterisk/trunk@38158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-24 15:47:59 +00:00
Luigi Rizzo 2c3bc8b1b3 move middle-of-the-block declaration at the top.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38149 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-24 11:46:27 +00:00
Luigi Rizzo d0ef036696 fix uninitialized variable
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38148 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-24 11:45:06 +00:00
Joshua Colp 6810884f60 Only deal with getting the supported payloads on audio if an audio RTP stream exists
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38139 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-24 03:42:27 +00:00
Russell Bryant fb94a4933b 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: https://origsvn.digium.com/svn/asterisk/trunk@38129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-23 15:21:44 +00:00
Russell Bryant a1fb7a2da3 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: https://origsvn.digium.com/svn/asterisk/trunk@38127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-23 15:19:16 +00:00
Russell Bryant 4103a6d8d7 fix a seg fault in this application if no context paramater is given
(issue #7571)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-23 05:20:59 +00:00
Russell Bryant ee4c121dec 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: https://origsvn.digium.com/svn/asterisk/trunk@38117 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-23 05:06:47 +00:00
Russell Bryant 02077a8cae 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: https://origsvn.digium.com/svn/asterisk/trunk@38108 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-23 04:58:56 +00:00
Russell Bryant 0b6a420520 remove a stray newline
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-23 03:29:19 +00:00
Russell Bryant 8f08d7cc13 update to mention svn instead of cvs
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-23 02:50:25 +00:00
Russell Bryant 5830e9cb4f 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: https://origsvn.digium.com/svn/asterisk/trunk@38088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-23 02:41:02 +00:00
Russell Bryant f21d43ad5e ast_pbx_outgoing_cdr_failed() is not used outside of pbx.c so make it static
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-22 00:38:30 +00:00
Russell Bryant d897bd41c2 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: https://origsvn.digium.com/svn/asterisk/trunk@38077 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-22 00:33:56 +00:00
Russell Bryant 41ab9c5015 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: https://origsvn.digium.com/svn/asterisk/trunk@38076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-22 00:08:21 +00:00
Russell Bryant 8dad7e730e slightly simplify a loop and replace an open coded version of ast_skip_blanks
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38068 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-21 23:58:14 +00:00
Russell Bryant 83749437a9 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: https://origsvn.digium.com/svn/asterisk/trunk@38060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-21 22:36:25 +00:00