[asterisk-commits] mogorman: branch mogorman/asterisk-jabber r41652
- in /team/mogorman/asterisk...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Aug 31 14:59:29 MST 2006
Author: mogorman
Date: Thu Aug 31 16:59:29 2006
New Revision: 41652
URL: http://svn.digium.com/view/asterisk?rev=41652&view=rev
Log:
updated to trunk
Added:
team/mogorman/asterisk-jabber/pbx/ael/ael-test/ael-test15/
- copied from r41651, trunk/pbx/ael/ael-test/ael-test15/
team/mogorman/asterisk-jabber/pbx/ael/ael-test/ael-test15/extensions.ael
- copied unchanged from r41651, trunk/pbx/ael/ael-test/ael-test15/extensions.ael
team/mogorman/asterisk-jabber/pbx/ael/ael-test/ael-test3/telemarket_torture.ael2
- copied unchanged from r41651, trunk/pbx/ael/ael-test/ael-test3/telemarket_torture.ael2
team/mogorman/asterisk-jabber/pbx/ael/ael-test/ref.ael-test15
- copied unchanged from r41651, trunk/pbx/ael/ael-test/ref.ael-test15
Modified:
team/mogorman/asterisk-jabber/ (props changed)
team/mogorman/asterisk-jabber/.cleancount
team/mogorman/asterisk-jabber/Makefile
team/mogorman/asterisk-jabber/UPGRADE.txt
team/mogorman/asterisk-jabber/acinclude.m4
team/mogorman/asterisk-jabber/apps/app_alarmreceiver.c
team/mogorman/asterisk-jabber/apps/app_echo.c
team/mogorman/asterisk-jabber/apps/app_festival.c
team/mogorman/asterisk-jabber/apps/app_followme.c
team/mogorman/asterisk-jabber/apps/app_milliwatt.c
team/mogorman/asterisk-jabber/apps/app_mixmonitor.c
team/mogorman/asterisk-jabber/apps/app_osplookup.c
team/mogorman/asterisk-jabber/apps/app_queue.c
team/mogorman/asterisk-jabber/apps/app_record.c
team/mogorman/asterisk-jabber/apps/app_rpt.c
team/mogorman/asterisk-jabber/cdr/cdr_csv.c
team/mogorman/asterisk-jabber/cdr/cdr_custom.c
team/mogorman/asterisk-jabber/cdr/cdr_manager.c
team/mogorman/asterisk-jabber/cdr/cdr_odbc.c
team/mogorman/asterisk-jabber/cdr/cdr_pgsql.c
team/mogorman/asterisk-jabber/cdr/cdr_radius.c
team/mogorman/asterisk-jabber/cdr/cdr_tds.c
team/mogorman/asterisk-jabber/channels/chan_agent.c
team/mogorman/asterisk-jabber/channels/chan_alsa.c
team/mogorman/asterisk-jabber/channels/chan_features.c
team/mogorman/asterisk-jabber/channels/chan_h323.c
team/mogorman/asterisk-jabber/channels/chan_iax2.c
team/mogorman/asterisk-jabber/channels/chan_jingle.c
team/mogorman/asterisk-jabber/channels/chan_local.c
team/mogorman/asterisk-jabber/channels/chan_mgcp.c
team/mogorman/asterisk-jabber/channels/chan_misdn.c
team/mogorman/asterisk-jabber/channels/chan_oss.c
team/mogorman/asterisk-jabber/channels/chan_phone.c
team/mogorman/asterisk-jabber/channels/chan_sip.c
team/mogorman/asterisk-jabber/channels/chan_skinny.c
team/mogorman/asterisk-jabber/channels/chan_vpb.cc
team/mogorman/asterisk-jabber/channels/chan_zap.c
team/mogorman/asterisk-jabber/channels/iax2-parser.c
team/mogorman/asterisk-jabber/channels/iax2-parser.h
team/mogorman/asterisk-jabber/codecs/codec_zap.c
team/mogorman/asterisk-jabber/configs/extensions.ael.sample
team/mogorman/asterisk-jabber/configs/extensions.conf.sample
team/mogorman/asterisk-jabber/configs/features.conf.sample
team/mogorman/asterisk-jabber/configs/sip.conf.sample
team/mogorman/asterisk-jabber/configure
team/mogorman/asterisk-jabber/configure.ac
team/mogorman/asterisk-jabber/doc/channelvariables.txt
team/mogorman/asterisk-jabber/funcs/func_odbc.c
team/mogorman/asterisk-jabber/funcs/func_strings.c
team/mogorman/asterisk-jabber/include/asterisk/channel.h
team/mogorman/asterisk-jabber/include/asterisk/chanspy.h
team/mogorman/asterisk-jabber/include/asterisk/features.h
team/mogorman/asterisk-jabber/include/asterisk/frame.h
team/mogorman/asterisk-jabber/include/asterisk/rtp.h
team/mogorman/asterisk-jabber/include/asterisk/slinfactory.h
team/mogorman/asterisk-jabber/main/abstract_jb.c
team/mogorman/asterisk-jabber/main/app.c
team/mogorman/asterisk-jabber/main/cdr.c
team/mogorman/asterisk-jabber/main/channel.c
team/mogorman/asterisk-jabber/main/dsp.c
team/mogorman/asterisk-jabber/main/file.c
team/mogorman/asterisk-jabber/main/frame.c
team/mogorman/asterisk-jabber/main/pbx.c
team/mogorman/asterisk-jabber/main/rtp.c
team/mogorman/asterisk-jabber/main/slinfactory.c
team/mogorman/asterisk-jabber/main/translate.c
team/mogorman/asterisk-jabber/main/udptl.c
team/mogorman/asterisk-jabber/pbx/ael/ael-test/ael-test3/extensions.ael
team/mogorman/asterisk-jabber/pbx/ael/ael-test/ref.ael-test3
team/mogorman/asterisk-jabber/pbx/ael/ael.flex
team/mogorman/asterisk-jabber/pbx/ael/ael_lex.c
team/mogorman/asterisk-jabber/pbx/pbx_config.c
team/mogorman/asterisk-jabber/pbx/pbx_dundi.c
team/mogorman/asterisk-jabber/res/res_agi.c
team/mogorman/asterisk-jabber/res/res_config_pgsql.c
team/mogorman/asterisk-jabber/res/res_features.c
team/mogorman/asterisk-jabber/res/res_indications.c
team/mogorman/asterisk-jabber/res/res_jabber.c
team/mogorman/asterisk-jabber/res/res_odbc.c
team/mogorman/asterisk-jabber/res/res_smdi.c
team/mogorman/asterisk-jabber/res/res_snmp.c
team/mogorman/asterisk-jabber/utils/ael_main.c
Propchange: team/mogorman/asterisk-jabber/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.
Propchange: team/mogorman/asterisk-jabber/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.
Propchange: team/mogorman/asterisk-jabber/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Thu Aug 31 16:59:29 2006
@@ -21,5 +21,4 @@
config.log
menuselect-tree
autom4te.cache
-muted
makeopts.embed_rules
Propchange: team/mogorman/asterisk-jabber/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Aug 31 16:59:29 2006
@@ -1,1 +1,1 @@
-/trunk:1-40922
+/trunk:1-41651
Modified: team/mogorman/asterisk-jabber/.cleancount
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/.cleancount?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/.cleancount (original)
+++ team/mogorman/asterisk-jabber/.cleancount Thu Aug 31 16:59:29 2006
@@ -1,1 +1,1 @@
-22
+23
Modified: team/mogorman/asterisk-jabber/Makefile
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/Makefile?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/Makefile (original)
+++ team/mogorman/asterisk-jabber/Makefile Thu Aug 31 16:59:29 2006
@@ -647,7 +647,7 @@
- at menuselect/menuselect $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts && echo "menuselect changes saved!" || echo "menuselect changes NOT saved!"
menuselect/menuselect: makeopts menuselect/menuselect.c menuselect/menuselect_curses.c menuselect/menuselect_stub.c menuselect/menuselect.h menuselect/linkedlists.h makeopts
- @unset CC LD AR RANLIB && $(MAKE) -C menuselect
+ @unset CC LD AR RANLIB && $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml sounds/sounds.xml build_tools/embed_modules.xml
@echo "Generating input for menuselect ..."
Modified: team/mogorman/asterisk-jabber/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/UPGRADE.txt?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/UPGRADE.txt (original)
+++ team/mogorman/asterisk-jabber/UPGRADE.txt Thu Aug 31 16:59:29 2006
@@ -96,6 +96,11 @@
not set, it uses the transferee variable. If not set in any channel, it will
attempt to use the last non macro context. If not possible, it will default
to the current context.
+
+* The autofallthrough setting introduced in Asterisk 1.2 now defaults to 'yes';
+ if your dialplan relies on the ability to 'run off the end' of an extension
+ and wait for a new extension without using WaitExten() to accomplish that,
+ you will need set autofallthrough to 'no' in your extensions.conf file.
Command Line Interface:
@@ -298,9 +303,19 @@
option in sip.conf is removed to osp.conf as authpolicy. allowguest option
in sip.conf cannot be set as osp anymore.
+* The Asterisk RTP stack has been changed in regards to RFC2833 reception
+ and transmission. Packets will now be sent with proper duration instead of all
+ at once. If you are receiving calls from a pre-1.4 Asterisk installation you
+ will want to turn on the rfc2833compensate option. Without this option your
+ DTMF reception may act poorly.
+
* The $SIPUSERAGENT dialplan variable is deprecated and will be removed
in coming versions of Asterisk. Please use the dialplan function
SIPCHANINFO(useragent) instead.
+
+* The ALERT_INFO dialplan variable is deprecated and will be removed
+ in coming versions of Asterisk. Please use the dialplan application
+ sipaddheader() to add the "Alert-Info" header to the outbound invite.
The Zap channel:
@@ -383,3 +398,13 @@
server puts a phone on a different server on hold, the remote server will be
responsible for playing the hold music to its local phone that was put on
hold instead of the far end server across the network playing the music.
+
+CDR Records:
+
+* The behavior of the "clid" field of the CDR has always been that it will
+ contain the callerid ANI if it is set, or the callerid number if ANI was not
+ set. When using the "callerid" option for various channel drivers, some
+ would set ANI and some would not. This has been cleared up so that all
+ channel drivers set ANI. If you would like to change the callerid number
+ on the channel from the dialplan and have that change also show up in the
+ CDR, then you *must* set CALLERID(ANI) as well as CALLERID(num).
Modified: team/mogorman/asterisk-jabber/acinclude.m4
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/acinclude.m4?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/acinclude.m4 (original)
+++ team/mogorman/asterisk-jabber/acinclude.m4 Thu Aug 31 16:59:29 2006
@@ -2,7 +2,7 @@
AC_DEFUN([AST_GCC_ATTRIBUTE],
[
-AC_MSG_CHECKING(checking for compiler 'attribute $1' support)
+AC_MSG_CHECKING(for compiler 'attribute $1' support)
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM([static int __attribute__(($1)) test(void) {}],
[]),
Modified: team/mogorman/asterisk-jabber/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/apps/app_alarmreceiver.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/apps/app_alarmreceiver.c (original)
+++ team/mogorman/asterisk-jabber/apps/app_alarmreceiver.c Thu Aug 31 16:59:29 2006
@@ -743,6 +743,7 @@
if(option_verbose >= 4)
ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: No config file\n");
+ return 0;
}
else{
@@ -809,7 +810,7 @@
}
ast_config_destroy(cfg);
}
- return 0;
+ return 1;
}
@@ -831,8 +832,10 @@
static int load_module(void)
{
- load_config();
- return ast_register_application(app, alarmreceiver_exec, synopsis, descrip);
+ if(load_config())
+ return ast_register_application(app, alarmreceiver_exec, synopsis, descrip);
+ else
+ return AST_MODULE_LOAD_DECLINE;
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Alarm Receiver for Asterisk");
Modified: team/mogorman/asterisk-jabber/apps/app_echo.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/apps/app_echo.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/apps/app_echo.c (original)
+++ team/mogorman/asterisk-jabber/apps/app_echo.c Thu Aug 31 16:59:29 2006
@@ -71,19 +71,13 @@
f->delivery.tv_usec = 0;
switch (f->frametype) {
case AST_FRAME_DTMF:
- case AST_FRAME_DTMF_END:
if (f->subclass == '#') {
res = 0;
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:
+ default:
if (ast_write(chan, f)) {
ast_frfree(f);
goto end;
Modified: team/mogorman/asterisk-jabber/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/apps/app_festival.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/apps/app_festival.c (original)
+++ team/mogorman/asterisk-jabber/apps/app_festival.c Thu Aug 31 16:59:29 2006
@@ -533,6 +533,12 @@
static int load_module(void)
{
+ struct ast_config *cfg = ast_config_load(FESTIVAL_CONFIG);
+ if (!cfg) {
+ ast_log(LOG_WARNING, "No such configuration file %s\n", FESTIVAL_CONFIG);
+ return AST_MODULE_LOAD_DECLINE;
+ }
+ ast_config_destroy(cfg);
return ast_register_application(app, festival_exec, synopsis, descrip);
}
Modified: team/mogorman/asterisk-jabber/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/apps/app_followme.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/apps/app_followme.c (original)
+++ team/mogorman/asterisk-jabber/apps/app_followme.c Thu Aug 31 16:59:29 2006
@@ -1098,7 +1098,8 @@
static int load_module(void)
{
- reload_followme();
+ if(!reload_followme())
+ return AST_MODULE_LOAD_DECLINE;
return ast_register_application(app, app_exec, synopsis, descrip);
}
Modified: team/mogorman/asterisk-jabber/apps/app_milliwatt.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/apps/app_milliwatt.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/apps/app_milliwatt.c (original)
+++ team/mogorman/asterisk-jabber/apps/app_milliwatt.c Thu Aug 31 16:59:29 2006
@@ -66,10 +66,16 @@
static int milliwatt_generate(struct ast_channel *chan, void *data, int len, int samples)
{
- struct ast_frame wf;
unsigned char buf[AST_FRIENDLY_OFFSET + 640];
const int maxsamples = sizeof (buf) / sizeof (buf[0]);
int i, *indexp = (int *) data;
+ struct ast_frame wf = {
+ .frametype = AST_FRAME_VOICE,
+ .subclass = AST_FORMAT_ULAW,
+ .offset = AST_FRIENDLY_OFFSET,
+ .data = buf + AST_FRIENDLY_OFFSET,
+ .src = __FUNCTION__,
+ };
/* Instead of len, use samples, because channel.c generator_force
* generate(chan, tmp, 0, 160) ignores len. In any case, len is
@@ -82,17 +88,8 @@
samples = maxsamples;
}
len = samples * sizeof (buf[0]);
- wf.frametype = AST_FRAME_VOICE;
- wf.subclass = AST_FORMAT_ULAW;
- wf.offset = AST_FRIENDLY_OFFSET;
- wf.mallocd = 0;
- wf.data = buf + AST_FRIENDLY_OFFSET;
wf.datalen = len;
wf.samples = samples;
- wf.src = "app_milliwatt";
- wf.delivery.tv_sec = 0;
- wf.delivery.tv_usec = 0;
- wf.prev = wf.next = NULL;
/* create a buffer containing the digital milliwatt pattern */
for(i = 0; i < len; i++)
{
Modified: team/mogorman/asterisk-jabber/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/apps/app_mixmonitor.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/apps/app_mixmonitor.c (original)
+++ team/mogorman/asterisk-jabber/apps/app_mixmonitor.c Thu Aug 31 16:59:29 2006
@@ -191,7 +191,7 @@
of frames if a queue flush was necessary, so process them
*/
for (; f; f = next) {
- next = f->next;
+ next = AST_LIST_NEXT(f, frame_list);
if (write)
ast_writestream(mixmonitor->fs, f);
ast_frfree(f);
Modified: team/mogorman/asterisk-jabber/apps/app_osplookup.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/apps/app_osplookup.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/apps/app_osplookup.c (original)
+++ team/mogorman/asterisk-jabber/apps/app_osplookup.c Thu Aug 31 16:59:29 2006
@@ -1431,10 +1431,11 @@
ast_config_destroy(cfg);
} else {
ast_log(LOG_WARNING, "OSP: Unable to find configuration. OSP support disabled\n");
+ return 0;
}
ast_log(LOG_DEBUG, "OSP: osp_initialized '%d'\n", osp_initialized);
- return 0;
+ return 1;
}
static int osp_unload(void)
@@ -1606,7 +1607,9 @@
{
int res;
- osp_load();
+ if(!osp_load())
+ return AST_MODULE_LOAD_DECLINE;
+
res = ast_cli_register(&osp_cli);
res |= ast_register_application(app1, ospauth_exec, synopsis1, descrip1);
res |= ast_register_application(app2, osplookup_exec, synopsis2, descrip2);
Modified: team/mogorman/asterisk-jabber/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/apps/app_queue.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/apps/app_queue.c (original)
+++ team/mogorman/asterisk-jabber/apps/app_queue.c Thu Aug 31 16:59:29 2006
@@ -3642,7 +3642,7 @@
.read = queue_function_queuememberlist,
};
-static void reload_queues(void)
+static int reload_queues(void)
{
struct call_queue *q;
struct ast_config *cfg;
@@ -3656,7 +3656,7 @@
if (!(cfg = ast_config_load("queues.conf"))) {
ast_log(LOG_NOTICE, "No call queueing config file (queues.conf), so no call queues\n");
- return;
+ return 0;
}
memset(interface, 0, sizeof(interface));
AST_LIST_LOCK(&queues);
@@ -3794,6 +3794,7 @@
}
AST_LIST_TRAVERSE_SAFE_END;
AST_LIST_UNLOCK(&queues);
+ return 1;
}
static int __queues_show(struct mansession *s, int manager, int fd, int argc, char **argv, int queue_show)
@@ -4359,7 +4360,10 @@
static int load_module(void)
{
int res;
-
+ if(!reload_queues())
+ return AST_MODULE_LOAD_DECLINE;
+ if (queue_persistent_members)
+ reload_queue_members();
res = ast_register_application(app, queue_exec, synopsis, descrip);
res |= ast_cli_register(&cli_show_queue);
res |= ast_cli_register(&cli_show_queues);
@@ -4381,12 +4385,6 @@
res |= ast_custom_function_register(&queuewaitingcount_function);
res |= ast_devstate_add(statechange_queue, NULL);
- if (!res) {
- reload_queues();
- if (queue_persistent_members)
- reload_queue_members();
- }
-
return res;
}
Modified: team/mogorman/asterisk-jabber/apps/app_record.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/apps/app_record.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/apps/app_record.c (original)
+++ team/mogorman/asterisk-jabber/apps/app_record.c Thu Aug 31 16:59:29 2006
@@ -302,6 +302,11 @@
}
} else if ((f->frametype == AST_FRAME_DTMF) &&
(f->subclass == terminator)) {
+ res = ast_writestream(s,f);
+
+ if (res) {
+ ast_log(LOG_WARNING,"Problem writing final record frame\n");
+ }
ast_frfree(f);
break;
}
Modified: team/mogorman/asterisk-jabber/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/apps/app_rpt.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/apps/app_rpt.c (original)
+++ team/mogorman/asterisk-jabber/apps/app_rpt.c Thu Aug 31 16:59:29 2006
@@ -7150,7 +7150,7 @@
}
-static void *rpt_master(void *ignore)
+static void *rpt_master(void *config)
{
int i,n;
pthread_attr_t attr;
@@ -7160,7 +7160,7 @@
/* go thru all the specified repeaters */
this = NULL;
n = 0;
- rpt_vars[n].cfg = ast_config_load("rpt.conf");
+ rpt_vars[n].cfg = config;
cfg = rpt_vars[n].cfg;
if (!cfg) {
ast_log(LOG_NOTICE, "Unable to open radio repeater configuration rpt.conf. Radio Repeater disabled.\n");
@@ -8030,7 +8030,12 @@
static int load_module(void)
{
- ast_pthread_create(&rpt_master_thread,NULL,rpt_master,NULL);
+ struct ast_config *cfg = ast_config_load("rpt.conf");
+ if (!cfg) {
+ ast_log(LOG_WARNING, "No such configuration file rpt.conf\n");
+ return AST_MODULE_LOAD_DECLINE;
+ }
+ ast_pthread_create(&rpt_master_thread,NULL,rpt_master,cfg);
/* Register cli extensions */
ast_cli_register(&cli_debug);
Modified: team/mogorman/asterisk-jabber/cdr/cdr_csv.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/cdr/cdr_csv.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/cdr/cdr_csv.c (original)
+++ team/mogorman/asterisk-jabber/cdr/cdr_csv.c Thu Aug 31 16:59:29 2006
@@ -108,13 +108,13 @@
if (!cfg) {
ast_log(LOG_WARNING, "unable to load config: %s\n", config);
- return -1;
+ return 0;
}
var = ast_variable_browse(cfg, "csv");
if (!var) {
ast_config_destroy(cfg);
- return -1;
+ return 0;
}
tmp = ast_variable_retrieve(cfg, "csv", "usegmtime");
@@ -142,7 +142,7 @@
}
ast_config_destroy(cfg);
- return 0;
+ return 1;
}
static int append_string(char *buf, char *s, size_t bufsize)
@@ -321,7 +321,8 @@
{
int res;
- load_config();
+ if(!load_config())
+ return AST_MODULE_LOAD_DECLINE;
res = ast_cdr_register(name, ast_module_info->description, csv_log);
if (res) {
Modified: team/mogorman/asterisk-jabber/cdr/cdr_custom.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/cdr/cdr_custom.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/cdr/cdr_custom.c (original)
+++ team/mogorman/asterisk-jabber/cdr/cdr_custom.c Thu Aug 31 16:59:29 2006
@@ -153,8 +153,9 @@
ast_log(LOG_ERROR, "Unable to register custom CDR handling\n");
if (mf)
fclose(mf);
- }
- return res;
+ return res;
+ } else
+ return AST_MODULE_LOAD_DECLINE;
}
static int reload(void)
Modified: team/mogorman/asterisk-jabber/cdr/cdr_manager.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/cdr/cdr_manager.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/cdr/cdr_manager.c (original)
+++ team/mogorman/asterisk-jabber/cdr/cdr_manager.c Thu Aug 31 16:59:29 2006
@@ -49,7 +49,7 @@
static int enablecdr = 0;
-static void loadconfigurationfile(void)
+static int loadconfigurationfile(void)
{
char *cat;
struct ast_config *cfg;
@@ -59,7 +59,7 @@
if (!cfg) {
/* Standard configuration */
enablecdr = 0;
- return;
+ return 0;
}
cat = ast_category_browse(cfg, NULL);
@@ -80,6 +80,7 @@
}
ast_config_destroy(cfg);
+ return 1;
}
static int manager_log(struct ast_cdr *cdr)
@@ -145,7 +146,8 @@
int res;
/* Configuration file */
- loadconfigurationfile();
+ if(loadconfigurationfile())
+ return AST_MODULE_LOAD_DECLINE;
res = ast_cdr_register(name, "Asterisk Manager Interface CDR Backend", manager_log);
if (res) {
Modified: team/mogorman/asterisk-jabber/cdr/cdr_odbc.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/cdr/cdr_odbc.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/cdr/cdr_odbc.c (original)
+++ team/mogorman/asterisk-jabber/cdr/cdr_odbc.c Thu Aug 31 16:59:29 2006
@@ -253,6 +253,7 @@
cfg = ast_config_load(config);
if (!cfg) {
ast_log(LOG_WARNING, "cdr_odbc: Unable to load config for ODBC CDR's: %s\n", config);
+ res = AST_MODULE_LOAD_DECLINE;
goto out;
}
Modified: team/mogorman/asterisk-jabber/cdr/cdr_pgsql.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/cdr/cdr_pgsql.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/cdr/cdr_pgsql.c (original)
+++ team/mogorman/asterisk-jabber/cdr/cdr_pgsql.c Thu Aug 31 16:59:29 2006
@@ -289,7 +289,7 @@
if (!(cfg = ast_config_load(config))) {
ast_log(LOG_WARNING, "Unable to load config for PostgreSQL CDR's: %s\n", config);
- return 0;
+ return AST_MODULE_LOAD_DECLINE;
}
res = process_my_load_module(cfg);
Modified: team/mogorman/asterisk-jabber/cdr/cdr_radius.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/cdr/cdr_radius.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/cdr/cdr_radius.c (original)
+++ team/mogorman/asterisk-jabber/cdr/cdr_radius.c Thu Aug 31 16:59:29 2006
@@ -247,7 +247,8 @@
if ((tmp = ast_variable_retrieve(cfg, "radius", "radiuscfg")))
ast_copy_string(radiuscfg, tmp, sizeof(radiuscfg));
ast_config_destroy(cfg);
- }
+ } else
+ return AST_MODULE_LOAD_DECLINE;
/* start logging */
rc_openlog("asterisk");
Modified: team/mogorman/asterisk-jabber/cdr/cdr_tds.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/cdr/cdr_tds.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/cdr/cdr_tds.c (original)
+++ team/mogorman/asterisk-jabber/cdr/cdr_tds.c Thu Aug 31 16:59:29 2006
@@ -505,7 +505,10 @@
static int load_module(void)
{
- return tds_load_module();
+ if(!tds_load_module())
+ return AST_MODULE_LOAD_DECLINE;
+ else
+ return AST_MODULE_LOAD_SUCCESS;
}
static int unload_module(void)
Modified: team/mogorman/asterisk-jabber/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/channels/chan_agent.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/channels/chan_agent.c (original)
+++ team/mogorman/asterisk-jabber/channels/chan_agent.c Thu Aug 31 16:59:29 2006
@@ -238,7 +238,8 @@
static struct ast_channel *agent_request(const char *type, int format, void *data, int *cause);
static int agent_devicestate(void *data);
static void agent_logoff_maintenance(struct agent_pvt *p, char *loginchan, long logintime, const char *uniqueid, char *logcommand);
-static int agent_digit(struct ast_channel *ast, char digit);
+static int agent_digit_begin(struct ast_channel *ast, char digit);
+static int agent_digit_end(struct ast_channel *ast, char digit);
static int agent_call(struct ast_channel *ast, char *dest, int timeout);
static int agent_hangup(struct ast_channel *ast);
static int agent_answer(struct ast_channel *ast);
@@ -258,7 +259,8 @@
.capabilities = -1,
.requester = agent_request,
.devicestate = agent_devicestate,
- .send_digit = agent_digit,
+ .send_digit_begin = agent_digit_begin,
+ .send_digit_end = agent_digit_end,
.call = agent_call,
.hangup = agent_hangup,
.answer = agent_answer,
@@ -491,7 +493,8 @@
}
}
break;
- case AST_FRAME_DTMF:
+ case AST_FRAME_DTMF_BEGIN:
+ case AST_FRAME_DTMF_END:
if (!p->acknowledged && (f->subclass == '#')) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "%s acknowledged\n", p->chan->name);
@@ -511,7 +514,9 @@
ast_frfree(f);
f = &ast_null_frame;
}
- break;
+ default:
+ /* pass everything else on through */
+ break;
}
}
@@ -603,15 +608,22 @@
return res;
}
-static int agent_digit(struct ast_channel *ast, char digit)
+static int agent_digit_begin(struct ast_channel *ast, char digit)
{
struct agent_pvt *p = ast->tech_pvt;
int res = -1;
ast_mutex_lock(&p->lock);
- if (p->chan)
- res = p->chan->tech->send_digit(p->chan, digit);
- else
- res = 0;
+ ast_senddigit_begin(p->chan, digit);
+ ast_mutex_unlock(&p->lock);
+ return res;
+}
+
+static int agent_digit_end(struct ast_channel *ast, char digit)
+{
+ struct agent_pvt *p = ast->tech_pvt;
+ int res = -1;
+ ast_mutex_lock(&p->lock);
+ ast_senddigit_end(p->chan, digit);
ast_mutex_unlock(&p->lock);
return res;
}
@@ -1101,7 +1113,7 @@
AST_LIST_TRAVERSE_SAFE_END
AST_LIST_UNLOCK(&agents);
ast_config_destroy(cfg);
- return 0;
+ return 1;
}
static int check_availability(struct agent_pvt *newlyavailable, int needlock)
@@ -2535,6 +2547,11 @@
ast_log(LOG_ERROR, "Unable to register channel class 'Agent'\n");
return -1;
}
+ /* Read in the config */
+ if (!read_agent_config())
+ return AST_MODULE_LOAD_DECLINE;
+ if (persistent_agents)
+ reload_agents();
/* Dialplan applications */
ast_register_application(app, login_exec, synopsis, descrip);
ast_register_application(app2, callback_exec, synopsis2, descrip2);
@@ -2553,10 +2570,6 @@
/* Dialplan Functions */
ast_custom_function_register(&agent_function);
- /* Read in the config */
- read_agent_config();
- if (persistent_agents)
- reload_agents();
return 0;
}
Modified: team/mogorman/asterisk-jabber/channels/chan_alsa.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/channels/chan_alsa.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/channels/chan_alsa.c (original)
+++ team/mogorman/asterisk-jabber/channels/chan_alsa.c Thu Aug 31 16:59:29 2006
@@ -203,7 +203,7 @@
.description = tdesc,
.capabilities = AST_FORMAT_SLINEAR,
.requester = alsa_request,
- .send_digit = alsa_digit,
+ .send_digit_end = alsa_digit,
.send_text = alsa_text,
.hangup = alsa_hangup,
.answer = alsa_answer,
Modified: team/mogorman/asterisk-jabber/channels/chan_features.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/channels/chan_features.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/channels/chan_features.c (original)
+++ team/mogorman/asterisk-jabber/channels/chan_features.c Thu Aug 31 16:59:29 2006
@@ -95,7 +95,8 @@
#define SUB_THREEWAY 2 /* Three-way call */
static struct ast_channel *features_request(const char *type, int format, void *data, int *cause);
-static int features_digit(struct ast_channel *ast, char digit);
+static int features_digit_begin(struct ast_channel *ast, char digit);
+static int features_digit_end(struct ast_channel *ast, char digit);
static int features_call(struct ast_channel *ast, char *dest, int timeout);
static int features_hangup(struct ast_channel *ast);
static int features_answer(struct ast_channel *ast);
@@ -109,7 +110,8 @@
.description = tdesc,
.capabilities = -1,
.requester = features_request,
- .send_digit = features_digit,
+ .send_digit_begin = features_digit_begin,
+ .send_digit_end = features_digit_end,
.call = features_call,
.hangup = features_hangup,
.answer = features_answer,
@@ -300,7 +302,7 @@
return res;
}
-static int features_digit(struct ast_channel *ast, char digit)
+static int features_digit_begin(struct ast_channel *ast, char digit)
{
struct feature_pvt *p = ast->tech_pvt;
int res = -1;
@@ -310,7 +312,23 @@
ast_mutex_lock(&p->lock);
x = indexof(p, ast, 0);
if (!x && p->subchan)
- res = ast_senddigit(p->subchan, digit);
+ res = ast_senddigit_begin(p->subchan, digit);
+ ast_mutex_unlock(&p->lock);
+
+ return res;
+}
+
+static int features_digit_end(struct ast_channel *ast, char digit)
+{
+ struct feature_pvt *p = ast->tech_pvt;
+ int res = -1;
+ int x;
+
+ /* Queue up a frame representing the indication as a control frame */
+ ast_mutex_lock(&p->lock);
+ x = indexof(p, ast, 0);
+ if (!x && p->subchan)
+ res = ast_senddigit_end(p->subchan, digit);
ast_mutex_unlock(&p->lock);
return res;
}
Modified: team/mogorman/asterisk-jabber/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/channels/chan_h323.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/channels/chan_h323.c (original)
+++ team/mogorman/asterisk-jabber/channels/chan_h323.c Thu Aug 31 16:59:29 2006
@@ -220,7 +220,8 @@
static int h323_do_reload(void);
static struct ast_channel *oh323_request(const char *type, int format, void *data, int *cause);
-static int oh323_digit(struct ast_channel *c, char digit);
+static int oh323_digit_begin(struct ast_channel *c, char digit);
+static int oh323_digit_end(struct ast_channel *c, char digit);
static int oh323_call(struct ast_channel *c, char *dest, int timeout);
static int oh323_hangup(struct ast_channel *c);
static int oh323_answer(struct ast_channel *c);
@@ -235,7 +236,8 @@
.capabilities = ((AST_FORMAT_MAX_AUDIO << 1) - 1),
.properties = AST_CHAN_TP_WANTSJITTER | AST_CHAN_TP_CREATESJITTER,
.requester = oh323_request,
- .send_digit = oh323_digit,
+ .send_digit_begin = oh323_digit_begin,
+ .send_digit_end = oh323_digit_end,
.call = oh323_call,
.hangup = oh323_hangup,
.answer = oh323_answer,
@@ -381,11 +383,17 @@
ast_mutex_unlock(&iflock);
}
+static int oh323_digit_begin(struct ast_channel *chan, char digit)
+{
+ /* XXX Implement me, plz, kthx */
+ return 0;
+}
+
/**
* Send (play) the specified digit to the channel.
*
*/
-static int oh323_digit(struct ast_channel *c, char digit)
+static int oh323_digit_end(struct ast_channel *c, char digit)
{
struct oh323_pvt *pvt = (struct oh323_pvt *) c->tech_pvt;
char *token;
@@ -2381,7 +2389,7 @@
}
res = reload_config();
if (res) {
- return 0;
+ return AST_MODULE_LOAD_DECLINE;
} else {
/* Make sure we can register our channel type */
if (ast_channel_register(&oh323_tech)) {
Modified: team/mogorman/asterisk-jabber/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-jabber/channels/chan_iax2.c?rev=41652&r1=41651&r2=41652&view=diff
==============================================================================
--- team/mogorman/asterisk-jabber/channels/chan_iax2.c (original)
+++ team/mogorman/asterisk-jabber/channels/chan_iax2.c Thu Aug 31 16:59:29 2006
@@ -621,11 +621,11 @@
};
static struct ast_iax2_queue {
- struct iax_frame *head;
- struct iax_frame *tail;
+ AST_LIST_HEAD(, iax_frame) queue;
int count;
- ast_mutex_t lock;
-} iaxq;
+} iaxq = {
+ .queue = AST_LIST_HEAD_INIT_VALUE
+};
static AST_LIST_HEAD_STATIC(users, iax2_user);
@@ -776,7 +776,8 @@
static int iax2_answer(struct ast_channel *c);
static int iax2_call(struct ast_channel *c, char *dest, int timeout);
static int iax2_devicestate(void *data);
-static int iax2_digit(struct ast_channel *c, char digit);
+static int iax2_digit_begin(struct ast_channel *c, char digit);
+static int iax2_digit_end(struct ast_channel *c, char digit);
static int iax2_do_register(struct iax2_registry *reg);
static int iax2_fixup(struct ast_channel *oldchannel, struct ast_channel *newchan);
static int iax2_hangup(struct ast_channel *c);
@@ -809,7 +810,8 @@
.properties = AST_CHAN_TP_WANTSJITTER,
.requester = iax2_request,
.devicestate = iax2_devicestate,
- .send_digit = iax2_digit,
+ .send_digit_begin = iax2_digit_begin,
+ .send_digit_end = iax2_digit_end,
.send_text = iax2_sendtext,
.send_image = iax2_sendimage,
.send_html = iax2_sendhtml,
@@ -1071,11 +1073,12 @@
static struct iax_frame *iaxfrdup2(struct iax_frame *fr)
{
- /* Malloc() a copy of a frame */
struct iax_frame *new = iax_frame_new(DIRECTION_INGRESS, fr->af.datalen);
if (new) {
- memcpy(new, fr, sizeof(struct iax_frame));
+ size_t mallocd_datalen = new->mallocd_datalen;
+ memcpy(new, fr, sizeof(*new));
iax_frame_wrap(new, &fr->af);
+ new->mallocd_datalen = mallocd_datalen;
new->data = NULL;
new->datalen = 0;
new->direction = DIRECTION_INGRESS;
@@ -1754,7 +1757,7 @@
ast_queue_hangup(owner);
}
- for (cur = iaxq.head; cur ; cur = cur->next) {
+ AST_LIST_TRAVERSE(&iaxq.queue, cur, list) {
/* Cancel any pending transmissions */
if (cur->callno == pvt->callno)
cur->retries = -1;
@@ -1875,17 +1878,10 @@
/* Do not try again */
if (freeme) {
/* Don't attempt delivery, just remove it from the queue */
- ast_mutex_lock(&iaxq.lock);
- if (f->prev)
- f->prev->next = f->next;
- else
- iaxq.head = f->next;
- if (f->next)
- f->next->prev = f->prev;
- else
- iaxq.tail = f->prev;
+ AST_LIST_LOCK(&iaxq.queue);
+ AST_LIST_REMOVE(&iaxq.queue, f, list);
iaxq.count--;
- ast_mutex_unlock(&iaxq.lock);
+ AST_LIST_UNLOCK(&iaxq.queue);
f->retrans = -1;
/* Free the IAX frame */
iax2_frame_free(f);
@@ -2082,7 +2078,7 @@
int cnt = 0, dead=0, final=0;
if (argc != 3)
return RESULT_SHOWUSAGE;
- for (cur = iaxq.head; cur ; cur = cur->next) {
+ AST_LIST_TRAVERSE(&iaxq.queue, cur, list) {
if (cur->retries < 0)
dead++;
if (cur->final)
@@ -2092,7 +2088,8 @@
ast_cli(fd, " IAX Statistics\n");
ast_cli(fd, "---------------------\n");
ast_cli(fd, "Outstanding frames: %d (%d ingress, %d egress)\n", iax_get_frames(), iax_get_iframes(), iax_get_oframes());
- ast_cli(fd, "Packets in transmit queue: %d dead, %d final, %d total\n", dead, final, cnt);
+ ast_cli(fd, "Packets in transmit queue: %d dead, %d final, %d total\n\n", dead, final, cnt);
+
return RESULT_SUCCESS;
}
@@ -2369,24 +2366,13 @@
static int iax2_transmit(struct iax_frame *fr)
{
/* Lock the queue and place this packet at the end */
- fr->next = NULL;
- fr->prev = NULL;
/* By setting this to 0, the network thread will send it for us, and
queue retransmission if necessary */
fr->sentyet = 0;
- ast_mutex_lock(&iaxq.lock);
- if (!iaxq.head) {
- /* Empty queue */
- iaxq.head = fr;
- iaxq.tail = fr;
- } else {
- /* Double link */
- iaxq.tail->next = fr;
- fr->prev = iaxq.tail;
- iaxq.tail = fr;
- }
+ AST_LIST_LOCK(&iaxq.queue);
+ AST_LIST_INSERT_TAIL(&iaxq.queue, fr, list);
iaxq.count++;
- ast_mutex_unlock(&iaxq.lock);
+ AST_LIST_UNLOCK(&iaxq.queue);
/* Wake up the network and scheduler thread */
pthread_kill(netthreadid, SIGURG);
signal_condition(&sched_lock, &sched_cond);
@@ -2395,9 +2381,14 @@
-static int iax2_digit(struct ast_channel *c, char digit)
-{
- return send_command_locked(PTR_TO_CALLNO(c->tech_pvt), AST_FRAME_DTMF, digit, 0, NULL, 0, -1);
+static int iax2_digit_begin(struct ast_channel *c, char digit)
+{
+ return send_command_locked(PTR_TO_CALLNO(c->tech_pvt), AST_FRAME_DTMF_BEGIN, digit, 0, NULL, 0, -1);
+}
+
+static int iax2_digit_end(struct ast_channel *c, char digit)
+{
+ return send_command_locked(PTR_TO_CALLNO(c->tech_pvt), AST_FRAME_DTMF_END, digit, 0, NULL, 0, -1);
}
static int iax2_sendtext(struct ast_channel *c, const char *text)
@@ -4803,6 +4794,7 @@
struct iax2_user *user = NULL;
struct iax_ie_data ied;
int res = -1, authreq_restrict = 0;
+ char challenge[10];
memset(&ied, 0, sizeof(ied));
@@ -4831,7 +4823,8 @@
iax_ie_append_short(&ied, IAX_IE_AUTHMETHODS, p->authmethods);
if (p->authmethods & (IAX_AUTH_MD5 | IAX_AUTH_RSA)) {
- ast_string_field_build(p,challenge, "%d", (int)ast_random());
+ snprintf(challenge, sizeof(challenge), "%d", (int)ast_random());
+ ast_string_field_set(p, challenge, challenge);
/* snprintf(p->challenge, sizeof(p->challenge), "%d", (int)ast_random()); */
iax_ie_append_str(&ied, IAX_IE_CHALLENGE, p->challenge);
}
[... 7189 lines stripped ...]
More information about the asterisk-commits
mailing list