[asterisk-commits] irroot: branch irroot/patches r334443 - /team/irroot/patches/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Sep 4 07:08:51 CDT 2011
Author: irroot
Date: Sun Sep 4 07:08:40 2011
New Revision: 334443
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=334443
Log:
Fixup changes to gwtimeout option
Modified:
team/irroot/patches/t38gateway-1.8.patch
Modified: team/irroot/patches/t38gateway-1.8.patch
URL: http://svnview.digium.com/svn/asterisk/team/irroot/patches/t38gateway-1.8.patch?view=diff&rev=334443&r1=334442&r2=334443
==============================================================================
--- team/irroot/patches/t38gateway-1.8.patch (original)
+++ team/irroot/patches/t38gateway-1.8.patch Sun Sep 4 07:08:40 2011
@@ -1,7 +1,7 @@
Index: channels/chan_sip.c
===================================================================
---- channels/chan_sip.c (.../branches/1.8) (revision 333503)
-+++ channels/chan_sip.c (.../team/irroot/t38gateway-1.8) (revision 333503)
+--- channels/chan_sip.c (.../branches/1.8) (revision 334440)
++++ channels/chan_sip.c (.../team/irroot/t38gateway-1.8) (revision 334440)
@@ -4316,6 +4316,9 @@
case T38_ENABLED:
state = T38_STATE_NEGOTIATED;
@@ -42,7 +42,7 @@
transmit_response_reliable(p, "488 Not acceptable here", &p->initreq);
} else if (p->t38.state == T38_ENABLED)
transmit_reinvite_with_sdp(p, FALSE, FALSE);
-@@ -9036,7 +9040,7 @@
+@@ -9037,7 +9041,7 @@
}
}
@@ -51,7 +51,7 @@
ast_debug(3, "Have T.38 but no audio, accepting offer anyway\n");
return 0;
}
-@@ -18948,7 +18952,7 @@
+@@ -18968,7 +18972,7 @@
} else if (!strcasecmp(data, "peername")) {
ast_copy_string(buf, p->peername, len);
} else if (!strcasecmp(data, "t38passthrough")) {
@@ -60,7 +60,7 @@
ast_copy_string(buf, "0", len);
} else { /* T38 is offered or enabled in this call */
ast_copy_string(buf, "1", len);
-@@ -19714,7 +19718,7 @@
+@@ -19734,7 +19738,7 @@
case 606: /* Not Acceptable */
xmitres = transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
if (p->udptl && p->t38.state == T38_LOCAL_REINVITE) {
@@ -69,7 +69,7 @@
/* Try to reset RTP timers */
//ast_rtp_set_rtptimers_onhold(p->rtp);
-@@ -21513,7 +21517,7 @@
+@@ -21533,7 +21537,7 @@
* want to abort the negotiation process
*/
if (p->t38id != -1) {
@@ -78,7 +78,7 @@
transmit_response_reliable(p, "488 Not acceptable here", &p->initreq);
p->t38id = -1;
dialog_unref(p, "unref the dialog ptr from sip_t38_abort, because it held a dialog ptr");
-@@ -22388,7 +22392,7 @@
+@@ -22408,7 +22412,7 @@
} else if (p->t38.state == T38_ENABLED) {
ast_set_flag(&p->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED);
transmit_response_with_t38_sdp(p, "200 OK", req, (reinvite ? XMIT_RELIABLE : (req->ignore ? XMIT_UNRELIABLE : XMIT_CRITICAL)));
@@ -89,8 +89,8 @@
ast_log(LOG_WARNING, "Target does not support required crypto\n");
Index: channels/sip/include/sip.h
===================================================================
---- channels/sip/include/sip.h (.../branches/1.8) (revision 333503)
-+++ channels/sip/include/sip.h (.../team/irroot/t38gateway-1.8) (revision 333503)
+--- channels/sip/include/sip.h (.../branches/1.8) (revision 334440)
++++ channels/sip/include/sip.h (.../team/irroot/t38gateway-1.8) (revision 334440)
@@ -597,7 +597,8 @@
T38_DISABLED = 0, /*!< Not enabled */
T38_LOCAL_REINVITE, /*!< Offered from local - REINVITE */
@@ -103,8 +103,8 @@
/*! \brief Parameters to know status of transfer */
Index: addons/chan_ooh323.c
===================================================================
---- addons/chan_ooh323.c (.../branches/1.8) (revision 333503)
-+++ addons/chan_ooh323.c (.../team/irroot/t38gateway-1.8) (revision 333503)
+--- addons/chan_ooh323.c (.../branches/1.8) (revision 334440)
++++ addons/chan_ooh323.c (.../team/irroot/t38gateway-1.8) (revision 334440)
@@ -25,6 +25,42 @@
#include "chan_ooh323.h"
#include <math.h>
@@ -1228,8 +1228,8 @@
Index: include/asterisk/res_fax.h
===================================================================
---- include/asterisk/res_fax.h (.../branches/1.8) (revision 333503)
-+++ include/asterisk/res_fax.h (.../team/irroot/t38gateway-1.8) (revision 333503)
+--- include/asterisk/res_fax.h (.../branches/1.8) (revision 334440)
++++ include/asterisk/res_fax.h (.../team/irroot/t38gateway-1.8) (revision 334440)
@@ -42,6 +42,8 @@
AST_FAX_TECH_T38 = (1 << 3),
/*! sending mulitple documents supported */
@@ -1262,8 +1262,8 @@
/*! the type of fax session supported with this ast_fax_tech structure */
Index: include/asterisk/dsp.h
===================================================================
---- include/asterisk/dsp.h (.../branches/1.8) (revision 333503)
-+++ include/asterisk/dsp.h (.../team/irroot/t38gateway-1.8) (revision 333503)
+--- include/asterisk/dsp.h (.../branches/1.8) (revision 334440)
++++ include/asterisk/dsp.h (.../team/irroot/t38gateway-1.8) (revision 334440)
@@ -43,9 +43,11 @@
#define DSP_FEATURE_CALL_PROGRESS (DSP_PROGRESS_TALK | DSP_PROGRESS_RINGING | DSP_PROGRESS_BUSY | DSP_PROGRESS_CONGESTION)
#define DSP_FEATURE_WAITDIALTONE (1 << 20) /*!< Enable dial tone detection */
@@ -1281,8 +1281,8 @@
#define DSP_TONE_STATE_RINGING 1
Index: main/dsp.c
===================================================================
---- main/dsp.c (.../branches/1.8) (revision 333503)
-+++ main/dsp.c (.../team/irroot/t38gateway-1.8) (revision 333503)
+--- main/dsp.c (.../branches/1.8) (revision 334440)
++++ main/dsp.c (.../team/irroot/t38gateway-1.8) (revision 334440)
@@ -254,6 +254,20 @@
typedef struct
@@ -1486,8 +1486,8 @@
Index: main/frame.c
===================================================================
---- main/frame.c (.../branches/1.8) (revision 333503)
-+++ main/frame.c (.../team/irroot/t38gateway-1.8) (revision 333503)
+--- main/frame.c (.../branches/1.8) (revision 334440)
++++ main/frame.c (.../team/irroot/t38gateway-1.8) (revision 334440)
@@ -413,7 +413,7 @@
out->samples = fr->samples;
out->offset = fr->offset;
@@ -1508,8 +1508,8 @@
out->seqno = f->seqno;
Index: configs/chan_ooh323.conf.sample
===================================================================
---- configs/chan_ooh323.conf.sample (.../branches/1.8) (revision 333503)
-+++ configs/chan_ooh323.conf.sample (.../team/irroot/t38gateway-1.8) (revision 333503)
+--- configs/chan_ooh323.conf.sample (.../branches/1.8) (revision 334440)
++++ configs/chan_ooh323.conf.sample (.../team/irroot/t38gateway-1.8) (revision 334440)
@@ -122,6 +122,18 @@
;
;roundtrip=x,y
@@ -1531,8 +1531,8 @@
; ------------------ -------------------
Index: res/res_fax.c
===================================================================
---- res/res_fax.c (.../branches/1.8) (revision 333503)
-+++ res/res_fax.c (.../team/irroot/t38gateway-1.8) (revision 333503)
+--- res/res_fax.c (.../branches/1.8) (revision 334440)
++++ res/res_fax.c (.../team/irroot/t38gateway-1.8) (revision 334440)
@@ -5,7 +5,24 @@
*
* Dwayne M. Hubbard <dhubbard at digium.com>
@@ -1575,20 +1575,17 @@
/*** DOCUMENTATION
<application name="ReceiveFax" language="en_US">
-@@ -163,6 +183,12 @@
+@@ -163,6 +183,9 @@
<enum name="modem">
<para>R/W Modem type (v17/v27/v29).</para>
</enum>
+ <enum name="gateway">
-+ <para>R/W T38 Gateway Enabled (yes/no)</para>
-+ </enum>
-+ <enum name="gwtimeout">
-+ <para>R/W Gateway fax activity timeout in seconds (yes/no/seconds)</para>
++ <para>R/W T38 Gateway Enabled With optional fax activity timeout in seconds (yes[,gwtimeout]/no)</para>
+ </enum>
<enum name="pages">
<para>R/O Number of pages transferred.</para>
</enum>
-@@ -196,10 +222,33 @@
+@@ -196,10 +219,33 @@
<ref type="application">SendFax</ref>
</see-also>
</function>
@@ -1622,7 +1619,7 @@
struct debug_info_history {
unsigned int consec_frames;
-@@ -213,12 +262,39 @@
+@@ -213,12 +259,39 @@
struct ast_dsp *dsp;
};
@@ -1662,12 +1659,11 @@
/*! \brief The faxregistry is used to manage information and statistics for all FAX sessions. */
static struct {
-@@ -393,10 +469,41 @@
+@@ -393,10 +466,40 @@
d->modems = general_options.modems;
d->minrate = general_options.minrate;
d->maxrate = general_options.maxrate;
+ d->gateway_id = -1;
-+ d->gateway_timeout = FAX_GATEWAY_TIMEOUT;
return d;
}
@@ -1704,7 +1700,7 @@
/*! \brief returns a reference counted details structure from the channel's fax datastore. If the datastore
* does not exist it will be created */
static struct ast_fax_session_details *find_or_create_details(struct ast_channel *chan)
-@@ -419,6 +526,11 @@
+@@ -419,6 +522,11 @@
}
/* add the datastore to the channel and increment the refcount */
datastore->data = details;
@@ -1716,7 +1712,7 @@
ao2_ref(details, 1);
ast_channel_lock(chan);
ast_channel_datastore_add(chan, datastore);
-@@ -511,6 +623,13 @@
+@@ -511,6 +619,13 @@
ast_build_string(&buf, &size, "MULTI_DOC");
first = 0;
}
@@ -1730,7 +1726,7 @@
return out;
}
-@@ -686,6 +805,19 @@
+@@ -686,6 +801,19 @@
}
}
@@ -1750,7 +1746,7 @@
static void fax_session_release(struct ast_fax_session *s, struct ast_fax_tech_token *token)
{
if (token) {
-@@ -732,6 +864,19 @@
+@@ -732,6 +860,19 @@
ast_free(s->chan_uniqueid);
}
@@ -1770,7 +1766,7 @@
static struct ast_fax_session *fax_session_reserve(struct ast_fax_session_details *details, struct ast_fax_tech_token **token)
{
struct ast_fax_session *s;
-@@ -743,6 +888,8 @@
+@@ -743,6 +884,8 @@
}
s->state = AST_FAX_STATE_INACTIVE;
@@ -1779,7 +1775,7 @@
/* locate a FAX technology module that can handle said requirements
* Note: the requirements have not yet been finalized as T.38
-@@ -781,7 +928,22 @@
+@@ -781,7 +924,22 @@
return s;
}
@@ -1803,7 +1799,7 @@
static struct ast_fax_session *fax_session_new(struct ast_fax_session_details *details, struct ast_channel *chan, struct ast_fax_session *reserved, struct ast_fax_tech_token *token)
{
struct ast_fax_session *s = NULL;
-@@ -792,6 +954,12 @@
+@@ -792,6 +950,12 @@
s = reserved;
ao2_ref(reserved, +1);
@@ -1816,7 +1812,7 @@
if (s->state == AST_FAX_STATE_RESERVED) {
ast_atomic_fetchadd_int(&faxregistry.reserved_sessions, -1);
s->state = AST_FAX_STATE_UNINITIALIZED;
-@@ -834,8 +1002,10 @@
+@@ -834,8 +998,10 @@
}
s->chan = chan;
@@ -1829,7 +1825,7 @@
details->id = s->id = ast_atomic_fetchadd_int(&faxregistry.nextsessionname, 1);
-@@ -935,9 +1105,6 @@
+@@ -935,9 +1101,6 @@
static int report_fax_status(struct ast_channel *chan, struct ast_fax_session_details *details, const char *status)
{
char *filenames = generate_filenames_string(details, "FileName: ", "\r\n");
@@ -1839,7 +1835,7 @@
ast_channel_lock(chan);
if (details->option.statusevents) {
-@@ -945,25 +1112,31 @@
+@@ -945,25 +1108,31 @@
get_manager_event_info(chan, &info);
manager_event(EVENT_FLAG_CALL,
@@ -1875,7 +1871,7 @@
return 0;
}
-@@ -1006,37 +1179,18 @@
+@@ -1006,37 +1175,18 @@
GENERIC_FAX_EXEC_ERROR_QUIET(fax, chan, errorstr, reason); \
} while (0)
@@ -1916,7 +1912,7 @@
case T38_STATE_NEGOTIATING: {
/* the other end already sent us a T.38 reinvite, so we need to prod the channel
* driver into resending their parameters to us if it supports doing so... if
-@@ -1118,13 +1272,6 @@
+@@ -1118,13 +1268,6 @@
return 0;
}
@@ -1930,7 +1926,7 @@
/*! \brief this is the generic FAX session handling function */
static int generic_fax_exec(struct ast_channel *chan, struct ast_fax_session_details *details, struct ast_fax_session *reserved, struct ast_fax_tech_token *token)
{
-@@ -1390,8 +1537,6 @@
+@@ -1390,8 +1533,6 @@
struct ast_frame *frame = NULL;
struct ast_control_t38_parameters t38_parameters;
@@ -1939,7 +1935,7 @@
/* don't send any audio if we've already received a T.38 reinvite */
if (ast_channel_get_t38_state(chan) != T38_STATE_NEGOTIATING) {
/* generate 3 seconds of CED */
-@@ -1551,6 +1696,7 @@
+@@ -1551,6 +1692,7 @@
);
struct ast_flags opts = { 0, };
struct manager_event_info info;
@@ -1947,7 +1943,7 @@
/* initialize output channel variables */
pbx_builtin_setvar_helper(chan, "FAXSTATUS", "FAILED");
-@@ -1579,6 +1725,14 @@
+@@ -1579,6 +1721,14 @@
ast_string_field_set(details, error, "INIT_ERROR");
set_channel_variables(chan, details);
@@ -1962,7 +1958,7 @@
if (details->maxrate < details->minrate) {
ast_atomic_fetchadd_int(&faxregistry.fax_failures, 1);
ast_string_field_set(details, error, "INVALID_ARGUMENTS");
-@@ -1683,7 +1837,8 @@
+@@ -1683,7 +1833,8 @@
details->option.statusevents = AST_FAX_OPTFLAG_TRUE;
}
@@ -1972,7 +1968,7 @@
ast_test_flag(&opts, OPT_ALLOWAUDIO)) {
details->option.allow_audio = AST_FAX_OPTFLAG_TRUE;
}
-@@ -1789,8 +1944,6 @@
+@@ -1789,8 +1940,6 @@
struct ast_frame *frame = NULL;
struct ast_control_t38_parameters t38_parameters;
@@ -1981,7 +1977,7 @@
/* send CNG tone while listening for the receiver to initiate a switch
* to T.38 mode; if they do, stop sending the CNG tone and proceed with
* the switch.
-@@ -2023,6 +2176,7 @@
+@@ -2023,6 +2172,7 @@
);
struct ast_flags opts = { 0, };
struct manager_event_info info;
@@ -1989,7 +1985,7 @@
/* initialize output channel variables */
pbx_builtin_setvar_helper(chan, "FAXSTATUS", "FAILED");
-@@ -2051,6 +2205,14 @@
+@@ -2051,6 +2201,14 @@
ast_string_field_set(details, error, "INIT_ERROR");
set_channel_variables(chan, details);
@@ -2004,7 +2000,7 @@
if (details->maxrate < details->minrate) {
ast_atomic_fetchadd_int(&faxregistry.fax_failures, 1);
ast_string_field_set(details, error, "INVALID_ARGUMENTS");
-@@ -2175,7 +2337,8 @@
+@@ -2175,7 +2333,8 @@
details->option.statusevents = AST_FAX_OPTFLAG_TRUE;
}
@@ -2014,7 +2010,7 @@
ast_test_flag(&opts, OPT_ALLOWAUDIO)) {
details->option.allow_audio = AST_FAX_OPTFLAG_TRUE;
}
-@@ -2287,6 +2450,899 @@
+@@ -2287,6 +2446,904 @@
return (!channel_alive) ? -1 : 0;
}
@@ -2079,7 +2075,7 @@
+ ast_dsp_set_faxmode(gateway->peer_dsp, DSP_FAXMODE_DETECT_V21 | DSP_FAXMODE_DETECT_CED);
+
+ details->caps = AST_FAX_TECH_GATEWAY;
-+ if (!(gateway->s = fax_session_reserve(details, &gateway->token))) {
++ if (details->gateway_timeout && !(gateway->s = fax_session_reserve(details, &gateway->token))) {
+ details->caps |= ~AST_FAX_TECH_GATEWAY;
+ ast_log(LOG_ERROR, "Can't reserve a FAX session, gateway attempt failed.\n");
+ ao2_ref(gateway, -1);
@@ -2163,6 +2159,7 @@
+
+ gateway->t38_state = T38_STATE_NEGOTIATING;
+ gateway->timeout_start = ast_tvnow();
++ details->gateway_timeout = FAX_GATEWAY_TIMEOUT;
+
+ ast_debug(1, "requesting T.38 for gateway session for %s\n", chan->name);
+ return fp;
@@ -2255,6 +2252,7 @@
+ t38_parameters_ast_to_fax(&details->their_t38_parameters, control_params);
+ gateway->t38_state = T38_STATE_UNKNOWN;
+ gateway->timeout_start = ast_tvnow();
++ details->gateway_timeout = FAX_GATEWAY_TIMEOUT;
+ ao2_ref(details, -1);
+ return f;
+ } else if (state == T38_STATE_UNAVAILABLE || state == T38_STATE_REJECTED) {
@@ -2292,6 +2290,7 @@
+ t38_parameters_ast_to_fax(&details->their_t38_parameters, control_params);
+ gateway->t38_state = T38_STATE_UNKNOWN;
+ gateway->timeout_start = ast_tvnow();
++ details->gateway_timeout = FAX_GATEWAY_TIMEOUT;
+
+ ast_debug(1, "%s is attempting to negotiate T.38 after we already sent a negotiation request based on v21 preamble detection\n", active->name);
+ ao2_ref(details, -1);
@@ -2535,7 +2534,9 @@
+ return f;
+ }
+
-+ gateway->timeout_start = ast_tvnow();
++ if (details->gateway_timeout) {
++ gateway->timeout_start = ast_tvnow();
++ }
+
+ /* we are bridged, change r/w formats to SLIN for v21 preamble
+ * detection and T.30 */
@@ -2555,7 +2556,7 @@
+ gateway->bridged = 1;
+ }
+
-+ if (details->gateway_timeout && gateway->bridged && !ast_tvzero(gateway->timeout_start)) {
++ if (gateway->bridged && !ast_tvzero(gateway->timeout_start)) {
+ if (ast_tvdiff_ms(ast_tvnow(), gateway->timeout_start) > details->gateway_timeout) {
+ ast_debug(1, "no fax activity between %s and %s after %d ms, disabling gateway\n", chan->name, peer->name, details->gateway_timeout);
+ ast_framehook_detach(chan, gateway->framehook);
@@ -2914,7 +2915,7 @@
/*! \brief hash callback for ao2 */
static int session_hash_cb(const void *obj, const int flags)
{
-@@ -2558,19 +3614,15 @@
+@@ -2558,19 +3615,15 @@
while ((s = ao2_iterator_next(&i))) {
ao2_lock(s);
@@ -2939,27 +2940,41 @@
ast_free(filenames);
ao2_unlock(s);
-@@ -2689,6 +3741,11 @@
+@@ -2689,6 +3742,9 @@
}
if (!strcasecmp(data, "ecm")) {
ast_copy_string(buf, details->option.ecm ? "yes" : "no", len);
+ } else if (!strcasecmp(data, "t38gateway") || !strcasecmp(data, "gateway") ||
+ !strcasecmp(data, "t38_gateway") || !strcasecmp(data, "faxgateway")) {
+ ast_copy_string(buf, details->gateway_id != -1 ? "yes" : "no", len);
-+ } else if (!strcasecmp(data, "gwtimeout")) {
-+ snprintf(buf, len, "%d", details->gateway_timeout / 1000);
} else if (!strcasecmp(data, "error")) {
ast_copy_string(buf, details->error, len);
} else if (!strcasecmp(data, "filename")) {
-@@ -2763,6 +3820,39 @@
+@@ -2763,6 +3819,43 @@
} else {
ast_log(LOG_WARNING, "Unsupported value '%s' passed to FAXOPT(ecm).\n", value);
}
+ } else if (!strcasecmp(data, "t38gateway") || !strcasecmp(data, "gateway") ||
+ !strcasecmp(data, "t38_gateway") || !strcasecmp(data, "faxgateway")) {
+ const char *val = ast_skip_blanks(value);
++ char *timeout = strchr(val, ',');
++
++ if (timeout) {
++ *timeout++ = '\0';
++ }
++
+ if (ast_true(val)) {
+ if (details->gateway_id < 0) {
++ details->gateway_timeout = 0;
++ if (timeout) {
++ unsigned int gwtimeout;
++ if (sscanf(timeout, "%u", &gwtimeout) == 1) {
++ details->gateway_timeout = gwtimeout * 1000;
++ } else {
++ ast_log(LOG_WARNING, "Unsupported timeout '%s' passed to FAXOPT(%s).\n", timeout, data);
++ }
++ }
++
+ details->gateway_id = fax_gateway_attach(chan, details);
+ if (details->gateway_id < 0) {
+ ast_log(LOG_ERROR, "Error attaching T.38 gateway to channel %s.\n", chan->name);
@@ -2976,22 +2991,10 @@
+ } else {
+ ast_log(LOG_WARNING, "Unsupported value '%s' passed to FAXOPT(%s).\n", value, data);
+ }
-+ } else if (!strcasecmp(data, "gwtimeout")) {
-+ const char *val = ast_skip_blanks(value);
-+ int timeout;
-+ if (ast_true(val)) {
-+ details->gateway_timeout = FAX_GATEWAY_TIMEOUT;
-+ } else if (ast_false(val)) {
-+ details->gateway_timeout = 0;
-+ } else if (sscanf(val, "%d", &timeout) == 1 && timeout > 0) {
-+ details->gateway_timeout = timeout * 1000;
-+ } else {
-+ ast_log(LOG_WARNING, "Unsupported value '%s' passed to FAXOPT(%s).\n", value, data);
-+ }
} else if (!strcasecmp(data, "headerinfo")) {
ast_string_field_set(details, headerinfo, value);
} else if (!strcasecmp(data, "localstationid")) {
-@@ -2813,6 +3903,10 @@
+@@ -2813,6 +3906,10 @@
ast_log(LOG_WARNING, "failed to unregister '%s'\n", app_receivefax);
}
@@ -3002,7 +3005,7 @@
if (fax_logger_level != -1) {
ast_logger_unregister_level("FAX");
}
-@@ -2852,8 +3946,13 @@
+@@ -2852,8 +3949,13 @@
ao2_ref(faxregistry.container, -1);
return AST_MODULE_LOAD_DECLINE;
}
@@ -3019,8 +3022,8 @@
return res;
Index: res/res_fax_spandsp.c
===================================================================
---- res/res_fax_spandsp.c (.../branches/1.8) (revision 333503)
-+++ res/res_fax_spandsp.c (.../team/irroot/t38gateway-1.8) (revision 333503)
+--- res/res_fax_spandsp.c (.../branches/1.8) (revision 334440)
++++ res/res_fax_spandsp.c (.../team/irroot/t38gateway-1.8) (revision 334440)
@@ -5,6 +5,22 @@
*
* Matthew Nicholson <mnicholson at digium.com>
@@ -3175,7 +3178,15 @@
ast_free(p);
s->tech_pvt = NULL;
s->fd = -1;
-@@ -538,6 +586,10 @@
+@@ -496,7 +544,6 @@
+ .subclass.codec = AST_FORMAT_SLINEAR,
+ .src = "res_fax_spandsp_g711",
+ };
+-
+ struct ast_frame *f = &fax_frame;
+
+ ast_timer_ack(p->timer, 1);
+@@ -538,6 +585,10 @@
{
struct spandsp_pvt *p = s->tech_pvt;
@@ -3186,7 +3197,7 @@
/* XXX do we need to lock here? */
if (s->state == AST_FAX_STATE_COMPLETE) {
ast_log(LOG_WARNING, "FAX session '%d' is in the '%s' state.\n", s->id, ast_fax_state_to_str(s->state));
-@@ -551,6 +603,182 @@
+@@ -551,6 +602,189 @@
}
}
@@ -3271,6 +3282,13 @@
+ ast_channel_unlock(s->chan);
+ return -1;
+ }
++
++ /* we can be in T38_STATE_NEGOTIATING or T38_STATE_NEGOTIATED when the
++ * gateway is started. We treat both states the same. */
++ if (p->ast_t38_state == T38_STATE_NEGOTIATING) {
++ p->ast_t38_state = T38_STATE_NEGOTIATED;
++ }
++
+ ast_activate_generator(p->ast_t38_state == T38_STATE_NEGOTIATED ? peer : s->chan, &t30_gen , s);
+
+ set_logging(&p->t38_gw_state.logging, s->details);
@@ -3369,7 +3387,7 @@
/*! \brief */
static int spandsp_fax_start(struct ast_fax_session *s)
{
-@@ -558,6 +786,10 @@
+@@ -558,6 +792,10 @@
s->state = AST_FAX_STATE_OPEN;
@@ -3380,7 +3398,7 @@
if (p->ist38) {
#if SPANDSP_RELEASE_DATE >= 20080725
/* for spandsp shaphots 0.0.6 and higher */
-@@ -627,6 +859,12 @@
+@@ -627,6 +865,12 @@
static int spandsp_fax_cancel(struct ast_fax_session *s)
{
struct spandsp_pvt *p = s->tech_pvt;
@@ -3393,7 +3411,7 @@
t30_terminate(p->t30_state);
p->isdone = 1;
return 0;
-@@ -655,7 +893,7 @@
+@@ -655,7 +899,7 @@
/*! \brief */
static char *spandsp_fax_cli_show_capabilities(int fd)
{
@@ -3402,7 +3420,7 @@
return CLI_SUCCESS;
}
-@@ -663,35 +901,48 @@
+@@ -663,35 +907,48 @@
static char *spandsp_fax_cli_show_session(struct ast_fax_session *s, int fd)
{
struct spandsp_pvt *p = s->tech_pvt;
@@ -3477,7 +3495,7 @@
Added: automerge
+ *
Added: svnmerge-integrated
- + /branches/1.8:1-333385
+ + /branches/1.8:1-334372
Added: automerge-email
+ gregory at distrotech.co.za
More information about the asterisk-commits
mailing list