[asterisk-commits] irroot: branch irroot/patches r338994 - /team/irroot/patches/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Oct 3 08:10:11 CDT 2011
Author: irroot
Date: Mon Oct 3 08:10:07 2011
New Revision: 338994
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=338994
Log:
Update patches WaitFax is gone replaced with FAXOPT(faxdetect)
Modified:
team/irroot/patches/distrotech-1.8.patch
team/irroot/patches/distrotech-10.patch
team/irroot/patches/distrotech-trunk.patch
team/irroot/patches/t38gateway-1.8.patch
Modified: team/irroot/patches/distrotech-1.8.patch
URL: http://svnview.digium.com/svn/asterisk/team/irroot/patches/distrotech-1.8.patch?view=diff&rev=338994&r1=338993&r2=338994
==============================================================================
--- team/irroot/patches/distrotech-1.8.patch (original)
+++ team/irroot/patches/distrotech-1.8.patch Mon Oct 3 08:10:07 2011
@@ -1,7 +1,7 @@
Index: channels/chan_sip.c
===================================================================
---- channels/chan_sip.c (.../branches/1.8) (revision 338894)
-+++ channels/chan_sip.c (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- channels/chan_sip.c (.../branches/1.8) (revision 338993)
++++ channels/chan_sip.c (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -4317,6 +4317,9 @@
case T38_ENABLED:
state = T38_STATE_NEGOTIATED;
@@ -405,8 +405,8 @@
Index: channels/sip/include/sip.h
===================================================================
---- channels/sip/include/sip.h (.../branches/1.8) (revision 338894)
-+++ channels/sip/include/sip.h (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- channels/sip/include/sip.h (.../branches/1.8) (revision 338993)
++++ channels/sip/include/sip.h (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -352,9 +352,11 @@
@@ -440,8 +440,8 @@
Index: channels/sip/include/sdp_crypto.h
===================================================================
---- channels/sip/include/sdp_crypto.h (.../branches/1.8) (revision 338894)
-+++ channels/sip/include/sdp_crypto.h (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- channels/sip/include/sdp_crypto.h (.../branches/1.8) (revision 338993)
++++ channels/sip/include/sdp_crypto.h (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -31,6 +31,7 @@
#include <asterisk/rtp_engine.h>
@@ -475,8 +475,8 @@
/*! \brief Return the a_crypto value of the sdp_crypto struct
Index: channels/sip/include/srtp.h
===================================================================
---- channels/sip/include/srtp.h (.../branches/1.8) (revision 338894)
-+++ channels/sip/include/srtp.h (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- channels/sip/include/srtp.h (.../branches/1.8) (revision 338993)
++++ channels/sip/include/srtp.h (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -34,6 +34,8 @@
#define SRTP_ENCR_OPTIONAL (1 << 1) /* SRTP encryption optional */
#define SRTP_CRYPTO_ENABLE (1 << 2)
@@ -488,8 +488,8 @@
struct sip_srtp {
Index: channels/sip/sdp_crypto.c
===================================================================
---- channels/sip/sdp_crypto.c (.../branches/1.8) (revision 338894)
-+++ channels/sip/sdp_crypto.c (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- channels/sip/sdp_crypto.c (.../branches/1.8) (revision 338993)
++++ channels/sip/sdp_crypto.c (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -32,6 +32,7 @@
#include "asterisk/options.h"
#include "asterisk/utils.h"
@@ -540,8 +540,8 @@
Index: channels/chan_local.c
===================================================================
---- channels/chan_local.c (.../branches/1.8) (revision 338894)
-+++ channels/chan_local.c (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- channels/chan_local.c (.../branches/1.8) (revision 338993)
++++ channels/chan_local.c (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -650,9 +650,10 @@
static int local_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen)
{
@@ -598,8 +598,8 @@
f.datalen = datalen;
Index: configure.ac
===================================================================
---- configure.ac (.../branches/1.8) (revision 338894)
-+++ configure.ac (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- configure.ac (.../branches/1.8) (revision 338993)
++++ configure.ac (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -1699,7 +1699,7 @@
AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
AST_C_DEFINE_CHECK([MISDN_FAC_RESULT], [Fac_RESULT], [mISDNuser/suppserv.h])
@@ -611,8 +611,8 @@
Index: apps/app_directed_pickup.c
===================================================================
---- apps/app_directed_pickup.c (.../branches/1.8) (revision 338894)
-+++ apps/app_directed_pickup.c (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- apps/app_directed_pickup.c (.../branches/1.8) (revision 338993)
++++ apps/app_directed_pickup.c (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -73,7 +73,10 @@
tries to find a channel which has defined a <variable>PICKUPMARK</variable>
channel variable with the same value as <replaceable>extension</replaceable>
@@ -639,8 +639,8 @@
***/
Index: apps/app_queue.c
===================================================================
---- apps/app_queue.c (.../branches/1.8) (revision 338894)
-+++ apps/app_queue.c (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- apps/app_queue.c (.../branches/1.8) (revision 338993)
++++ apps/app_queue.c (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -524,11 +524,25 @@
<enum name="count">
<para>Returns the total number of members for the specified queue.</para>
@@ -1577,52 +1577,9 @@
.unload = unload_module,
Index: addons/chan_ooh323.c
===================================================================
---- addons/chan_ooh323.c (.../branches/1.8) (revision 338894)
-+++ addons/chan_ooh323.c (.../team/irroot/distrotech-customers-1.8) (revision 338894)
-@@ -25,6 +25,42 @@
- #include "chan_ooh323.h"
- #include <math.h>
-
-+/*** DOCUMENTATION
-+ <function name="OOH323" language="en_US">
-+ <synopsis>
-+ Allow Setting / Reading OOH323 Settings
-+ </synopsis>
-+ <syntax>
-+ <parameter name="name" required="true">
-+ <enumlist>
-+ <enum name="faxdetect">
-+ <para>Fax Detect [R/W]</para>
-+ <para>Returns 0 or 1</para>
-+ <para>Write yes or no</para>
-+ </enum>
-+ </enumlist>
-+ <enumlist>
-+ <enum name="t38support">
-+ <para>t38support [R/W]</para>
-+ <para>Returns 0 or 1</para>
-+ <para>Write yes or no</para>
-+ </enum>
-+ </enumlist>
-+ <enumlist>
-+ <enum name="h323id">
-+ <para>Returns h323id [R]</para>
-+ </enum>
-+ </enumlist>
-+ </parameter>
-+ </syntax>
-+ <description>
-+ <para>Read and set channel parameters in the dialplan.
-+ <replaceable>name</replaceable> is one of the above only those with a [W] can be writen to.
-+ </para>
-+ </description>
-+ </function>
-+***/
-+
- #define FORMAT_STRING_SIZE 512
-
- /* Defaults */
-@@ -50,6 +86,9 @@
+--- addons/chan_ooh323.c (.../branches/1.8) (revision 338993)
++++ addons/chan_ooh323.c (.../team/irroot/distrotech-customers-1.8) (revision 338993)
+@@ -50,6 +50,9 @@
#define T38_ENABLED 1
#define T38_FAXGW 1
@@ -1632,7 +1589,26 @@
/* Channel description */
static const char type[] = "OOH323";
static const char tdesc[] = "Objective Systems H323 Channel Driver";
-@@ -140,6 +179,8 @@
+@@ -79,6 +82,8 @@
+ static int ooh323_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen);
+ static int ooh323_queryoption(struct ast_channel *ast, int option, void *data, int *datalen);
+ static int ooh323_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
++static int function_ooh323_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len);
++static int function_ooh323_write(struct ast_channel *chan, const char *cmd, char *data, const char *value);
+
+ static enum ast_rtp_glue_result ooh323_get_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance **rtp);
+ static enum ast_rtp_glue_result ooh323_get_vrtp_peer(struct ast_channel *chan, struct ast_rtp_instance **rtp);
+@@ -113,7 +118,8 @@
+ .queryoption = ooh323_queryoption,
+ .bridge = ast_rtp_instance_bridge, /* XXX chan unlocked ? */
+ .early_bridge = ast_rtp_instance_early_bridge,
+-
++ .func_channel_read = function_ooh323_read,
++ .func_channel_write = function_ooh323_write,
+ };
+
+ static struct ast_rtp_glue ooh323_rtp = {
+@@ -140,6 +146,8 @@
struct ast_rtp_instance *vrtp; /* Placeholder for now */
int t38support; /* T.38 mode - disable, transparent, faxgw */
@@ -1641,7 +1617,7 @@
int rtptimeout;
struct ast_udptl *udptl;
int faxmode;
-@@ -201,25 +242,26 @@
+@@ -201,25 +209,26 @@
/* Profile of H.323 user registered with PBX*/
struct ooh323_user{
ast_mutex_t lock;
@@ -1686,7 +1662,7 @@
struct ooh323_user *next;
};
-@@ -235,6 +277,7 @@
+@@ -235,6 +244,7 @@
int amaflags;
int dtmfmode;
int dtmfcodec;
@@ -1694,7 +1670,7 @@
int t38support;
int mFriend; /* indicates defined as friend */
char ip[20];
-@@ -295,6 +338,7 @@
+@@ -295,6 +305,7 @@
static struct ast_codec_pref gPrefs;
static int gDTMFMode = H323_DTMF_RFC2833;
static int gDTMFCodec = 101;
@@ -1702,7 +1678,7 @@
static int gT38Support = T38_FAXGW;
static char gGatekeeper[100];
static enum RasGatekeeperMode gRasGkMode = RasNoGatekeeper;
-@@ -343,10 +387,12 @@
+@@ -343,10 +354,12 @@
static struct ast_channel *ooh323_new(struct ooh323_pvt *i, int state,
@@ -1716,7 +1692,7 @@
if (gH323Debug)
ast_verbose("--- ooh323_new - %s, %d\n", host, capability);
-@@ -390,18 +436,29 @@
+@@ -390,18 +403,29 @@
ast_module_ref(myself);
/* Allocate dsp for in-band DTMF support */
@@ -1753,7 +1729,7 @@
ast_mutex_lock(&usecnt_lock);
usecnt++;
ast_mutex_unlock(&usecnt_lock);
-@@ -517,6 +574,9 @@
+@@ -517,6 +541,9 @@
ast_udptl_set_error_correction_scheme(pvt->udptl, UDPTL_ERROR_CORRECTION_NONE);
ast_udptl_set_far_max_datagram(pvt->udptl, 144);
pvt->faxmode = 0;
@@ -1763,7 +1739,7 @@
pvt->t38support = gT38Support;
pvt->rtptimeout = gRTPTimeout;
pvt->rtdrinterval = gRTDRInterval;
-@@ -646,6 +706,7 @@
+@@ -646,6 +673,7 @@
p->g729onlyA = peer->g729onlyA;
p->dtmfmode |= peer->dtmfmode;
p->dtmfcodec = peer->dtmfcodec;
@@ -1771,7 +1747,7 @@
p->t38support = peer->t38support;
p->rtptimeout = peer->rtptimeout;
p->faststart = peer->faststart;
-@@ -675,6 +736,7 @@
+@@ -675,6 +703,7 @@
p->g729onlyA = g729onlyA;
p->dtmfmode = gDTMFMode;
p->dtmfcodec = gDTMFCodec;
@@ -1779,7 +1755,7 @@
p->t38support = gT38Support;
p->rtptimeout = gRTPTimeout;
p->capability = gCapability;
-@@ -864,17 +926,7 @@
+@@ -864,17 +893,7 @@
}
ast_mutex_lock(&p->lock);
@@ -1798,7 +1774,7 @@
ast_rtp_instance_dtmf_begin(p->rtp, digit);
} else if (((p->dtmfmode & H323_DTMF_Q931) ||
(p->dtmfmode & H323_DTMF_H245ALPHANUMERIC) ||
-@@ -1309,27 +1361,50 @@
+@@ -1309,27 +1328,50 @@
(int)sizeof(enum ast_control_t38), (int)datalen);
} else {
const struct ast_control_t38_parameters *parameters = data;
@@ -1853,7 +1829,7 @@
default:
;
-@@ -1375,17 +1450,18 @@
+@@ -1375,17 +1417,18 @@
case AST_OPTION_T38_STATE:
if (*datalen != sizeof(enum ast_t38_state)) {
@@ -1879,7 +1855,7 @@
*((enum ast_t38_state *) data) = state;
res = 0;
-@@ -1803,6 +1879,7 @@
+@@ -1803,6 +1846,7 @@
memcpy(&p->prefs, &user->prefs, sizeof(struct ast_codec_pref));
p->dtmfmode |= user->dtmfmode;
p->dtmfcodec = user->dtmfcodec;
@@ -1887,7 +1863,7 @@
p->t38support = user->t38support;
p->rtptimeout = user->rtptimeout;
p->h245tunneling = user->h245tunneling;
-@@ -2225,6 +2302,7 @@
+@@ -2225,6 +2269,7 @@
user->rtptimeout = gRTPTimeout;
user->dtmfmode = gDTMFMode;
user->dtmfcodec = gDTMFCodec;
@@ -1895,7 +1871,7 @@
user->t38support = gT38Support;
user->faststart = gFastStart;
user->h245tunneling = gTunneling;
-@@ -2300,7 +2378,27 @@
+@@ -2300,7 +2345,27 @@
user->dtmfmode |= ast_true(v->value) ? H323_DTMF_INBANDRELAX : 0;
} else if (!strcasecmp(v->name, "dtmfcodec") && atoi(v->value)) {
user->dtmfcodec = atoi(v->value);
@@ -1924,7 +1900,7 @@
if (!strcasecmp(v->value, "disabled"))
user->t38support = T38_DISABLED;
if (!strcasecmp(v->value, "no"))
-@@ -2339,11 +2437,12 @@
+@@ -2339,11 +2404,12 @@
peer->amaflags = gAMAFLAGS;
peer->dtmfmode = gDTMFMode;
peer->dtmfcodec = gDTMFCodec;
@@ -1938,7 +1914,7 @@
if (0 == friend_type) {
peer->mFriend = 1;
}
-@@ -2439,7 +2538,27 @@
+@@ -2439,7 +2505,27 @@
peer->dtmfmode |= ast_true(v->value) ? H323_DTMF_INBANDRELAX : 0;
} else if (!strcasecmp(v->name, "dtmfcodec") && atoi(v->value)) {
peer->dtmfcodec = atoi(v->value);
@@ -1967,7 +1943,7 @@
if (!strcasecmp(v->value, "disabled"))
peer->t38support = T38_DISABLED;
if (!strcasecmp(v->value, "no"))
-@@ -2560,6 +2679,7 @@
+@@ -2560,6 +2646,7 @@
memset(&gPrefs, 0, sizeof(struct ast_codec_pref));
gDTMFMode = H323_DTMF_RFC2833;
gDTMFCodec = 101;
@@ -1975,7 +1951,7 @@
gT38Support = T38_FAXGW;
gTRCLVL = OOTRCLVLERR;
gRasGkMode = RasNoGatekeeper;
-@@ -2756,7 +2876,27 @@
+@@ -2756,7 +2843,27 @@
gDTMFMode |= ast_true(v->value) ? H323_DTMF_INBANDRELAX : 0;
} else if (!strcasecmp(v->name, "dtmfcodec") && atoi(v->value)) {
gDTMFCodec = atoi(v->value);
@@ -2004,7 +1980,7 @@
if (!strcasecmp(v->value, "disabled"))
gT38Support = T38_DISABLED;
if (!strcasecmp(v->value, "no"))
-@@ -2843,14 +2983,13 @@
+@@ -2843,14 +2950,13 @@
if (a->argc != 4)
return CLI_SHOWUSAGE;
@@ -2021,7 +1997,7 @@
prev = peer;
peer = peer->next;
ast_mutex_unlock(&prev->lock);
-@@ -2858,53 +2997,64 @@
+@@ -2858,53 +2964,64 @@
}
if (peer) {
@@ -2128,7 +2104,7 @@
}
ast_mutex_unlock(&peerl.lock);
-@@ -2994,9 +3144,9 @@
+@@ -2994,9 +3111,9 @@
user = userl.users;
while (user) {
ast_mutex_lock(&user->lock);
@@ -2140,7 +2116,7 @@
prev = user;
user = user->next;
ast_mutex_unlock(&prev->lock);
-@@ -3004,53 +3154,64 @@
+@@ -3004,53 +3121,64 @@
}
if (user) {
@@ -2246,7 +2222,7 @@
}
ast_mutex_unlock(&userl.lock);
-@@ -3149,91 +3310,93 @@
+@@ -3149,91 +3277,93 @@
if (a->argc != 3)
return CLI_SHOWUSAGE;
@@ -2402,7 +2378,7 @@
pAlias = pAlias->next;
}
}
-@@ -3250,7 +3413,116 @@
+@@ -3250,7 +3380,109 @@
AST_CLI_DEFINE(handle_cli_ooh323_reload, "reload ooh323 config")
};
@@ -2509,27 +2485,10 @@
+ return res;
+}
+
-+/*! \brief Structure to declare a dialplan function: OOH323 */
-+static struct ast_custom_function ooh323_function = {
-+ .name = "OOH323",
-+ .read = function_ooh323_read,
-+ .write = function_ooh323_write,
-+};
-+
static int load_module(void)
{
int res;
-@@ -3407,6 +3679,9 @@
- restart_monitor();
- }
-
-+ /* Register dialplan functions */
-+ ast_custom_function_register(&ooh323_function);
-+
- return 0;
- }
-
-@@ -3681,7 +3956,7 @@
+@@ -3681,7 +3913,7 @@
ast_mutex_unlock(&userl.lock);
return 0;
}
@@ -2538,20 +2497,16 @@
static int unload_module(void)
{
struct ooh323_pvt *p;
-@@ -3796,8 +4071,11 @@
- }
+@@ -3797,7 +4029,7 @@
ooH323EpDestroy();
-+ /* Unregister dial plan functions */
-+ ast_custom_function_unregister(&ooh323_function);
-+
if (gH323Debug) {
- ast_verbose("+++ ooh323 unload_module \n");
+ ast_verbose("+++ ooh323 unload_module \n");
}
return 0;
-@@ -4262,6 +4540,7 @@
+@@ -4262,6 +4494,7 @@
{
/* Retrieve audio/etc from channel. Assumes p->lock is already held. */
struct ast_frame *f;
@@ -2559,7 +2514,7 @@
static struct ast_frame null_frame = { AST_FRAME_NULL, };
switch (ast->fdno) {
case 0:
-@@ -4286,25 +4565,60 @@
+@@ -4286,25 +4519,60 @@
f = &null_frame;
}
@@ -2634,7 +2589,7 @@
return f;
}
-@@ -4326,6 +4640,7 @@
+@@ -4326,6 +4594,7 @@
if (gH323Debug)
ast_debug(1, "mode for %s is already %d\n", call->callToken,
t38mode);
@@ -2642,7 +2597,7 @@
ast_mutex_unlock(&p->lock);
return;
}
-@@ -4336,11 +4651,13 @@
+@@ -4336,11 +4605,13 @@
DEADLOCK_AVOIDANCE(&p->lock);
}
if (!p->owner) {
@@ -2656,7 +2611,7 @@
ast_mutex_unlock(&p->lock);
ast_log(LOG_ERROR, "Channel has no owner\n");
return;
-@@ -4350,10 +4667,26 @@
+@@ -4350,10 +4621,26 @@
if (p->t38support == T38_ENABLED) {
@@ -2684,7 +2639,7 @@
parameters.request_response = AST_T38_REQUEST_NEGOTIATE;
if (call->T38FarMaxDatagram) {
ast_udptl_set_far_max_datagram(p->udptl, call->T38FarMaxDatagram);
-@@ -4369,6 +4702,7 @@
+@@ -4369,6 +4656,7 @@
¶meters, sizeof(parameters));
p->faxmode = 1;
@@ -2692,7 +2647,7 @@
}
} else {
if (p->t38support == T38_ENABLED) {
-@@ -4380,6 +4714,7 @@
+@@ -4380,6 +4668,7 @@
¶meters, sizeof(parameters));
}
p->faxmode = 0;
@@ -2702,8 +2657,8 @@
Index: Makefile
===================================================================
---- Makefile (.../branches/1.8) (revision 338894)
-+++ Makefile (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- Makefile (.../branches/1.8) (revision 338993)
++++ Makefile (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -127,7 +127,7 @@
# Asterisk.conf is located in ASTETCDIR or by using the -C flag
# when starting Asterisk
@@ -2715,8 +2670,8 @@
# If you use Apache, you may determine by a grep 'DocumentRoot' of your httpd.conf file
Index: funcs/func_channel.c
===================================================================
---- funcs/func_channel.c (.../branches/1.8) (revision 338894)
-+++ funcs/func_channel.c (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- funcs/func_channel.c (.../branches/1.8) (revision 338993)
++++ funcs/func_channel.c (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -89,6 +89,9 @@
<enum name="callgroup">
<para>R/W call groups for call pickup.</para>
@@ -2727,7 +2682,30 @@
<enum name="channeltype">
<para>R/O technology used for channel.</para>
</enum>
-@@ -373,6 +376,9 @@
+@@ -251,6 +254,22 @@
+ The channel is either on hold or a call waiting call.</para>
+ </enum>
+ </enumlist>
++ <para><emphasis>chan_ooh323</emphasis> provides the following additional options:</para>
++ <enumlist>
++ <enum name="faxdetect">
++ <para>Fax Detect [R/W]</para>
++ <para>Returns 0 or 1</para>
++ <para>Write yes or no</para>
++ </enum>
++ <enum name="t38support">
++ <para>t38support [R/W]</para>
++ <para>Returns 0 or 1</para>
++ <para>Write yes or no</para>
++ </enum>
++ <enum name="h323id">
++ <para>Returns h323id [R]</para>
++ </enum>
++ </enumlist>
+ </parameter>
+ </syntax>
+ <description>
+@@ -373,6 +392,9 @@
else if (!strcasecmp(data, "callgroup")) {
char groupbuf[256];
locked_copy_string(chan, buf, ast_print_group(groupbuf, sizeof(groupbuf), chan->callgroup), len);
@@ -2737,7 +2715,7 @@
} else if (!strcasecmp(data, "amaflags")) {
char amabuf[256];
snprintf(amabuf,sizeof(amabuf), "%d", chan->amaflags);
-@@ -458,9 +464,11 @@
+@@ -458,9 +480,11 @@
ast_channel_unlock(chan);
new_zone = ast_tone_zone_unref(new_zone);
}
@@ -2753,8 +2731,8 @@
} else if (!strcasecmp(data, "rxgain")) {
Index: include/asterisk/global_datastores.h
===================================================================
---- include/asterisk/global_datastores.h (.../branches/1.8) (revision 338894)
-+++ include/asterisk/global_datastores.h (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- include/asterisk/global_datastores.h (.../branches/1.8) (revision 338993)
++++ include/asterisk/global_datastores.h (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -28,6 +28,7 @@
extern const struct ast_datastore_info dialed_interface_info;
@@ -2765,8 +2743,8 @@
AST_LIST_ENTRY(ast_dialed_interface) list;
Index: include/asterisk/res_fax.h
===================================================================
---- include/asterisk/res_fax.h (.../branches/1.8) (revision 338894)
-+++ include/asterisk/res_fax.h (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- include/asterisk/res_fax.h (.../branches/1.8) (revision 338993)
++++ include/asterisk/res_fax.h (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -42,6 +42,8 @@
AST_FAX_TECH_T38 = (1 << 3),
/*! sending mulitple documents supported */
@@ -2776,7 +2754,7 @@
};
/*! \brief fax modem capabilities */
-@@ -168,6 +170,10 @@
+@@ -168,6 +170,12 @@
struct ast_fax_t38_parameters our_t38_parameters;
/*! the other endpoint's T.38 session parameters, if any */
struct ast_fax_t38_parameters their_t38_parameters;
@@ -2784,10 +2762,12 @@
+ int gateway_id;
+ /*! the timeout for this gateway in seconds */
+ int gateway_timeout;
++ /*! the id of the faxdetect framehook for this channel */
++ int faxdetect_id;
};
struct ast_fax_tech;
-@@ -204,6 +210,9 @@
+@@ -204,6 +212,9 @@
struct ast_smoother *smoother;
};
@@ -2799,8 +2779,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 338894)
-+++ include/asterisk/dsp.h (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- include/asterisk/dsp.h (.../branches/1.8) (revision 338993)
++++ include/asterisk/dsp.h (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -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 */
@@ -2818,8 +2798,8 @@
#define DSP_TONE_STATE_RINGING 1
Index: main/channel.c
===================================================================
---- main/channel.c (.../branches/1.8) (revision 338894)
-+++ main/channel.c (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- main/channel.c (.../branches/1.8) (revision 338993)
++++ main/channel.c (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -7214,6 +7214,9 @@
long time_left_ms=0;
char caller_warning = 0;
@@ -2864,8 +2844,8 @@
int to;
Index: main/features.c
===================================================================
---- main/features.c (.../branches/1.8) (revision 338894)
-+++ main/features.c (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- main/features.c (.../branches/1.8) (revision 338993)
++++ main/features.c (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -7038,6 +7038,7 @@
struct ast_party_connected_line connected_caller;
struct ast_channel *chans[2] = { chan, target };
@@ -2902,8 +2882,8 @@
}
Index: main/dsp.c
===================================================================
---- main/dsp.c (.../branches/1.8) (revision 338894)
-+++ main/dsp.c (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- main/dsp.c (.../branches/1.8) (revision 338993)
++++ main/dsp.c (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -254,6 +254,20 @@
typedef struct
@@ -3107,8 +3087,8 @@
Index: main/frame.c
===================================================================
---- main/frame.c (.../branches/1.8) (revision 338894)
-+++ main/frame.c (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- main/frame.c (.../branches/1.8) (revision 338993)
++++ main/frame.c (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -413,7 +413,7 @@
out->samples = fr->samples;
out->offset = fr->offset;
@@ -3129,8 +3109,8 @@
out->seqno = f->seqno;
Index: main/global_datastores.c
===================================================================
---- main/global_datastores.c (.../branches/1.8) (revision 338894)
-+++ main/global_datastores.c (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- main/global_datastores.c (.../branches/1.8) (revision 338993)
++++ main/global_datastores.c (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -110,3 +110,7 @@
.destroy = secure_call_store_destroy,
.duplicate = secure_call_store_duplicate,
@@ -3141,8 +3121,8 @@
+};
Index: configs/sip.conf.sample
===================================================================
---- configs/sip.conf.sample (.../branches/1.8) (revision 338894)
-+++ configs/sip.conf.sample (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- configs/sip.conf.sample (.../branches/1.8) (revision 338993)
++++ configs/sip.conf.sample (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -890,6 +890,9 @@
;encryption=no ; Whether to offer SRTP encrypted media (and only SRTP encrypted media)
; on outgoing calls to a peer. Calls will fail with HANGUPCAUSE=58 if
@@ -3155,8 +3135,8 @@
; For additional information on ARA, the Asterisk Realtime Architecture,
Index: configs/chan_ooh323.conf.sample
===================================================================
---- configs/chan_ooh323.conf.sample (.../branches/1.8) (revision 338894)
-+++ configs/chan_ooh323.conf.sample (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- configs/chan_ooh323.conf.sample (.../branches/1.8) (revision 338993)
++++ configs/chan_ooh323.conf.sample (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -122,6 +122,18 @@
;
;roundtrip=x,y
@@ -3178,8 +3158,8 @@
; ------------------ -------------------
Index: configs/queues.conf.sample
===================================================================
---- configs/queues.conf.sample (.../branches/1.8) (revision 338894)
-+++ configs/queues.conf.sample (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- configs/queues.conf.sample (.../branches/1.8) (revision 338993)
++++ configs/queues.conf.sample (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -61,6 +61,16 @@
;
;shared_lastcall=no
@@ -3220,8 +3200,8 @@
; If you wish to have a delay before the member is connected to the caller (or
Index: configs/features.conf.sample
===================================================================
---- configs/features.conf.sample (.../branches/1.8) (revision 338894)
-+++ configs/features.conf.sample (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- configs/features.conf.sample (.../branches/1.8) (revision 338993)
++++ configs/features.conf.sample (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -79,6 +79,10 @@
;xfersound = beep ; to indicate an attended transfer is complete
;xferfailsound = beeperr ; to indicate a failed transfer
@@ -3235,8 +3215,8 @@
;featuredigittimeout = 1000 ; Max time (ms) between digits for
Index: res/res_fax.c
===================================================================
---- res/res_fax.c (.../branches/1.8) (revision 338894)
-+++ res/res_fax.c (.../team/irroot/distrotech-customers-1.8) (revision 338894)
+--- res/res_fax.c (.../branches/1.8) (revision 338993)
++++ res/res_fax.c (.../team/irroot/distrotech-customers-1.8) (revision 338993)
@@ -5,7 +5,24 @@
*
* Dwayne M. Hubbard <dhubbard at digium.com>
@@ -3279,51 +3259,20 @@
/*** DOCUMENTATION
<application name="ReceiveFax" language="en_US">
-@@ -163,6 +183,9 @@
+@@ -163,6 +183,12 @@
<enum name="modem">
<para>R/W Modem type (v17/v27/v29).</para>
</enum>
+ <enum name="gateway">
-+ <para>R/W T38 Gateway Enabled With optional fax activity timeout in seconds (yes[,gwtimeout]/no)</para>
++ <para>R/W T38 fax gateway, with optional fax activity timeout in seconds (yes[,timeout]/no)</para>
++ </enum>
++ <enum name="faxdetect">
++ <para>R/W Enable FAX detect with optional timeout in seconds seconds (yes[,timeout]/no)</para>
+ </enum>
<enum name="pages">
<para>R/O Number of pages transferred.</para>
</enum>
-@@ -196,10 +219,33 @@
- <ref type="application">SendFax</ref>
- </see-also>
- </function>
-+ <application name="WaitFAX" language="en_US">
-+ <synopsis>
-+ Generic Fax Detect CNG/T.38 (Wait For Fax)
-+ </synopsis>
-+ <syntax>
-+ <parameter name="timeout" required="true">
-+ <para>Specifies the number of seconds we attempt to detect a fax tone on the channel</para>
-+ </parameter>
-+ <parameter name="tone" required="false">
-+ <para>Either the tone name defined in the "indications.conf" configuration file,
-+ or a directly specified list of frequencies and durations.</para>
-+ <para>If not specified silence is generated.</para>
-+ </parameter>
-+ <parameter name="noise" required="false">
-+ <para>Number of ms noise detected before proceeding with the dialplan.</para>
-+ </parameter>
-+ </syntax>
-+ <description>
-+ <para>This application sets FAXOPT(status) To SUCCESS | FAILURE | ERROR</para>
-+ <para>FAXOPT(statusstr) will be set to CNG | T38 on SUCCESS or reason on FAILURE | ERROR</para>
-+ </description>
-+ </application>
- ***/
-
- static const char app_receivefax[] = "ReceiveFAX";
- static const char app_sendfax[] = "SendFAX";
-+static const char app_waitfax[] = "WaitFAX";
-
- struct debug_info_history {
- unsigned int consec_frames;
-@@ -213,12 +259,39 @@
+@@ -213,12 +239,57 @@
struct ast_dsp *dsp;
};
@@ -3353,6 +3302,24 @@
+ unsigned int peer_write_format;
+};
+
++/*! \brief used for fax detect framehook */
++struct fax_detect {
++ /*! \brief the start of our timeout counter */
++ struct timeval timeout_start;
++ /*! \brief faxdetect timeout */
++ int timeout;
++ /*! \brief DSP Processor */
++ struct ast_dsp *dsp;
++ /*! \brief original audio formats */
++ unsigned int orig_format;
++ /*! \brief Noise limit to end faxdetect */
++ int noiselim;
++ /*! \brief result of the framehook e[CED]/f[CNG]/n[Noise]/t[T38] */
++ int result;
++ /*! \brief fax session details */
++ struct ast_fax_session_details *details;
++};
++
static int fax_logger_level = -1;
/*! \brief maximum buckets for res_fax ao2 containers */
@@ -3363,11 +3330,13 @@
/*! \brief The faxregistry is used to manage information and statistics for all FAX sessions. */
static struct {
-@@ -393,10 +466,40 @@
+@@ -393,10 +464,42 @@
d->modems = general_options.modems;
d->minrate = general_options.minrate;
d->maxrate = general_options.maxrate;
+ d->gateway_id = -1;
++ d->faxdetect_id = -1;
++ d->gateway_timeout = 0;
return d;
}
@@ -3651,7 +3620,7 @@
ast_string_field_set(details, error, "INIT_ERROR");
set_channel_variables(chan, details);
-+ if (details->caps & AST_FAX_TECH_GATEWAY) {
++ if ((details->caps & AST_FAX_TECH_GATEWAY) && (details->gateway_id > 0)) {
+ ast_string_field_set(details, resultstr, "can't receive a fax on a channel with a T.38 gateway");
+ set_channel_variables(chan, details);
+ ast_log(LOG_ERROR, "executing ReceiveFAX on a channel with a T.38 Gateway is not supported\n");
@@ -3693,7 +3662,7 @@
ast_string_field_set(details, error, "INIT_ERROR");
set_channel_variables(chan, details);
-+ if (details->caps & AST_FAX_TECH_GATEWAY) {
++ if ((details->caps & AST_FAX_TECH_GATEWAY) && (details->gateway_id > 0)) {
+ ast_string_field_set(details, resultstr, "can't send a fax on a channel with a T.38 gateway");
+ set_channel_variables(chan, details);
+ ast_log(LOG_ERROR, "executing SendFAX on a channel with a T.38 Gateway is not supported\n");
@@ -3714,7 +3683,7 @@
ast_test_flag(&opts, OPT_ALLOWAUDIO)) {
details->option.allow_audio = AST_FAX_OPTFLAG_TRUE;
}
-@@ -2287,6 +2446,908 @@
+@@ -2287,6 +2446,951 @@
return (!channel_alive) ? -1 : 0;
}
@@ -4427,203 +4396,246 @@
+ return gateway->framehook;
+}
+
-+/*! \brief Faxdetect loop used by WaitFAX
-+ * \details Run DSP faxdetect on the channel for timeout seconds or until fax is detected
-+ * \param chan channel to run fax detect on
-+ * \param timeout maximum time to wait for fax detection
-+ * \return 0 if nothing was detected 1 on CNG detected 2 if T38 negotiation is started -1 on error*/
-+static int do_waitfax_exec(struct ast_channel *chan, int timeout, int noiselim)
++/*! \brief destroy a FAX detect structure */
++static void destroy_faxdetect(void *data)
+{
-+ int timeleft = timeout;
-+ int res = 0;
-+ int dspnoise = 0;
-+ struct ast_dsp *dsp = NULL;
-+ struct ast_frame *f, *dup_f;
-+ enum ast_t38_state t38state = T38_STATE_UNKNOWN;
-+ unsigned int orig_read_format;
-+ AST_LIST_HEAD_NOLOCK(, ast_frame) deferred_frames;
-+
-+ /* Setup DSP CNG processing */
-+ orig_read_format = chan->readformat;
-+ switch (chan->readformat) {
-+ case AST_FORMAT_SLINEAR:
++ struct fax_detect *faxdetect = data;
++
++ if (faxdetect->dsp) {
++ ast_dsp_free(faxdetect->dsp);
++ faxdetect->dsp = NULL;
++ }
++ ao2_ref(faxdetect->details, -1);
++}
++
++/*! \brief Create a new fax detect object.
++ * \param chan the channel attaching to
++ * \param timeout remove framehook in this time if set
++ * \param noiselim end faxdetect when noiselim ms of noise is detected
++ * \param dsp_detect_flag dsp faxmode detect flags
++ * \return NULL or a fax gateway object
++ */
++static struct fax_detect *fax_detect_new(struct ast_channel *chan, int timeout, int noiselim, int dsp_detect_flag)
++{
++ struct fax_detect *faxdetect = ao2_alloc(sizeof(*faxdetect), destroy_faxdetect);
++ if (!faxdetect) {
++ return NULL;
++ }
++
++ faxdetect->noiselim = noiselim;
++ faxdetect->result = 0;
++
++ if (timeout) {
++ faxdetect->timeout_start = ast_tvnow();
++ } else {
++ faxdetect->timeout_start.tv_sec = 0;
++ faxdetect->timeout_start.tv_usec = 0;
++ }
++
++ faxdetect->dsp = ast_dsp_new();
++ if (!faxdetect->dsp) {
++ ao2_ref(faxdetect, -1);
++ return NULL;
++ }
++
++ ast_dsp_set_features(faxdetect->dsp, DSP_FEATURE_FAX_DETECT);
++ ast_dsp_set_faxmode(faxdetect->dsp, dsp_detect_flag || DSP_FAXMODE_DETECT_SQUELCH);
++ ast_dsp_set_threshold(faxdetect->dsp, ast_dsp_get_threshold_from_settings(THRESHOLD_SILENCE));
++ return faxdetect;
++}
++
++/*! \brief Deref the faxdetect data structure when the faxdetect framehook is detached
++ * \param data framehook data (faxdetect data)*/
++static void fax_detect_framehook_destroy(void *data) {
++ struct fax_detect *faxdetect = data;
++
++ ao2_ref(faxdetect, -1);
++}
++
++/*! \brief Fax Detect Framehook
++ *
++ * Listen for fax tones in audio path and enable jumping to a extension when detected.
++ *
++ * \param chan channel
++ * \param f frame to handle may be NULL
++ * \param event framehook event
++ * \param data framehook data (struct fax_detect *)
++ *
++ * \return processed frame or NULL when f is NULL or a null frame
++ */
++static struct ast_frame *fax_detect_framehook(struct ast_channel *chan, struct ast_frame *f, enum ast_framehook_event event, void *data) {
++ struct fax_detect *faxdetect = data;
++ struct ast_fax_session_details *details;
++ struct ast_control_t38_parameters *control_params;
++ struct ast_channel *peer;
++ int dspnoise;
++
++ details = faxdetect->details;
++
++ switch (event) {
++ case AST_FRAMEHOOK_EVENT_ATTACHED:
++ /* Setup format for DSP on ATTACH*/
++ faxdetect->orig_format = chan->readformat;
++ switch (chan->readformat) {
++ case AST_FORMAT_SLINEAR:
++ break;
++ default:
++ if (ast_set_read_format(chan, AST_FORMAT_SLINEAR)) {
++ ast_framehook_detach(chan, details->faxdetect_id);
++ details->faxdetect_id = -1;
++ return f;
++ }
++ }
++ return NULL;
++ case AST_FRAMEHOOK_EVENT_DETACHED:
++ /* restore audio formats when we are detached */
++ ast_set_read_format(chan, faxdetect->orig_format);
++ if ((peer = ast_bridged_channel(chan))) {
++ ast_channel_make_compatible(chan, peer);
++ }
++ return NULL;
++ case AST_FRAMEHOOK_EVENT_READ:
++ if (f) {
++ break;
++ }
++ default:
++ return f;
++ };
++
++ if (details->faxdetect_id < 0) {
++ return f;
++ }
++
++ if ((!ast_tvzero(faxdetect->timeout_start) &&
++ (ast_tvdiff_ms(ast_tvnow(), faxdetect->timeout_start) > faxdetect->timeout))) {
++ ast_framehook_detach(chan, details->faxdetect_id);
++ details->faxdetect_id = -1;
++ return f;
++ }
++
++ /* only handle VOICE and CONTROL frames*/
++ switch (f->frametype) {
++ case AST_FRAME_VOICE:
++ /* We can only process some formats*/
++ switch (f->subclass.codec) {
++ case AST_FORMAT_SLINEAR:
++ break;
++ default:
++ return f;
++ }
++ break;
++ case AST_FRAME_CONTROL:
++ if (f->subclass.integer == AST_CONTROL_T38_PARAMETERS) {
++ break;
++ }
++ return f;
++ default:
++ return f;
++ }
++
++ if (f->frametype == AST_FRAME_VOICE) {
++ f = ast_dsp_process(chan, faxdetect->dsp, f);
++ if (f->frametype == AST_FRAME_DTMF) {
++ faxdetect->result = f->subclass.integer;
++ } else if ((f->frametype == AST_FRAME_VOICE) && (faxdetect->noiselim > 0)) {
++ ast_dsp_noise(faxdetect->dsp, f, &dspnoise);
++ if (dspnoise > faxdetect->noiselim) {
++ faxdetect->result = 'n';
++ }
++ }
++ } else if ((f->frametype == AST_FRAME_CONTROL) && (f->datalen != sizeof(struct ast_control_t38_parameters))) {
++ control_params = f->data.ptr;
++ switch (control_params->request_response) {
++ case AST_T38_NEGOTIATED:
++ case AST_T38_REQUEST_NEGOTIATE:
++ faxdetect->result = 't';
+ break;
+ default:
-+ if (ast_set_read_format(chan, AST_FORMAT_SLINEAR)) {
-+ return -1;
++ break;
++ }
++ }
++
++ if (faxdetect->result) {
++ const char *target_context = S_OR(chan->macrocontext, chan->context);
++ switch (faxdetect->result) {
++ case 'f':
++ case 't':
++ ast_channel_unlock(chan);
++ if (ast_exists_extension(chan, target_context, "fax", 1,
++ S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) {
++ ast_channel_lock(chan);
++ ast_verbose(VERBOSE_PREFIX_2 "Redirecting '%s' to fax extension due to %s detection\n",
++ chan->name, (faxdetect->result == 'f') ? "CNG" : "T38");
++ pbx_builtin_setvar_helper(chan, "FAXEXTEN", chan->exten);
++ if (ast_async_goto(chan, target_context, "fax", 1)) {
++ ast_log(LOG_NOTICE, "Failed to async goto '%s' into fax of '%s'\n", chan->name, target_context);
++ }
++ ast_frfree(f);
++ f = &ast_null_frame;
++ } else {
++ ast_channel_lock(chan);
++ ast_log(LOG_NOTICE, "FAX %s detected but no fax extension\n",
++ (faxdetect->result == 'f') ? "CNG" : "T38");
+ }
-+ }
-+
-+ if (!(dsp = ast_dsp_new())) {
-+ return -1;
-+ }
-+
-+ ast_dsp_set_features(dsp, DSP_FEATURE_FAX_DETECT);
-+ ast_dsp_set_faxmode(dsp, DSP_FAXMODE_DETECT_CNG | DSP_FAXMODE_DETECT_SQUELCH);
-+ ast_dsp_set_threshold(dsp, ast_dsp_get_threshold_from_settings(THRESHOLD_SILENCE));
-+
-+ AST_LIST_HEAD_INIT_NOLOCK(&deferred_frames);
-+
-+ while ((timeleft = ast_waitfor(chan, timeleft))) {
-+ if (!(f = ast_read(chan))) {
-+ break;
-+ }
-+
-+ if (dsp && (f->frametype == AST_FRAME_VOICE) && ((f->subclass.codec == AST_FORMAT_SLINEAR) ||
-+ (f->subclass.codec == AST_FORMAT_ULAW) || (f->subclass.codec == AST_FORMAT_ALAW))) {
-+ f = ast_dsp_process(chan, dsp, f);
-+ if ((f->frametype == AST_FRAME_DTMF) && (f->subclass.integer == 'f')) {
-+ res = 1;
-+ } else if ((f->frametype == AST_FRAME_VOICE) && (noiselim > 0)) {
-+ ast_dsp_noise(dsp, f, &dspnoise);
-+ if (dspnoise > noiselim) {
-+ break;
-+ }
-+ }
-+ }
-+
-+ if (ast_is_deferrable_frame(f)) {
[... 3319 lines stripped ...]
More information about the asterisk-commits
mailing list