[asterisk-commits] branch group/t38passthrough r30362 - in
/team/group/t38passthrough: ./ apps/ ...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu May 25 12:29:32 MST 2006
Author: mogorman
Date: Thu May 25 14:29:31 2006
New Revision: 30362
URL: http://svn.digium.com/view/asterisk?rev=30362&view=rev
Log:
just fixing small error from kevin so it builds
Modified:
team/group/t38passthrough/ (props changed)
team/group/t38passthrough/apps/app_echo.c
team/group/t38passthrough/apps/app_lookupblacklist.c
team/group/t38passthrough/apps/app_lookupcidname.c
team/group/t38passthrough/apps/app_setcdruserfield.c
team/group/t38passthrough/apps/app_settransfercapability.c
team/group/t38passthrough/codecs/gsm/Makefile
team/group/t38passthrough/funcs/func_channel.c
team/group/t38passthrough/res/res_agi.c
Propchange: team/group/t38passthrough/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu May 25 14:29:31 2006
@@ -1,1 +1,1 @@
-/trunk:1-30333
+/trunk:1-30361
Modified: team/group/t38passthrough/apps/app_echo.c
URL: http://svn.digium.com/view/asterisk/team/group/t38passthrough/apps/app_echo.c?rev=30362&r1=30361&r2=30362&view=diff
==============================================================================
--- team/group/t38passthrough/apps/app_echo.c (original)
+++ team/group/t38passthrough/apps/app_echo.c Thu May 25 14:29:31 2006
@@ -72,26 +72,30 @@
break;
f->delivery.tv_sec = 0;
f->delivery.tv_usec = 0;
- if (f->frametype == AST_FRAME_VOICE) {
- if (ast_write(chan, f))
- break;
- } else if (f->frametype == AST_FRAME_VIDEO) {
- if (ast_write(chan, f))
- break;
- } else if (f->frametype == AST_FRAME_DTMF) {
+ switch (f->frametype) {
+ case AST_FRAME_DTMF:
+ case AST_FRAME_DTMF_END:
if (f->subclass == '#') {
res = 0;
- break;
- } else {
- if (ast_write(chan, f))
- break;
+ ast_frfree(f);
+ goto end;
+ }
+ /* fall through */
+ case AST_FRAME_DTMF_BEGIN:
+ case AST_FRAME_VOICE:
+ case AST_FRAME_VIDEO:
+ case AST_FRAME_TEXT:
+ case AST_FRAME_HTML:
+ case AST_FRAME_IMAGE:
+ if (ast_write(chan, f)) {
+ ast_frfree(f);
+ goto end;
}
}
ast_frfree(f);
}
-
+end:
LOCAL_USER_REMOVE(u);
-
return res;
}
Modified: team/group/t38passthrough/apps/app_lookupblacklist.c
URL: http://svn.digium.com/view/asterisk/team/group/t38passthrough/apps/app_lookupblacklist.c?rev=30362&r1=30361&r2=30362&view=diff
==============================================================================
--- team/group/t38passthrough/apps/app_lookupblacklist.c (original)
+++ team/group/t38passthrough/apps/app_lookupblacklist.c Thu May 25 14:29:31 2006
@@ -65,6 +65,32 @@
LOCAL_USER_DECL;
+static int blacklist_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
+{
+ char blacklist[1];
+ int bl = 0;
+
+ if (chan->cid.cid_num) {
+ if (!ast_db_get("blacklist", chan->cid.cid_num, blacklist, sizeof (blacklist)))
+ bl = 1;
+ }
+ if (chan->cid.cid_name) {
+ if (!ast_db_get("blacklist", chan->cid.cid_name, blacklist, sizeof (blacklist)))
+ bl = 1;
+ }
+
+ snprintf(buf, len, "%d", bl);
+ return 0;
+}
+
+static struct ast_custom_function blacklist_function = {
+ .name = "BLACKLIST",
+ .synopsis = "Check if the callerid is on the blacklist",
+ .desc = "Uses astdb to check if the Caller*ID is in family 'blacklist'. Returns 1 or 0.\n",
+ .syntax = "BLACKLIST()",
+ .read = blacklist_read,
+};
+
static int
lookupblacklist_exec (struct ast_channel *chan, void *data)
{
@@ -72,8 +98,14 @@
struct localuser *u;
int bl = 0;
int priority_jump = 0;
+ static int dep_warning = 0;
LOCAL_USER_ADD(u);
+
+ if (!dep_warning) {
+ dep_warning = 1;
+ ast_log(LOG_WARNING, "LookupBlacklist is deprecated. Please use ${BLACKLIST()} instead.\n");
+ }
if (!ast_strlen_zero(data)) {
if (strchr(data, 'j'))
@@ -112,6 +144,7 @@
int res;
res = ast_unregister_application(app);
+ res |= ast_custom_function_unregister(&blacklist_function);
STANDARD_HANGUP_LOCALUSERS;
@@ -120,7 +153,9 @@
static int load_module(void *mod)
{
- return ast_register_application (app, lookupblacklist_exec, synopsis,descrip);
+ int res = ast_custom_function_register(&blacklist_function);
+ res |= ast_register_application (app, lookupblacklist_exec, synopsis,descrip);
+ return res;
}
static const char *description(void)
Modified: team/group/t38passthrough/apps/app_lookupcidname.c
URL: http://svn.digium.com/view/asterisk/team/group/t38passthrough/apps/app_lookupcidname.c?rev=30362&r1=30361&r2=30362&view=diff
==============================================================================
--- team/group/t38passthrough/apps/app_lookupcidname.c (original)
+++ team/group/t38passthrough/apps/app_lookupcidname.c Thu May 25 14:29:31 2006
@@ -66,8 +66,13 @@
{
char dbname[64];
struct localuser *u;
+ static int dep_warning = 0;
LOCAL_USER_ADD (u);
+ if (!dep_warning) {
+ dep_warning = 1;
+ ast_log(LOG_WARNING, "LookupCIDName is deprecated. Please use ${DB(cidname/${CALLERID(num)})} instead.\n");
+ }
if (chan->cid.cid_num) {
if (!ast_db_get ("cidname", chan->cid.cid_num, dbname, sizeof (dbname))) {
ast_set_callerid (chan, NULL, dbname, NULL);
Modified: team/group/t38passthrough/apps/app_setcdruserfield.c
URL: http://svn.digium.com/view/asterisk/team/group/t38passthrough/apps/app_setcdruserfield.c?rev=30362&r1=30361&r2=30362&view=diff
==============================================================================
--- team/group/t38passthrough/apps/app_setcdruserfield.c (original)
+++ team/group/t38passthrough/apps/app_setcdruserfield.c Thu May 25 14:29:31 2006
@@ -109,11 +109,17 @@
{
struct localuser *u;
int res = 0;
+ static int dep_warning = 0;
LOCAL_USER_ADD(u);
if (chan->cdr && data) {
ast_cdr_setuserfield(chan, (char*)data);
+ }
+
+ if (!dep_warning) {
+ dep_warning = 1;
+ ast_log(LOG_WARNING, "SetCDRUserField is deprecated. Please use CDR(userfield) instead.\n");
}
LOCAL_USER_REMOVE(u);
@@ -125,11 +131,17 @@
{
struct localuser *u;
int res = 0;
+ static int dep_warning = 0;
LOCAL_USER_ADD(u);
if (chan->cdr && data) {
ast_cdr_appenduserfield(chan, (char*)data);
+ }
+
+ if (!dep_warning) {
+ dep_warning = 1;
+ ast_log(LOG_WARNING, "AppendCDRUserField is deprecated. Please use CDR(userfield) instead.\n");
}
LOCAL_USER_REMOVE(u);
Modified: team/group/t38passthrough/apps/app_settransfercapability.c
URL: http://svn.digium.com/view/asterisk/team/group/t38passthrough/apps/app_settransfercapability.c?rev=30362&r1=30361&r2=30362&view=diff
==============================================================================
--- team/group/t38passthrough/apps/app_settransfercapability.c (original)
+++ team/group/t38passthrough/apps/app_settransfercapability.c Thu May 25 14:29:31 2006
@@ -76,9 +76,15 @@
int x;
char *opts;
int transfercapability = -1;
+ static int dep_warning = 0;
LOCAL_USER_ADD(u);
-
+
+ if (!dep_warning) {
+ dep_warning = 1;
+ ast_log(LOG_WARNING, "SetTransferCapability is deprecated. Please use CHANNEL(transfercapability) instead.\n");
+ }
+
if (data)
tmp = ast_strdupa(data);
else
Modified: team/group/t38passthrough/codecs/gsm/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/t38passthrough/codecs/gsm/Makefile?rev=30362&r1=30361&r2=30362&view=diff
==============================================================================
--- team/group/t38passthrough/codecs/gsm/Makefile (original)
+++ team/group/t38passthrough/codecs/gsm/Makefile Thu May 25 14:29:31 2006
@@ -38,9 +38,8 @@
######### probably require gcc.
ifeq (, $(findstring $(OSARCH) , Darwin SunOS ))
-ifeq (, $(findstring $(PROC) , x86_64 amd64 ultrasparc sparc64 arm ppc ppc64 ia64 ))
+ifeq (, $(findstring $(PROC) , x86_64 amd64 ultrasparc sparc64 arm ppc ppc64 ia64 s390))
ifeq (, $(findstring $(shell uname -m) , ppc ppc64 alpha armv4l ))
-ifneq (${PROC},s390)
OPTIMIZE+=-march=$(PROC)
endif
endif
Modified: team/group/t38passthrough/funcs/func_channel.c
URL: http://svn.digium.com/view/asterisk/team/group/t38passthrough/funcs/func_channel.c?rev=30362&r1=30361&r2=30362&view=diff
==============================================================================
--- team/group/t38passthrough/funcs/func_channel.c (original)
+++ team/group/t38passthrough/funcs/func_channel.c Thu May 25 14:29:31 2006
@@ -51,6 +51,12 @@
ast_channel_unlock(chan); \
} while (0)
+char *transfercapability_table[0x20] = {
+ "SPEECH", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK",
+ "DIGITAL", "RESTRICTED_DIGITAL", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK",
+ "3K1AUDIO", "DIGITAL_W_TONES", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK",
+ "VIDEO", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", };
+
static int func_channel_read(struct ast_channel *chan, char *function,
char *data, char *buf, size_t len)
{
@@ -78,6 +84,8 @@
locked_copy_string(chan, buf, ast_state2str(chan->_state), len);
else if (!strcasecmp(data, "channeltype"))
locked_copy_string(chan, buf, chan->tech->type, len);
+ else if (!strcasecmp(data, "transfercapability"))
+ locked_copy_string(chan, buf, transfercapability_table[chan->transfercapability & 0x1f], len);
else if (!strcasecmp(data, "callgroup")) {
char groupbuf[256];
locked_copy_string(chan, buf, ast_print_group(groupbuf, sizeof(groupbuf), chan->callgroup), len);
@@ -107,7 +115,15 @@
ast_channel_setoption(chan, AST_OPTION_TXGAIN, &gainset, sizeof(gainset), 0);
} else if (!strcasecmp(data, "rxgain")) {
sscanf(value, "%hhd", &gainset);
- ast_channel_setoption(chan, AST_OPTION_RXGAIN, &gainset, sizeof(gainset), 0);
+ ast_channel_setoption(chan, AST_OPTION_RXGAIN, &gainset, sizeof(gainset), 0);
+ } else if (!strcasecmp(data, "transfercapability")) {
+ unsigned short i;
+ for (i = 0; i < 0x20; i++) {
+ if (!strcasecmp(transfercapability_table[i], value) && strcmp(value, "UNK")) {
+ chan->transfercapability = i;
+ break;
+ }
+ }
} else if (!chan->tech->func_channel_write
|| chan->tech->func_channel_write(chan, function, data, value)) {
ast_log(LOG_WARNING, "Unknown or unavailable item requested: '%s'\n",
Modified: team/group/t38passthrough/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/team/group/t38passthrough/res/res_agi.c?rev=30362&r1=30361&r2=30362&view=diff
==============================================================================
--- team/group/t38passthrough/res/res_agi.c (original)
+++ team/group/t38passthrough/res/res_agi.c Thu May 25 14:29:31 2006
@@ -90,6 +90,9 @@
" This channel will stop dialplan execution on hangup inside of this\n"
"application, except when using DeadAGI. Otherwise, dialplan execution\n"
"will continue normally.\n"
+" A locally executed AGI script will receive SIGHUP on hangup from the channel\n"
+"except when using DeadAGI. This can be disabled by setting the AGISIGHUP channel\n"
+"variable to \"no\" before executing the AGI application.\n"
" Using 'EAGI' provides enhanced AGI, with incoming audio available out of band\n"
"on file descriptor 3\n\n"
" Use the CLI command 'show agi' to list available agi commands\n"
@@ -1858,8 +1861,11 @@
}
/* Notify process */
if (pid > -1) {
- if (kill(pid, SIGHUP))
- ast_log(LOG_WARNING, "unable to send SIGHUP to AGI process %d: %s\n", pid, strerror(errno));
+ const char *sighup = pbx_builtin_getvar_helper(chan, "AGISIGHUP");
+ if (ast_strlen_zero(sighup) || !ast_false(sighup)) {
+ if (kill(pid, SIGHUP))
+ ast_log(LOG_WARNING, "unable to send SIGHUP to AGI process %d: %s\n", pid, strerror(errno));
+ }
}
fclose(readf);
return returnstatus;
More information about the asterisk-commits
mailing list