asterisk/asterisk.git
10 years agoBlocked revisions 187865 via svnmerge
Russell Bryant [Fri, 10 Apr 2009 19:27:23 +0000 (19:27 +0000)]
Blocked revisions 187865 via svnmerge

........
r187865 | russell | 2009-04-10 14:26:40 -0500 (Fri, 10 Apr 2009) | 4 lines

Support "signaling" in addition to "signalling".

The sample configuration file has references to both spellings.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187866 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoIndicating connected line or redirecting updates were missing a call to lock the...
Mark Michelson [Fri, 10 Apr 2009 18:56:52 +0000 (18:56 +0000)]
Indicating connected line or redirecting updates were missing a call to lock the local_pvt.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187830 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoChange how we set the local and remote address.
Joshua Colp [Fri, 10 Apr 2009 18:14:47 +0000 (18:14 +0000)]
Change how we set the local and remote address.

The code will now only change the address and port. It will not overwrite any other values.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187773 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix some uninitialized memory notices that appeared under valgrind.
Joshua Colp [Fri, 10 Apr 2009 18:02:44 +0000 (18:02 +0000)]
Fix some uninitialized memory notices that appeared under valgrind.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187772 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMake sure tc is unlocked before calling ast_call since calling a Local
Mark Michelson [Fri, 10 Apr 2009 17:32:25 +0000 (17:32 +0000)]
Make sure tc is unlocked before calling ast_call since calling a Local
channel could result in a deadlock.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187770 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 187763 via svnmerge from
Tilghman Lesher [Fri, 10 Apr 2009 17:29:34 +0000 (17:29 +0000)]
Merged revisions 187763 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r187763 | tilghman | 2009-04-10 12:28:46 -0500 (Fri, 10 Apr 2009) | 2 lines

  Add lastms column to the contributed table designs
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187764 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclean up some patterns for files to remove
Kevin P. Fleming [Fri, 10 Apr 2009 16:51:44 +0000 (16:51 +0000)]
clean up some patterns for files to remove

add embedding support for bridge and test modules

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187721 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoast_strdup failures aren't really failures if the original value was NULL.
Mark Michelson [Fri, 10 Apr 2009 16:26:48 +0000 (16:26 +0000)]
ast_strdup failures aren't really failures if the original value was NULL.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187714 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoDon't let ast_channel_alloc fail if explicitly passed NULL cid_name or cid_number.
Mark Michelson [Fri, 10 Apr 2009 16:06:22 +0000 (16:06 +0000)]
Don't let ast_channel_alloc fail if explicitly passed NULL cid_name or cid_number.

This also fixes a small memory leak.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187680 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoDisable test modules by default.
Russell Bryant [Fri, 10 Apr 2009 16:00:29 +0000 (16:00 +0000)]
Disable test modules by default.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187675 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoEnsure pvt is not NULL before dereferencing it.
Tilghman Lesher [Fri, 10 Apr 2009 15:59:40 +0000 (15:59 +0000)]
Ensure pvt is not NULL before dereferencing it.
(closes issue #14784)
 Reported by: pj

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187674 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoEven more changes concerning r187426. Revised where locks are placed yet once again...
David Vossel [Fri, 10 Apr 2009 15:49:16 +0000 (15:49 +0000)]
Even more changes concerning r187426. Revised where locks are placed yet once again.  ast_call() should not be called with a channel locked.  could cause deadlock issues with local channels.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187673 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agorevert addition of LOG_SECURITY log channel; after further discussion, a much better...
Kevin P. Fleming [Fri, 10 Apr 2009 15:11:16 +0000 (15:11 +0000)]
revert addition of LOG_SECURITY log channel; after further discussion, a much better solution will be used

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187636 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMiscellaneous minor changes to chan_misdn.
Richard Mudgett [Fri, 10 Apr 2009 14:53:59 +0000 (14:53 +0000)]
Miscellaneous minor changes to chan_misdn.

* Miscellaneous spacing and comment changes.
* Minor code rearangements.
* Miscellaneous doxygen comments.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187635 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMake chan_misdn_log() avoid generating the log message if logging is disabled.
Richard Mudgett [Fri, 10 Apr 2009 14:50:42 +0000 (14:50 +0000)]
Make chan_misdn_log() avoid generating the log message if logging is disabled.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187634 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoModify headers and macros, according to Russell's suggestions on the -dev list
Tilghman Lesher [Fri, 10 Apr 2009 03:55:27 +0000 (03:55 +0000)]
Modify headers and macros, according to Russell's suggestions on the -dev list

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187599 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd a new option, mwi_from, to sip.conf.
Mark Michelson [Thu, 9 Apr 2009 21:06:26 +0000 (21:06 +0000)]
Add a new option, mwi_from, to sip.conf.

This allows for you to change the From header for outgoing MWI
NOTIFY requests. Prior to this, the best you could do was to
set a callerid in the general section of sip.conf. The problem
was that this was used for all outbound requests, not just
MWI NOTIFY requests.

AST-201

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187560 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMore changes concerning r187426. Revised where locks are placed.
David Vossel [Thu, 9 Apr 2009 20:40:34 +0000 (20:40 +0000)]
More changes concerning r187426. Revised where locks are placed.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187556 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd ability for dialplan execution to continue when caller hangs up.
Jeff Peeler [Thu, 9 Apr 2009 19:10:02 +0000 (19:10 +0000)]
Add ability for dialplan execution to continue when caller hangs up.

The F option to app_dial has been modified to accept no parameters and perform
the above functionality. I don't see anywhere else that is doing function
overloading, but this really is the best place for this operation because:

- It makes it close to the 'g' option in the argument list which provides
similar functionality.
- The existing code to support the current F option provides a very
convienient location to add this new feature.

(closes issue #12381)
Reported by: michael-fig

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187491 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 187484 via svnmerge from
Mark Michelson [Thu, 9 Apr 2009 18:58:41 +0000 (18:58 +0000)]
Merged revisions 187484 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r187484 | mmichelson | 2009-04-09 13:51:20 -0500 (Thu, 09 Apr 2009) | 18 lines

  Handle a SIP race condition (reinvite before an ACK) properly.

  RFC 5047 explains the proper course of action to take if a
  reINVITE is received before the ACK from a previous invite
  transaction. What we are to do is to treat the reINVITE as
  if it were both an ACK and a reINVITE and process it normally.

  Later, when we receive the ACK we had been expecting, we will
  ignore it since its CSeq is less than the current iseqno of
  the sip_pvt representing this dialog.

  (closes issue #13849)
  Reported by: klaus3000
  Patches:
        13849_v2.patch uploaded by mmichelson (license 60)
  Tested by: mmichelson, klaus3000
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187488 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 187428 via svnmerge from
Tilghman Lesher [Thu, 9 Apr 2009 18:40:01 +0000 (18:40 +0000)]
Merged revisions 187428 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r187428 | tilghman | 2009-04-09 13:08:20 -0500 (Thu, 09 Apr 2009) | 8 lines

  Race condition between ast_cli_command() and 'module unload' could cause a deadlock.
  Add lock timeouts to avoid this potential deadlock.
  (closes issue #14705)
   Reported by: jamessan
   Patches:
         20090320__bug14705.diff.txt uploaded by tilghman (license 14)
   Tested by: jamessan
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187483 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFixes deadlock caused by calling get_cid_name with chan locked.
David Vossel [Thu, 9 Apr 2009 17:39:10 +0000 (17:39 +0000)]
Fixes deadlock caused by calling get_cid_name with chan locked.

get_cid_name should not be called with a channel lock.  get_cid_name calls ast_get_hint which eventually calls pbx_find_extension.  pbx_find_extension starts and stops autoservice which should not be done with a channel lock, so get_cid_name should not be called with one.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187426 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoUse safe macro practices even though they really aren't necessary.
Mark Michelson [Thu, 9 Apr 2009 17:34:39 +0000 (17:34 +0000)]
Use safe macro practices even though they really aren't necessary.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187424 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix a crash in res_musiconhold when using cached realtime moh.
Mark Michelson [Thu, 9 Apr 2009 17:30:39 +0000 (17:30 +0000)]
Fix a crash in res_musiconhold when using cached realtime moh.

The moh_register function links an mohclass and then immediately
unrefs the class since the container now has a reference. The problem
with using realtime music on hold is that the class is allocated,
registered, and started in one fell swoop. The refcounting logic
resulted in the count being off by one. The same problem did not
happen when using a static config because the allocation and registration
of an mohclass is a separate operation from starting moh. This also did
not affect non-cached realtime moh because the classes are not registered
at all.

I also have modified res_musiconhold to use the _t_ variants of the ao2_
functions so that more info can be gleaned when attempting to trace the
refcounts. I found this to be incredibly helpful for debugging this issue
and there's no good reason to remove it.

(closes issue #14661)
Reported by: sum

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187421 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAllow '/' in username portion of register; this is a regression.
Tilghman Lesher [Thu, 9 Apr 2009 17:20:49 +0000 (17:20 +0000)]
Allow '/' in username portion of register; this is a regression.
(closes issue #14668)
 Reported by: Netview

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187381 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 187362 via svnmerge from
Tilghman Lesher [Thu, 9 Apr 2009 16:39:43 +0000 (16:39 +0000)]
Merged revisions 187362 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r187362 | tilghman | 2009-04-09 11:38:37 -0500 (Thu, 09 Apr 2009) | 3 lines

  Permit zero-length text messages in SIP.
  (Related to an issue posted to the -users list, subject "AEL2, BASE64_DECODE and hexadecimal")
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187363 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoDo not try to send the format read/format write/make compatible options over IAX2.
Joshua Colp [Thu, 9 Apr 2009 16:27:53 +0000 (16:27 +0000)]
Do not try to send the format read/format write/make compatible options over IAX2.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187361 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd support for allowing the channel driver to handle transcoding.
Joshua Colp [Thu, 9 Apr 2009 16:19:35 +0000 (16:19 +0000)]
Add support for allowing the channel driver to handle transcoding.

This was accomplished using a set of options and the setoption channel callback.
The core calls into the channel driver using these options and the channel driver
either returns success or failure.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187360 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 187300-187301 via svnmerge from
Tilghman Lesher [Thu, 9 Apr 2009 04:59:05 +0000 (04:59 +0000)]
Merged revisions 187300-187301 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r187300 | tilghman | 2009-04-08 23:31:38 -0500 (Wed, 08 Apr 2009) | 3 lines

  Add debugging mode for diagnosing file descriptor leaks.
  (Related to issue #14625)
........
  r187301 | tilghman | 2009-04-08 23:32:40 -0500 (Wed, 08 Apr 2009) | 2 lines

  Oops, missed this file in the last commit.
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187302 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoadd a dedicated log channel for modules to be able report security-related events...
Kevin P. Fleming [Thu, 9 Apr 2009 02:44:27 +0000 (02:44 +0000)]
add a dedicated log channel for modules to be able report security-related events, so that they can be fed into external processes for analysis and possible mitigation efforts

(inspired by this evening's Toronto Asterisk Users Group meeting and previous dicussions amongst various community members)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187269 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd timer for features so that backup bridge config can go away
Jeff Peeler [Wed, 8 Apr 2009 21:00:39 +0000 (21:00 +0000)]
Add timer for features so that backup bridge config can go away

The biggest change done here was elimination of the backup_config for use with
features. Previously, the bridging code upon detecting a feature would set the
start time of the bridge to the start time of the feature. Then after the
feature had either expired or timed out the start time would be reset to the
true bridge start time from the backup_config. Now, the time differences are
calculated with respect to the newly added feature_start_time timeval instead.

There should be no behavior changes from the previous functionality aside from
the bridge timing being unaffected by either valid or partial feature matches.
Previously the timing would be increased by the length of time configured for
featuredigittimeout, which was probably never noticed.

(closes issue #14503)
Reported by: KNK
Tested by: jpeeler

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187211 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoRecorded merge of revisions 187209 via svnmerge from
Tilghman Lesher [Wed, 8 Apr 2009 20:39:55 +0000 (20:39 +0000)]
Recorded merge of revisions 187209 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r187209 | tilghman | 2009-04-08 15:39:13 -0500 (Wed, 08 Apr 2009) | 4 lines

  Backport resolution for file descriptor leak in 1.6.0 to 1.4.
  This fixes short reads in http manager sessions, such as those done by the
  ast-gui branch.  (Fixes AST-198)
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187210 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd documentation for reviewboard usage and guidelines.
Russell Bryant [Wed, 8 Apr 2009 19:59:21 +0000 (19:59 +0000)]
Add documentation for reviewboard usage and guidelines.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187179 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoBlocked revisions 187135 via svnmerge
Mark Michelson [Wed, 8 Apr 2009 19:18:10 +0000 (19:18 +0000)]
Blocked revisions 187135 via svnmerge

........
  r187135 | mmichelson | 2009-04-08 14:16:49 -0500 (Wed, 08 Apr 2009) | 8 lines

  Fix a crash due to too few arguments to RetryDial.

  (closes issue #14852)
  Reported by: junky
  Patches:
        retry_fix.diff uploaded by junky (license 177)
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187138 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix a bug where we would native bridge when we did not want to.
Joshua Colp [Wed, 8 Apr 2009 18:12:28 +0000 (18:12 +0000)]
Fix a bug where we would native bridge when we did not want to.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187108 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoRemove duplicate prototype for temp_peer().
Russell Bryant [Wed, 8 Apr 2009 17:51:35 +0000 (17:51 +0000)]
Remove duplicate prototype for temp_peer().

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187105 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoIf the first column is empty, output a delimiter anyway.
Tilghman Lesher [Wed, 8 Apr 2009 17:08:43 +0000 (17:08 +0000)]
If the first column is empty, output a delimiter anyway.
(closes issue #14848)
 Reported by: john8675309
 Patches:
       20090408__bug14848.diff.txt uploaded by tilghman (license 14)
 Tested by: john8675309

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187050 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 187045 via svnmerge from
Mark Michelson [Wed, 8 Apr 2009 16:52:20 +0000 (16:52 +0000)]
Merged revisions 187045 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r187045 | mmichelson | 2009-04-08 11:52:03 -0500 (Wed, 08 Apr 2009) | 10 lines

  Fix a small logical error when loading moh classes.

  We were unconditionally incrementing the number of mohclasses
  registered. However, we should actually only increment if the
  call to moh_register was successful.

  While this probably has never caused problems, I noticed it
  and decided to fix it anyway.
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187046 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoTurn a warning message into a debug message and do not treat two situations as errors...
Joshua Colp [Wed, 8 Apr 2009 16:27:36 +0000 (16:27 +0000)]
Turn a warning message into a debug message and do not treat two situations as errors when they are not.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187036 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 186984 via svnmerge from
Mark Michelson [Wed, 8 Apr 2009 15:27:41 +0000 (15:27 +0000)]
Merged revisions 186984 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r186984 | mmichelson | 2009-04-08 10:26:46 -0500 (Wed, 08 Apr 2009) | 24 lines

  Make a couple of changes with regards to a new message printed in ast_read().

  "ast_read() called with no recorded file descriptor" is a new message added
  after a bug was discovered. Unfortunately, it seems there are a bunch of places
  that potentially make such calls to ast_read() and trigger this error message
  to be displayed. This commit does two things to help to make this message appear
  less.

  First, the message has been downgraded to a debug level message if dev mode is
  not enabled. The message means a lot more to developers than it does to end users,
  and so developers should take an effort to be sure to call ast_read only when
  a channel is ready to be read from. However, since this doesn't actually cause an
  error in operation and is not something a user can easily fix, we should not spam
  their console with these messages.

  Second, the message has been moved to after the check for any pending masquerades.
  ast_read() being called with no recorded file descriptor should not interfere with
  a masquerade taking place.

  This could be seen as a simple way of resolving issue #14723. However, I still want
  to try to clear out the existing ways of triggering this message, since I feel that
  would be a better resolution for the issue.
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186985 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd some additional notes on release numbering.
Russell Bryant [Wed, 8 Apr 2009 13:38:27 +0000 (13:38 +0000)]
Add some additional notes on release numbering.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186957 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoStart splitting up miscellaneous doxygen documentation into separate files.
Russell Bryant [Wed, 8 Apr 2009 13:24:48 +0000 (13:24 +0000)]
Start splitting up miscellaneous doxygen documentation into separate files.

doxyref.h was created to hold miscellaneous documentation that was not specific
to a part of the code.  This file has grown quite a bit so I decided to start
splitting parts of it out into new files.  Now, you can drop a new file into
include/asterisk/doxygen/ and it will be processed by doxygen.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186953 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoUpdate some comments and resolve potential memory corruption in chan_sip.
Russell Bryant [Wed, 8 Apr 2009 12:35:57 +0000 (12:35 +0000)]
Update some comments and resolve potential memory corruption in chan_sip.

While browsing chan_sip the other day, I noticed this dangerous code in
dialog_needdestroy().  This function is an ao2_callback.  It is absolutely
_not_ okay to unlock the container from within this function.  It's also not
clear why it was useful.  Given that it could cause memory corruption, I have
removed it.

There was also a TODO comment left describing a potential implementation of
an improvement to the needdestroy handling.  I'm not convinced that what was
described is the best choice here, so I have briefly described the way that
this function is used today that could be improved.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186928 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd lastms to the require API call.
Tilghman Lesher [Wed, 8 Apr 2009 05:06:22 +0000 (05:06 +0000)]
Add lastms to the require API call.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186899 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 186841 via svnmerge from
Mark Michelson [Wed, 8 Apr 2009 00:09:28 +0000 (00:09 +0000)]
Merged revisions 186841 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r186841 | mmichelson | 2009-04-07 19:09:04 -0500 (Tue, 07 Apr 2009) | 8 lines

  Fix a few typos of the word "frequency."

  (closes issue #14842)
  Reported by: jvandal
  Patches:
        frequency-typo.diff uploaded by jvandal (license 413)
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186842 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix bad merge from fix for issue 13867.
Mark Michelson [Wed, 8 Apr 2009 00:01:49 +0000 (00:01 +0000)]
Fix bad merge from fix for issue 13867.

(closes issue #14686)
Reported by: davidw

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186837 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 186832 via svnmerge from
Mark Michelson [Tue, 7 Apr 2009 23:50:56 +0000 (23:50 +0000)]
Merged revisions 186832 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r186832 | mmichelson | 2009-04-07 18:49:49 -0500 (Tue, 07 Apr 2009) | 8 lines

  Set the AST_FEATURE_WARNING_ACTIVE flag when a p2p bridge returns AST_BRIDGE_RETRY.

  Without this flag set, warning sounds will not be properly played to either party
  of the bridge.

  (closes issue #14845)
  Reported by: adomjan
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186833 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 186775 via svnmerge from
Tilghman Lesher [Tue, 7 Apr 2009 22:23:46 +0000 (22:23 +0000)]
Merged revisions 186775 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r186775 | tilghman | 2009-04-07 17:16:50 -0500 (Tue, 07 Apr 2009) | 3 lines

  Fix Macro documentation to match current (and intended) behavior.
  (See -dev mailing list)
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186799 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 186719 via svnmerge from
Mark Michelson [Tue, 7 Apr 2009 20:46:18 +0000 (20:46 +0000)]
Merged revisions 186719 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r186719 | mmichelson | 2009-04-07 15:43:49 -0500 (Tue, 07 Apr 2009) | 6 lines

  Ensure that \r\n is printed after the ActionID in an OriginateResponse.

  (closes issue #14847)
  Reported by: kobaz
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186720 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix a log message getting output when it should not have been.
Joshua Colp [Mon, 6 Apr 2009 23:11:13 +0000 (23:11 +0000)]
Fix a log message getting output when it should not have been.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186687 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix problem when authenticating a non-RTP dialog.
Joshua Colp [Mon, 6 Apr 2009 17:03:07 +0000 (17:03 +0000)]
Fix problem when authenticating a non-RTP dialog.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186653 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd support for changing the outbound codec on a SIP call using
Joshua Colp [Mon, 6 Apr 2009 16:15:30 +0000 (16:15 +0000)]
Add support for changing the outbound codec on a SIP call using
a dialplan variable.

This adds a dialplan variable (SIP_CODEC_OUTBOUND) which controls
the codec offered for an outgoing SIP call. This is much like the
SIP_CODEC dialplan variable and has the same restrictions. The codec
set must be one that is configured for the call.

(closes issue #13243)
Reported by: samdell3
Patches:
      13243.diff uploaded by file (license 11)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186624 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoSilly svn. These files didn't get merged over in the merge of the issue8824 branch.
Mark Michelson [Mon, 6 Apr 2009 16:06:25 +0000 (16:06 +0000)]
Silly svn. These files didn't get merged over in the merge of the issue8824 branch.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186620 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoBlocked revisions 186565 via svnmerge
Mark Michelson [Mon, 6 Apr 2009 13:57:39 +0000 (13:57 +0000)]
Blocked revisions 186565 via svnmerge

........
  r186565 | mmichelson | 2009-04-06 08:54:41 -0500 (Mon, 06 Apr 2009) | 3 lines

  Revert commit 186445 because it causes the build to fail when IMAP_STORAGE is used.
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186566 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoPass the correct value to sizeof when copying address information.
Joshua Colp [Mon, 6 Apr 2009 13:23:12 +0000 (13:23 +0000)]
Pass the correct value to sizeof when copying address information.

(issue #14827)
Reported by: pj
Patches:
      14827.diff uploaded by file (license 11)
Tested by: pj

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186563 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoRemove merged branch properties accidentally merged to trunk.
Richard Mudgett [Sat, 4 Apr 2009 00:13:50 +0000 (00:13 +0000)]
Remove merged branch properties accidentally merged to trunk.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186537 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoThis commit introduces COLP/CONP and Redirecting party information into Asterisk.
Mark Michelson [Fri, 3 Apr 2009 22:41:46 +0000 (22:41 +0000)]
This commit introduces COLP/CONP and Redirecting party information into Asterisk.

The channel drivers which have been most heavily tested with these enhancements are
chan_sip and chan_misdn. Further work is being done to add Q.SIG support and will be
introduced in a later commit. chan_skinny has code added to it here, but according
to user pj, the support on chan_skinny is not working as of now. This will be fixed in
a later commit.

A special thanks goes out to bugtracker user gareth for getting the ball rolling and
providing the initial support for this work. Without his initial work on this, this would
not have been nearly as painless as it was.

This functionality has been tested by Digium's product quality department, as well as a
customer site running thousands of calls every day. In addition, many many many many bugtracker
users have tested this, too.

(closes issue #8824)
Reported by: gareth

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186525 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 186458 via svnmerge from
Kevin P. Fleming [Fri, 3 Apr 2009 20:20:01 +0000 (20:20 +0000)]
Merged revisions 186458 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r186458 | kpfleming | 2009-04-03 15:19:20 -0500 (Fri, 03 Apr 2009) | 5 lines

  Fix a bug where DAHDI/Zaptel channels would not properly switch formats when requested

  Don't offer AST_FORMAT_SLINEAR on DAHDI/Zaptel channels... while it could provide a slight performance benefit, the translation core in Asterisk has some flaws when a channel driver offers multiple raw formats. this fix is much simpler than fixing the translation core to solve that issue (although that will be done later).
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186461 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 186445 via svnmerge from
Tilghman Lesher [Fri, 3 Apr 2009 19:59:55 +0000 (19:59 +0000)]
Merged revisions 186445 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r186445 | tilghman | 2009-04-03 14:56:48 -0500 (Fri, 03 Apr 2009) | 2 lines

  Found a conflict in the last commit, due to multiple targets
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186447 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 186415 via svnmerge from
Tilghman Lesher [Fri, 3 Apr 2009 19:30:34 +0000 (19:30 +0000)]
Merged revisions 186415 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r186415 | tilghman | 2009-04-03 14:06:58 -0500 (Fri, 03 Apr 2009) | 7 lines

  Distinguish in a sent email between simple sends and forwards.
  (closes issue #11678)
   Reported by: jamessan
   Patches:
         20090330__bug11678.diff.txt uploaded by tilghman (license 14)
   Tested by: tilghman, lmadsen
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186444 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd better support for relaying success or failure of the ast_transfer() API call.
Joshua Colp [Fri, 3 Apr 2009 16:47:27 +0000 (16:47 +0000)]
Add better support for relaying success or failure of the ast_transfer() API call.

This API call now waits for a special frame from the underlying channel driver to
indicate success or failure. This allows the return value to truly convey whether
the transfer worked or not. In the case of the Transfer() dialplan application this
means the value of the TRANSFERSTATUS dialplan variable is actually true.

(closes issue #12713)
Reported by: davidw
Tested by: file

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186382 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoaudio_audiohook_write_list() did not correctly update sample size after ast_translate.
David Vossel [Fri, 3 Apr 2009 16:29:47 +0000 (16:29 +0000)]
audio_audiohook_write_list() did not correctly update sample size after ast_translate.

audio_audiohook_write_list() did not take into account that the sample size may change after translation depending on if the original frame is is 8khz or 16khz.  the sample size is now updated after translating to reflect this possibility.  This caused the audio on the receiving end to sound terrible.  Thanks to jcolp and mmichelson for helping me work this out.

(issue AST-197)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186379 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 186320 via svnmerge from
Joshua Colp [Fri, 3 Apr 2009 15:52:50 +0000 (15:52 +0000)]
Merged revisions 186320 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r186320 | file | 2009-04-03 12:48:56 -0300 (Fri, 03 Apr 2009) | 5 lines

  Fix a problem with the crypto variable definitions not actually being defined properly.

  (closes issue #14804)
  Reported by: jvandal
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186321 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoCompatibility fix for glibc 2.4
Tilghman Lesher [Fri, 3 Apr 2009 15:18:28 +0000 (15:18 +0000)]
Compatibility fix for glibc 2.4
(Closes issue #14820)
Reported by: phsultan

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186297 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix the ability to retrieve voicemail messages from IMAP.
Mark Michelson [Fri, 3 Apr 2009 14:32:05 +0000 (14:32 +0000)]
Fix the ability to retrieve voicemail messages from IMAP.

A recent change made interactive vm_states no longer get
added to the list of vm_states and instead get stored in
thread-local storage.

In trunk and all the 1.6.X branches, the problem is that
when we search for messages in a voicemail box, we would
attempt to update the appropriate vm_state struct by directly
searching in the list of vm_states instead of using the
get_vm_state_by_imap_user function. This meant we could not
find the interactive vm_state that we wanted.

(closes issue #14685)
Reported by: BlargMaN
Patches:
      14685.patch uploaded by mmichelson (license 60)
Tested by: BlargMaN, qualleyiv, mmichelson

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186286 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 186229 via svnmerge from
Russell Bryant [Fri, 3 Apr 2009 02:03:48 +0000 (02:03 +0000)]
Merged revisions 186229 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r186229 | russell | 2009-04-02 20:57:44 -0500 (Thu, 02 Apr 2009) | 21 lines

Fix a memory leak in cdr_radius.

I came across this while doing some testing of my ast_channel_ao2 branch.
After running a test overnight that generated over 5 million calls, Asterisk
had taken up about 1 GB of my system memory.  So, I re-ran the test with
MALLOC_DEBUG turned on.  However, it showed no leaks in Asterisk during the
test, even though Asterisk was still consuming it somehow.

Instead, I turned to valgrind, which when run with --leak-check=full, told
me exactly where the leak came from, which was from allocations inside the
radiusclient-ng library.  This explains why MALLOC_DEBUG did not report it.

After a bit of analysis, I found that we were leaking a little bit of memory
every time a CDR record was passed to cdr_radius.

I don't actually have a radius server set up to receive CDR records.  However,
I always have my development systems compile and install all modules.  In
addition to making sure there are not build errors across modules, always
loading modules helps find bugs like this, too, so it is strongly recommend for
all developers.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186230 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 186174 via svnmerge from
Mark Michelson [Thu, 2 Apr 2009 21:56:21 +0000 (21:56 +0000)]
Merged revisions 186174 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r186174 | mmichelson | 2009-04-02 16:55:34 -0500 (Thu, 02 Apr 2009) | 5 lines

  Fix instructions in one-step parking comment to make more sense.

  Changed a capital K to a lowercase k.
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186175 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 186081 via svnmerge from
Kevin P. Fleming [Thu, 2 Apr 2009 17:26:07 +0000 (17:26 +0000)]
Merged revisions 186081 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r186081 | kpfleming | 2009-04-02 12:21:29 -0500 (Thu, 02 Apr 2009) | 3 lines

  ensure that the buffer passed to DAHDI_SET_BUFINFO is fully initialized
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186101 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerge in the RTP engine API.
Joshua Colp [Thu, 2 Apr 2009 17:20:52 +0000 (17:20 +0000)]
Merge in the RTP engine API.

This API provides a generic way for multiple RTP stacks to be
integrated into Asterisk. Right now there is only one present, res_rtp_asterisk,
which is the existing Asterisk RTP stack. Functionality wise this commit
performs the same as previously. API documentation can be viewed in the
rtp_engine.h header file.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186078 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 186059 via svnmerge from
Tilghman Lesher [Thu, 2 Apr 2009 17:10:28 +0000 (17:10 +0000)]
Merged revisions 186059 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
  r186059 | tilghman | 2009-04-02 12:09:13 -0500 (Thu, 02 Apr 2009) | 9 lines

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

  ........
    r186056 | tilghman | 2009-04-02 12:02:18 -0500 (Thu, 02 Apr 2009) | 2 lines

    Fix for AST-2009-003
  ........
................

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186060 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoBlocked revisions 186057 via svnmerge
Tilghman Lesher [Thu, 2 Apr 2009 17:04:40 +0000 (17:04 +0000)]
Blocked revisions 186057 via svnmerge

........
  r186057 | tilghman | 2009-04-02 12:03:59 -0500 (Thu, 02 Apr 2009) | 2 lines

  Avoid multiple warning messages in SIP, due to this column not existing
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186058 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMissed a common case for needing to extend the buffer.
Tilghman Lesher [Thu, 2 Apr 2009 15:14:22 +0000 (15:14 +0000)]
Missed a common case for needing to extend the buffer.
(closes issue #14716)
 Reported by: sum
 Patches:
       20090402__bug14716.diff.txt uploaded by tilghman (license 14)
 Tested by: sum

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186021 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerged revisions 185952 via svnmerge from
Kevin P. Fleming [Thu, 2 Apr 2009 13:51:44 +0000 (13:51 +0000)]
Merged revisions 185952 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r185952 | kpfleming | 2009-04-02 08:43:43 -0500 (Thu, 02 Apr 2009) | 5 lines

  the DAHDI_GETCONF, DAHDI_SETCONF and DAHDI_GET_PARAMS ioctls were recently corrected to show that they do, in fact, read data from userspace as part of their work. due to this fix, valgrind now reports a number of cases where chan_dahdi passed an uninitialized (or partially) buffer to these ioctls, which could lead to unexpected behavior.

  this patch corrects chan_dahdi to ensure that buffers passed to these ioctls are always fully initialized.
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185953 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoMerge changes from str_substitution that are unrelated to that branch.
Tilghman Lesher [Wed, 1 Apr 2009 20:13:28 +0000 (20:13 +0000)]
Merge changes from str_substitution that are unrelated to that branch.
Included is a small bugfix to an ast_str helper, but most of these changes
are simply doxygen fixes.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185912 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoMerged revisions 185845 via svnmerge from
David Vossel [Wed, 1 Apr 2009 19:03:32 +0000 (19:03 +0000)]
Merged revisions 185845 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r185845 | dvossel | 2009-04-01 14:02:00 -0500 (Wed, 01 Apr 2009) | 10 lines

  Fixes issue with dropped calles due to re-Invite glare and re-Invites never executing after a 491

  Acknowledgement for 491 responses were never being processed because it didn't match our pending invite's seqno.  Since the ACK was never processed, the 491 frame would continue to be retransmitted until eventually the call was dropped due to max retries.  Now during a pending invite, if we receive another invite, we send an 491 and hold on to that glare invite's seqno in the "glareinvite" variable for that sip_pvt struct.  When ACK's are received, we first check to see if it is in response to our pending invite, if not we check to see if it is in response to a glare invite.  In this case, it is in response to the glare invite and must be dealt with or the call is dropped.  I've changed the wait time for resending the re-Invite after receving a 491 response to comply with RFC 3261.  Before this patch the scheduled re-Invite would only change a flag indicating that the re-Invite should be sent out, now it actually sends it out as well.

  (closes issue #12013)
  Reported by: alx

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185846 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoAddress Russell's comments regarding rev 185704.
Mark Michelson [Wed, 1 Apr 2009 13:59:34 +0000 (13:59 +0000)]
Address Russell's comments regarding rev 185704.

Use ast_debug and ast_softhangup_nolock.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185777 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoMerged revisions 185771 via svnmerge from
Russell Bryant [Wed, 1 Apr 2009 13:48:26 +0000 (13:48 +0000)]
Merged revisions 185771 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r185771 | russell | 2009-04-01 08:47:30 -0500 (Wed, 01 Apr 2009) | 6 lines

Fix a case where DTMF could bypass audiohooks.

This change fixes a situation where an audiohook that wants DTMF would not
actually get it.  This is in the code path where we end DTMF digit length
emulation while handling a NULL frame.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185772 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoFix dev-mode build on my box.
Russell Bryant [Wed, 1 Apr 2009 12:13:16 +0000 (12:13 +0000)]
Fix dev-mode build on my box.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185741 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoAllow the AMI Hangup command to accept a Cause header.
Mark Michelson [Wed, 1 Apr 2009 00:39:01 +0000 (00:39 +0000)]
Allow the AMI Hangup command to accept a Cause header.

(closes issue #14695)
Reported by: mneuhauser
Patches:
      cause-for-hangup-manager-action.patch uploaded by mneuhauser (license 425)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185704 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoignore copied (generated) file
Kevin P. Fleming [Tue, 31 Mar 2009 22:35:07 +0000 (22:35 +0000)]
ignore copied (generated) file

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185664 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoFix trunk's compilation.
Mark Michelson [Tue, 31 Mar 2009 22:12:52 +0000 (22:12 +0000)]
Fix trunk's compilation.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185604 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoMerged revisions 185599 via svnmerge from
Mark Michelson [Tue, 31 Mar 2009 22:02:48 +0000 (22:02 +0000)]
Merged revisions 185599 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r185599 | mmichelson | 2009-03-31 17:00:01 -0500 (Tue, 31 Mar 2009) | 6 lines

  Fix crash that would occur if an empty member was specified in queues.conf.

  (closes issue #14796)
  Reported by: pida
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185600 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoOptimizations to the stringfields API
Kevin P. Fleming [Tue, 31 Mar 2009 21:29:50 +0000 (21:29 +0000)]
Optimizations to the stringfields API

This patch provides a number of optimizations to the stringfields API, focused around saving (not wasting) memory whenever possible. Thanks to Mark Michelson for inspiring this work and coming up with the first two optimizations that are represented here:

Changes:

- Cleanup of some code, fix incorrect doxygen comments

- When a field is emptied or replaced with a new allocation, decrease the amount of 'active' space in the pool it was held in; if that pool reaches zero active space, and is not the current pool, then free it as it is no longer in use

- When allocating a pool, try to allocate a size that will fit in a 'standard' malloc() allocation without wasting space

- When allocating space for a field, store the amount of space in the two bytes immediately preceding the field; this eliminates the need to call strlen() on the field when overwriting it, and more importantly it 'remembers' the amount of space the field has available, even if a shorter string has been stored in it since it was allocated

- Don't automatically double the size of each successive pool allocated; it's wasteful

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185581 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoBlocked revisions 185531 via svnmerge
Mark Michelson [Tue, 31 Mar 2009 20:56:46 +0000 (20:56 +0000)]
Blocked revisions 185531 via svnmerge

........
  r185531 | mmichelson | 2009-03-31 15:55:47 -0500 (Tue, 31 Mar 2009) | 3 lines

  Use AST_SCHED_DEL_SPINLOCK instead of manually using the logic.
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185532 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoMerged revisions 185468 via svnmerge from
Mark Michelson [Tue, 31 Mar 2009 19:46:18 +0000 (19:46 +0000)]
Merged revisions 185468 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r185468 | mmichelson | 2009-03-31 14:45:30 -0500 (Tue, 31 Mar 2009) | 8 lines

  Fix Russian voicemail intro to say the word "messages" properly.

  (closes issue #14736)
  Reported by: chappell
  Patches:
        voicemail_no_messages.diff uploaded by chappell (license 8)
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185469 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoImprove performance of the code handling the frame queue in chan_iax2.
Russell Bryant [Tue, 31 Mar 2009 19:07:58 +0000 (19:07 +0000)]
Improve performance of the code handling the frame queue in chan_iax2.

In my tests that exercised full frame handling in chan_iax2, the version with
these changes took 30% to 40% of the CPU time compared to the same test of
Asterisk trunk before these modifications.

While doing some profiling for <http://reviewboard.digium.com/r/205/>,
one function that caught my eye was network_thread() in chan_iax2.c.
After the things that I was working on there, it was the next target
for analysis and optimization.  I used oprofile's source annotation
functionality and found that the loop traversing the frame queue in
network_thread() was to blame for the excessive CPU cycle consumption.

The frame_queue in chan_iax2 previously held all frames that either were
pending transmission or had been transmitted and are still pending
acknowledgment.

In network_thread(), the previous code would go back through the main
for loop after reading a single incoming frame or after being signaled
because a frame had been queued up for initial transmission.  In each
iteration of the loop, it traverses the entire frame queue looking for
frames that need to be transmitted.  On a busy server, this could easily
be quite a few entries.

This patch is actually quite simple.  The frame_queue has become only a list
of frames pending acknowledgment.  Frames that need to be transmitted are
queued up to a dedicated transmit thread via the taskprocessor API.

As a result, the code in network_thread() becomes much simpler, as its only
job is to read incoming frames.

In addition to the previously described changes, this patch includes some
additional changes to the frame_queue.  Instead of one big frame_queue, now
there is a list per call number to further reduce wasted list traversals.
The biggest impact of this change is in socket_process().

For additional details on testing and test results, see the review request.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185432 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoMerged revisions 185362 via svnmerge from
David Brooks [Tue, 31 Mar 2009 16:46:57 +0000 (16:46 +0000)]
Merged revisions 185362 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r185362 | dbrooks | 2009-03-31 11:37:12 -0500 (Tue, 31 Mar 2009) | 35 lines

  Fix incorrect parsing in chan_gtalk when xmpp contains extra whitespaces

  To drill into the xmpp to find the capabilities between channels, chan_gtalk
  calls iks_child() and iks_next(). iks_child() and iks_next() are functions in
  the iksemel xml parsing library that traverse xml nodes. The bug here is that
  both iks_child() and iks_next() will return the next iks_struct node
  *regardless* of type. chan_gtalk expects the next node to be of type IKS_TAG,
  which in most cases, it is, but in this case (a call being made from the
  Empathy IM client), there exists iks_struct nodes which are not IKS_TAG data
  (they are extraneous whitespaces), and chan_gtalk doesn't handle that case,
  so capabilities don't match, and a call cannot be made.

  iks_first_tag() and iks_next_tag(), on the other hand, will not return the
  very next iks_struct, but will check to see if the next iks_struct is of
  type IKS_TAG. If it isn't, it will be skipped, and the next struct of type
  IKS_TAG it finds will be returned. This assures that chan_gtalk will find
  the iks_struct it is looking for.

  This fix simply changes all calls to iks_child() and iks_next() to become
  calls to iks_first_tag() and iks_next_tag(), which resolves the capability
  matching.

  The following is a payload listing from Empathy, which, due to the extraneous
  whitespace, will not be parsed correctly by iksemel:

  <iq from='dbrooksjab@235-22-24-10/Telepathy' to='astjab@235-22-24-10/asterisk' type='set' id='542757715704'> <session xmlns='http://www.google.com/session' initiator='dbrooksjab@235-22-24-10/Telepathy' type='initiate' id='1837267342'> <description xmlns='http://www.google.com/session/phone'> <payload-type clockrate='16000' name='speex' id='96'/>
   <payload-type clockrate='8000' name='PCMA' id='8'/>
   <payload-type clockrate='8000' name='PCMU' id='0'/>
   <payload-type clockrate='90000' name='MPA' id='97'/>
   <payload-type clockrate='16000' name='SIREN' id='98'/>
   <payload-type clockrate='8000' name='telephone-event' id='99'/>
  </description>
  </session>
  </iq>

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185363 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoBlocked revisions 185298 via svnmerge
Mark Michelson [Tue, 31 Mar 2009 15:34:29 +0000 (15:34 +0000)]
Blocked revisions 185298 via svnmerge

........
  r185298 | mmichelson | 2009-03-31 10:34:05 -0500 (Tue, 31 Mar 2009) | 10 lines

  Fix some state_interface stuff that was in trunk but not in the backport to 1.4.

  Issue #14359 was fixed between the time that I posted the review of the backport
  of the state interface change for 1.4. This merges the changes from that issue
  back into 1.4.

  (closes issue #14359)
  Reported by: francesco_r
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185299 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoDon't free() an astobj2 object.
Russell Bryant [Tue, 31 Mar 2009 14:53:45 +0000 (14:53 +0000)]
Don't free() an astobj2 object.

(closes issue #14672)
Reported by: makoto

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185261 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoMerged revisions 185196 via svnmerge from
Joshua Colp [Tue, 31 Mar 2009 14:07:36 +0000 (14:07 +0000)]
Merged revisions 185196 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r185196 | file | 2009-03-31 11:06:39 -0300 (Tue, 31 Mar 2009) | 8 lines

  Fix crash when moving audiohooks between channels.

  Handle the scenario where we are called to move audiohooks between channels
  and the source channel does not actually have any on it.

  (closes issue #14734)
  Reported by: corruptor
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185197 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoMerged revisions 185121 via svnmerge from
Richard Mudgett [Mon, 30 Mar 2009 20:42:14 +0000 (20:42 +0000)]
Merged revisions 185121 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r185121 | rmudgett | 2009-03-30 15:40:11 -0500 (Mon, 30 Mar 2009) | 1 line

  Update the channel allocation method documentation.
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185123 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoMerged revisions 185120 via svnmerge from
Richard Mudgett [Mon, 30 Mar 2009 20:41:24 +0000 (20:41 +0000)]
Merged revisions 185120 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r185120 | rmudgett | 2009-03-30 15:38:11 -0500 (Mon, 30 Mar 2009) | 19 lines

  Make chan_misdn BRI TE side normally defer channel selection to the NT side.

  Channel allocation collisions are not handled by chan_misdn very well.
  This patch simply avoids the problem for BRI only.

  For PRI, allocation collisions are still possible but less likely since
  there are simply more channels available and each end could use a different
  allocation strategy.

  misdn.conf options available:
  te_choose_channel - Use to force the TE side to allocate channels.
  method - Specify the channel allocation strategy.

  (closes issue #13488)
  Reported by: Christian_Pinedo
  Patches:
        isdn_lib.patch.txt uploaded by crich
  Tested by: crich, siepkes, festr
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185122 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoMerged revisions 185031 via svnmerge from
Mark Michelson [Mon, 30 Mar 2009 16:26:48 +0000 (16:26 +0000)]
Merged revisions 185031 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r185031 | mmichelson | 2009-03-30 11:17:35 -0500 (Mon, 30 Mar 2009) | 39 lines

  Fix queue weight behavior so that calls in low-weight queues are not inappropriately blocked.

  (This is copied and pasted from the review request I made for this patch)

  Asterisk has some odd behavior when queue weights are used. The current logic used when
  potentially calling a queue member is:

  If the member we are going to call is part of another queue and _that other queue has any
  callers in it_ and has a higher weight than the queue we are calling from, then don't try
  to contact that member. The issue here is what I have marked with underscores. If the
  higher-weighted queue has any callers in it at all, then the queue member will be unreachable
  from the lower-weighted queue. This has the potential to be really really bad if using a
  queue strategy, such as leastrecent or fewestcalls, with the potential to call the same
  member repeatedly.

  The fix proposed by garychen on issue 13220 is very simple and, as far as I can see, works
  well for this situation. With this set of changes, the logic used becomes:

  If the member we are going to call is part of another queue, the other queue has a higher
  weight than the queue we are calling from, and the higher weight queue has at least as many
  callers as available members, then do not try to contact the queue member. If the higher
  weighted queue has fewer callers than available members, then there is no reason to deny
  the call to this member since the other queue can afford to spare a member.

  Since the fix involved writing a generic function for determining the number of available
  members in the queue, I also modified the is_our_turn function to make use of the new
  num_available_members function to determine if it is our turn to try calling a member. There
  is one small behavior change. Before writing this patch, if you had autofill disabled, then
  if you were the head caller in a queue, you would automatically be told that it was your
  turn to try calling a member. This did not take into account whether there were actually any
  queue members available to take the call. Now we actually make sure there is at least one
  member available to take the call if autofill is disabled.

  (closes issue #13220)
  Reported by: garychen

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185072 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoBlocked revisions 184980 via svnmerge
Mark Michelson [Mon, 30 Mar 2009 15:25:04 +0000 (15:25 +0000)]
Blocked revisions 184980 via svnmerge

........
  r184980 | mmichelson | 2009-03-30 10:23:59 -0500 (Mon, 30 Mar 2009) | 22 lines

  Backport state interface changes to app_queue from trunk.

  After several issues raised on the Asterisk bugtracker against
  the 1.4 branch were determined to be fixable with the state interface
  change available in the 1.6.X series, it finally came time to just
  suck it up and backport the change.

  For a detailed explanation of what this change entails, the original
  trunk commit for this feature may be found here:

  http://svn.digium.com/view/asterisk?view=revision&revision=97203

  In addition, the details for the use of this change to fix the problems
  stated in issue #12970 may be found in the review request I made for
  this change. It is linked below.

  (closes issue #12970)
  Reported by: edugs15

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184986 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoMerged revisions 184947 via svnmerge from
Joshua Colp [Mon, 30 Mar 2009 14:37:47 +0000 (14:37 +0000)]
Merged revisions 184947 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r184947 | file | 2009-03-30 11:35:47 -0300 (Mon, 30 Mar 2009) | 14 lines

  Improve our handling of T38 in the initial INVITE from a device.

  We now answer with matching media streams to what is requested. If an INVITE
  is received with both a T38 and RTP media stream this means we answer with both.
  For any outgoing calls created as a result of this inbound one no T38 is requested
  in the initial INVITE. Instead if we start receiving udptl packets we trigger a
  reinvite on the outbound side.

  (closes issue #12437)
  Reported by: marsosa
  Tested by: pinga-fogo, okrief, file, afu

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184948 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoFix build error when chan_h323 is not being built.
Russell Bryant [Mon, 30 Mar 2009 13:55:44 +0000 (13:55 +0000)]
Fix build error when chan_h323 is not being built.

(reported by cai1982 in #asterisk-dev)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184910 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoMerged revisions 184842 via svnmerge from
Russell Bryant [Sun, 29 Mar 2009 05:52:20 +0000 (05:52 +0000)]
Merged revisions 184842 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r184842 | russell | 2009-03-29 00:51:55 -0500 (Sun, 29 Mar 2009) | 5 lines

Ensure targs variable is fully initialized.

(closes issue #14758)
Reported by: tim_ringenbach

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184843 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoSimplify chan_h323 build to not require a second run of "make".
Russell Bryant [Sun, 29 Mar 2009 05:32:04 +0000 (05:32 +0000)]
Simplify chan_h323 build to not require a second run of "make".

(closes issue #14715)
Reported by: jthurman
Patches:
      h323-makefile-1.6.2.0-beta1.patch uploaded by jthurman (license 614)
Tested by: tzafrir, russell

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184838 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoFix a typo in app_ices.
Leif Madsen [Fri, 27 Mar 2009 20:08:44 +0000 (20:08 +0000)]
Fix a typo in app_ices.

(closes issue #14765)
Reported by: timeshell
Patches:
      app_ices.svn-1.6.0.diff uploaded by timeshell (license 399)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184801 65c4cc65-6c06-0410-ace0-fbb531ad65f3

11 years agoUpdate commit message guidelines in re: to punctuation.
Leif Madsen [Fri, 27 Mar 2009 19:31:04 +0000 (19:31 +0000)]
Update commit message guidelines in re: to punctuation.
The doxygen documentation has now been updated to state explicitly that I want
punctuation atthe end of the first sentence in a commit message. :).

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184798 65c4cc65-6c06-0410-ace0-fbb531ad65f3