Commit Graph

2127 Commits

Author SHA1 Message Date
Mark Michelson 0a63e3fa10 Log spandsp's fax debug output to the FAX logger level.
Review: https://reviewboard.asterisk.org/r/658



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-21 15:15:58 +00:00
Mark Michelson 6bb45831eb Fix transcode_via_sln option with SIP calls and improve PLC usage.
From reviewboard:
The problem here is a bit complex, so try to bear with me...

It was noticed by a Digium customer that generic PLC (as configured in
codecs.conf) did not appear to actually be having any sort of benefit when
packet loss was introduced on an RTP stream. I reproduced this issue myself
by streaming a file across an RTP stream and dropping approx. 5% of the
RTP packets. I saw no real difference between when PLC was enabled or disabled
when using wireshark to analyze the RTP streams.

After analyzing what was going on, it became clear that one of the problems
faced was that when running my tests, the translation paths were being set
up in such a way that PLC could not possibly work as expected. To illustrate,
if packets are lost on channel A's read stream, then we expect that PLC will
be applied to channel B's write stream. The problem is that generic PLC can
only be done when there is a translation path that moves from some codec to
SLINEAR. When I would run my tests, I found that every single time, read
and write translation paths would be set up on channel A instead of channel
B. There appeared to be no real way to predict which channel the translation
paths would be set up on.

This is where Kevin swooped in to let me know about the transcode_via_sln
option in asterisk.conf. It is supposed to work by placing a read translation
path on both channels from the channel's rawreadformat to SLINEAR. It also
will place a write translation path on both channels from SLINEAR to the
channel's rawwriteformat. Using this option allows one to predictably set up
translation paths on all channels. There are two problems with this, though.
First and foremost, the transcode_via_sln option did not appear to be working
properly when I was placing a SIP call between two endpoints which did not
share any common formats. Second, even if this option were to work, for PLC
to be applied, there had to be a write translation path that would go from
some format to SLINEAR. It would not work properly if the starting format
of translation was SLINEAR.

The one-line change presented in this review request in chan_sip.c fixed the
first issue for me. The problem was that in sip_request_call, the
jointcapability of the outbound channel was being set to the format passed to
sip_request_call. This is nativeformats of the inbound channel. Because of this,
when ast_channel_make_compatible was called by app_dial, both channels already
had compatibly read and write formats. Thus, no translation path was set up at
the time. My change is to set the jointcapability of the sip_pvt created during
sip_request_call to the intersection of the inbound channel's nativeformats and
the configured peer capability that we determined during the earlier call to
create_addr. Doing this got the translation paths set up as expected when using
transcode_via_sln.

The changes presented in channel.c fixed the second issue for me. First and
foremost, when Asterisk is started, we'll read codecs.conf to see the value of
the genericplc option. If this option is set, and ast_write is called for a
frame with no data, then we will attempt to fill in the missing samples for
the frame. The implementation uses a channel datastore for maintaining the
PLC state and for creating a buffer to store PLC samples in. Even when we
receive a frame with data, we'll call plc_rx so that the PLC state will have
knowledge of the previous voice frame, which it can use as a basis for when
it comes time to actually do a PLC fill-in.

So, reviewers, now I ask for your help. First off, there's the one line change
in chan_sip that I have put in. Is it right? By my logic it seems correct, but
I'm sure someone can tell me why it is not going to work. This is probably the
change I'm least concerned about, though. What concerns me much more is the
set of changes in channel.c. First off, am I even doing it right? When I run
tests, I can clearly see that when PLC is activated, I see a significant increase
in RTP traffic where I would expect it to be. However, in my humble opinion, the
audio sounds kind of crappy whenever the PLC fill-in is done. It sounds worse to
me than when no PLC is used at all. I need someone to review the logic I have used
to be sure that I'm not misusing anything. As far as I can see my pointer arithmetic
is correct, and my use of AST_FRIENDLY_OFFSET should be correct as well, but I'm
sure someone can point out somewhere where I've done something incorrectly.

As I was writing this review request up, I decided to give the code a test run under
valgrind, and I find that for some reason, calls to plc_rx are causing some invalid
reads. Apparently I'm reading past the end of a buffer somehow. I'll have to dig around
a bit to see why that is the case. If it's obvious to someone reviewing, speak up!

Finally, I have one other proposal that is not reflected in my code review. Since
without transcode_via_sln set, one cannot predict or control where a translation
path will be up, it seems to me that the current practice of using PLC only when
transcoding to SLINEAR is not useful. I recommend that once it has been determined
that the method used in this code review is correct and works as expected, then
the code in translate.c that invokes PLC should be removed.

Review: https://reviewboard.asterisk.org/r/622/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-19 21:29:08 +00:00
Tilghman Lesher b5a629624a Merged revisions 264248 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r264248 | tilghman | 2010-05-19 12:41:29 -0500 (Wed, 19 May 2010) | 17 lines
  
  Internal timing is now on by default, if you're using DAHDI 2.3 or above.
  
  The reason for ensuring DAHDI 2.3 or above is that this version ensures that
  a timer is always available, whereas in previous versions, it was possible
  for DAHDI to be loaded, but have no drivers to actually generate timing.  If
  internal_timing was turned on in this circumstance, a complete lack of audio
  would result.  This is the reason why internal_timing was not on by default.
  However, now that DAHDI ensures the availability of a timer, there is no
  reason for this setting to be off (and in fact, it solves a great many initial
  user problems).
  
  (closes issue #15932)
   Reported by: dimas
   Patches: 
         20100519__issue15932.diff.txt uploaded by tilghman (license 14)
   Tested by: tilghman
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264249 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-19 17:48:31 +00:00
Tilghman Lesher 4c034c1f72 Cache sound tarfiles in a common directory, such that a clean reinstall does not force a re-download of the tarballs.
(closes issue #15370)
 Reported by: pprindeville
 Patches: 
       asterisk-trunk-bugid15370.patch uploaded by pprindeville (license 347)
 Tested by: pprindeville, tilghman, seanbright


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@263724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-17 23:49:15 +00:00
Mark Michelson b5d5cc565f Enhancements to connected line and redirecting work.
From reviewboard:

Digium has a commercial customer who has made extensive use of the connected party and
redirecting information present in later versions of Asterisk Business Edition and which
is to be in the upcoming 1.8 release. Through their use of the feature, new problems and solutions
have come about. This patch adds several enhancements to maximize usage of the connected party
and redirecting information functionality.

First, Asterisk trunk already had connected line interception macros. These macros allow you to
manipulate connected line information before it was sent out to its target. This patch adds the
same feature except for redirecting information instead.

Second, the ast_callerid and ast_party_id structures have been enhanced to provide a "tag." This
tag can be set with func_callerid, func_connectedline, func_redirecting, and in the case of DAHDI,
mISDN, and SIP channels, can be set in a configuration file. The idea behind the callerid tag is
that it can be set to whatever value the administrator likes. Later, when running connected line
and redirecting macros, the admin can read the tag off the appropriate structure to determine what
action to take. You can think of this sort of like a channel variable, except that instead of having
the variable associated with a channel, the variable is associated with a specific identity within
Asterisk.

Third, app_dial has two new options, s and u. The s option lets a dialplan writer force a specific
caller ID tag to be placed on the outgoing channel. The u option allows the dialplan writer to force
a specific calling presentation value on the outgoing channel.

Fourth, there is a new control frame subclass called AST_CONTROL_READ_ACTION added. This was added
to correct a very specific situation. In the case of SIP semi-attended (blond) transfers, the party
being transferred would not have the opportunity to run a connected line interception macro to
possibly alter the transfer target's connected line information. The issue here was that during a
blond transfer, the SIP transfer code has no bridged channel on which to queue the connected line
update. The way this was corrected was to add this new control frame subclass. Now, we queue an
AST_CONTROL_READ_ACTION frame on the channel on which the connected line interception macro should
be run. When ast_read is called to read the frame, ast_read responds by calling a callback function
associated with the specific read action the control frame describes. In this case, the action taken
is to run the connected line interception macro on the transferee's channel.

Review: https://reviewboard.asterisk.org/r/652/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@263541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-17 15:36:31 +00:00
Tilghman Lesher 8d6ee962c7 Add kqueue(2) implementation to Asterisk in various places.
This will save a considerable amount of CPU on the BSDs, including Mac OS X,
as it eliminates several places in the code that we previously used a busy
loop.  Additionally, this adds a res_timing interface, using kqueue timers.

Review: https://reviewboard.asterisk.org/r/543/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-13 05:37:31 +00:00
Paul Belanger 4b1d9f85a7 Convert to AST_CLI_YESNO and AST_CLI_ONOFF
Clean up chan_sip.c to use new AST_CLI functions

(closes issue #17287)
Reported by: pabelanger
Patches:
      issue17287.patch uploaded by pabelanger (license 224)
Tested by: russell


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-12 01:00:55 +00:00
Richard Mudgett 9534f72cb0 Dialing an invalid extension causes incomplete hangup sequence.
Revision -r1489 of the libpri 1.4 branch corrected a deviation from Q.931
Section 5.3.2.  However, this resulted in an unexpected behaviour change
to the upper layer (Asterisk).

This change uses pri_hangup_fix_enable() to follow Q.931 Section 5.3.2
call hangup better if the version of libpri supports it.

(issue #17104)
Reported by: shawkris
Tested by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-11 23:18:53 +00:00
Tilghman Lesher 2c10997e99 Move cause 200 to cause 26, as specified in Q.850.
Also cleanup the formatting and add a few more that seem like good candidates.

(closes issue #16157)
 Reported by: wimpy


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-11 21:25:05 +00:00
Tilghman Lesher 92a8650677 Cleanup a bit more by getting rid of useless version defines. Also make library detection use passed CFLAGS.
(closes issue #17309)
 Reported by: stuarth


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-09 02:14:04 +00:00
Tilghman Lesher 13f15cae67 Use the detected pthread building flags in every place, instead of hardcoding -lpthread.
We nicely detect the right flags on each system for building Asterisk with
pthreads, then ignore it for every other build option that requires us to
build with pthreads.  This caused some items to return a false negative.
Also cleanup some minor naming issues that caused "library library" redundancy
in the output.

(closes issue #17303)
 Reported by: stuarth
 Patches: 
       20100507__issue17303.diff.txt uploaded by tilghman (license 14)
 Tested by: stuarth


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@261913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-07 20:35:17 +00:00
Paul Belanger b2f59bea24 New 'manager show settings' CLI command.
See the CHANGES file for more details.

(closes issue #16343)
Reported by: pabelanger
Patches:
      issue16343.patch.v5 uploaded by pabelanger (license 224)
Tested by: pabelanger, tilghman, lmadsen

Review: https://reviewboard.asterisk.org/r/630/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@261180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-05 00:44:37 +00:00
Eliel C. Sardanons caa2eff30c Avoid making AstData depend on libxml2 to compile.
We have some functions inside the AstData API to get the tree
in XML form, but it is not required at the moment to compile 
asterisk and we can disable that part of the API if we don't have
libxml2 support.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@260521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-02 02:52:23 +00:00
David Vossel d4358a46a9 Merged revisions 260049 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r260049 | dvossel | 2010-04-29 10:31:02 -0500 (Thu, 29 Apr 2010) | 14 lines
  
  Fixes crash in audiohook_write_list
  
  The middle_frame in the audiohook_write_list function was
  being freed if a audiohook manipulator returned a failure.
  This is incorrect logic.  This patch resolves this and
  adds detailed descriptions of how this function should work
  and why manipulator failures must be ignored.
  
  (closes issue #17052)
  Reported by: dvossel
  Tested by: dvossel

  (closes issue #16196)
  Reported by: atis
  
  Review: https://reviewboard.asterisk.org/r/623/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@260050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-29 15:33:27 +00:00
Richard Mudgett 6adcbd6be5 Fix comment.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@260007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-29 00:35:14 +00:00
Leif Madsen 595245c0e0 Update the Mantis Workflow document in doxygen.
(closes issue #17175)
Reported by: lmadsen
Patches:
      Bug_Tracker_Workflow.v2.txt uploaded by pabelanger (license 224)
Tested by: pabelanger, lmadsen

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@259438 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-27 21:10:32 +00:00
Matthew Nicholson 13f523731a Update res_fax and res_fax_spandsp to be compatible with Fax For Asterisk 1.2.
The fax session initilization code for T.38 faxes has been rewritten. T.38 session initialization was removed from generic_fax_exec, and split into two different code paths for receive and send.  Also the 'z' option (to send a T.38 reinvite if we do not receive one) was added to sendfax.

In the output of 'fax show sessions', the 'Type' column has been renamed to 'Tech' and replaced with a new 'Tech' column that will report 'G.711' or 'T.38'.

Control of ECM defaults has been added to res_fax

A 'fax show settings' CLI command has been added.

Support of the new AST_T38_REQUEST_PARMS control method request to handle channels that have already received a T.38 reinvite before the FAX application is start has been added.

Support for the 'fax show settings' command has been added to res_fax_spandsp and handling of the ECM flag has been slightly altered.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@258896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-26 14:18:15 +00:00
Jason Parker 9e3f5fa6fb Remove ABI differences that occured when compiling with DEBUG_THREADS.
"Bad Things" would happen if Asterisk was compiled with DEBUG_THREADS, but a
loaded module was not (or vice versa).  This also immensely simplifies the
lock code, since there are no longer 2 separate versions of them.

Review: https://reviewboard.asterisk.org/r/508/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@258557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-22 19:08:01 +00:00
Eliel C. Sardanons a753e8878b Asterisk data retrieval API.
This module implements an abstraction for retrieving and exporting
asterisk data.
Developed by:
	Brett Bryant <brettbryant@gmail.com>
	Eliel C. Sardanons (LU1ALY) <eliels@gmail.com>
For the Google Summer of code 2009 Project.
Documentation can be found in doxygen format and inside the
header include/asterisk/data.h

Review: https://reviewboard.asterisk.org/r/275/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@258517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-22 18:07:02 +00:00
Leif Madsen 8b11ae2e4f Add ability to generate ASCII documentation from the TeX files.
These changes add the ability to run 'make asterisk.txt' just like the existing
'make asterisk.pdf' commands to generate a text document from the TeX files we
have in the doc/tex/ directory. I've also updated a few of the .tex files because
they weren't properly escaping certain characters so they would show up as Unicode
characters (like [U+021C]). Made changes to the configure scripts so it would
detect the catdvi program which is required to convert the .dvi file generated
by latex.

I've also added a few lines to the build_tools/prep_tarball script so that the
text documentation gets generated and added to future tarballs of Asterisk
releases.

(closes issue #17220)
Reported by: lmadsen
Patches: 
      asterisk.txt.patch uploaded by lmadsen (license 10)
      asterisk.txt.patch-v4 uploaded by pabelanger (license 224)
Tested by: lmadsen, pabelanger

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@258351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-21 19:18:35 +00:00
Julian Lyndon-Smith d85650e4aa Added MixMonitorMute manager command
Added a new manager command to mute/unmute MixMonitor audio on a channel. 
Added a new feature to audiohooks so that you can mute either read / write
(or both) types of frames - this allows for MixMonitor to mute either side
of the conversation without affecting the conversation itself.

(closes issue #16740)
Reported by: jmls

Review: https://reviewboard.asterisk.org/r/487/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@258190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-21 11:27:27 +00:00
Tilghman Lesher 8ced3317ed Merged revisions 257544 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r257544 | tilghman | 2010-04-15 16:23:24 -0500 (Thu, 15 Apr 2010) | 6 lines
  
  Allow application options with arguments to contain parentheses, through a variety of escaping techniques.
  
  Fixes SWP-1194 (ABE-2143).
  
  Review: https://reviewboard.asterisk.org/r/604/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@257560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-15 21:26:19 +00:00
Richard Mudgett 537edff10f Remove PRI CCSS BUGBUG message and update configure script.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-09 16:43:30 +00:00
Mark Michelson e24661fd18 Merge Call completion support into trunk.
From Reviewboard:
CCSS stands for Call Completion Supplementary Services. An admittedly out-of-date
overview of the architecture can be found in the file doc/CCSS_architecture.pdf
in the CCSS branch. Off the top of my head, the big differences between what is
implemented and what is in the document are as follows:

1. We did not end up modifying the Hangup application at all.
2. The document states that a single call completion monitor may be used across
   multiple calls to the same device. This proved to not be such a good idea
   when implementing protocol-specific monitors, and so we ended up using one
   monitor per-device per-call.
3. There are some configuration options which were conceived after the document
   was written. These are documented in the ccss.conf.sample that is on this
   review request.
		      
For some basic understanding of terminology used throughout this code, see the
ccss.tex document that is on this review.

This implements CCBS and CCNR in several flavors.

First up is a "generic" implementation, which can work over any channel technology
provided that the channel technology can accurately report device state. Call
completion is requested using the dialplan application CallCompletionRequest and can
be canceled using CallCompletionCancel. Device state subscriptions are used in order
to monitor the state of called parties.

Next, there is a SIP-specific implementation of call completion. This method uses the
methods outlined in draft-ietf-bliss-call-completion-06 to implement call completion
using SIP signaling. There are a few things to note here:

* The agent/monitor terminology used throughout Asterisk sometimes is the reverse of
  what is defined in the referenced draft.

* Implementation of the draft required support for SIP PUBLISH. I attempted to write
  this in a generic-enough fashion such that if someone were to want to write PUBLISH
  support for other event packages, such as dialog-state or presence, most of the effort
  would be in writing callbacks specific to the event package.

* A subportion of supporting PUBLISH reception was that we had to implement a PIDF
  parser. The PIDF support added is a bit minimal. I first wrote a validation
  routine to ensure that the PIDF document is formatted properly. The rest of the
  PIDF reading is done in-line in the call-completion-specific PUBLISH-handling
  code. In other words, while there is PIDF support here, it is not in any state
  where it could easily be applied to other event packages as is.

Finally, there are a variety of ISDN-related call completion protocols supported. These
were written by Richard Mudgett, and as such I can't really say much about their
implementation. There are notes in the CHANGES file that indicate the ISDN protocols
over which call completion is supported.

Review: https://reviewboard.asterisk.org/r/523


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-09 15:31:32 +00:00
Mark Michelson 6cad0f1602 func_srv and explicit specification of a remote IP for SIP.
From Review Board:
There are two interrelated changes here.

First, there is the introduction of func_srv. This adds two new read-only
dialplan functions, SRVQUERY and SRVRESULT. They work very similarly to the
ENUMQUERY and ENUMRESULT functions, except that this allows one to query SRV
records instead. In order to facilitate this work, I added a couple of new API
calls to srv.h. ast_srv_get_record_count tells the number of records returned
by an SRV lookup. This number is calculated at the time of the SRV lookup.
ast_srv_get_nth_record allows one to get a numbered SRV record.

Second, there is the modification to chan_sip that allows one to specify a
hostname or IP address (along with a port) to send an outgoing INVITE to when
dialing a SIP peer. This goes hand-in-hand with func_srv. You can query SRV
records and then use the host and port from the results to dial via a specific
host instead of what is configured in sip.conf.

Review: https://reviewboard.asterisk.org/r/608
SWP-1200



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-09 14:37:50 +00:00
Tilghman Lesher bcbafc800e Mac OS X does not support comparing a mutex to its initializer. Create a test for this.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-06 19:28:42 +00:00
Richard Mudgett a5a0a5f867 Consolidate ast_channel.cid.cid_rdnis into ast_channel.redirecting.from.number.
SWP-1229
ABE-2161

* Ensure chan_local.c:local_call() will not leak cid.cid_dnid when
copying.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-03 02:12:33 +00:00
Tilghman Lesher 17a72827c8 Fix DEBUG_THREADS build on Darwin.
(closes issue #16828)
 Reported by: oej
 Patches: 
       20100331__issue16828.diff.txt uploaded by tilghman (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@255796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-01 18:16:37 +00:00
Kevin P. Fleming 32938f653f Remove no-longer-used (and unsafe) field in ast_channel for linked lists.
The ast_channel structure had a field used for linking a channel into a
linked list, but now that ast_channel structures are ao2 objects, this is
no longer needed, and could be harmful as ao2 objects really shouldn't
ever be placed into linked lists (since those lists don't assist with
reference count management on the objects).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@254637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-25 18:38:27 +00:00
Mark Michelson a1e426cd2a Merged revisions 254552 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r254552 | mmichelson | 2010-03-25 12:33:35 -0500 (Thu, 25 Mar 2010) | 5 lines
  
  Add doxygen for acl.h
  
  Review: https://reviewboard.asterisk.org/r/528
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@254553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-25 17:42:36 +00:00
Kevin P. Fleming 42577406fd Improve handling of T.38 re-INVITEs that arrive before a T.38-capable
application is executing on a channel.

This patch addresses an issue found during working with end-users
using res_fax. If an incoming call is answered in the dialplan, or
jumps to the 'fax' extension due to reception of a CNG tone (with
faxdetect enabled), and then the remote endpoint sends a T.38
re-INVITE, it is possible for the channel's T.38 state to be
'T38_STATE_NEGOTIATING' when the application starts up. Unfortunately,
even if the application wants to use T.38, it can't respond to the
peer's negotiation request, because the AST_CONTROL_T38_PARAMETERS
control frame that chan_sip sent originally has been lost, and the
application needs the content of that frame to be able to formulate a
reply.

This patch adds a new 'request' type to AST_CONTROL_T38_PARAMETERS,
AST_T38_REQUEST_PARMS. If the application sends this request, chan_sip
will re-send the original control frame (with
AST_T38_REQUEST_NEGOTIATE as the request type), and the application
can respond as normal. If this occurs within the five second timeout
in chan_sip, the automatic cancellation of the peer reinvite will be
stopped, and the application will 'own' the negotiation process from
that point onwards.

This also improves the code path in chan_sip to allow sip_indicate(),
when called for AST_CONTROL_T38_PARAMETERS, to be able to return a
non-zero response, which should have been in place before since the
control frame *can* fail to be processed properly. It also modifies
ast_indicate() to return whatever result the channel driver returned
for this control frame, rather than converting all non-zero results
into '-1'. Finally, the new request type intentionally returns a
positive value, so that an application that sends
AST_T38_REQUEST_PARMS can know for certain whether the channel driver
accepted it and will be replying with a control frame of its own, or
whether it was ignored (if the sip_indicate()/ast_indicate() path had
properly supported failure responses before, this would not be
necessary).

This patch also modifies res_fax to take advantage of the new request.

In addition, this patch makes sip_t38_abort() actually lock the
private structure before doing its work... bad programmer, no donut.

This patch also enhances chan_sip's 'faxdetect' support to allow
triggering on T.38 re-INVITEs received as well as CNG tone detection.

Review: https://reviewboard.asterisk.org/r/556/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@254450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-25 15:27:31 +00:00
Kevin P. Fleming ae6008ef3a Change per-file debug and verbose levels to be per-module, the way
users expect them to work.

'core set debug' and 'core set verbose' can optionally change the
level for a specific filename; however, this is actually for a
specific source file name, not the module that source file is included
in. With examples like chan_sip, chan_iax2, chan_misdn and others
consisting of multiple source files, this will not lead to the
behavior that users expect. If they want to set the debug level for
chan_sip, they want it set for all of chan_sip, and not to have to
also set it for reqresp_parser and other files that comprise the
chan_sip module.

This patch changes this functionality to be module-name based instead
of file-name based.

To make this work, some Makefile modifications were required to ensure
that the AST_MODULE definition is present in each object file produced
for each module as well.

Review: https://reviewboard.asterisk.org/r/574/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-23 14:22:27 +00:00
Tilghman Lesher 374e4e9d72 Fix bamboo compile error by calculating an integer with the same size as a pointer.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-17 00:14:29 +00:00
Tilghman Lesher 385a40226a Fix test_time on Mac OS X (and other platforms without inotify)
Reviewboard: https://reviewboard.asterisk.org/r/554/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-16 19:34:01 +00:00
Terry Wilson 68d1ded8dd Only change the RTP ssrc when we see that it has changed
This change basically reverts the change reviewed in
https://reviewboard.asterisk.org/r/374/ and instead limits the
updating of the RTP synchronization source to only those times when we
detect that the other side of the conversation has changed the ssrc.

The problem is that SRCUPDATE control frames are sent many times where
we don't want a new ssrc, including whenever Asterisk has to send DTMF
in a normal bridge. This is also not the first time that this mistake
has been made. The initial implementation of the ast_rtp_new_source
function also changed the ssrc--and then it was removed because of
this same issue. Then, we put it back in again to fix a different
issue. This patch attempts to only change the ssrc when we see that
the other side of the conversation has changed the ssrc.

It also renames some functions to make their purpose more clear.

Review: https://reviewboard.asterisk.org/r/540/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-12 22:04:51 +00:00
Tilghman Lesher da6ba8e60e Remove portions that weren't meant to be committed for the OS X compat fix
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-08 05:15:01 +00:00
Tilghman Lesher e58fc610ae Change needed to make Mac OS X 10.6 happy
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-08 05:12:55 +00:00
Russell Bryant 925aad8944 Remove pbx_gtkconsole and related gtk1 checks.
Review: https://reviewboard.asterisk.org/r/541/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-05 19:32:19 +00:00
Russell Bryant 335558c5d1 Fix up the ast_rtp_property enum.
The mis-placement of the latest entry meant that when it was set, it was writing
one index past the end of the properties array in the ast_rtp_instance (which
happened to be the local_address field).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250871 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-05 02:07:33 +00:00
Richard Mudgett 73ef4b8daf Removed cdrflags from ast_channel structure.
Only chan_dahdi set a value in cdrflags.  Everyone else just copied it
around the system.  Noone cared about any value it may have contained.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-03 19:38:06 +00:00
Matthew Nicholson 49aaeb1df2 Merge missed files from res_fax/res_fax_spandsp merge.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-02 23:22:11 +00:00
Matthew Nicholson 06dc8bc123 Merge res_fax and res_fax_spandsp.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-02 23:11:06 +00:00
David Vossel 862ebf4d00 fixes adaptive jitterbuffer configuration
When configuring the adaptive jitterbuffer, the target_extra
value not only could not be set from the configuration, but was
not even being set to its proper default.  This value is required
in order for the adaptive jitterbuffer to work correctly.  To resolve
this a config option has been added to expose this value to the conf
files, and a default value is provided when no config specific value
is present.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-02 19:08:38 +00:00
Tilghman Lesher a6fd85250d Properly document voicemail API documents. Also fix a crash reported via the -dev list.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-28 07:10:22 +00:00
Russell Bryant 53bf191569 Trim trailing whitespace, convert lists of defines to enums
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-26 08:26:10 +00:00
Tilghman Lesher 4e1e6820db Merged revisions 248582 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r248582 | tilghman | 2010-02-24 15:02:18 -0600 (Wed, 24 Feb 2010) | 7 lines
  
  Remove color code sequences from verbose messages that go to logfiles.
  (closes issue #16786)
   Reported by: dodo
   Patches: 
         logger2.patch uploaded by dodo (license 989)
   Tested by: tilghman
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@248584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-24 21:17:26 +00:00
Russell Bryant 5665aa361f Minor tweaks to comment blocks and includes.
Fix the copyright lines, tweak doxygen formatting, and remove some unnecessary
includes.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@248226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-22 06:45:52 +00:00
Mark Michelson 2ce7eabb24 Fix two problems in ast_str functions found while writing a unit test.
1. The documentation for ast_str_set and ast_str_append state that
the max_len parameter may be -1 in order to limit the size of the
ast_str to its current allocated size. The problem was that the max_len
parameter in all cases was a size_t, which is unsigned. Thus a -1 was
interpreted as UINT_MAX instead of -1. Changing the max_len parameter
to be ssize_t fixed this issue.

2. Once issue 1 was fixed, there was an off-by-one error in the case
where we attempted to write a string larger than the current allotted
size to a string when -1 was passed as the max_len parameter. When trying
to write more than the allotted size, the ast_str's __AST_STR_USED was
set to 1 higher than it should have been. Thanks to Tilghman for quickly
spotting the offending line of code.

Oh, and the unit test that I referenced in the top line of this commit
will be added to reviewboard shortly. Sit tight...



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-17 21:22:40 +00:00
Mark Michelson 164549691e Add some clarifying documentation to the ast_str_set and ast_str_append functions.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-16 21:15:38 +00:00
Russell Bryant 1321748c19 Add a test module for the event API, test_event.c.
This module includes a single test so far that creates events using two
different methods and does some verification on the result to make sure
the correct data can be retrieved from the event that was created.

One bug was found in the event API while developing this test, which makes
me happy.  :-)

Review: https://reviewboard.asterisk.org/r/495/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-10 23:19:16 +00:00