asterisk/channels
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
..
h323 Expand codec bitfield from 32 bits to 64 bits. 2009-11-04 14:05:12 +00:00
misdn Whitespace change. 2009-10-02 01:49:25 +00:00
sip Improve handling of T.38 re-INVITEs that arrive before a T.38-capable 2010-03-25 15:27:31 +00:00
xpmr AST-2009-005 2009-08-10 19:20:57 +00:00
Makefile Change per-file debug and verbose levels to be per-module, the way 2010-03-23 14:22:27 +00:00
chan_agent.c small correction from 241314 2010-01-19 18:51:19 +00:00
chan_alsa.c fixes adaptive jitterbuffer configuration 2010-03-02 19:08:38 +00:00
chan_bridge.c Expand codec bitfield from 32 bits to 64 bits. 2009-11-04 14:05:12 +00:00
chan_console.c fixes adaptive jitterbuffer configuration 2010-03-02 19:08:38 +00:00
chan_dahdi.c remove unneeded explicit channel in dahdi ioctls 2010-03-25 10:09:24 +00:00
chan_gtalk.c fixes adaptive jitterbuffer configuration 2010-03-02 19:08:38 +00:00
chan_h323.c Only change the RTP ssrc when we see that it has changed 2010-03-12 22:04:51 +00:00
chan_iax2.c Merged revisions 250394 via svnmerge from 2010-03-03 18:03:19 +00:00
chan_jingle.c fixes adaptive jitterbuffer configuration 2010-03-02 19:08:38 +00:00
chan_local.c Removed cdrflags from ast_channel structure. 2010-03-03 19:38:06 +00:00
chan_mgcp.c Only change the RTP ssrc when we see that it has changed 2010-03-12 22:04:51 +00:00
chan_misdn.c Merged revisions 247910 via svnmerge from 2010-02-19 17:33:33 +00:00
chan_multicast_rtp.c Expand codec bitfield from 32 bits to 64 bits. 2009-11-04 14:05:12 +00:00
chan_nbs.c Missed these two channel drivers on the codec_bits merge 2009-11-06 19:38:33 +00:00
chan_oss.c fixes adaptive jitterbuffer configuration 2010-03-02 19:08:38 +00:00
chan_phone.c More 32->64 bit codec conversions. 2009-12-01 20:27:37 +00:00
chan_phone.h rename DialTone.h to chan_phone.h because chan_phone.c is the only file using it 2008-05-28 20:00:21 +00:00
chan_sip.c Improve handling of T.38 re-INVITEs that arrive before a T.38-capable 2010-03-25 15:27:31 +00:00
chan_skinny.c Only change the RTP ssrc when we see that it has changed 2010-03-12 22:04:51 +00:00
chan_unistim.c fixes adaptive jitterbuffer configuration 2010-03-02 19:08:38 +00:00
chan_usbradio.c fixes adaptive jitterbuffer configuration 2010-03-02 19:08:38 +00:00
chan_vpb.cc Formats are inconsistent between even 32-bit and 64-bit Linux. Use casts to ensure both compile. 2010-01-21 15:14:55 +00:00
console_board.c import the recent additions for video console into trunk, 2008-06-29 21:17:14 +00:00
console_gui.c Const-ify the world (or at least a good part of it) 2009-05-21 21:13:09 +00:00
console_video.c (closes issue #13557) 2008-10-09 14:17:33 +00:00
console_video.h implement the 'freeze' function for incoming frames; 2008-06-30 15:45:15 +00:00
iax2-parser.c Informational message, not an error. 2010-01-28 20:00:09 +00:00
iax2-parser.h Expand codec bitfield from 32 bits to 64 bits. 2009-11-04 14:05:12 +00:00
iax2-provision.c AST-2009-005 2009-08-10 19:20:57 +00:00
iax2-provision.h Don't reload a configuration file if nothing has changed. 2007-08-16 21:09:46 +00:00
iax2.h Expand codec bitfield from 32 bits to 64 bits. 2009-11-04 14:05:12 +00:00
misdn_config.c fixes adaptive jitterbuffer configuration 2010-03-02 19:08:38 +00:00
sig_analog.c Simplified dahdi_request() channel selection failed reason/cause code. 2010-03-10 16:55:34 +00:00
sig_analog.h Simplified dahdi_request() channel selection failed reason/cause code. 2010-03-10 16:55:34 +00:00
sig_pri.c Simplified dahdi_request() channel selection failed reason/cause code. 2010-03-10 16:55:34 +00:00
sig_pri.h Minor tweaks and comment updates to chan_dahdi. 2010-03-11 18:07:16 +00:00
vcodecs.c Const-ify the world (or at least a good part of it) 2009-05-21 21:13:09 +00:00
vgrabbers.c free memory used by the x11 grabber when closing it. 2008-07-14 16:50:54 +00:00