dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

1871 Commits

Author SHA1 Message Date
russell 1ae3284012 Change g_eid to ast_eid_default.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184630 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-27 14:00:18 +00:00
russell f7ab36aef7 Fix some issues with rwlock corruption that caused deadlock like symptoms.
When dvossel and I were doing some load testing last week, we noticed that we
could make Asterisk trunk lock up instantly when we started generating a bunch
of calls.  The backtraces of locked threads were bizarre, and many were stuck
on an _unlock_ of an rwlock.

The changes are:

1) Fix a number of places where a backtrace would be loaded into an invalid
   index of the backtrace array.  It's an off by one error, which ends up
   writing over the rwlock itself.

2) Ensure that in the array of held locks, we NULL out an index once it is
   not being used so that it's not confusing when analyzing its contents.

3) Remove a bunch of logging referring to an rwlock operating being done
   with "deep reentrancy".  It is normal for _many_ threads to hold a
   read lock on an rwlock.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184531 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-27 02:20:23 +00:00
russell d8dbfb1cb1 Pass more useful information through to lock tracking when DEBUG_THREADS is on.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184512 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-27 01:35:56 +00:00
russell f89c5f7e6c Improve performance of the ast_event cache functionality.
This code comes from svn/asterisk/team/russell/event_performance/.

Here is a summary of the changes that have been made, in order of both
invasiveness and performance impact, from smallest to largest.

1) Asterisk 1.6.1 introduces some additional logic to be able to handle
   distributed device state.  This functionality comes at a cost.
   One relatively minor change in this patch is that the extra processing
   required for distributed device state is now completely bypassed if
   it's not needed.

2) One of the things that I noticed when profiling this code was that a
   _lot_ of time was spent doing string comparisons.  I changed the way
   strings are represented in an event to include a hash value at the front.
   So, before doing a string comparison, we do an integer comparison on the
   hash.

3) Finally, the code that handles the event cache has been re-written.
   I tried to do this in a such a way that it had minimal impact on the API.
   I did have to change one API call, though - ast_event_queue_and_cache().
   However, the way it works now is nicer, IMO.  Each type of event that
   can be cached (MWI, device state) has its own hash table and rules for
   hashing and comparing objects.  This by far made the biggest impact on
   performance.

For additional details regarding this code and how it was tested, please see the
review request.

(closes issue #14738)
Reported by: russell

Review: http://reviewboard.digium.com/r/205/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184339 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-25 21:57:19 +00:00
russell 4d91abde1f Fix build issues on Mac OSX.
(closes issue #14714)
Reported by: ygor


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184147 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-25 01:42:10 +00:00
mmichelson 05cd25cfcf Remove symbols I just added to main/asterisk.exports and instead rename the functions.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@183554 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-20 16:24:20 +00:00
dvossel 00a31b1c96 Merged revisions 183386 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r183386 | dvossel | 2009-03-19 14:40:07 -0500 (Thu, 19 Mar 2009) | 6 lines
  
  Cleaning up a few things in detect disconnect patch
  
  Initialized ast_call_feature in detect_disconnect to avoid accessing uninitialized memory.  Cleaned up /param tags in features.h.  No longer send dynamic features in ast_feature_detect. 
  
  issue #11583
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@183436 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-19 20:30:39 +00:00
russell ed49842057 Merged revisions 183241 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r183241 | russell | 2009-03-19 12:52:52 -0500 (Thu, 19 Mar 2009) | 2 lines

Remove the use of RTLD_NOLOAD, as it is not behaving like expected.

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@183242 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-19 18:00:15 +00:00
dvossel 92a2f9411f Merged revisions 183126 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r183126 | dvossel | 2009-03-19 11:15:16 -0500 (Thu, 19 Mar 2009) | 17 lines
  
  Allow disconnect feature before a call is bridged
  
  feature.conf has a disconnect option.  By default this option is set to '*', but it could be anything.  If a user wishes to disconnect a call before the other side answers, only '*' will work, regardless if the disconnect option is set to something else.  This is because features are unavailable until bridging takes place.  The default disconnect option, '*', was hardcoded in app_dial, which doesn't make any sense from a user perspective since they may expect it to be something different.  This patch allows features to be detected from outside of the bridge, but not operated on.  In this case, the disconnect feature can be detected before briding and handled outside of features.c.
  
  (closes issue #11583)
  Reported by: sobomax
  Patches:
  	patch-apps__app_dial.c uploaded by sobomax (license 359)
  	11583.latest-patch uploaded by murf (license 17)
  	detect_disconnect.diff uploaded by dvossel (license 671)
  Tested by: sobomax, dvossel
  Review: http://reviewboard.digium.com/r/195/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@183172 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-19 16:28:33 +00:00
kpfleming 1af379d0ec Merged revisions 182882 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r182882 | kpfleming | 2009-03-18 06:31:41 -0500 (Wed, 18 Mar 2009) | 3 lines
  
  fix another symbol namespace issue (reported by Andrew on asterisk-dev)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@182883 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18 11:40:11 +00:00
russell b48669aa8f Merged revisions 182810 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r182810 | russell | 2009-03-17 21:09:13 -0500 (Tue, 17 Mar 2009) | 44 lines

Fix cases where the internal poll() was not being used when it needed to be.

We have seen a number of problems caused by poll() not working properly on 
Mac OSX.  If you search around, you'll find a number of references to using 
select() instead of poll() to work around these issues.  In Asterisk, we've 
had poll.c which implements poll() using select() internally.  However, we 
were still getting reports of problems.

vadim investigated a bit and realized that at least on his system, even 
though we were compiling in poll.o, the system poll() was still being used.  
So, the primary purpose of this patch is to ensure that we're using the 
internal poll() when we want it to be used.

The changes are:

1) Remove logic for when internal poll should be used from the Makefile.  
   Instead, put it in the configure script.  The logic in the configure 
   script is the same as it was in the Makefile.  Ideally, we would have 
   a functionality test for the problem, but that's not actually possible, 
   since we would have to be able to run an application on the _target_ 
   system to test poll() behavior.

2) Always include poll.o in the build, but it will be empty if AST_POLL_COMPAT
   is not defined.

3) Change uses of poll() throughout the source tree to ast_poll().  I feel 
   that it is good practice to give the API call a new name when we are 
   changing its behavior and not using the system version directly in all cases.
   So, normally, ast_poll() is just redefined to poll().  On systems where 
   AST_POLL_COMPAT is defined, ast_poll() is redefined to ast_internal_poll().

4) Change poll() in main/poll.c to be ast_internal_poll().

It's worth noting that any code that still uses poll() directly will work fine 
(if they worked fine before).  So, for example, out of tree modules that are 
using poll() will not stop working or anything.  However, for modules to work 
properly on Mac OSX, ast_poll() needs to be used.

(closes issue #13404)
Reported by: agalbraith
Tested by: russell, vadim

http://reviewboard.digium.com/r/198/

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@182847 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18 02:28:55 +00:00
kpfleming 870bfecfe6 Merged revisions 182808 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r182808 | kpfleming | 2009-03-17 20:55:22 -0500 (Tue, 17 Mar 2009) | 5 lines
  
  Improve the build system to *properly* remove unnecessary symbols from the runtime global namespace. Along the way, change the prefixes on some internal-only API calls to use a common prefix.
  
  With these changes, for a module to export symbols into the global namespace, it must have *both* the AST_MODFLAG_GLOBAL_SYMBOLS flag and a linker script that allows the linker to leave the symbols exposed in the module's .so file (see res_odbc.exports for an example).
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@182826 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18 02:21:23 +00:00
kpfleming 5b52c7bb4d Improve behavior of ast_answer() to not lose incoming frames
ast_answer(), when supplied a delay before returning to the caller, use ast_safe_sleep() to implement the delay. Unfortunately during this time any incoming frames are discarded, which is problematic for T.38 re-INVITES and other sorts of channel operations.

When a delay is not passed to ast_answer(), it still delays for up to 500 milliseconds, waiting for media to arrive. Again, though, it discards any control frames, or non-voice media frames.

This patch rectifies this situation, by storing all incoming frames during the delay period on a list, and then requeuing them onto the channel before returning to the caller.

http://reviewboard.digium.com/r/196/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@182525 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-17 14:38:11 +00:00
russell da10000f37 Add MFC/R2 support for chan_dahdi.
This commit introduces official support for R2 signaling in chan_dahdi.  The
modifications to chan_dahdi, and the supporting library, LibOpenR2, were both
written by Moises Silva.

Many users are using this code, or a variant of it, in Asterisk 1.2, 1.4 and 1.6
in Brazil, México and Argentina. An unknown number of users (but at least 1) 
are using it in each of the following countries: Colombia, Nepal, Thailand, 
Venezuela, Perú, and probably others.

To use this code, LibOpenR2 must be installed from http://www.libopenr2.org/.
Information about configuration can be found in configs/chan_dahdi.conf.sample.

The code committed is the most up to date version, which was being maintained
in svn/asterisk/team/moy/mfcr2/.

I would also like to include a Thank You to the many others that tested this
code beyond those listed in this commit message.  These are the names that I
could find in the mantis issue.

(closes issue #12509)
Reported by: moy
Patches:
      chan_zap-mfr2.patch uploaded by moy (license 222)
Tested by: moy, korihor, viniciusfontes, Skarmeth, loloski, asbestoshead, titogarrido, heliocoelhojr, konsultex, ncorrare, ecarruda, rtorresduque, PTorres, ychen

Review: http://reviewboard.digium.com/r/40/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@182355 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-16 20:35:58 +00:00
tilghman c6fbda10d4 Turn off malloc debugging of astobj2, since it apparently doesn't work too well during startup.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@181301 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-11 17:04:46 +00:00
jpeeler 7e7a32a4ed Fix malloc debug macros to work properly with h323.
The main problem here was that cstdlib was undefining free thereby causing the
proper debug macros to not be used. ast_h323.cxx has been changed to call
ast_free instead to avoid the issue. 

A few other issues were addressed:
- There were a few instances of functions improperly passing ast_free instead
of ast_free_ptr.
- Some clean up was done to avoid the debug macros intentionally being redefined.
(copied below from Kevin's commit, appreciate the help)
- disable astmm.h from doing anything when STANDALONE is defined, which is used
by the tools in the utils/ directory that use parts of Asterisk header files in
hackish ways; also ensure that utils/extconf.c and utils/conf2ael.c are
compiled with STANDALONE defined.

(closes issue #13593)
Reported by: pj



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@181135 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-11 04:06:44 +00:00
tilghman a914fe0511 Add MALLOC_DEBUG to various utility APIs, so that memory leaks can be tracked back to their source.
(related to issue #14636)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@181028 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-11 00:29:59 +00:00
jpeeler 5a0a55b7a4 Add Doxygen documentation for API changes from 1.6.0 to 1.6.1
Copied from my review board description:
This is a continuation of the API changes documentation started for describing
changes between releases. Most of the API changes were pretty simple needing
only to be brought to attention via the new "Asterisk API Changes" list.
However, if you see anything that needs further explanation feel free to
supplement what is there. The current method of documenting is to add (in the
header file): \version <ver number> <description of changes> and then to add
the function to the change list in doxyref.h on the AstAPIChanges page. I also
made sure all the functions that were newly added were tagged with \since
1.6.1. I think this is a good habit to start both for the historical aspect as
well as for the future ability to easily add a "New Asterisk API" page.

Review: http://reviewboard.digium.com/r/190/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@180719 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-09 20:58:17 +00:00
kpfleming 5d5eb54ba7 Merged revisions 180372 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r180372 | kpfleming | 2009-03-05 12:22:16 -0600 (Thu, 05 Mar 2009) | 9 lines
  
  Fix problems when RTP packet frame size is changed
  
  During some code analysis, I found that calling ast_rtp_codec_setpref() on an ast_rtp session does not work as expected; it does not adjust the smoother that may on the RTP session, in fact it summarily drops it, even if it has data in it, even if the current format's framing size has not changed. This is not good.
  
  This patch changes this behavior, so that if the packetization size for the current format changes, any existing smoother is safely updated to use the new size, and if no smoother was present, one is created. A new API call for smoothers, ast_smoother_reconfigure(), was required to implement these changes.
  
  Review: http://reviewboard.digium.com/r/184/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@180373 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-05 18:29:38 +00:00
file 78d18e52a4 Merge phase 1 support for the new bridging architecture.
This commit brings in the bridging core, bridging technologies,
and the ConfBridge application.

For usage information on the ConfBridge application please see
the output of "core show application ConfBridge" from the CLI.

For API documentation please see the doxygen page describing the
architecture and the documentation for each API call.

Review: http://reviewboard.digium.com/r/93/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@180369 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-05 18:18:27 +00:00
dvossel 58c677376b app_read does not break from prompt loop with user terminated empty string
In app.c, ast_app_getdata is called to stream the prompts and receive DTMF input.  If ast_app_getdata() receives an empty string caused by the user inputing the end of string character, in this case '#', it should break from the prompt loop and return to app_read, but instead it cycles through all the prompts.  I've added a return value for this special case in ast_readstring() which uses an enum I've delcared in apps.h.  This enum is now used as a return value for ast_app_getdata().

(closes issue #14279)
Reported by: Marquis
Patches:
	fix_app_read.patch uploaded by Marquis (license 32)
	read-ampersanmd.patch2 uploaded by dvossel (license 671)
Tested by: Marquis, dvossel
Review: http://reviewboard.digium.com/r/177/




git-svn-id: http://svn.digium.com/svn/asterisk/trunk@180032 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-03 23:21:18 +00:00
tilghman 82a4dd2ed8 Use notification when timezone files change and re-scan then.
(closes issue #14300)
 Reported by: jamessan
 Patches: 
       20090127__bug14300.diff.txt uploaded by tilghman (license 14)
       20090224__bug14300.diff uploaded by jamessan (license 246)
 Tested by: jamessan
 Review: http://reviewboard.digium.com/r/136/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@178605 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-25 19:24:44 +00:00
seanbright fd686d9901 Trailing whitespace, minor coding guideline fixes, and start beefing up the
hashtab documentation a bit.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@177884 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-21 14:16:44 +00:00
russell 788e8cc126 Fix build issues on Solaris and OpenBSD.
(closes issue #14512)
Reported by: snuffy


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@177855 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-21 13:17:47 +00:00
tilghman c0d72b8bcf Merged revisions 177701 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r177701 | tilghman | 2009-02-20 15:15:01 -0600 (Fri, 20 Feb 2009) | 3 lines
  
  This exception does not appear to still be true for Solaris 10, and OpenSolaris definitely needs it to be removed.
  Fixed for snuff-home on -dev channel.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@177732 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-20 21:25:37 +00:00
tilghman 8d625b91bc Allow semicolons to be escaped, when passing arguments to the System command.
(closes issue #14231)
 Reported by: jcovert
 Patches: 
       20090113__bug14231__2.diff.txt uploaded by Corydon76 (license 14)
       corrected_20090113__bug14231__2.diff.txt uploaded by jcovert (license 551)
 Tested by: jcovert


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@177664 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-20 17:29:51 +00:00
jpeeler 1a30c461f1 Fix another merge error from 176708
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@177387 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-19 16:45:02 +00:00
tilghman 48707e53d9 ODBC transaction support
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@177320 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-19 00:26:01 +00:00
tilghman 0f43f83ee5 Merged revisions 177096 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r177096 | tilghman | 2009-02-18 12:30:38 -0600 (Wed, 18 Feb 2009) | 2 lines
  
  Document the return value of the update method (as requested on -dev list)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@177098 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-18 19:05:15 +00:00
russell 235f1da99f Add example code for a heap traversal.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176904 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-18 06:14:47 +00:00
jpeeler fa3ebc7f2c Merged revisions 176701 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r176701 | jpeeler | 2009-02-17 15:54:34 -0600 (Tue, 17 Feb 2009) | 17 lines
  
  Modify bridging to properly evaluate DTMF after first warning is played
  
  The main problem is currently if the Dial flag L is used with a warning sound,
  DTMF is not evaluated after the first warning sound. To fix this, a flag has 
  been added in ast_generic_bridge for playing the warning which ensures that if
  a scheduled warning is missed, multiple warrnings are not played back (due to a
  feature evaluation or waiting for digits). ast_channel_bridge was modified to
  store the nexteventts in the ast_bridge_config structure as that information
  was lost every time ast_channel_bridge was reentered, causing a hangup due to
  incorrect time calculations.
  
  (closes issue #14315)
  Reported by: tim_ringenbach
 
  Reviewed on reviewboard:
  http://reviewboard.digium.com/r/163/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176708 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-17 22:08:00 +00:00
mmichelson 509eed412d Clear up documentation of AST_FRIENDLY_OFFSET in frame.h
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176697 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-17 21:40:09 +00:00
russell 590d768106 Update the timing API to have better support for multiple timing interfaces.
1) Add module use count handling so that timing modules can be unloaded.

2) Implement unload_module() functions for the timing interface modules.

3) Allow multiple timing modules to be loaded, and use the one with the
   highest priority value.

4) Report which timing module is being use in the "timing test" CLI command.

(closes issue #14489)
Reported by: russell

Review: http://reviewboard.digium.com/r/162/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176666 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-17 21:22:40 +00:00
russell 18f52ab1e7 Add an implementation of the heap data structure.
A heap is a convenient data structure for implementing a priority queue.

Code from svn/asterisk/team/russell/heap/.

Review: http://reviewboard.digium.com/r/160/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176632 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-17 20:51:10 +00:00
oej d6b563a51d Typo
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176631 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-17 20:50:03 +00:00
russell 1f57cd4e51 Merge a large set of updates to the Asterisk indications API.
This patch includes a number of changes to the indications API.  The primary
motivation for this work was to improve stability.  The object management
in this API was significantly flawed, and a number of trivial situations could
cause crashes.

The changes included are:

1) Remove the module res_indications.  This included the critical functionality
   that actually loaded the indications configuration.  I have seen many people
   have Asterisk problems because they accidentally did not have an
   indications.conf present and loaded.  Now, this code is in the core,
   and Asterisk will fail to start without indications configuration.

   There was one part of res_indications, the dialplan applications, which did
   belong in a module, and have been moved to a new module, app_playtones.

2) Object management has been significantly changed.  Tone zones are now
   managed using astobj2, and it is no longer possible to crash Asterisk by
   issuing a reload that destroys tone zones while they are in use.

3) The API documentation has been filled out.

4) The API has been updated to follow our naming conventions.

5) Various bits of code throughout the tree have been updated to account
   for the API update.

6) Configuration parsing has been mostly re-written.

7) "Code cleanup"

The code is from svn/asterisk/team/russell/indications/.

Review: http://reviewboard.digium.com/r/149/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176627 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-17 20:41:24 +00:00
kpfleming 26faefc9a2 Merged revisions 176216 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r176216 | kpfleming | 2009-02-16 15:10:38 -0600 (Mon, 16 Feb 2009) | 3 lines
  
  fix a flaw in the ast_string_field_build() family of API calls; these functions made no attempt to reuse the space already allocated to a field, so every time the field was written it would allocate new space, leading to what appeared to be a memory leak.
........
  r176254 | kpfleming | 2009-02-16 15:41:46 -0600 (Mon, 16 Feb 2009) | 3 lines

  correct a logic error in the last stringfields commit... don't mark additional space as allocated if the string was built using already-allocated space
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176255 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-16 21:45:54 +00:00
mvanbaak 6573bfb8ea Merged revisions 175921 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r175921 | mvanbaak | 2009-02-16 00:37:03 +0100 (Mon, 16 Feb 2009) | 3 lines
  
  fix mis-spelling of the word registered.
  Reported by De_Mon on #asterisk-dev.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@175952 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-16 00:26:59 +00:00
russell a67e27326e Make ast_sched_report() and ast_sched_dump() thread safe.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@175882 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-15 21:27:33 +00:00
russell 3714d9820f Fix a number of problems with ast_sched_report().
1) It had numerous coding guidelines violations with regards to formatting.

2) It allocated memory using ast_calloc() that was never freed.

3) It didn't check for failure from the allocation.

4) It used sprintf() and strcat() to build the result, doing zero checking to
   prevent writing past the end of the provided buffer.

The function also lacks API documentation, but that has not been addressed in
this commit.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@175829 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-15 20:56:27 +00:00
kpfleming a46dd55034 Add basic (passthrough, playback, record) support for ITU G.722.1 and G.722.1C (also known as Siren7 and Siren14)
This patch adds passthrough, file recording and file playback support for the codecs listed above, with negotiation over SIP/SDP supported. Due to Asterisk's current limitation of treating a codec/bitrate combination as a unique codec, only G.722.1 at 32 kbps and G.722.1C at 48 kbps are supported.

Along the way, some related work was done:

1) The rtpPayloadType structure definition, used as a return result for an API call in rtp.h, was moved from rtp.c to rtp.h so that the API call was actually usable. The only previous used of the API all was chan_h323.c, which had a duplicate of the structure definition instead of doing it the right way.

2) The hardcoded SDP sample rates for various codecs in chan_sip.c were removed, in favor of storing these sample rates in rtp.c along with the codec definitions there. A new API call was added to allow retrieval of the sample rate for a given codec.

3) Some basic 'a=fmtp' parsing for SDP was added to chan_sip, because chan_sip *must* decline any media streams offered for these codecs that are not at the bitrates that we support (otherwise Bad Things (TM) would result).

Review: http://reviewboard.digium.com/r/158/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@175508 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-13 13:35:24 +00:00
mmichelson 84a9682d1f Make lock information for ao2_trylock be more useful and gnarly
Core show locks information involving an ao2_trylock did not
show the function that called ao2_trylock, but would instead
show ao2_trylock as the source of the lock. This is not useful
when trying to debug locking issues.

One bizarre note is that this logic is already in 1.4 but somehow
did not get merged to trunk or the 1.6.X branches.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@175121 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-12 16:28:06 +00:00
mmichelson f251215c27 Fix 'd' option for app_dial and add new option to Answer application
The 'd' option would not work for channel types which use RTP to transport
DTMF digits. The only way to allow for this to work was to answer the channel
if we saw that this option was enabled.

I realized that this may cause issues with CDRs, specifically with giving false
dispositions and answer times. I therefore modified ast_answer to take another
parameter which would tell if the CDR should be marked answered.

I also extended this to the Answer application so that the channel may be answered
but not CDRified if desired.

I also modified app_dictate and app_waitforsilence to only answer the channel if it
is not already up, to help not allow for faulty CDR answer times.

All of these changes are going into Asterisk trunk. For 1.6.0 and 1.6.1, however, all
the changes except for the change to the Answer application will go in since we do
not introduce new features into stable branches

(closes issue #14164)
Reported by: DennisD
Patches:
      14164.patch uploaded by putnopvut (license 60)
Tested by: putnopvut

Review: http://reviewboard.digium.com/r/145



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@174945 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-11 22:41:01 +00:00
kpfleming 446fe9d067 improve slinfactory API to remove implicit sample rate and require explicit sample rate selection by creator of the slinfactory
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@174705 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-10 19:38:26 +00:00
russell 65e7ac9ff3 Add a common implementation of a scheduler context with a dedicated thread.
This commit expands the Asterisk scheduler API to include a common implementation
of a scheduler context being processed by a dedicated thread.  chan_iax2 has been
updated to use this new code.  Also, as a result, this resolves some race
conditions related to the previous chan_iax2 scheduler handling.

Related to rev 171452 which resolved the same issues in 1.4.

Code from team/russell/sched_thread2

Review: http://reviewboard.digium.com/r/129/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@173858 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-06 10:55:35 +00:00
jpeeler c9c18ea1da Merged revisions 173211 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r173211 | jpeeler | 2009-02-03 15:57:01 -0600 (Tue, 03 Feb 2009) | 17 lines
  
  Parking attempts made to one end of a bridge no longer will hang up due to a
  parking failure.
  
  Parking attempts made using either one-touch, or doing either a blind or 
  assisted transfer to the parking extension now keep up the bridge instead of
  hanging up the attempted parked party. Normal causes for the parking attempt
  to fail includes the specific specified extension (via PARKINGEXTEN) not being 
  available or if all the parking spaces are currently in use. To avoid having
  to reverse a masquerade park_space_reserve was made to provide foresight if
  a parking attempt will succeed and if so reserve the parking space.
  
  (closes issue #13494)
  Reported by: mdu113
  
  Reviewed by Russell: http://reviewboard.digium.com/r/133/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@173500 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-04 21:17:53 +00:00
tilghman 494821a071 1. Make OS X compile cleanly with app_stack.
2. Use curl to download sound files, as curl is installed natively on OS X,
whereas wget and fetch are not.
(closes issue #14332)
 Reported by: oej
 Tested by: Corydon76


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@173130 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-03 00:29:49 +00:00
murf 9764d18ab1 This reverts the changes I made for 11583; will
reviewboard this before committing again...
reopened 11583 until all Russell's issues are
resolved.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@172929 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-02 19:02:24 +00:00
murf 0fb5a8a2ff This change allows the disconnect feature (as in "one-touch" in features.c)
to be used within the dial app, before a call is bridged.

Many thanks to sobomax for submitting this patch. 

Quoting from bug 11582:

  "So the goal of the patch was to use the user configured feature code during the 
   call setup phase. The original ast_feature_interpret() function is not well suited 
   for this purpose as it uses much call bridge specific data and doesn't separate a 
   detection of feature from a feature handler call. So a new function ast_feature_detect() 
   has been extracted off the ast_feature_interpret() function but keeping the original 
   logic intact except some insignificant changes to locking.

  "Having created the ast_feature_detect() function the possibility to use feature detection 
   in almost any place of the asterisk code. So a call to this function has been added to 
   wait_for_answer() function of app_dial.so module. This code doesn't call the feature handler 
   however and uses old call leg disconnect logic to make the changes as small and simple as 
   possible to prevent unexpected problems. A disconnect feature currently is the only one 
   supported during call setup as other features as call parking and call transfer don't make much 
   sense during call setup. However if need in some of the features would arise it is much easier to 
   implement as the infrastructure changes are already in place with this patch."

I have cleaned up the patch somewhat, and verified that the existing functionality is not
harmed, and that the new functionality works. Terry has committed his stuff, and there were
no conflicts (see 14274).

(closes issue #11583)
Reported by: sobomax
Patches:
      patch-apps__app_dial.c uploaded by sobomax (license 359)
      patch-include__asterisk__features.h uploaded by sobomax (license 359)
      patch-res__res_features.c uploaded by sobomax (license 359)
      enable-features-during-call-setup.diff uploaded by sobomax (license 359)
      11583.newdiff uploaded by murf (license 17)
      enable-features-during-call-setup-1.diff uploaded by sobomax (license 359)
      11583.latest-patch uploaded by murf (license 17)
Tested by: sobomax, murf




git-svn-id: http://svn.digium.com/svn/asterisk/trunk@172890 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-02 17:37:15 +00:00
mmichelson 5333c02701 Fix redefinition of flag in channel.h
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@172598 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-30 22:22:04 +00:00