[asterisk-commits] murf: branch murf/CDRfix4 r122590 - in /team/murf/CDRfix4: ./ apps/ build_too...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jun 13 11:45:42 CDT 2008
Author: murf
Date: Fri Jun 13 11:45:42 2008
New Revision: 122590
URL: http://svn.digium.com/view/asterisk?view=rev&rev=122590
Log:
Merged revisions 122046,122127,122130,122137,122208,122259,122311,122314,122589 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r122046 | murf | 2008-06-12 07:47:34 -0600 (Thu, 12 Jun 2008) | 37 lines
(closes issue #10668)
Reported by: arkadia
Tested by: murf, arkadia
Options added to forkCDR() app and the CDR() func to
remove some roadblocks for CDR applications.
The "show application ForkCDR" output was upgraded
to more fully explain the inner workings of forkCDR.
The A option was added to forkCDR to force the
CDR system to NOT change the disposition on the
original CDR, after the fork. This involves
ast_cdr_answer, _busy, _failed, and so on.
The T option was added to forkCDR to force
obedience of the cdr LOCKED flag in the
ast_cdr_end, all the disposition changing
funcs (ast_cdr_answer, etc), and in the
ast_cdr_setvar func.
The CHANGES file was updated to explain ALL
the new options added to satisfy this bug report
(and some requests made verbally and via
email, irc, etc, over the past months/year)
The 's' option was added to the CDR() func,
to force it to skip LOCKED cdr's in the
chain.
Again, the new options should be totally transparent
to existing apps! Current behavior of CDR,
forkCDR, and the rest of the CDR system should
not change one little bit. Until you add the
new options, at least!
........
r122127 | murf | 2008-06-12 08:51:44 -0600 (Thu, 12 Jun 2008) | 1 line
Arkadia tried to warn me, but the code added to ast_cdr_busy, _failed, and _noanswer was redundant. Didn't spot it until I was resolving conflicts in trunk. Ugh. Redundant code removed. It wasn't harmful. Just dumb.
........
r122130 | tilghman | 2008-06-12 09:11:30 -0600 (Thu, 12 Jun 2008) | 4 lines
Occasionally, the alertpipe loses its nonblocking status, so detect and correct
that situation before it causes a deadlock. (Reported and tested by ctooley
via #asterisk-dev)
........
r122137 | tilghman | 2008-06-12 09:18:39 -0600 (Thu, 12 Jun 2008) | 8 lines
Flipflop the sections for two options, since the section for 'X' (exit context)
may otherwise absorb keypresses meant for 's' (admin/user menu).
(closes issue #12836)
Reported by: blitzrage
Patches:
20080611__bug12836.diff.txt uploaded by Corydon76 (license 14)
Tested by: blitzrage
........
r122208 | jpeeler | 2008-06-12 09:46:08 -0600 (Thu, 12 Jun 2008) | 5 lines
(closes issue #12193)
Reported by: davidw
Patch by: Corydon76, modified by me to work properly with ParkAndAnnounce app
........
r122259 | russell | 2008-06-12 12:22:44 -0600 (Thu, 12 Jun 2008) | 3 lines
Fix some race conditions that cause ast_assert() to report that chan_iax2 tried
to remove an entry that wasn't in the scheduler
........
r122311 | mmichelson | 2008-06-12 12:50:58 -0600 (Thu, 12 Jun 2008) | 9 lines
Properly play a holdtime message if the announce-holdtime option is
set to "once."
(closes issue #12842)
Reported by: ramonpeek
Patches:
patch001.diff uploaded by ramonpeek (license 266)
........
r122314 | jpeeler | 2008-06-12 13:08:20 -0600 (Thu, 12 Jun 2008) | 2 lines
Adds DAHDI support alongside Zaptel. DAHDI usage favored, but all Zap stuff should continue working. Release announcement to follow.
........
r122589 | twilson | 2008-06-13 10:29:07 -0600 (Fri, 13 Jun 2008) | 7 lines
This should fix the behavior of the 'T' dial feature being passed incorrectly to the transferee when builtin_atxfers are used.
Also, doing a builtin_atxfer to parking was broken and is fixed here as well.
(closes issue #11898)
Reported by: sergee
Tested by: otherwiseguy
........
Added:
team/murf/CDRfix4/apps/app_dahdibarge.c
- copied unchanged from r122589, branches/1.4/apps/app_dahdibarge.c
team/murf/CDRfix4/apps/app_dahdiras.c
- copied unchanged from r122589, branches/1.4/apps/app_dahdiras.c
team/murf/CDRfix4/apps/app_dahdiscan.c
- copied unchanged from r122589, branches/1.4/apps/app_dahdiscan.c
team/murf/CDRfix4/channels/chan_dahdi.c
- copied unchanged from r122589, branches/1.4/channels/chan_dahdi.c
team/murf/CDRfix4/codecs/codec_dahdi.c
- copied unchanged from r122589, branches/1.4/codecs/codec_dahdi.c
team/murf/CDRfix4/include/asterisk/dahdi_compat.h
- copied unchanged from r122589, branches/1.4/include/asterisk/dahdi_compat.h
Removed:
team/murf/CDRfix4/apps/app_zapbarge.c
team/murf/CDRfix4/apps/app_zapras.c
team/murf/CDRfix4/apps/app_zapscan.c
team/murf/CDRfix4/channels/chan_zap.c
team/murf/CDRfix4/codecs/codec_zap.c
Modified:
team/murf/CDRfix4/ (props changed)
team/murf/CDRfix4/CHANGES
team/murf/CDRfix4/acinclude.m4
team/murf/CDRfix4/apps/app_chanspy.c
team/murf/CDRfix4/apps/app_dial.c
team/murf/CDRfix4/apps/app_disa.c
team/murf/CDRfix4/apps/app_flash.c
team/murf/CDRfix4/apps/app_forkcdr.c
team/murf/CDRfix4/apps/app_getcpeid.c
team/murf/CDRfix4/apps/app_meetme.c
team/murf/CDRfix4/apps/app_page.c
team/murf/CDRfix4/apps/app_parkandannounce.c
team/murf/CDRfix4/apps/app_read.c
team/murf/CDRfix4/apps/app_rpt.c
team/murf/CDRfix4/build_tools/menuselect-deps.in
team/murf/CDRfix4/channels/chan_iax2.c
team/murf/CDRfix4/channels/chan_mgcp.c
team/murf/CDRfix4/channels/chan_misdn.c
team/murf/CDRfix4/configure
team/murf/CDRfix4/configure.ac
team/murf/CDRfix4/contrib/utils/zones2indications.c
team/murf/CDRfix4/funcs/func_cdr.c
team/murf/CDRfix4/funcs/func_channel.c
team/murf/CDRfix4/include/asterisk/autoconfig.h.in
team/murf/CDRfix4/include/asterisk/cdr.h
team/murf/CDRfix4/include/asterisk/channel.h
team/murf/CDRfix4/include/asterisk/indications.h
team/murf/CDRfix4/include/asterisk/options.h
team/murf/CDRfix4/main/app.c
team/murf/CDRfix4/main/asterisk.c
team/murf/CDRfix4/main/cdr.c
team/murf/CDRfix4/main/channel.c
team/murf/CDRfix4/main/file.c
team/murf/CDRfix4/main/indications.c
team/murf/CDRfix4/main/loader.c
team/murf/CDRfix4/makeopts.in
team/murf/CDRfix4/pbx/pbx_config.c
team/murf/CDRfix4/res/res_features.c
team/murf/CDRfix4/res/res_indications.c
team/murf/CDRfix4/res/res_musiconhold.c
team/murf/CDRfix4/res/snmp/agent.c
Propchange: team/murf/CDRfix4/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jun 13 11:45:42 2008
@@ -1,1 +1,1 @@
-/branches/1.4:1-122009
+/branches/1.4:1-122589
Modified: team/murf/CDRfix4/CHANGES
URL: http://svn.digium.com/view/asterisk/team/murf/CDRfix4/CHANGES?view=diff&rev=122590&r1=122589&r2=122590
==============================================================================
--- team/murf/CDRfix4/CHANGES (original)
+++ team/murf/CDRfix4/CHANGES Fri Jun 13 11:45:42 2008
@@ -131,12 +131,22 @@
o New Option: K/k parking via dtmf tones
5. Dictate() -- optional filename argument added.
6. Directory() -- new option: e - In addition to the name, also read the extension number...
- 7. Meetme() -- new options:
+ 7. ForkCDR() -- new options:
+ o 'a' -- update answer time on new cdr
+ o 'A' -- Lock the orig CDR answer time against changes.
+ o 'D' -- Copy the disposition from the orig to the new CDR.
+ o 'd' -- clear the dstcannel field in the new CDR.
+ o 'e' -- set the end time of the original CDR.
+ o 'R' -- do NOT reset the new CDR.
+ o 's' -- Add/change var in orig CDR.
+ o 'T' -- Force ast_cdr_end, answer to obey LOCKED flag for the orig. CDR.
+ -- ast_cdr_setvar will be forced also (used by the CDR() func in write mode)
+ 8. Meetme() -- new options:
o 'I' -- announce user join/leave without review
o 'l' -- set listen only mode (Listen only, no talking)
o 'o' -- set talker optimization - treats talkers who aren't speaking as...
o '1' -- do not play message when first person enters
- 8. MeetmeAdmin() -- new options:
+ 9. MeetmeAdmin() -- new options:
o 'r' -- Reset one user's volume settings
o 'R' -- Reset all users volume settings
o 's' -- Lower entire conference speaking volume
@@ -147,21 +157,21 @@
o 'U' -- Lower all users listen volume
o 'v' -- Lower entire conference listening volume
o 'V' -- Raise entire conference listening volume
- 9. OSPFinish() : now also can return ERROR result.
- 10. OSPLookup() : Sets more variables, also now returns ERROR result.
- 11. Page() -- New option: r - record the page into a file (see 'r' for app_meetme)
- 12. Pickup() -- multiple extensions, PICKUPMARK; read the description!
- 13. Queue()
+ 10. OSPFinish() : now also can return ERROR result.
+ 11. OSPLookup() : Sets more variables, also now returns ERROR result.
+ 12. Page() -- New option: r - record the page into a file (see 'r' for app_meetme)
+ 13. Pickup() -- multiple extensions, PICKUPMARK; read the description!
+ 14. Queue()
o New Argument: AGI
o New option: i
- 14. Random() -- is now deprecated in 1.4
- 15. Read() -- replace 'skip' and 'noanswer' options with 's', 'n', add 'i' option.
- 16. Record() -- New option: 'x' : ignore all terminator keys (DTMF) and keep recording until hangup
- 17. UserEvent() -- slight change in behavior. Read the description.
- 18. VoiceMailMain() -- new a(#) option, goes to folder # directly.
- 19. WaitForSilence() -- new optional 3rd arg, time delay before returning.
+ 15. Random() -- is now deprecated in 1.4
+ 16. Read() -- replace 'skip' and 'noanswer' options with 's', 'n', add 'i' option.
+ 17. Record() -- New option: 'x' : ignore all terminator keys (DTMF) and keep recording until hangup
+ 18. UserEvent() -- slight change in behavior. Read the description.
+ 19. VoiceMailMain() -- new a(#) option, goes to folder # directly.
+ 20. WaitForSilence() -- new optional 3rd arg, time delay before returning.
* Functions that have changes to their interfaces:
- 1. CDR -- new option: u
+ 1. CDR -- new options: u and s
2. LANGUAGE -- Deprecated. Use CHANNEL(language) instead.
3. MUSICCLASS -- Deprecated. Use CHANNEL(musicclass) instead.
* Configuration File Changes:
Modified: team/murf/CDRfix4/acinclude.m4
URL: http://svn.digium.com/view/asterisk/team/murf/CDRfix4/acinclude.m4?view=diff&rev=122590&r1=122589&r2=122590
==============================================================================
--- team/murf/CDRfix4/acinclude.m4 (original)
+++ team/murf/CDRfix4/acinclude.m4 Fri Jun 13 11:45:42 2008
@@ -99,6 +99,54 @@
exit 1
fi
fi
+])
+
+# The next three functions check for the availability of a given package.
+# AST_C_DEFINE_CHECK looks for the presence of a #define in a header file,
+# AST_C_COMPILE_CHECK can be used for testing for various items in header files,
+# AST_EXT_LIB_CHECK looks for a symbol in a given library, or at least
+# for the presence of a header file.
+# AST_EXT_TOOL_CHECK looks for a symbol in using $1-config to determine CFLAGS and LIBS
+#
+# They are only run if PBX_$1 != 1 (where $1 is the package),
+# so you can call them multiple times and stop at the first matching one.
+# On success, they both set PBX_$1 = 1, set $1_INCLUDE and $1_LIB as applicable,
+# and also #define HAVE_$1 1 and #define HAVE_$1_VERSION ${last_argument}
+# in autoconfig.h so you can tell which test succeeded.
+# They should be called after AST_EXT_LIB_SETUP($1, ...)
+
+# Check if a given macro is defined in a certain header.
+
+# AST_C_DEFINE_CHECK([package], [macro name], [header file], [version])
+AC_DEFUN([AST_C_DEFINE_CHECK],
+[
+ if test "x${PBX_$1}" != "x1"; then
+ AC_MSG_CHECKING([for $2 in $3])
+ saved_cppflags="${CPPFLAGS}"
+ if test "x${$1_DIR}" != "x"; then
+ $1_INCLUDE="-I${$1_DIR}/include"
+ fi
+ CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
+
+ AC_COMPILE_IFELSE(
+ [ AC_LANG_PROGRAM( [#include <$3>],
+ [#if defined($2)
+ int foo = 0;
+ #else
+ int foo = bar;
+ #endif
+ 0
+ ])],
+ [ AC_MSG_RESULT(yes)
+ PBX_$1=1
+ AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
+ AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])
+ ],
+ [ AC_MSG_RESULT(no) ]
+ )
+ CPPFLAGS="${saved_cppflags}"
+ fi
+ AC_SUBST(PBX_$1)
])
# AST_C_COMPILE_CHECK can be used for testing for various items in header files
Modified: team/murf/CDRfix4/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/murf/CDRfix4/apps/app_chanspy.c?view=diff&rev=122590&r1=122589&r2=122590
==============================================================================
--- team/murf/CDRfix4/apps/app_chanspy.c (original)
+++ team/murf/CDRfix4/apps/app_chanspy.c Fri Jun 13 11:45:42 2008
@@ -461,6 +461,7 @@
const char *exten, const char *context, struct chanspy_ds *chanspy_ds)
{
struct ast_channel *this;
+ char channel_name[AST_CHANNEL_NAME];
redo:
if (spec)
@@ -473,7 +474,8 @@
if (!this)
return NULL;
- if (!strncmp(this->name, "Zap/pseudo", 10)) {
+ snprintf(channel_name, AST_CHANNEL_NAME, "%s/pseudo", dahdi_chan_name);
+ if (!strncmp(this->name, channel_name, 10)) {
ast_channel_unlock(this);
goto redo;
} else if (this == chan) {
Modified: team/murf/CDRfix4/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/murf/CDRfix4/apps/app_dial.c?view=diff&rev=122590&r1=122589&r2=122590
==============================================================================
--- team/murf/CDRfix4/apps/app_dial.c (original)
+++ team/murf/CDRfix4/apps/app_dial.c Fri Jun 13 11:45:42 2008
@@ -789,7 +789,7 @@
return 0;
}
-static void set_dial_features(struct ast_flags *opts, struct ast_dial_features *features)
+static void set_dial_features(struct ast_flags *opts, struct ast_dial_features *features, struct ast_channel *chan)
{
struct ast_flags perm_opts = {.flags = 0};
@@ -800,6 +800,22 @@
memset(features->options, 0, sizeof(features->options));
ast_app_options2str(dial_exec_options, &perm_opts, features->options, sizeof(features->options));
+ if (ast_test_flag(&perm_opts, OPT_CALLEE_TRANSFER))
+ ast_set_flag(&(features->features_callee), AST_FEATURE_REDIRECT);
+ if (ast_test_flag(&perm_opts, OPT_CALLER_TRANSFER))
+ ast_set_flag(&(features->features_caller), AST_FEATURE_REDIRECT);
+ if (ast_test_flag(&perm_opts, OPT_CALLEE_HANGUP))
+ ast_set_flag(&(features->features_callee), AST_FEATURE_DISCONNECT);
+ if (ast_test_flag(&perm_opts, OPT_CALLER_HANGUP))
+ ast_set_flag(&(features->features_caller), AST_FEATURE_DISCONNECT);
+ if (ast_test_flag(&perm_opts, OPT_CALLEE_MONITOR))
+ ast_set_flag(&(features->features_callee), AST_FEATURE_AUTOMON);
+ if (ast_test_flag(&perm_opts, OPT_CALLER_MONITOR))
+ ast_set_flag(&(features->features_caller), AST_FEATURE_AUTOMON);
+ if (ast_test_flag(&perm_opts, OPT_CALLEE_PARK))
+ ast_set_flag(&(features->features_callee), AST_FEATURE_PARKCALL);
+ if (ast_test_flag(&perm_opts, OPT_CALLER_PARK))
+ ast_set_flag(&(features->features_caller), AST_FEATURE_PARKCALL);
}
static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags *peerflags, int *continue_exec)
@@ -1109,18 +1125,16 @@
goto out;
}
- if (!(caller_features = ast_malloc(sizeof(*caller_features)))) {
+ if (!(caller_features = ast_calloc(1, sizeof(*caller_features)))) {
ast_log(LOG_WARNING, "Unable to allocate memory for feature flags. Aborting!\n");
goto out;
}
+ ast_channel_lock(chan);
caller_features->is_caller = 1;
- set_dial_features(&opts, caller_features);
-
- ds_caller_features->inheritance = DATASTORE_INHERIT_FOREVER;
+ set_dial_features(&opts, caller_features, chan);
+ ds_caller_features->inheritance = -1;
ds_caller_features->data = caller_features;
-
- ast_channel_lock(chan);
ast_channel_datastore_add(chan, ds_caller_features);
ast_channel_unlock(chan);
@@ -1291,22 +1305,19 @@
goto out;
}
- if (!(callee_features = ast_malloc(sizeof(*callee_features)))) {
+ if (!(callee_features = ast_calloc(1, sizeof(*callee_features)))) {
ast_log(LOG_WARNING, "Unable to allocate memory for feature flags. Aborting!\n");
ast_free(tmp);
goto out;
}
+ ast_channel_lock(tmp->chan);
callee_features->is_caller = 0;
- set_dial_features(&opts, callee_features);
-
- ds_callee_features->inheritance = DATASTORE_INHERIT_FOREVER;
+ set_dial_features(&opts, callee_features, tmp->chan);
+ ds_callee_features->inheritance = -1;
ds_callee_features->data = callee_features;
-
- ast_channel_lock(tmp->chan);
ast_channel_datastore_add(tmp->chan, ds_callee_features);
ast_channel_unlock(tmp->chan);
-
/* Place the call, but don't wait on the answer */
res = ast_call(tmp->chan, numsubst, 0);
Modified: team/murf/CDRfix4/apps/app_disa.c
URL: http://svn.digium.com/view/asterisk/team/murf/CDRfix4/apps/app_disa.c?view=diff&rev=122590&r1=122589&r2=122590
==============================================================================
--- team/murf/CDRfix4/apps/app_disa.c (original)
+++ team/murf/CDRfix4/apps/app_disa.c Fri Jun 13 11:45:42 2008
@@ -98,7 +98,7 @@
static void play_dialtone(struct ast_channel *chan, char *mailbox)
{
- const struct tone_zone_sound *ts = NULL;
+ const struct ind_tone_zone_sound *ts = NULL;
if(ast_app_has_voicemail(mailbox, NULL))
ts = ast_get_indication_tone(chan->zone, "dialrecall");
else
Modified: team/murf/CDRfix4/apps/app_flash.c
URL: http://svn.digium.com/view/asterisk/team/murf/CDRfix4/apps/app_flash.c?view=diff&rev=122590&r1=122589&r2=122590
==============================================================================
--- team/murf/CDRfix4/apps/app_flash.c (original)
+++ team/murf/CDRfix4/apps/app_flash.c Fri Jun 13 11:45:42 2008
@@ -26,7 +26,7 @@
*/
/*** MODULEINFO
- <depend>zaptel</depend>
+ <depend>dahdi</depend>
***/
#include "asterisk.h"
@@ -38,7 +38,6 @@
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
-#include <zaptel/zaptel.h>
#include "asterisk/lock.h"
#include "asterisk/file.h"
@@ -49,6 +48,8 @@
#include "asterisk/translate.h"
#include "asterisk/image.h"
#include "asterisk/options.h"
+
+#include "asterisk/dahdi_compat.h"
static char *app = "Flash";
@@ -65,9 +66,9 @@
{
/* Avoid the silly zt_waitevent which ignores a bunch of events */
int i,j=0;
- i = ZT_IOMUX_SIGEVENT;
- if (ioctl(fd, ZT_IOMUX, &i) == -1) return -1;
- if (ioctl(fd, ZT_GETEVENT, &j) == -1) return -1;
+ i = DAHDI_IOMUX_SIGEVENT;
+ if (ioctl(fd, DAHDI_IOMUX, &i) == -1) return -1;
+ if (ioctl(fd, DAHDI_GETEVENT, &j) == -1) return -1;
return j;
}
@@ -76,15 +77,15 @@
int res = -1;
int x;
struct ast_module_user *u;
- struct zt_params ztp;
+ DAHDI_PARAMS ztp;
u = ast_module_user_add(chan);
if (!strcasecmp(chan->tech->type, "Zap")) {
memset(&ztp, 0, sizeof(ztp));
- res = ioctl(chan->fds[0], ZT_GET_PARAMS, &ztp);
+ res = ioctl(chan->fds[0], DAHDI_GET_PARAMS, &ztp);
if (!res) {
- if (ztp.sigtype & __ZT_SIG_FXS) {
- x = ZT_FLASH;
- res = ioctl(chan->fds[0], ZT_HOOK, &x);
+ if (ztp.sigtype & __DAHDI_SIG_FXS) {
+ x = DAHDI_FLASH;
+ res = ioctl(chan->fds[0], DAHDI_HOOK, &x);
if (!res || (errno == EINPROGRESS)) {
if (res) {
/* Wait for the event to finish */
Modified: team/murf/CDRfix4/apps/app_forkcdr.c
URL: http://svn.digium.com/view/asterisk/team/murf/CDRfix4/apps/app_forkcdr.c?view=diff&rev=122590&r1=122589&r2=122590
==============================================================================
--- team/murf/CDRfix4/apps/app_forkcdr.c (original)
+++ team/murf/CDRfix4/apps/app_forkcdr.c Fri Jun 13 11:45:42 2008
@@ -48,21 +48,82 @@
"Forks the Call Data Record";
static char *descrip =
" ForkCDR([options]): Causes the Call Data Record to fork an additional\n"
-"cdr record starting from the time of the fork call\n"
+"cdr record starting from the time of the fork call. This new cdr record will\n"
+"be linked to end of the list of cdr records attached to the channel. The original CDR is\n"
+"has a LOCKED flag set, which forces most cdr operations to skip it, except\n"
+"for the functions that set the answer and end times, which ignore the LOCKED\n"
+"flag. This allows all the cdr records in the channel to be 'ended' together\n"
+"when the channel is closed.\n"
+"The CDR() func (when setting CDR values) normally ignores the LOCKED flag also,\n"
+"but has options to vary its behavior. The 'T' option (described below), can\n"
+"override this behavior, but beware the risks.\n"
+"\n"
+"Detailed Behavior Description:\n"
+"First, this app finds the last cdr record in the list, and makes\n"
+"a copy of it. This new copy will be the newly forked cdr record.\n"
+"Next, this new record is linked to the end of the cdr record list.\n"
+"Next, The new cdr record is RESET (unless you use an option to prevent this)\n"
+"This means that:\n"
+" 1. All flags are unset on the cdr record\n"
+" 2. the start, end, and answer times are all set to zero.\n"
+" 3. the billsec and duration fields are set to zero.\n"
+" 4. the start time is set to the current time.\n"
+" 5. the disposition is set to NULL.\n"
+"Next, unless you specified the 'v' option, all variables will be\n"
+"removed from the original cdr record. Thus, the 'v' option allows\n"
+"any CDR variables to be replicated to all new forked cdr records.\n"
+"Without the 'v' option, the variables on the original are effectively\n"
+"moved to the new forked cdr record.\n"
+"Next, if the 's' option is set, the provided variable and value\n"
+"are set on the original cdr record.\n"
+"Next, if the 'a' option is given, and the original cdr record has an\n"
+"answer time set, then the new forked cdr record will have its answer\n"
+"time set to its start time. If the old answer time were carried forward,\n"
+"the answer time would be earlier than the start time, giving strange\n"
+"duration and billsec times.\n"
+"Next, if the 'd' option was specified, the disposition is copied from\n"
+"the original cdr record to the new forked cdr.\n"
+"Next, if the 'D' option was specified, the destination channel field\n"
+"in the new forked CDR is erased.\n"
+"Next, if the 'e' option was specified, the 'end' time for the original\n"
+"cdr record is set to the current time. Future hang-up or ending events\n"
+"will not override this time stamp.\n"
+"Next, If the 'A' option is specified, the original cdr record will have\n"
+"it ANS_LOCKED flag set, which prevent future answer events\n"
+"from updating the original cdr record's disposition. Normally, an\n"
+"'ANSWERED' event would mark all cdr records in the chain as 'ANSWERED'.\n"
+"Next, if the 'T' option is specified, the original cdr record will have\n"
+"its 'DONT_TOUCH' flag set, which will force the cdr_answer, cdr_end, and\n"
+"cdr_setvar functions to leave that cdr record alone.\n"
+"And, last but not least, the original cdr record has its LOCKED flag\n"
+"set. Almost all internal CDR functions (except for the funcs that set\n"
+"the end, and answer times, and set a variable) will honor this flag\n"
+"and leave a LOCKED cdr record alone.\n"
+"This means that the newly created forked cdr record will affected\n"
+"by events transpiring within Asterisk, with the previously noted\n"
+"exceptions.\n"
" Options:\n"
-" a - update the answer time on the NEW CDR just after it's been inited..\n"
+" a - update the answer time on the NEW CDR just after it's been inited..\n"
" The new CDR may have been answered already, the reset that forkcdr.\n"
-" does will erase the answer time. This will bring it back, but.\n"
+" does will erase the answer time. This will bring it back, but\n"
" the answer time will be a copy of the fork/start time. It will.\n"
" only do this if the initial cdr was indeed already answered..\n"
-" D - Copy the disposition forward from the old cdr, after the .\n"
+" A - Lock the original CDR against the answer time being updated.\n"
+" This will allow the disposition on the original CDR to remain the same.\n"
+" d - Copy the disposition forward from the old cdr, after the .\n"
" init..\n"
-" d - Clear the dstchannel on the new CDR after reset..\n"
-" e - end the original CDR. Do this after all the necc. data.\n"
+" D - Clear the dstchannel on the new CDR after reset..\n"
+" e - end the original CDR. Do this after all the necc. data.\n"
" is copied from the original CDR to the new forked CDR..\n"
" R - do NOT reset the new cdr..\n"
" s(name=val) - Set the CDR var 'name' in the original CDR, with value.\n"
" 'val'.\n"
+" T - Mark the original CDR with a DONT_TOUCH flag. setvar, answer, and end\n"
+" cdr funcs will obey this flag; normally they don't honor the LOCKED\n"
+" flag set on the original CDR record.\n"
+" Beware-- using this flag may cause CDR's not to have their end times\n"
+" updated! It is suggested that if you specify this flag, you might\n"
+" wish to use the 'e' flag as well!\n"
" v - When the new CDR is forked, it gets a copy of the vars attached\n"
" to the current CDR. The vars attached to the original CDR are removed\n"
" unless this option is specified.\n";
@@ -76,6 +137,8 @@
OPT_NORESET = (1 << 4),
OPT_KEEPVARS = (1 << 5),
OPT_VARSET = (1 << 6),
+ OPT_ANSLOCK = (1 << 7),
+ OPT_DONTOUCH = (1 << 8),
};
enum {
@@ -86,11 +149,13 @@
AST_APP_OPTIONS(forkcdr_exec_options, {
AST_APP_OPTION('a', OPT_SETANS),
+ AST_APP_OPTION('A', OPT_ANSLOCK),
AST_APP_OPTION('d', OPT_SETDISP),
AST_APP_OPTION('D', OPT_RESETDEST),
AST_APP_OPTION('e', OPT_ENDCDR),
AST_APP_OPTION('R', OPT_NORESET),
AST_APP_OPTION_ARG('s', OPT_VARSET, OPT_ARG_VARSET),
+ AST_APP_OPTION('T', OPT_DONTOUCH),
AST_APP_OPTION('v', OPT_KEEPVARS),
});
@@ -138,6 +203,12 @@
if (ast_test_flag(&optflags, OPT_ENDCDR))
ast_cdr_end(cdr);
+ if (ast_test_flag(&optflags, OPT_ANSLOCK))
+ ast_set_flag(cdr, AST_CDR_FLAG_ANSLOCKED);
+
+ if (ast_test_flag(&optflags, OPT_DONTOUCH))
+ ast_set_flag(cdr, AST_CDR_FLAG_DONT_TOUCH);
+
ast_set_flag(cdr, AST_CDR_FLAG_CHILD | AST_CDR_FLAG_LOCKED);
}
Modified: team/murf/CDRfix4/apps/app_getcpeid.c
URL: http://svn.digium.com/view/asterisk/team/murf/CDRfix4/apps/app_getcpeid.c?view=diff&rev=122590&r1=122589&r2=122590
==============================================================================
--- team/murf/CDRfix4/apps/app_getcpeid.c (original)
+++ team/murf/CDRfix4/apps/app_getcpeid.c Fri Jun 13 11:45:42 2008
@@ -49,7 +49,7 @@
static char *descrip =
" GetCPEID: Obtains and displays ADSI CPE ID and other information in order\n"
-"to properly setup zapata.conf for on-hook operations.\n";
+"to properly setup chan_dahdi.conf for on-hook operations.\n";
static int cpeid_setstatus(struct ast_channel *chan, char *stuff[], int voice)
Modified: team/murf/CDRfix4/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/murf/CDRfix4/apps/app_meetme.c?view=diff&rev=122590&r1=122589&r2=122590
==============================================================================
--- team/murf/CDRfix4/apps/app_meetme.c (original)
+++ team/murf/CDRfix4/apps/app_meetme.c Fri Jun 13 11:45:42 2008
@@ -30,7 +30,7 @@
*/
/*** MODULEINFO
- <depend>zaptel</depend>
+ <depend>dahdi</depend>
***/
#include "asterisk.h"
@@ -45,7 +45,6 @@
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <zaptel/zaptel.h>
#include "asterisk/lock.h"
#include "asterisk/file.h"
@@ -68,6 +67,8 @@
#include "asterisk/devicestate.h"
#include "asterisk/dial.h"
#include "asterisk/causes.h"
+
+#include "asterisk/dahdi_compat.h"
#include "enter.h"
#include "leave.h"
@@ -580,8 +581,8 @@
while (len) {
if (block) {
- x = ZT_IOMUX_WRITE | ZT_IOMUX_SIGEVENT;
- res = ioctl(fd, ZT_IOMUX, &x);
+ x = DAHDI_IOMUX_WRITE | DAHDI_IOMUX_SIGEVENT;
+ res = ioctl(fd, DAHDI_IOMUX, &x);
} else
res = 0;
if (res >= 0)
@@ -741,7 +742,7 @@
static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin, int make, int dynamic, int refcount)
{
struct ast_conference *cnf;
- struct zt_confinfo ztc = { 0, };
+ DAHDI_CONFINFO ztc = { 0, };
int confno_int = 0;
AST_LIST_LOCK(&confs);
@@ -768,9 +769,9 @@
/* Setup a new zap conference */
ztc.confno = -1;
- ztc.confmode = ZT_CONF_CONFANN | ZT_CONF_CONFANNMON;
+ ztc.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
cnf->fd = open("/dev/zap/pseudo", O_RDWR);
- if (cnf->fd < 0 || ioctl(cnf->fd, ZT_SETCONF, &ztc)) {
+ if (cnf->fd < 0 || ioctl(cnf->fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Unable to open pseudo device\n");
if (cnf->fd >= 0)
close(cnf->fd);
@@ -788,8 +789,8 @@
ast_set_write_format(cnf->chan, AST_FORMAT_SLINEAR);
ztc.chan = 0;
ztc.confno = cnf->zapconf;
- ztc.confmode = ZT_CONF_CONFANN | ZT_CONF_CONFANNMON;
- if (ioctl(cnf->chan->fds[0], ZT_SETCONF, &ztc)) {
+ ztc.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
+ if (ioctl(cnf->chan->fds[0], DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
if (cnf->chan)
ast_hangup(cnf->chan);
@@ -1218,8 +1219,8 @@
}
/* flush any data sitting in the pseudo channel */
- x = ZT_FLUSH_ALL;
- if (ioctl(fd, ZT_FLUSH, &x))
+ x = DAHDI_FLUSH_ALL;
+ if (ioctl(fd, DAHDI_FLUSH, &x))
ast_log(LOG_WARNING, "Error flushing channel\n");
}
@@ -1372,7 +1373,7 @@
struct ast_conf_user *user = NULL;
struct ast_conf_user *usr = NULL;
int fd;
- struct zt_confinfo ztc, ztc_empty;
+ DAHDI_CONFINFO ztc, ztc_empty;
struct ast_frame *f;
struct ast_channel *c;
struct ast_frame fr;
@@ -1405,7 +1406,7 @@
char members[10] = "";
int dtmf, opt_waitmarked_timeout = 0;
time_t timeout = 0;
- ZT_BUFFERINFO bi;
+ DAHDI_BUFFERINFO bi;
char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
char *buf = __buf + AST_FRIENDLY_OFFSET;
int setusercount = 0;
@@ -1444,8 +1445,8 @@
ast_set_write_format(conf->lchan, AST_FORMAT_SLINEAR);
ztc.chan = 0;
ztc.confno = conf->zapconf;
- ztc.confmode = ZT_CONF_CONFANN | ZT_CONF_CONFANNMON;
- if (ioctl(conf->lchan->fds[0], ZT_SETCONF, &ztc)) {
+ ztc.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
+ if (ioctl(conf->lchan->fds[0], DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error starting listen channel\n");
ast_hangup(conf->lchan);
conf->lchan = NULL;
@@ -1616,16 +1617,16 @@
/* Setup buffering information */
memset(&bi, 0, sizeof(bi));
bi.bufsize = CONF_SIZE/2;
- bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
- bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
+ bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
+ bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.numbufs = audio_buffers;
- if (ioctl(fd, ZT_SET_BUFINFO, &bi)) {
+ if (ioctl(fd, DAHDI_SET_BUFINFO, &bi)) {
ast_log(LOG_WARNING, "Unable to set buffering information: %s\n", strerror(errno));
close(fd);
goto outrun;
}
x = 1;
- if (ioctl(fd, ZT_SETLINEAR, &x)) {
+ if (ioctl(fd, DAHDI_SETLINEAR, &x)) {
ast_log(LOG_WARNING, "Unable to set linear mode: %s\n", strerror(errno));
close(fd);
goto outrun;
@@ -1640,7 +1641,7 @@
memset(&ztc_empty, 0, sizeof(ztc_empty));
/* Check to see if we're in a conference... */
ztc.chan = 0;
- if (ioctl(fd, ZT_GETCONF, &ztc)) {
+ if (ioctl(fd, DAHDI_GETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error getting conference\n");
close(fd);
goto outrun;
@@ -1670,15 +1671,15 @@
}
if (confflags & CONFFLAG_WAITMARKED && !conf->markedusers)
- ztc.confmode = ZT_CONF_CONF;
+ ztc.confmode = DAHDI_CONF_CONF;
else if (confflags & CONFFLAG_MONITOR)
- ztc.confmode = ZT_CONF_CONFMON | ZT_CONF_LISTENER;
+ ztc.confmode = DAHDI_CONF_CONFMON | DAHDI_CONF_LISTENER;
else if (confflags & CONFFLAG_TALKER)
- ztc.confmode = ZT_CONF_CONF | ZT_CONF_TALKER;
+ ztc.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER;
else
- ztc.confmode = ZT_CONF_CONF | ZT_CONF_TALKER | ZT_CONF_LISTENER;
-
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ ztc.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER;
+
+ if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
ast_mutex_unlock(&conf->playlock);
@@ -1796,8 +1797,8 @@
if(confflags & CONFFLAG_MARKEDEXIT)
break;
else {
- ztc.confmode = ZT_CONF_CONF;
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ ztc.confmode = DAHDI_CONF_CONF;
+ if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
goto outrun;
@@ -1812,12 +1813,12 @@
/* Marked user entered, so cancel timeout */
timeout = 0;
if (confflags & CONFFLAG_MONITOR)
- ztc.confmode = ZT_CONF_CONFMON | ZT_CONF_LISTENER;
+ ztc.confmode = DAHDI_CONF_CONFMON | DAHDI_CONF_LISTENER;
else if (confflags & CONFFLAG_TALKER)
- ztc.confmode = ZT_CONF_CONF | ZT_CONF_TALKER;
+ ztc.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER;
else
- ztc.confmode = ZT_CONF_CONF | ZT_CONF_TALKER | ZT_CONF_LISTENER;
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ ztc.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER;
+ if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
goto outrun;
@@ -1858,9 +1859,9 @@
/* Check if my modes have changed */
/* If I should be muted but am still talker, mute me */
- if ((user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) && (ztc.confmode & ZT_CONF_TALKER)) {
- ztc.confmode ^= ZT_CONF_TALKER;
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ if ((user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) && (ztc.confmode & DAHDI_CONF_TALKER)) {
+ ztc.confmode ^= DAHDI_CONF_TALKER;
+ if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference - Un/Mute \n");
ret = -1;
break;
@@ -1876,9 +1877,9 @@
}
/* If I should be un-muted but am not talker, un-mute me */
- if (!(user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) && !(confflags & CONFFLAG_MONITOR) && !(ztc.confmode & ZT_CONF_TALKER)) {
- ztc.confmode |= ZT_CONF_TALKER;
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ if (!(user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) && !(confflags & CONFFLAG_MONITOR) && !(ztc.confmode & DAHDI_CONF_TALKER)) {
+ ztc.confmode |= DAHDI_CONF_TALKER;
+ if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference - Un/Mute \n");
ret = -1;
break;
@@ -1909,6 +1910,8 @@
break;
if (c) {
+ char dtmfstr[2] = "";
+
if (c->fds[0] != origfd || (user->zapchannel && (c->audiohooks || c->monitor))) {
if (using_pseudo) {
/* Kill old pseudo */
@@ -1926,6 +1929,11 @@
f = ast_read(c);
if (!f)
break;
+ if (f->frametype == AST_FRAME_DTMF) {
+ dtmfstr[0] = f->subclass;
+ dtmfstr[1] = '\0';
+ }
+
if ((f->frametype == AST_FRAME_VOICE) && (f->subclass == AST_FORMAT_SLINEAR)) {
if (user->talk.actual)
ast_frame_adjust_volume(f, user->talk.actual);
@@ -1976,21 +1984,6 @@
if (user->talking || !(confflags & CONFFLAG_OPTIMIZETALKER))
careful_write(fd, f->data, f->datalen, 0);
}
- } else if ((f->frametype == AST_FRAME_DTMF) && (confflags & CONFFLAG_EXIT_CONTEXT)) {
- char tmp[2];
-
- if (confflags & CONFFLAG_PASS_DTMF)
- conf_queue_dtmf(conf, user, f);
-
- tmp[0] = f->subclass;
- tmp[1] = '\0';
- if (!ast_goto_if_exists(chan, exitcontext, tmp, 1)) {
- ast_log(LOG_DEBUG, "Got DTMF %c, goto context %s\n", tmp[0], exitcontext);
- ret = 0;
- ast_frfree(f);
- break;
- } else if (option_debug > 1)
- ast_log(LOG_DEBUG, "Exit by single digit did not work in meetme. Extension %s does not exist in context %s\n", tmp, exitcontext);
} else if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '#') && (confflags & CONFFLAG_POUNDEXIT)) {
if (confflags & CONFFLAG_PASS_DTMF)
conf_queue_dtmf(conf, user, f);
@@ -2000,7 +1993,7 @@
} else if (((f->frametype == AST_FRAME_DTMF) && (f->subclass == '*') && (confflags & CONFFLAG_STARMENU)) || ((f->frametype == AST_FRAME_DTMF) && menu_active)) {
if (confflags & CONFFLAG_PASS_DTMF)
conf_queue_dtmf(conf, user, f);
- if (ioctl(fd, ZT_SETCONF, &ztc_empty)) {
+ if (ioctl(fd, DAHDI_SETCONF, &ztc_empty)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
ast_frfree(f);
@@ -2146,7 +2139,7 @@
if (musiconhold)
ast_moh_start(chan, NULL, NULL);
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
ast_frfree(f);
@@ -2154,6 +2147,18 @@
}
conf_flush(fd, chan);
+ /* Since this option could absorb dtmf for the previous, we have to check this one last */
+ } else if ((f->frametype == AST_FRAME_DTMF) && (confflags & CONFFLAG_EXIT_CONTEXT) && ast_exists_extension(chan, exitcontext, dtmfstr, 1, "")) {
+ if (confflags & CONFFLAG_PASS_DTMF)
+ conf_queue_dtmf(conf, user, f);
+
+ if (!ast_goto_if_exists(chan, exitcontext, dtmfstr, 1)) {
+ ast_log(LOG_DEBUG, "Got DTMF %c, goto context %s\n", dtmfstr[0], exitcontext);
+ ret = 0;
+ ast_frfree(f);
+ break;
+ } else if (option_debug > 1)
+ ast_log(LOG_DEBUG, "Exit by single digit did not work in meetme. Extension '%s' does not exist in context '%s'\n", dtmfstr, exitcontext);
} else if ((f->frametype == AST_FRAME_DTMF_BEGIN || f->frametype == AST_FRAME_DTMF_END)
&& confflags & CONFFLAG_PASS_DTMF) {
conf_queue_dtmf(conf, user, f);
@@ -2241,7 +2246,7 @@
ztc.chan = 0;
ztc.confno = 0;
ztc.confmode = 0;
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
}
}
@@ -3108,9 +3113,9 @@
if ((sscanf(val, "%d", &audio_buffers) != 1)) {
ast_log(LOG_WARNING, "audiobuffers setting must be a number, not '%s'\n", val);
audio_buffers = DEFAULT_AUDIO_BUFFERS;
- } else if ((audio_buffers < ZT_DEFAULT_NUM_BUFS) || (audio_buffers > ZT_MAX_NUM_BUFS)) {
+ } else if ((audio_buffers < DAHDI_DEFAULT_NUM_BUFS) || (audio_buffers > DAHDI_MAX_NUM_BUFS)) {
ast_log(LOG_WARNING, "audiobuffers setting must be between %d and %d\n",
- ZT_DEFAULT_NUM_BUFS, ZT_MAX_NUM_BUFS);
+ DAHDI_DEFAULT_NUM_BUFS, DAHDI_MAX_NUM_BUFS);
audio_buffers = DEFAULT_AUDIO_BUFFERS;
}
if (audio_buffers != DEFAULT_AUDIO_BUFFERS)
Modified: team/murf/CDRfix4/apps/app_page.c
URL: http://svn.digium.com/view/asterisk/team/murf/CDRfix4/apps/app_page.c?view=diff&rev=122590&r1=122589&r2=122590
==============================================================================
--- team/murf/CDRfix4/apps/app_page.c (original)
+++ team/murf/CDRfix4/apps/app_page.c Fri Jun 13 11:45:42 2008
@@ -26,7 +26,7 @@
*/
/*** MODULEINFO
- <depend>zaptel</depend>
+ <depend>dahdi</depend>
<depend>app_meetme</depend>
***/
Modified: team/murf/CDRfix4/apps/app_parkandannounce.c
[... 2435 lines stripped ...]
More information about the asterisk-commits
mailing list