[asterisk-commits] oej: branch oej/videocaps r168478 - in /team/oej/videocaps: ./ apps/ cdr/ cha...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Jan 12 08:13:11 CST 2009
Author: oej
Date: Mon Jan 12 08:13:10 2009
New Revision: 168478
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168478
Log:
Reset automerge, resolve conflicts
Added:
team/oej/videocaps/apps/app_originate.c
- copied unchanged from r168334, trunk/apps/app_originate.c
team/oej/videocaps/contrib/scripts/sip_nat_settings
- copied unchanged from r168334, trunk/contrib/scripts/sip_nat_settings
team/oej/videocaps/doc/api-1.6.2-changes.txt
- copied unchanged from r168334, trunk/doc/api-1.6.2-changes.txt
team/oej/videocaps/funcs/func_audiohookinherit.c
- copied unchanged from r168334, trunk/funcs/func_audiohookinherit.c
team/oej/videocaps/main/strings.c
- copied unchanged from r168334, trunk/main/strings.c
Modified:
team/oej/videocaps/ (props changed)
team/oej/videocaps/CHANGES
team/oej/videocaps/UPGRADE-1.6.txt
team/oej/videocaps/apps/app_chanisavail.c
team/oej/videocaps/apps/app_chanspy.c
team/oej/videocaps/apps/app_dial.c
team/oej/videocaps/apps/app_directory.c
team/oej/videocaps/apps/app_dumpchan.c
team/oej/videocaps/apps/app_externalivr.c
team/oej/videocaps/apps/app_fax.c
team/oej/videocaps/apps/app_followme.c
team/oej/videocaps/apps/app_jack.c
team/oej/videocaps/apps/app_macro.c
team/oej/videocaps/apps/app_meetme.c
team/oej/videocaps/apps/app_minivm.c
team/oej/videocaps/apps/app_page.c
team/oej/videocaps/apps/app_queue.c
team/oej/videocaps/apps/app_record.c
team/oej/videocaps/apps/app_voicemail.c
team/oej/videocaps/cdr/cdr_adaptive_odbc.c
team/oej/videocaps/cdr/cdr_manager.c
team/oej/videocaps/cdr/cdr_pgsql.c
team/oej/videocaps/cdr/cdr_sqlite3_custom.c
team/oej/videocaps/channels/chan_dahdi.c
team/oej/videocaps/channels/chan_iax2.c
team/oej/videocaps/channels/chan_local.c
team/oej/videocaps/channels/chan_misdn.c
team/oej/videocaps/channels/chan_oss.c
team/oej/videocaps/channels/chan_sip.c
team/oej/videocaps/channels/h323/README
team/oej/videocaps/channels/h323/ast_h323.cxx
team/oej/videocaps/channels/iax2-parser.c
team/oej/videocaps/channels/misdn_config.c
team/oej/videocaps/configs/extconfig.conf.sample
team/oej/videocaps/configs/extensions.conf.sample
team/oej/videocaps/configs/queues.conf.sample
team/oej/videocaps/configs/sip.conf.sample
team/oej/videocaps/configure
team/oej/videocaps/configure.ac
team/oej/videocaps/contrib/scripts/safe_asterisk
team/oej/videocaps/contrib/scripts/sip-friends.sql
team/oej/videocaps/doc/CODING-GUIDELINES
team/oej/videocaps/doc/appdocsxml.dtd
team/oej/videocaps/doc/realtimetext.txt (props changed)
team/oej/videocaps/doc/sip-retransmit.txt (props changed)
team/oej/videocaps/doc/tex/cdrdriver.tex
team/oej/videocaps/doc/tex/odbcstorage.tex
team/oej/videocaps/doc/tex/phoneprov.tex (props changed)
team/oej/videocaps/funcs/func_curl.c
team/oej/videocaps/funcs/func_logic.c
team/oej/videocaps/funcs/func_odbc.c
team/oej/videocaps/funcs/func_realtime.c
team/oej/videocaps/funcs/func_strings.c
team/oej/videocaps/funcs/func_timeout.c
team/oej/videocaps/include/asterisk.h
team/oej/videocaps/include/asterisk/app.h
team/oej/videocaps/include/asterisk/audiohook.h
team/oej/videocaps/include/asterisk/autoconfig.h.in
team/oej/videocaps/include/asterisk/cdr.h
team/oej/videocaps/include/asterisk/channel.h
team/oej/videocaps/include/asterisk/doxyref.h
team/oej/videocaps/include/asterisk/features.h
team/oej/videocaps/include/asterisk/pbx.h
team/oej/videocaps/include/asterisk/strings.h
team/oej/videocaps/include/asterisk/tcptls.h
team/oej/videocaps/include/asterisk/threadstorage.h
team/oej/videocaps/include/asterisk/utils.h
team/oej/videocaps/main/Makefile
team/oej/videocaps/main/app.c
team/oej/videocaps/main/asterisk.c
team/oej/videocaps/main/astobj2.c
team/oej/videocaps/main/audiohook.c
team/oej/videocaps/main/cdr.c
team/oej/videocaps/main/channel.c
team/oej/videocaps/main/cli.c
team/oej/videocaps/main/config.c
team/oej/videocaps/main/db.c
team/oej/videocaps/main/dnsmgr.c
team/oej/videocaps/main/features.c
team/oej/videocaps/main/file.c
team/oej/videocaps/main/frame.c
team/oej/videocaps/main/http.c
team/oej/videocaps/main/indications.c
team/oej/videocaps/main/logger.c
team/oej/videocaps/main/manager.c
team/oej/videocaps/main/pbx.c
team/oej/videocaps/main/rtp.c
team/oej/videocaps/main/tcptls.c
team/oej/videocaps/main/threadstorage.c
team/oej/videocaps/main/translate.c
team/oej/videocaps/main/utils.c
team/oej/videocaps/main/xmldoc.c
team/oej/videocaps/pbx/ael/ael-test/ref.ael-vtest13
team/oej/videocaps/pbx/ael/ael-test/ref.ael-vtest17
team/oej/videocaps/pbx/pbx_ael.c
team/oej/videocaps/pbx/pbx_config.c
team/oej/videocaps/pbx/pbx_dundi.c
team/oej/videocaps/pbx/pbx_realtime.c
team/oej/videocaps/phoneprov/polycom_line.xml (props changed)
team/oej/videocaps/res/res_agi.c
team/oej/videocaps/res/res_clialiases.c
team/oej/videocaps/res/res_config_curl.c
team/oej/videocaps/res/res_config_ldap.c
team/oej/videocaps/res/res_config_odbc.c
team/oej/videocaps/res/res_config_pgsql.c
team/oej/videocaps/res/res_config_sqlite.c
team/oej/videocaps/res/res_http_post.c (contents, props changed)
team/oej/videocaps/res/res_musiconhold.c
team/oej/videocaps/res/res_odbc.c
team/oej/videocaps/res/res_phoneprov.c (contents, props changed)
team/oej/videocaps/res/res_realtime.c
team/oej/videocaps/res/snmp/agent.c
team/oej/videocaps/sounds/Makefile
team/oej/videocaps/utils/ (props changed)
team/oej/videocaps/utils/Makefile
team/oej/videocaps/utils/ael_main.c
team/oej/videocaps/utils/check_expr.c
team/oej/videocaps/utils/conf2ael.c
team/oej/videocaps/utils/extconf.c
team/oej/videocaps/utils/hashtest.c
team/oej/videocaps/utils/hashtest2.c
team/oej/videocaps/utils/refcounter.c
Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
automerge = http://www.codename-pineapple.org/
Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.
Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Jan 12 08:13:10 2009
@@ -1,1 +1,1 @@
-/trunk:1-163975
+/trunk:1-168476
Modified: team/oej/videocaps/CHANGES
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/CHANGES?view=diff&rev=168478&r1=168477&r2=168478
==============================================================================
--- team/oej/videocaps/CHANGES (original)
+++ team/oej/videocaps/CHANGES Mon Jan 12 08:13:10 2009
@@ -30,10 +30,21 @@
after T38 is negotiated. This option is disabled by default.
* If ATTENDED_TRANSFER_COMPLETE_SOUND is set, the sound will be played to the
target of an attended transfer
+ * Added two new configuration options, "qualifygap" and "qualifypeers", which allow
+ finer control over how many peers Asterisk will qualify and the gap between them
+ when all peers need to be qualified at the same time.
+ * Added a new 'ignoresdpversion' option to sip.conf. When this is enabled
+ (either globally or for a specific peer), chan_sip will treat any SDP data
+ it receives as new data and update the media stream accordingly. By
+ default, Asterisk will only modify the media stream if the SDP session
+ version received is different from the current SDP session version. This
+ option is required to interoperate with devices that have non-standard SDP
+ session version implementations (observed with Microsoft OCS). This option
+ is diabled by default.
Skinny Changes
--------------
- * The configuration file now holds seperate sections for devices and lines.
+ * The configuration file now holds separate sections for devices and lines.
Please have a look at configs/skinny.conf.sample and change your skinny.conf
accordingly.
@@ -60,9 +71,13 @@
* Added LOCAL_PEEK, which I have no idea how to use, but Leif Madsen wanted it.
Russell says it's, like, a scope resolution function for LOCAL variables.
Totally. Hopefully, that means more to you than it does to me.
+ * Added AUDIOHOOK_INHERIT. For information on its use, please see the output
+ of "core show function AUDIOHOOK_INHERIT" from the CLI
Applications
------------
+ * DAHDISendCallreroutingFacility parameters are now comma-separated,
+ instead of the old pipe.
* Scheduled meetme conferences may now have their end times extended by
using MeetMeAdmin.
* app_authenticate now gives the ability to select a prompt other than
@@ -70,6 +85,8 @@
* app_directory now pays attention to the searchcontexts setting in
voicemail.conf and will look through all contexts, if no context is
specified in the initial argument.
+ * A new application, Originate, has been introduced, that allows asynchronous
+ call origination from the dialplan.
Miscellaneous
-------------
@@ -87,6 +104,19 @@
which are interpreted as relative to the astvarlibdir setting in asterisk.conf.
* All deprecated CLI commands are removed from the sourcecode. They are now handled
by the new clialiases module. See cli_aliases.conf.sample file.
+ * Times within timespecs are now accurate down to the minute. This is a change
+ from historical Asterisk, which only provided timespecs rounded to the nearest
+ even (read: evenly divisible by 2) minute mark.
+ * The realtime switch now supports an option flag, 'p', which disables searches for
+ pattern matches.
+ * In addition to a time range and date range, timespecs now accept a 5th optional
+ argument, timezone. This allows you to perform time checks on alternate
+ timezones, especially if those daylight savings time ranges vary from your
+ machine's native timezone. See GotoIfTime, ExecIfTime, IFTIME(), and timed
+ includes.
+ * The contrib/scripts/ directory now has a script called sip_nat_settings that will
+ give you the correct output for an asterisk box behind nat. It will give you the
+ externhost and localnet settings.
Asterisk Manager Interface
--------------------------
@@ -696,8 +726,12 @@
is typically placed.
* The configuration method for the "joinempty" and "leavewhenempty" options has
changed to a comma-separated list of methods of determining member availability
- instead of vague terms such as "yes," "loose," "no," and "strict." These old four
- values are still accepted for backwards-compatibility, though.
+ instead of vague terms such as "yes," "loose," "no," and "strict." These old four
+ values are still accepted for backwards-compatibility, though.
+ * The average talktime is now calculated on queues. This information is reported via the
+ CLI commands "queue show" and "queues show"; through the AMI events AgentComplete, QueueSummary,
+ and QueueParams; and through the channelvariable QUEUETALKTIME if setinterfacevar=yes is set for
+ the queue.
MeetMe Changes
--------------
Modified: team/oej/videocaps/UPGRADE-1.6.txt
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/UPGRADE-1.6.txt?view=diff&rev=168478&r1=168477&r2=168478
==============================================================================
--- team/oej/videocaps/UPGRADE-1.6.txt (original)
+++ team/oej/videocaps/UPGRADE-1.6.txt Mon Jan 12 08:13:10 2009
@@ -66,6 +66,11 @@
arguments of AGI applications. After converting to use the ',' delimiter,
change this option to res_agi=1.6.
+* As a side effect of the application delimiter change, many places that used
+ to need quotes in order to get the proper meaning are no longer required.
+ You now only need to quote strings in configuration files if you literally
+ want quotation marks within a string.
+
* The logger.conf option 'rotatetimestamp' has been deprecated in favor of
'rotatestrategy'. This new option supports a 'rotate' strategy that more
closely mimics the system logger in terms of file rotation.
Modified: team/oej/videocaps/apps/app_chanisavail.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/apps/app_chanisavail.c?view=diff&rev=168478&r1=168477&r2=168478
==============================================================================
--- team/oej/videocaps/apps/app_chanisavail.c (original)
+++ team/oej/videocaps/apps/app_chanisavail.c Mon Jan 12 08:13:10 2009
@@ -160,13 +160,13 @@
status = inuse = ast_device_state(trychan);
}
if ((inuse <= 1) && (tempchan = ast_request(tech, chan->nativeformats, number, &status))) {
- ast_str_append(&tmp_availchan, 0, "%s%s", tmp_availchan->used ? "&" : "", tempchan->name);
+ ast_str_append(&tmp_availchan, 0, "%s%s", ast_str_strlen(tmp_availchan) ? "&" : "", tempchan->name);
snprintf(tmp, sizeof(tmp), "%s/%s", tech, number);
- ast_str_append(&tmp_availorig, 0, "%s%s", tmp_availorig->used ? "&" : "", tmp);
+ ast_str_append(&tmp_availorig, 0, "%s%s", ast_str_strlen(tmp_availorig) ? "&" : "", tmp);
snprintf(tmp, sizeof(tmp), "%d", status);
- ast_str_append(&tmp_availstat, 0, "%s%s", tmp_availstat->used ? "&" : "", tmp);
+ ast_str_append(&tmp_availstat, 0, "%s%s", ast_str_strlen(tmp_availstat) ? "&" : "", tmp);
ast_hangup(tempchan);
tempchan = NULL;
@@ -176,16 +176,16 @@
}
} else {
snprintf(tmp, sizeof(tmp), "%d", status);
- ast_str_append(&tmp_availstat, 0, "%s%s", tmp_availstat->used ? "&" : "", tmp);
+ ast_str_append(&tmp_availstat, 0, "%s%s", ast_str_strlen(tmp_availstat) ? "&" : "", tmp);
}
cur = rest;
} while (cur);
}
- pbx_builtin_setvar_helper(chan, "AVAILCHAN", tmp_availchan->str);
+ pbx_builtin_setvar_helper(chan, "AVAILCHAN", ast_str_buffer(tmp_availchan));
/* Store the originally used channel too */
- pbx_builtin_setvar_helper(chan, "AVAILORIGCHAN", tmp_availorig->str);
- pbx_builtin_setvar_helper(chan, "AVAILSTATUS", tmp_availstat->str);
+ pbx_builtin_setvar_helper(chan, "AVAILORIGCHAN", ast_str_buffer(tmp_availorig));
+ pbx_builtin_setvar_helper(chan, "AVAILSTATUS", ast_str_buffer(tmp_availstat));
return 0;
}
Modified: team/oej/videocaps/apps/app_chanspy.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/apps/app_chanspy.c?view=diff&rev=168478&r1=168477&r2=168478
==============================================================================
--- team/oej/videocaps/apps/app_chanspy.c (original)
+++ team/oej/videocaps/apps/app_chanspy.c Mon Jan 12 08:13:10 2009
@@ -760,7 +760,7 @@
char *ptr;
int num;
int num_spyed_upon = 1;
- struct chanspy_ds chanspy_ds;
+ struct chanspy_ds chanspy_ds = { 0, };
if (ast_test_flag(flags, OPTION_EXIT)) {
const char *c;
Modified: team/oej/videocaps/apps/app_dial.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/apps/app_dial.c?view=diff&rev=168478&r1=168477&r2=168478
==============================================================================
--- team/oej/videocaps/apps/app_dial.c (original)
+++ team/oej/videocaps/apps/app_dial.c Mon Jan 12 08:13:10 2009
@@ -1999,6 +1999,10 @@
theapp = pbx_findapp("Macro");
if (theapp && !res) { /* XXX why check res here ? */
+ /* Set peer->exten and peer->context so that MACRO_EXTEN and MACRO_CONTEXT get set */
+ ast_copy_string(peer->context, chan->context, sizeof(peer->context));
+ ast_copy_string(peer->exten, chan->exten, sizeof(peer->exten));
+
replace_macro_delimiter(opt_args[OPT_ARG_CALLEE_MACRO]);
res = pbx_exec(peer, theapp, opt_args[OPT_ARG_CALLEE_MACRO]);
ast_debug(1, "Macro exited with status %d\n", res);
@@ -2090,11 +2094,14 @@
if (gosub_args) {
res9 = pbx_exec(peer, theapp, gosub_args);
if (!res9) {
- ast_pbx_run(peer);
+ struct ast_pbx_args args;
+ /* A struct initializer fails to compile for this case ... */
+ memset(&args, 0, sizeof(args));
+ args.no_hangup_chan = 1;
+ ast_pbx_run_args(peer, &args);
}
ast_free(gosub_args);
- if (option_debug)
- ast_log(LOG_DEBUG, "Gosub exited with status %d\n", res9);
+ ast_debug(1, "Gosub exited with status %d\n", res9);
} else {
ast_log(LOG_ERROR, "Could not Allocate string for Gosub arguments -- Gosub Call Aborted!\n");
}
@@ -2219,14 +2226,9 @@
res = ast_bridge_call(chan, peer, &config);
}
- if (res != AST_PBX_NO_HANGUP_PEER_PARKED && ast_test_flag64(&opts, OPT_PEER_H)) {
- ast_log(LOG_NOTICE, "PEER context: %s; PEER exten: %s; PEER priority: %d\n",
- peer->context, peer->exten, peer->priority);
- }
- if (res != AST_PBX_NO_HANGUP_PEER_PARKED)
- strcpy(peer->context, chan->context);
-
- if (res != AST_PBX_NO_HANGUP_PEER_PARKED && ast_test_flag64(&opts, OPT_PEER_H) && ast_exists_extension(peer, peer->context, "h", 1, peer->cid.cid_num)) {
+ strcpy(peer->context, chan->context);
+
+ if (ast_test_flag64(&opts, OPT_PEER_H) && ast_exists_extension(peer, peer->context, "h", 1, peer->cid.cid_num)) {
int autoloopflag;
int found;
int res9;
@@ -2246,41 +2248,34 @@
}
ast_set2_flag(peer, autoloopflag, AST_FLAG_IN_AUTOLOOP); /* set it back the way it was */
}
- if (res != AST_PBX_NO_HANGUP_PEER && res != AST_PBX_NO_HANGUP_PEER_PARKED) {
- if (!ast_check_hangup(peer) && ast_test_flag64(&opts, OPT_CALLEE_GO_ON) && !ast_strlen_zero(opt_args[OPT_ARG_CALLEE_GO_ON])) {
- replace_macro_delimiter(opt_args[OPT_ARG_CALLEE_GO_ON]);
- ast_parseable_goto(peer, opt_args[OPT_ARG_CALLEE_GO_ON]);
- ast_pbx_start(peer);
- } else {
- if (!ast_check_hangup(chan))
- chan->hangupcause = peer->hangupcause;
- ast_hangup(peer);
- }
+ if (!ast_check_hangup(peer) && ast_test_flag64(&opts, OPT_CALLEE_GO_ON) && !ast_strlen_zero(opt_args[OPT_ARG_CALLEE_GO_ON])) {
+ replace_macro_delimiter(opt_args[OPT_ARG_CALLEE_GO_ON]);
+ ast_parseable_goto(peer, opt_args[OPT_ARG_CALLEE_GO_ON]);
+ ast_pbx_start(peer);
+ } else {
+ if (!ast_check_hangup(chan))
+ chan->hangupcause = peer->hangupcause;
+ ast_hangup(peer);
}
}
out:
- /* cleaning up chan is not a good idea here if AST_PBX_KEEPALIVE
- is returned; chan will get the love it needs from another
- thread */
- if (res != AST_PBX_KEEPALIVE) {
- if (moh) {
- moh = 0;
- ast_moh_stop(chan);
- } else if (sentringing) {
- sentringing = 0;
- ast_indicate(chan, -1);
- }
- ast_channel_early_bridge(chan, NULL);
- hanguptree(outgoing, NULL, 0); /* In this case, there's no answer anywhere */
- pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
- senddialendevent(chan, pa.status);
- ast_debug(1, "Exiting with DIALSTATUS=%s.\n", pa.status);
-
- if ((ast_test_flag64(peerflags, OPT_GO_ON)) && !ast_check_hangup(chan) && (res != AST_PBX_KEEPALIVE) && (res != AST_PBX_INCOMPLETE)) {
- if (!ast_tvzero(calldurationlimit))
- memset(&chan->whentohangup, 0, sizeof(chan->whentohangup));
- res = 0;
- }
+ if (moh) {
+ moh = 0;
+ ast_moh_stop(chan);
+ } else if (sentringing) {
+ sentringing = 0;
+ ast_indicate(chan, -1);
+ }
+ ast_channel_early_bridge(chan, NULL);
+ hanguptree(outgoing, NULL, 0); /* In this case, there's no answer anywhere */
+ pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
+ senddialendevent(chan, pa.status);
+ ast_debug(1, "Exiting with DIALSTATUS=%s.\n", pa.status);
+
+ if ((ast_test_flag64(peerflags, OPT_GO_ON)) && !ast_check_hangup(chan) && (res != AST_PBX_INCOMPLETE)) {
+ if (!ast_tvzero(calldurationlimit))
+ memset(&chan->whentohangup, 0, sizeof(chan->whentohangup));
+ res = 0;
}
done:
@@ -2436,7 +2431,7 @@
if (!con)
ast_log(LOG_ERROR, "Dial virtual context 'app_dial_gosub_virtual_context' does not exist and unable to create\n");
else
- ast_add_extension2(con, 1, "s", 1, NULL, NULL, "KeepAlive", ast_strdup(""), ast_free_ptr, "app_dial");
+ ast_add_extension2(con, 1, "s", 1, NULL, NULL, "NoOp", ast_strdup(""), ast_free_ptr, "app_dial");
res = ast_register_application_xml(app, dial_exec);
res |= ast_register_application_xml(rapp, retrydial_exec);
Modified: team/oej/videocaps/apps/app_directory.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/apps/app_directory.c?view=diff&rev=168478&r1=168477&r2=168478
==============================================================================
--- team/oej/videocaps/apps/app_directory.c (original)
+++ team/oej/videocaps/apps/app_directory.c Mon Jan 12 08:13:10 2009
@@ -437,6 +437,9 @@
if (!(cat = ast_category_new(context, "", 99999))) {
ast_log(LOG_WARNING, "Out of memory\n");
ast_config_destroy(cfg);
+ if (rtdata) {
+ ast_config_destroy(rtdata);
+ }
return NULL;
}
ast_category_append(cfg, cat);
Modified: team/oej/videocaps/apps/app_dumpchan.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/apps/app_dumpchan.c?view=diff&rev=168478&r1=168477&r2=168478
==============================================================================
--- team/oej/videocaps/apps/app_dumpchan.c (original)
+++ team/oej/videocaps/apps/app_dumpchan.c Mon Jan 12 08:13:10 2009
@@ -35,6 +35,7 @@
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/channel.h"
+#include "asterisk/app.h"
/*** DOCUMENTATION
<application name="DumpChan" language="en_US">
@@ -148,7 +149,7 @@
static int dumpchan_exec(struct ast_channel *chan, void *data)
{
- struct ast_str *vars = ast_str_alloca(BUFSIZ * 4); /* XXX very large! */
+ struct ast_str *vars = ast_str_thread_get(&global_app_buf, 16);
char info[1024];
int level = 0;
static char *line = "================================================================================";
@@ -156,10 +157,11 @@
if (!ast_strlen_zero(data))
level = atoi(data);
- pbx_builtin_serialize_variables(chan, &vars);
- serialize_showchan(chan, info, sizeof(info));
- if (option_verbose >= level)
- ast_verbose("\nDumping Info For Channel: %s:\n%s\nInfo:\n%s\nVariables:\n%s%s\n", chan->name, line, info, vars->str, line);
+ if (option_verbose >= level) {
+ serialize_showchan(chan, info, sizeof(info));
+ pbx_builtin_serialize_variables(chan, &vars);
+ ast_verbose("\nDumping Info For Channel: %s:\n%s\nInfo:\n%s\nVariables:\n%s%s\n", chan->name, line, info, ast_str_buffer(vars), line);
+ }
return 0;
}
Modified: team/oej/videocaps/apps/app_externalivr.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/apps/app_externalivr.c?view=diff&rev=168478&r1=168477&r2=168478
==============================================================================
--- team/oej/videocaps/apps/app_externalivr.c (original)
+++ team/oej/videocaps/apps/app_externalivr.c Mon Jan 12 08:13:10 2009
@@ -122,8 +122,8 @@
ast_str_append(&tmp, 0, ",%s", data);
}
- fprintf(handle, "%s\n", tmp->str);
- ast_debug(1, "sent '%s'\n", tmp->str);
+ fprintf(handle, "%s\n", ast_str_buffer(tmp));
+ ast_debug(1, "sent '%s'\n", ast_str_buffer(tmp));
}
static void *gen_alloc(struct ast_channel *chan, void *params)
@@ -276,7 +276,7 @@
ast_str_append(&newstring, 0, "%s=%s,", variable, value);
ast_channel_unlock(chan);
- ast_copy_string(outbuf, newstring->str, outbuflen);
+ ast_copy_string(outbuf, ast_str_buffer(newstring), outbuflen);
}
}
@@ -659,7 +659,8 @@
continue;
if (input[0] == 'P') {
- send_eivr_event(eivr_events, 'P', args->str, chan);
+ struct ast_str *tmp = (struct ast_str *) args;
+ send_eivr_event(eivr_events, 'P', ast_str_buffer(tmp), chan);
} else if ( input[0] == 'T' ) {
ast_chan_log(LOG_WARNING, chan, "Answering channel if needed and starting generator\n");
if (chan->_state != AST_STATE_UP) {
Modified: team/oej/videocaps/apps/app_fax.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/apps/app_fax.c?view=diff&rev=168478&r1=168477&r2=168478
==============================================================================
--- team/oej/videocaps/apps/app_fax.c (original)
+++ team/oej/videocaps/apps/app_fax.c Mon Jan 12 08:13:10 2009
@@ -29,6 +29,9 @@
#include <tiffio.h>
#include <spandsp.h>
+#ifdef HAVE_SPANDSP_EXPOSE_H
+#include <spandsp/expose.h>
+#endif
#include <spandsp/version.h>
#include "asterisk/lock.h"
Modified: team/oej/videocaps/apps/app_followme.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/apps/app_followme.c?view=diff&rev=168478&r1=168477&r2=168478
==============================================================================
--- team/oej/videocaps/apps/app_followme.c (original)
+++ team/oej/videocaps/apps/app_followme.c Mon Jan 12 08:13:10 2009
@@ -960,9 +960,8 @@
}
/* This one has to exist; it was part of the query */
ordstr = ast_variable_retrieve(cfg, catg, "ordinal");
- ast_str_make_space(&str, strlen(numstr) + 1);
- ast_copy_string(str->str, numstr, str->len);
- if ((cur = create_followme_number(str->str, timeout, atoi(ordstr)))) {
+ ast_str_set(&str, 0, "%s", numstr);
+ if ((cur = create_followme_number(ast_str_buffer(str), timeout, atoi(ordstr)))) {
AST_LIST_INSERT_TAIL(&new->numbers, cur, entry);
}
}
@@ -1074,6 +1073,11 @@
}
ast_mutex_unlock(&f->lock);
+ /* Answer the call */
+ if (chan->_state != AST_STATE_UP) {
+ ast_answer(chan);
+ }
+
if (ast_test_flag(&targs.followmeflags, FOLLOWMEFLAG_STATUSMSG))
ast_stream_and_wait(chan, targs.statusprompt, "");
Modified: team/oej/videocaps/apps/app_jack.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/apps/app_jack.c?view=diff&rev=168478&r1=168477&r2=168478
==============================================================================
--- team/oej/videocaps/apps/app_jack.c (original)
+++ team/oej/videocaps/apps/app_jack.c Mon Jan 12 08:13:10 2009
@@ -182,7 +182,7 @@
ast_str_append(&str, 0, ", %s", jack_status_to_str((1 << i)));
}
- ast_log(LOG_NOTICE, "%s: %s\n", prefix, str->str);
+ ast_log(LOG_NOTICE, "%s: %s\n", prefix, ast_str_buffer(str));
}
static int alloc_resampler(struct jack_data *jack_data, int input)
Modified: team/oej/videocaps/apps/app_macro.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/apps/app_macro.c?view=diff&rev=168478&r1=168477&r2=168478
==============================================================================
--- team/oej/videocaps/apps/app_macro.c (original)
+++ team/oej/videocaps/apps/app_macro.c Mon Jan 12 08:13:10 2009
@@ -155,6 +155,31 @@
static char *exclusive_app = "MacroExclusive";
static char *exit_app = "MacroExit";
+static void macro_fixup(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan);
+
+struct ast_datastore_info macro_ds_info = {
+ .type = "MACRO",
+ .chan_fixup = macro_fixup,
+};
+
+static void macro_fixup(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)
+{
+ int i;
+ char varname[10];
+ pbx_builtin_setvar_helper(new_chan, "MACRO_DEPTH", "0");
+ pbx_builtin_setvar_helper(new_chan, "MACRO_CONTEXT", NULL);
+ pbx_builtin_setvar_helper(new_chan, "MACRO_EXTEN", NULL);
+ pbx_builtin_setvar_helper(new_chan, "MACRO_PRIORITY", NULL);
+ pbx_builtin_setvar_helper(new_chan, "MACRO_OFFSET", NULL);
+ for (i = 1; i < 100; i++) {
+ snprintf(varname, sizeof(varname), "ARG%d", i);
+ while (pbx_builtin_getvar_helper(new_chan, varname)) {
+ /* Kill all levels of arguments */
+ pbx_builtin_setvar_helper(new_chan, varname, NULL);
+ }
+ }
+}
+
static struct ast_exten *find_matching_priority(struct ast_context *c, const char *exten, int priority, const char *callerid)
{
struct ast_exten *e;
@@ -209,17 +234,31 @@
const char *inhangupc;
int offset, depth = 0, maxdepth = 7;
int setmacrocontext=0;
- int autoloopflag, dead = 0, inhangup = 0;
+ int autoloopflag, inhangup = 0;
char *save_macro_exten;
char *save_macro_context;
char *save_macro_priority;
char *save_macro_offset;
+ struct ast_datastore *macro_store = ast_channel_datastore_find(chan, ¯o_ds_info, NULL);
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "Macro() requires arguments. See \"core show application macro\" for help.\n");
return -1;
}
+
+ do {
+ if (macro_store) {
+ break;
+ }
+ if (!(macro_store = ast_datastore_alloc(¯o_ds_info, NULL))) {
+ ast_log(LOG_WARNING, "Unable to allocate new datastore.\n");
+ break;
+ }
+ /* Just the existence of this datastore is enough. */
+ macro_store->inheritance = DATASTORE_INHERIT_FOREVER;
+ ast_channel_datastore_add(chan, macro_store);
+ } while (0);
/* does the user want a deeper rabbit hole? */
ast_channel_lock(chan);
@@ -367,15 +406,9 @@
case MACRO_EXIT_RESULT:
res = 0;
goto out;
- case AST_PBX_KEEPALIVE:
- ast_debug(2, "Spawn extension (%s,%s,%d) exited KEEPALIVE in macro %s on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
- ast_verb(2, "Spawn extension (%s, %s, %d) exited KEEPALIVE in macro '%s' on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
- goto out;
- break;
default:
ast_debug(2, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
- dead = 1;
goto out;
}
}
@@ -448,31 +481,30 @@
chan->priority++;
}
out:
+
+ /* Don't let the channel change now. */
+ ast_channel_lock(chan);
+
/* Reset the depth back to what it was when the routine was entered (like if we called Macro recursively) */
snprintf(depthc, sizeof(depthc), "%d", depth);
- if (!dead) {
- pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
- ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
- }
+ pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
+ ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
for (x = 1; x < argc; x++) {
/* Restore old arguments and delete ours */
snprintf(varname, sizeof(varname), "ARG%d", x);
if (oldargs[x]) {
- if (!dead)
- pbx_builtin_setvar_helper(chan, varname, oldargs[x]);
+ pbx_builtin_setvar_helper(chan, varname, oldargs[x]);
ast_free(oldargs[x]);
- } else if (!dead) {
+ } else {
pbx_builtin_setvar_helper(chan, varname, NULL);
}
}
/* Restore macro variables */
- if (!dead) {
- pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", save_macro_exten);
- pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", save_macro_context);
- pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority);
- }
+ pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", save_macro_exten);
+ pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", save_macro_context);
+ pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority);
if (save_macro_exten)
ast_free(save_macro_exten);
if (save_macro_context)
@@ -480,13 +512,13 @@
if (save_macro_priority)
ast_free(save_macro_priority);
- if (!dead && setmacrocontext) {
+ if (setmacrocontext) {
chan->macrocontext[0] = '\0';
chan->macroexten[0] = '\0';
chan->macropriority = 0;
}
- if (!dead && !strcasecmp(chan->context, fullmacro)) {
+ if (!strcasecmp(chan->context, fullmacro)) {
/* If we're leaving the macro normally, restore original information */
chan->priority = oldpriority;
ast_copy_string(chan->context, oldcontext, sizeof(chan->context));
@@ -494,7 +526,6 @@
/* Copy the extension, so long as we're not in softhangup, where we could be given an asyncgoto */
const char *offsets;
ast_copy_string(chan->exten, oldexten, sizeof(chan->exten));
- ast_channel_lock(chan);
if ((offsets = pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"))) {
/* Handle macro offset if it's set by checking the availability of step n + offset + 1, otherwise continue
normally if there is any problem */
@@ -504,12 +535,10 @@
}
}
}
- ast_channel_unlock(chan);
- }
- }
-
- if (!dead)
- pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset);
+ }
+ }
+
+ pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset);
if (save_macro_offset)
ast_free(save_macro_offset);
@@ -521,6 +550,7 @@
res = 0;
}
}
+ ast_channel_unlock(chan);
return res;
}
Modified: team/oej/videocaps/apps/app_meetme.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/apps/app_meetme.c?view=diff&rev=168478&r1=168477&r2=168478
==============================================================================
--- team/oej/videocaps/apps/app_meetme.c (original)
+++ team/oej/videocaps/apps/app_meetme.c Mon Jan 12 08:13:10 2009
@@ -1260,7 +1260,7 @@
min = ((now - cnf->start) % 3600) / 60;
sec = (now - cnf->start) % 60;
if (!concise) {
- ast_cli(a->fd, MC_DATA_FORMAT, cnf->confno, cnf->users, cmdline->str, hr, min, sec, cnf->isdynamic ? "Dynamic" : "Static", cnf->locked ? "Yes" : "No");
+ ast_cli(a->fd, MC_DATA_FORMAT, cnf->confno, cnf->users, ast_str_buffer(cmdline), hr, min, sec, cnf->isdynamic ? "Dynamic" : "Static", cnf->locked ? "Yes" : "No");
} else {
ast_cli(a->fd, "%s!%d!%d!%02d:%02d:%02d!%d!%d\n",
cnf->confno,
@@ -1345,9 +1345,9 @@
return CLI_SHOWUSAGE;
}
- ast_debug(1, "Cmdline: %s\n", cmdline->str);
-
- admin_exec(NULL, cmdline->str);
+ ast_debug(1, "Cmdline: %s\n", ast_str_buffer(cmdline));
+
+ admin_exec(NULL, ast_str_buffer(cmdline));
ast_free(cmdline);
return CLI_SUCCESS;
@@ -1435,9 +1435,9 @@
return CLI_SHOWUSAGE;
}
- ast_debug(1, "Cmdline: %s\n", cmdline->str);
-
- admin_exec(NULL, cmdline->str);
+ ast_debug(1, "Cmdline: %s\n", ast_str_buffer(cmdline));
+
+ admin_exec(NULL, ast_str_buffer(cmdline));
ast_free(cmdline);
return CLI_SUCCESS;
@@ -1812,7 +1812,7 @@
char endtime[32];
struct timeval now;
struct ast_tm tm;
- struct ast_variable *var;
+ struct ast_variable *var, *orig_var;
char bookid[8];
if (!extendby) {
@@ -1827,6 +1827,8 @@
var = ast_load_realtime("meetme", "confno",
confno, "startTime<= ", currenttime,
"endtime>= ", currenttime, NULL);
+
+ orig_var = var;
/* Identify the specific RealTime conference */
while (var) {
@@ -1839,7 +1841,7 @@
var = var->next;
}
- ast_variables_destroy(var);
+ ast_variables_destroy(orig_var);
ast_strptime(endtime, DATE_FORMAT, &tm);
now = ast_mktime(&tm, NULL);
@@ -4615,7 +4617,7 @@
ast_set_flag(&conf_flags,
CONFFLAG_QUIET | CONFFLAG_MARKEDEXIT | CONFFLAG_PASS_DTMF | CONFFLAG_SLA_STATION);
answer_trunk_chan(trunk_ref->chan);
- conf = build_conf(conf_name->str, "", "", 0, 0, 1, trunk_ref->chan);
+ conf = build_conf(ast_str_buffer(conf_name), "", "", 0, 0, 1, trunk_ref->chan);
if (conf) {
conf_run(trunk_ref->chan, conf, conf_flags.flags, NULL);
dispose_conf(conf);
@@ -4625,7 +4627,7 @@
if (ast_atomic_dec_and_test((int *) &trunk_ref->trunk->active_stations) &&
trunk_ref->state != SLA_TRUNK_STATE_ONHOLD_BYME) {
ast_str_append(&conf_name, 0, ",K");
- admin_exec(NULL, conf_name->str);
+ admin_exec(NULL, ast_str_buffer(conf_name));
trunk_ref->trunk->hold_stations = 0;
sla_change_trunk_state(trunk_ref->trunk, SLA_TRUNK_STATE_IDLE, ALL_TRUNK_REFS, NULL);
}
Modified: team/oej/videocaps/apps/app_minivm.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/apps/app_minivm.c?view=diff&rev=168478&r1=168477&r2=168478
==============================================================================
--- team/oej/videocaps/apps/app_minivm.c (original)
+++ team/oej/videocaps/apps/app_minivm.c Mon Jan 12 08:13:10 2009
@@ -208,13 +208,13 @@
<para>This application is part of the Mini-Voicemail system, configured in <filename>minivm.conf</filename></para>
<para>MiniVM records audio file in configured format and forwards message to e-mail and pager.</para>
<para>If there's no user account for that address, a temporary account will be used with default options.</para>
- <para>The recorded file name and path will be stored in <variable>MINIVM_FILENAME</variable> and the duration
- of the message will be stored in <variable>MINIVM_DURATION</variable></para>
+ <para>The recorded file name and path will be stored in <variable>MVM_FILENAME</variable> and the duration
+ of the message will be stored in <variable>MVM_DURATION</variable></para>
<note><para>If the caller hangs up after the recording, the only way to send the message and clean up is to
execute in the <literal>h</literal> extension. The application will exit if any of the following DTMF digits
are received and the requested extension exist in the current context.</para></note>
<variablelist>
- <variable name="MINIVM_RECORD_STATUS">
+ <variable name="MVM_RECORD_STATUS">
<para>This is the status of the record operation</para>
<value name="SUCCESS" />
<value name="USEREXIT" />
@@ -256,7 +256,7 @@
<para>Busy and unavailable messages can be choosen, but will be overridden if a temporary
message exists for the account.</para>
<variablelist>
- <variable name="MINIVM_GREET_STATUS">
+ <variable name="MVM_GREET_STATUS">
<para>This is the status of the greeting playback.</para>
<value name="SUCCESS" />
<value name="USEREXIT" />
@@ -296,7 +296,7 @@
<para>If no template is given, the default email template will be used to send email and default pager
template to send paging message (if the user account is configured with a paging address.</para>
<variablelist>
- <variable name="MINIVM_NOTIFY_STATUS">
+ <variable name="MVM_NOTIFY_STATUS">
<para>This is the status of the notification attempt</para>
<value name="SUCCESS" />
<value name="FAILED" />
@@ -317,7 +317,7 @@
<para>This application is part of the Mini-Voicemail system, configured in <filename>minivm.conf</filename>.</para>
<para>It deletes voicemail file set in MVM_FILENAME or given filename.</para>
<variablelist>
- <variable name="MINIVM_DELETE_STATUS">
+ <variable name="MVM_DELETE_STATUS">
<para>This is the status of the delete operation.</para>
<value name="SUCCESS" />
<value name="FAILED" />
@@ -362,7 +362,7 @@
and temporary messages.</para>
<para>Account specific directories will be created if they do not exist.</para>
<variablelist>
- <variable name="MINIVM_ACCMESS_STATUS">
+ <variable name="MVM_ACCMESS_STATUS">
<para>This is the result of the attempt to record the specified greeting.</para>
<para><literal>FAILED</literal> is set if the file can't be created.</para>
<value name="SUCCESS" />
@@ -644,7 +644,7 @@
}
while (var) {
- ast_debug(3, "-_-_- Configuring template option %s = \"%s\" for template %s\n", var->name, var->value, name);
+ ast_debug(3, "Configuring template option %s = \"%s\" for template %s\n", var->name, var->value, name);
if (!strcasecmp(var->name, "fromaddress")) {
ast_copy_string(template->fromaddress, var->value, sizeof(template->fromaddress));
} else if (!strcasecmp(var->name, "fromemail")) {
@@ -961,7 +961,7 @@
ast_log(LOG_NOTICE, "No username or domain? \n");
return NULL;
}
- ast_debug(3, "-_-_-_- Looking for voicemail user %s in domain %s\n", username, domain);
+ ast_debug(3, "Looking for voicemail user %s in domain %s\n", username, domain);
AST_LIST_LOCK(&minivm_accounts);
AST_LIST_TRAVERSE(&minivm_accounts, cur, list) {
@@ -972,7 +972,7 @@
AST_LIST_UNLOCK(&minivm_accounts);
if (cur) {
- ast_debug(3, "-_-_- Found account for %s@%s\n", username, domain);
[... 12722 lines stripped ...]
More information about the asterisk-commits
mailing list