[asterisk-commits] mjordan: branch mjordan/cdrs-of-doom r387017 - in /team/mjordan/cdrs-of-doom:...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Apr 30 14:54:01 CDT 2013
Author: mjordan
Date: Tue Apr 30 14:53:54 2013
New Revision: 387017
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=387017
Log:
Merge stuff and a lot of cleanup
Added:
team/mjordan/cdrs-of-doom/configs/stasis_http.conf.sample (with props)
team/mjordan/cdrs-of-doom/res/stasis_http.make (with props)
team/mjordan/cdrs-of-doom/tests/test_stasis_http.c (with props)
Modified:
team/mjordan/cdrs-of-doom/CHANGES
team/mjordan/cdrs-of-doom/UPGRADE.txt
team/mjordan/cdrs-of-doom/apps/app_cdr.c
team/mjordan/cdrs-of-doom/apps/app_forkcdr.c
team/mjordan/cdrs-of-doom/apps/app_queue.c
team/mjordan/cdrs-of-doom/bridges/bridge_softmix.c
team/mjordan/cdrs-of-doom/cdr/cdr_csv.c
team/mjordan/cdrs-of-doom/channels/chan_agent.c
team/mjordan/cdrs-of-doom/configs/features.conf.sample
team/mjordan/cdrs-of-doom/funcs/func_cdr.c
team/mjordan/cdrs-of-doom/include/asterisk/cdr.h
team/mjordan/cdrs-of-doom/include/asterisk/channel.h
team/mjordan/cdrs-of-doom/include/asterisk/test.h
team/mjordan/cdrs-of-doom/main/bridging.c
team/mjordan/cdrs-of-doom/main/cdr.c
team/mjordan/cdrs-of-doom/main/channel.c
team/mjordan/cdrs-of-doom/main/channel_internal_api.c
team/mjordan/cdrs-of-doom/main/frame.c
team/mjordan/cdrs-of-doom/main/http.c
team/mjordan/cdrs-of-doom/main/pbx.c
team/mjordan/cdrs-of-doom/main/stasis.c
team/mjordan/cdrs-of-doom/main/stasis_channels.c
team/mjordan/cdrs-of-doom/main/strings.c
team/mjordan/cdrs-of-doom/main/test.c
team/mjordan/cdrs-of-doom/tests/test_cdr.c
team/mjordan/cdrs-of-doom/tests/test_stasis.c
team/mjordan/cdrs-of-doom/tests/test_strings.c
Modified: team/mjordan/cdrs-of-doom/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/cdrs-of-doom/CHANGES?view=diff&rev=387017&r1=387016&r2=387017
==============================================================================
--- team/mjordan/cdrs-of-doom/CHANGES (original)
+++ team/mjordan/cdrs-of-doom/CHANGES Tue Apr 30 14:53:54 2013
@@ -11,12 +11,94 @@
--- Functionality changes from Asterisk 11 to Asterisk 12 --------------------
------------------------------------------------------------------------------
-CDR changes:
-
-Too many to list, but:
-
-NewPeerAccount AMI event is gone. Just listen for NewAccountCode.
-
+Applications
+------------------
+
+AgentMonitorOutgoing
+------------------
+ * The 'c' option has been removed. It is not possible to modify the name of a
+ channel involved in a CDR.
+
+ForkCDR
+------------------
+ * ForkCDR no longer automatically resets the forked CDR. See the 'r' option
+ for more information.
+
+ * Variables are no longer purged from the original CDR. See the 'v' option for
+ more information.
+
+ * The 'A' option has been removed. The Answer time on a CDR is never updated
+ once set.
+
+ * The 'd' option has been removed. The disposition on a CDR is a function of
+ the state of the channel and cannot be altered.
+
+ * The 'D' option has been removed. Who the Party B is on a CDR is a function
+ of the state of the respective channels, and cannot be altered.
+
+ * The 'r' option has been changed. Previously, ForkCDR always reset the CDR
+ such that the start time and, if applicable, the answer time was updated.
+ Now, by default, ForkCDR simply forks the CDR, maintaining any times. The
+ 'r' option now triggers the Reset, setting the start time (and answer time
+ if applicable) to the current time.
+
+ * The 's' option has been removed. A variable can be set on the original CDR
+ if desired using the CDR function, and removed from a forked CDR using the
+ same function.
+
+ * The 'T' option has been removed. The concept of DONT_TOUCH and LOCKED no
+ longer applies in the CDR engine.
+
+ * The 'v' option now prevents the copy of the variables from the original CDR
+ to the forked CDR. Previously the variables were always copied but were
+ removed from the original. Removing variables from a CDR can have unintended
+ side effects - this option allows the user to prevent propagation of
+ variables from the original to the forked without modifying the original.
+
+MeetMe
+-------------------
+* Added the 'n' option to MeetMe to prevent application of the DENOISE function
+ to a channel joining a conference. Some channel drivers that vary the number
+ of audio samples in a voice frame will experience significant quality problems
+ if a denoiser is attached to the channel; this option gives them the ability
+ to remove the denoiser without having to unload func_speex.
+
+NoCDR
+------------------
+ * The NoCDR application is deprecated. Please use the CDR_PROP function to
+ disable CDRs.
+ * While the NoCDR application will prevent CDRs for a channel from being
+ propagated to registered CDR backends, it will not prevent that data from
+ being collected. Hence, a subsequent call to ResetCDR or the CDR_PROP
+ function that enables CDRs on a channel will restore those records that have
+ not yet been finalized.
+
+Queue
+-------------------
+ * Add queue available hint. exten => 8501,hint,Queue:markq_avail
+ Note: the suffix '_avail' after the queuename.
+ Reports 'InUse' for no logged in agents or no free agents.
+ Reports 'Idle' when an agent is free.
+
+ResetCDR
+------------------
+ * The 'e' option has been deprecated. Use the CDR_PROP function to re-enable
+ CDRs when they were previously disabled on a channel.
+ * The 'w' and 'a' options have been removed. Dispatching CDRs to registered
+ backends occurs on an as-needed basis in order to preserve linkedid
+ propagation and other needed behavior.
+
+SetAMAFlags
+------------------
+ * This application is deprecated in favor of the CHANNEL function.
+
+
+Core
+------------------
+ * Redirecting reasons can now be set to arbitrary strings. This means
+ that the REDIRECTING dialplan function can be used to set the redirecting
+ reason to any string. It also allows for custom strings to be read as the
+ redirecting reason from SIP Diversion headers.
AMI (Asterisk Manager Interface)
------------------
@@ -65,6 +147,70 @@
event, the various ChanVariable fields will contain a suffix that specifies
which channel they correspond to.
+ * The NewPeerAccount AMI event is no longer raised. The NewAccountCode AMI
+ event always conveys the AMI event for a particular channel.
+
+CDR
+------------------
+ * Significant changes have been made to the behavior of CDRs. For a full
+ definition of CDR behavior in Asterisk 12, please read the specification
+ on the Asterisk wiki (wiki.asterisk.org).
+
+ * CDRs will now be created between all participants in a bridge. For each
+ pair of channels in a bridge, a CDR is created to represent the path of
+ communication between those two endpoints. This lets an end user choose who
+ to bill for what during multi-party bridges or bridge operations during
+ transfer scenarios.
+
+ * For non-dialed channels in a bridge, the Party A of a CDR can be set from the
+ dialplan using the CDR_PROP function.
+
+ * When a CDR is dispatched, user defined CDR variables from both parties are
+ included in the resulting CDR. If both parties have the same variable, only
+ the Party A value is provided.
+
+Features
+-------------------
+ * The BRIDGE_FEATURES channel variable would previously only set features for
+ the calling party and would set this feature regardless of whether the
+ feature was in caps or in lowercase. Use of a caps feature for a letter
+ will now apply the feature to the calling party while use of a lowercase
+ letter will apply that feature to the called party.
+
+ * Add support for automixmonitor to the BRIDGE_FEATURES channel variable.
+
+ * PARKINGSLOT and PARKEDLOT channel variables will now be set for a parked
+ channel even when comebactoorigin=yes
+
+ * You can now have the settings for a channel updated using the FEATURE()
+ and FEATUREMAP() functions inherited to child channels by setting
+ FEATURE(inherit)=yes.
+
+Logging
+-------------------
+ * When performing queue pause/unpause on an interface without specifying an
+ individual queue, the PAUSEALL/UNPAUSEALL event will only be logged if at
+ least one member of any queue exists for that interface.
+
+ * Added the 'queue_log_realtime_use_gmt' option to have timestamps in GMT
+ for realtime queue log entries.
+
+Realtime
+------------------
+ * Dynamic realtime tables for SIP Users can now include a 'path' field. This
+ will store the path information for that peer when it registers. Realtime
+ tables can also use the 'supportpath' field to enable Path header support.
+
+ * LDAP realtime configurations for SIP Users now have the AstAccountPathSupport
+ objectIdentifier. This maps to the supportpath option in sip.conf.
+
+Sorcery
+------------------
+ * All future modules which utilize Sorcery for object persistence must have a
+ column named "id" within their schema when using the Sorcery realtime module.
+ This column must be able to contain a string of up to 128 characters in length.
+
+
Channel Drivers
------------------
* When a channel driver is configured to enable jiterbuffers, they are now
@@ -73,6 +219,18 @@
function, then the existing jitterbuffer will be used and the one set by
the channel driver will not be applied.
+chan_agent
+------------------
+ * The updatecdr option has been removed. Altering the names of channels on a
+ CDR is not supported - the name of the channel is the name of the channel,
+ and pretending otherwise helps no one.
+ * The AGENTUPDATECDR channel variable has also been removed, for the same
+ reason as the updatecdr option.
+
+chan_local
+------------------
+ * The /b option has been removed.
+
chan_mobile
------------------
* Added general support for busy detection.
@@ -87,68 +245,43 @@
set of proxies by using a pre-loaded route-set defined by the Path headers in
the REGISTER request. See Realtime updates for more configuration information.
-Features
--------------------
- * The BRIDGE_FEATURES channel variable would previously only set features for
- the calling party and would set this feature regardless of whether the
- feature was in caps or in lowercase. Use of a caps feature for a letter
- will now apply the feature to the calling party while use of a lowercase
- letter will apply that feature to the called party.
-
- * Add support for automixmonitor to the BRIDGE_FEATURES channel variable.
-
- * PARKINGSLOT and PARKEDLOT channel variables will now be set for a parked
- channel even when comebactoorigin=yes
-
- * You can now have the settings for a channel updated using the FEATURE()
- and FEATUREMAP() functions inherited to child channels by setting
- FEATURE(inherit)=yes.
Functions
+------------------
+
+JITTERBUFFER
------------------
* JITTERBUFFER now accepts an argument of 'disabled' which can be used
to remove jitterbuffers previously set on a channel with JITTERBUFFER.
The value of this setting is ignored when disabled is used for the argument.
-Logging
--------------------
- * When performing queue pause/unpause on an interface without specifying an
- individual queue, the PAUSEALL/UNPAUSEALL event will only be logged if at
- least one member of any queue exists for that interface.
-
- * Added the 'queue_log_realtime_use_gmt' option to have timestamps in GMT
- for realtime queue log entries.
-
-MeetMe
--------------------
-* Added the 'n' option to MeetMe to prevent application of the DENOISE function
- to a channel joining a conference. Some channel drivers that vary the number
- of audio samples in a voice frame will experience significant quality problems
- if a denoiser is attached to the channel; this option gives them the ability
- to remove the denoiser without having to unload func_speex.
-
-Queue
--------------------
- * Add queue available hint. exten => 8501,hint,Queue:markq_avail
- Note: the suffix '_avail' after the queuename.
- Reports 'InUse' for no logged in agents or no free agents.
- Reports 'Idle' when an agent is free.
-
-Core
-------------------
- * Redirecting reasons can now be set to arbitrary strings. This means
- that the REDIRECTING dialplan function can be used to set the redirecting
- reason to any string. It also allows for custom strings to be read as the
- redirecting reason from SIP Diversion headers.
-
-Realtime
-------------------
- * Dynamic realtime tables for SIP Users can now include a 'path' field. This
- will store the path information for that peer when it registers. Realtime
- tables can also use the 'supportpath' field to enable Path header support.
-
- * LDAP realtime configurations for SIP Users now have the AstAccountPathSupport
- objectIdentifier. This maps to the supportpath option in sip.conf.
+CDR
+------------------
+ * The 'amaflags' and 'accountcode' attributes for the CDR function are
+ deprecated. Use the CHANNEL function instead to access these attributes.
+ * The 'l' option has been removed. When reading a CDR attribute, the most
+ recent record is always used. When writing a CDR attribute, all non-finalized
+ CDRs are updated.
+ * The 'r' option has been removed, for the same reason as the 'l' option.
+ * The 's' option has been removed, as LOCKED semantics no longer exist in the
+ CDR engine.
+
+CDR_PROP
+------------------
+ * A new function CDR_PROP has been added. This function lets you set properties
+ on a channel's active CDRs. This function is write-only. Properties accept
+ boolean values to set/clear them on the channel's CDRs. Valid properties
+ include:
+ * 'party_a' - make this channel the preferred Party A in any CDR between two
+ channels. If two channels have this property set, the creation time of the
+ channel is used to determine who is Party A. Note that dialed channels are
+ never Party A in a CDR.
+ * 'disable' - disable CDRs on this channel. This is analogous to the NoCDR
+ application when set to True, and analogous to the 'e' option in ResetCDR
+ when set to False.
+
+Resources
+------------------
RTP
------------------
@@ -164,11 +297,7 @@
If no resources exist or all are unavailable the device state is considered
to be unavailable.
-Sorcery
-------------------
- * All future modules which utilize Sorcery for object persistence must have a
- column named "id" within their schema when using the Sorcery realtime module.
- This column must be able to contain a string of up to 128 characters in length.
+
------------------------------------------------------------------------------
--- Functionality changes from Asterisk 10 to Asterisk 11 --------------------
Modified: team/mjordan/cdrs-of-doom/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/cdrs-of-doom/UPGRADE.txt?view=diff&rev=387017&r1=387016&r2=387017
==============================================================================
--- team/mjordan/cdrs-of-doom/UPGRADE.txt (original)
+++ team/mjordan/cdrs-of-doom/UPGRADE.txt Tue Apr 30 14:53:54 2013
@@ -21,6 +21,48 @@
===
===========================================================
+AgentMonitorOutgoing
+ - The 'c' option has been removed. It is not possible to modify the name of a
+ channel involved in a CDR.
+
+NoCDR:
+ - This application is deprecated. Please use the CDR_PROP function instead.
+
+ResetCDR:
+ - The 'w' and 'a' options have been removed. Dispatching CDRs to registered
+ backends occurs on an as-needed basis in order to preserve linkedid
+ propagation and other needed behavior.
+ - The 'e' option is deprecated. Please use the CDR_PROP function to enable
+ CDRs on a channel that they were previously disabled on.
+ - The ResetCDR application is no longer a part of core Asterisk, and instead
+ is now delivered as part of app_cdr.
+
+ForkCDR:
+ - ForkCDR no longer automatically resets the forked CDR. See the 'r' option
+ for more information.
+ - Variables are no longer purged from the original CDR. See the 'v' option for
+ more information.
+ - The 'A' option has been removed. The Answer time on a CDR is never updated
+ once set.
+ - The 'd' option has been removed. The disposition on a CDR is a function of
+ the state of the channel and cannot be altered.
+ - The 'D' option has been removed. Who the Party B is on a CDR is a function
+ of the state of the respective channels, and cannot be altered.
+ - The 'r' option has been changed. Previously, ForkCDR always reset the CDR
+ such that the start time and, if applicable, the answer time was updated.
+ Now, by default, ForkCDR simply forks the CDR, maintaining any times. The
+ 'r' option now triggers the Reset, setting the start time (and answer time
+ if applicable) to the current time.
+ - The 's' option has been removed. A variable can be set on the original CDR
+ if desired using the CDR function, and removed from a forked CDR using the
+ same function.
+ - The 'T' option has been removed. The concept of DONT_TOUCH and LOCKED no
+ longer applies in the CDR engine.
+ - The 'v' option now prevents the copy of the variables from the original CDR
+ to the forked CDR. Previously the variables were always copied but were
+ removed from the original. Removing variables from a CDR can have unintended
+ side effects - this option allows the user to prevent propagation of
+ variables from the original to the forked without modifying the original.
AMI:
- The SIP SIPqualifypeer action now sends a response indicating it will qualify
@@ -63,11 +105,24 @@
- Now recognizes 'W' to pause sending DTMF for one second in addition to
the previously existing 'w' that paused sending DTMF for half a second.
+SetAMAFlags
+ - This application is deprecated in favor of the CHANNEL function.
+
+chan_agent:
+ - The updatecdr option has been removed. Altering the names of channels on a
+ CDR is not supported - the name of the channel is the name of the channel,
+ and pretending otherwise helps no one.
+ - The AGENTUPDATECDR channel variable has also been removed, for the same
+ reason as the updatecdr option.
+
chan_dahdi:
- Analog port dialing and deferred DTMF dialing for PRI now distinguishes
between 'w' and 'W'. The 'w' pauses dialing for half a second. The 'W'
pauses dialing for one second.
- The default for inband_on_proceeding has changed to no.
+
+chan_local:
+ - The /b option has been removed.
Dialplan:
- All channel and global variable names are evaluated in a case-sensitive manner.
@@ -80,6 +135,12 @@
- BRIDGE_FEATURES channel variable is now casesensitive for feature letter codes.
Uppercase variants apply them to the calling party while lowercase variants
apply them to the called party.
+
+Features:
+ - The features.conf [applicationmap] <FeatureName> ActivatedBy option is
+ no longer honored. The feature is activated by which channel
+ DYNAMIC_FEATURES includes the feature is on. Use predial to set different
+ values of DYNAMIC_FEATURES on the channels
From 10 to 11:
Modified: team/mjordan/cdrs-of-doom/apps/app_cdr.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/cdrs-of-doom/apps/app_cdr.c?view=diff&rev=387017&r1=387016&r2=387017
==============================================================================
--- team/mjordan/cdrs-of-doom/apps/app_cdr.c (original)
+++ team/mjordan/cdrs-of-doom/apps/app_cdr.c Tue Apr 30 14:53:54 2013
@@ -48,8 +48,8 @@
the current channel. This does <emphasis>NOT</emphasis> mean that
information is not tracked; rather, if the channel is hung up no
CDRs will be created for that channel.</para>
- <para>If a subsequent call to ResetCDR occurs, all CDRs created for
- the channel will be enabled.</para>
+ <para>If a subsequent call to ResetCDR occurs, all non-finalized
+ CDRs created for the channel will be enabled.</para>
<note><para>This application is deprecated. Please use the CDR_PROP
function to disable CDRs on a channel.</para></note>
</description>
Modified: team/mjordan/cdrs-of-doom/apps/app_forkcdr.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/cdrs-of-doom/apps/app_forkcdr.c?view=diff&rev=387017&r1=387016&r2=387017
==============================================================================
--- team/mjordan/cdrs-of-doom/apps/app_forkcdr.c (original)
+++ team/mjordan/cdrs-of-doom/apps/app_forkcdr.c Tue Apr 30 14:53:54 2013
@@ -44,7 +44,7 @@
/*** DOCUMENTATION
<application name="ForkCDR" language="en_US">
<synopsis>
- Forks the Call Data Record.
+ Forks the current Call Data Record for this channel.
</synopsis>
<syntax>
<parameter name="options">
@@ -55,11 +55,11 @@
not used, the answer time on the forked CDR will be the
answer time on the original CDR. If the channel is not
answered, this option has no effect.</para>
- <para>Note that this option is implicitly assumed by the
- <literal>r</literal> option.</para>
+ <para>Note that this option is implicitly assumed if the
+ <literal>r</literal> option is used.</para>
</option>
<option name="e">
- <para>End the original CDR.</para>
+ <para>End (finalize) the original CDR.</para>
</option>
<option name="r">
<para>Reset the start and answer times on the forked CDR.
Modified: team/mjordan/cdrs-of-doom/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/cdrs-of-doom/apps/app_queue.c?view=diff&rev=387017&r1=387016&r2=387017
==============================================================================
--- team/mjordan/cdrs-of-doom/apps/app_queue.c (original)
+++ team/mjordan/cdrs-of-doom/apps/app_queue.c Tue Apr 30 14:53:54 2013
@@ -3625,10 +3625,7 @@
member_call_pending_clear(tmp->member);
- /* BUGBUG: Set the CDR to busy somehow */
- /*if (ast_channel_cdr(qe->chan)) {
- ast_cdr_busy(ast_channel_cdr(qe->chan));
- }*/
+ /* BUGBUG: Raise a BUSY dial end message here */
tmp->stillgoing = 0;
++*busies;
return 0;
@@ -4134,16 +4131,14 @@
if (pos == 1 /* not found */) {
if (numlines == (numbusies + numnochan)) {
ast_debug(1, "Everyone is busy at this time\n");
- /* BUGBUG: make the CDR busy */
- /*if (ast_channel_cdr(in) && ast_channel_state(in) != AST_STATE_UP) {
- ast_cdr_busy(ast_channel_cdr(in));
- }*/
+ /* BUGBUG: We shouldn't have to set anything here, as each
+ * individual dial attempt should have set that CDR to busy
+ */
} else {
ast_debug(3, "No one is answering queue '%s' (%d numlines / %d busies / %d failed channels)\n", queue, numlines, numbusies, numnochan);
- /* BUGBUG: make the CDR failed */
- /*if (ast_channel_cdr(in) && ast_channel_state(in) != AST_STATE_UP) {
- ast_cdr_failed(ast_channel_cdr(in));
- }*/
+ /* BUGBUG: We shouldn't have to set anything here, as each
+ * individual dial attempt should have set that CDR to busy
+ */
}
*to = 0;
return NULL;
@@ -4329,6 +4324,7 @@
if (f->frametype == AST_FRAME_CONTROL) {
switch (f->subclass.integer) {
case AST_CONTROL_ANSWER:
+ /* BUGBUG: Raise an ANSWER dial end message here */
/* This is our guy if someone answered. */
if (!peer) {
ast_verb(3, "%s answered %s\n", ochan_name, inchan_name);
@@ -4363,10 +4359,7 @@
break;
case AST_CONTROL_BUSY:
ast_verb(3, "%s is busy\n", ochan_name);
- /* BUGBUG: make the CDR busy */
- /*if (ast_channel_cdr(in)) {
- ast_cdr_busy(ast_channel_cdr(in));
- }*/
+ /* BUGBUG: Raise a BUSY dial end message here */
do_hang(o);
endtime = (long) time(NULL);
endtime -= starttime;
@@ -4385,10 +4378,7 @@
break;
case AST_CONTROL_CONGESTION:
ast_verb(3, "%s is circuit-busy\n", ochan_name);
- /* BUGBUG make the CDR congested */
- /*if (ast_channel_cdr(in)) {
- ast_cdr_failed(ast_channel_cdr(in));
- }*/
+ /* BUGBUG: Raise a CONGESTION dial end message here */
endtime = (long) time(NULL);
endtime -= starttime;
rna(endtime * 1000, qe, on, membername, qe->parent->autopauseunavail);
@@ -4520,10 +4510,7 @@
ast_verb(3, "User hit %c to disconnect call.\n", f->subclass.integer);
*to = 0;
ast_frfree(f);
- /* BUGBUG: No answer */
- /*if (ast_channel_cdr(in) && ast_channel_state(in) != AST_STATE_UP) {
- ast_cdr_noanswer(ast_channel_cdr(in));
- }*/
+ /* BUGBUG: Raise a NO ANSWER dial end message here */
return NULL;
}
if ((f->frametype == AST_FRAME_DTMF) && valid_exit(qe, f->subclass.integer)) {
@@ -4531,10 +4518,7 @@
*to = 0;
*digit = f->subclass.integer;
ast_frfree(f);
- /* BUGBUG: No answer */
- /*if (ast_channel_cdr(in) && ast_channel_state(in) != AST_STATE_UP) {
- ast_cdr_noanswer(ast_channel_cdr(in));
- }*/
+ /* BUGBUG: Raise a NO ANSWER dial end message here */
return NULL;
}
@@ -4590,12 +4574,7 @@
rna(orig, qe, o->interface, o->member->membername, 1);
}
- /* BUGBUG: No answer */
- /*if (ast_channel_cdr(in)
- && ast_channel_state(in) != AST_STATE_UP
- && (!*to || ast_check_hangup(in))) {
- ast_cdr_noanswer(ast_channel_cdr(in));
- }*/
+ /* BUGBUG: Raise a NO ANSWER dial end message here */
}
#ifdef HAVE_EPOLL
@@ -5540,6 +5519,7 @@
/* Caller must have hung up just before being connected */
ast_log(LOG_NOTICE, "Caller was about to talk to agent on %s but the caller hungup.\n", ast_channel_name(peer));
ast_queue_log(queuename, ast_channel_uniqueid(qe->chan), member->membername, "ABANDON", "%d|%d|%ld", qe->pos, qe->opos, (long) time(NULL) - qe->start);
+ /* BUGBUG: Send a CANCEL dial end message */
record_abandoned(qe);
ast_autoservice_chan_hangup_peer(qe->chan, peer);
ao2_ref(member, -1);
@@ -5552,19 +5532,14 @@
} else {
ast_moh_stop(qe->chan);
}
- /* If appropriate, log that we have a destination channel */
- /* BUGBUG: remove me */
- /*if (ast_channel_cdr(qe->chan)) {
- ast_cdr_setdestchan(ast_channel_cdr(qe->chan), ast_channel_name(peer));
- }*/
+
/* Make sure channels are compatible */
res = ast_channel_make_compatible(qe->chan, peer);
if (res < 0) {
ast_queue_log(queuename, ast_channel_uniqueid(qe->chan), member->membername, "SYSCOMPAT", "%s", "");
ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", ast_channel_name(qe->chan), ast_channel_name(peer));
record_abandoned(qe);
- /* BUGBUG: Fail the CDR? */
- /*ast_cdr_failed(ast_channel_cdr(qe->chan));*/
+ /* BUGBUG: Send a CANCEL dial end message */
ast_autoservice_chan_hangup_peer(qe->chan, peer);
ao2_ref(member, -1);
return -1;
@@ -5713,19 +5688,15 @@
}
ast_debug(1, "Arguments being passed to MixMonitor: %s\n", mixmonargs);
- /* XXX TODO BUGBUG and all that
+ /* BUGBUG
* This needs to be done differently. We need to start a MixMonitor on
* the actual queue bridge itself, not drop some channel out and pull it
- * back. Doing it this way sucks.
+ * back. Once the media channel work is done, start a media channel on
+ * the bridge.
+ *
+ * Alternatively, don't use pbx_exec to put an audio hook on a channel.
*/
- /* We purposely lock the CDR so that pbx_exec does not update the application data */
- /*if (ast_channel_cdr(qe->chan)) {
- ast_set_flag(ast_channel_cdr(qe->chan), AST_CDR_FLAG_LOCKED);
- }*/
pbx_exec(qe->chan, mixmonapp, mixmonargs);
- /*if (ast_channel_cdr(qe->chan)) {
- ast_clear_flag(ast_channel_cdr(qe->chan), AST_CDR_FLAG_LOCKED);
- }*/
} else {
ast_log(LOG_WARNING, "Asked to run MixMonitor on this call, but cannot find the MixMonitor app!\n");
}
Modified: team/mjordan/cdrs-of-doom/bridges/bridge_softmix.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/cdrs-of-doom/bridges/bridge_softmix.c?view=diff&rev=387017&r1=387016&r2=387017
==============================================================================
--- team/mjordan/cdrs-of-doom/bridges/bridge_softmix.c (original)
+++ team/mjordan/cdrs-of-doom/bridges/bridge_softmix.c Tue Apr 30 14:53:54 2013
@@ -873,9 +873,13 @@
AST_LIST_TRAVERSE(&bridge->channels, bridge_channel, entry) {
struct softmix_channel *sc = bridge_channel->tech_pvt;
- if (!sc) {
- continue;
- }
+ /* BUGBUG
+ * There is a crash here when using ast_bridge_depart. It doesn't
+ * happen often, but somehow this is getting called on a bridge_channel
+ * with no sc pointer. Checking for NULL here doesn't solve it
+ * either, which means that it's getting nuked after checking here
+ * but before the ast_mutex_lock later on.
+ */
/* Update the sample rate to match the bridge's native sample rate if necessary. */
if (update_all_rates) {
Modified: team/mjordan/cdrs-of-doom/cdr/cdr_csv.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/cdrs-of-doom/cdr/cdr_csv.c?view=diff&rev=387017&r1=387016&r2=387017
==============================================================================
--- team/mjordan/cdrs-of-doom/cdr/cdr_csv.c (original)
+++ team/mjordan/cdrs-of-doom/cdr/cdr_csv.c Tue Apr 30 14:53:54 2013
@@ -285,9 +285,6 @@
char buf[1024];
char csvmaster[PATH_MAX];
snprintf(csvmaster, sizeof(csvmaster),"%s/%s/%s", ast_config_AST_LOG_DIR, CSV_LOG_DIR, CSV_MASTER);
-#if 0
- printf("[CDR] %s ('%s' -> '%s') Dur: %ds Bill: %ds Disp: %s Flags: %s Account: [%s]\n", cdr->channel, cdr->src, cdr->dst, cdr->duration, cdr->billsec, ast_cdr_disp2str(cdr->disposition), ast_channel_amaflags2string(cdr->amaflags), cdr->accountcode);
-#endif
if (build_csv_record(buf, sizeof(buf), cdr)) {
ast_log(LOG_WARNING, "Unable to create CSV record in %d bytes. CDR not recorded!\n", (int)sizeof(buf));
return 0;
Modified: team/mjordan/cdrs-of-doom/channels/chan_agent.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/cdrs-of-doom/channels/chan_agent.c?view=diff&rev=387017&r1=387016&r2=387017
==============================================================================
--- team/mjordan/cdrs-of-doom/channels/chan_agent.c (original)
+++ team/mjordan/cdrs-of-doom/channels/chan_agent.c Tue Apr 30 14:53:54 2013
@@ -112,10 +112,6 @@
<optionlist>
<option name="d">
<para>make the app return <literal>-1</literal> if there is an error condition.</para>
- </option>
- <option name="c">
- <para>change the CDR so that the source of the call is
- <literal>Agent/agent_id</literal></para>
</option>
<option name="n">
<para>don't generate the warnings when there is no callerid or the
@@ -235,7 +231,6 @@
static char recordformatext[AST_MAX_BUF] = "";
static char urlprefix[AST_MAX_BUF] = "";
static char savecallsin[AST_MAX_BUF] = "";
-static int updatecdr = 0;
static char beep[AST_MAX_BUF] = "beep";
#define GETAGENTBYCALLERID "AGENTBYCALLERID"
@@ -1197,12 +1192,6 @@
strcpy(agentgoodbye,v->value);
} else if (!strcasecmp(v->name, "musiconhold")) {
ast_copy_string(moh, v->value, sizeof(moh));
- } else if (!strcasecmp(v->name, "updatecdr")) {
- /* BUGBUG TODO: deprecate this */
- if (ast_true(v->value))
- updatecdr = 1;
- else
- updatecdr = 0;
} else if (!strcasecmp(v->name, "autologoffunavail")) {
if (ast_true(v->value))
autologoffunavail = 1;
@@ -2234,14 +2223,12 @@
char agent[AST_MAX_AGENT];
if (data) {
- if (strchr(data, 'd'))
+ if (strchr(data, 'd')) {
exitifnoagentid = 1;
- if (strchr(data, 'n'))
+ }
+ if (strchr(data, 'n')) {
nowarnings = 1;
- if (strchr(data, 'c')) {
- /* TODO: deprecate this */
- }
-
+ }
}
if (ast_channel_caller(chan)->id.number.valid
&& !ast_strlen_zero(ast_channel_caller(chan)->id.number.str)) {
Modified: team/mjordan/cdrs-of-doom/configs/features.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/cdrs-of-doom/configs/features.conf.sample?view=diff&rev=387017&r1=387016&r2=387017
==============================================================================
--- team/mjordan/cdrs-of-doom/configs/features.conf.sample (original)
+++ team/mjordan/cdrs-of-doom/configs/features.conf.sample Tue Apr 30 14:53:54 2013
@@ -157,7 +157,7 @@
;
; Set(__DYNAMIC_FEATURES=myfeature1#myfeature2#myfeature3)
;
-; (Note: The two leading underscores allow these feature settings to be set on
+; (Note: The two leading underscores allow these feature settings to be set
; on the outbound channels, as well. Otherwise, only the original channel
; will have access to these features.)
;
@@ -176,10 +176,10 @@
; application on the same channel that activated the feature. "peer"
; means run the application on the opposite channel from the one that
; has activated the feature.
-; ActivatedBy -> This is which channel is allowed to activate this feature. Valid
-; values are "caller", "callee", and "both". "both" is the default.
-; The "caller" is the channel that executed the Dial application, while
-; the "callee" is the channel called by the Dial application.
+; ActivatedBy -> ActivatedBy is no longer honored. The feature is activated by which
+; channel DYNAMIC_FEATURES includes the feature is on. Use predial
+; to set different values of DYNAMIC_FEATURES on the channels.
+; Historic values are: "caller", "callee", and "both".
; Application -> This is the application to execute.
; AppArguments -> These are the arguments to be passed into the application. If you need
; commas in your arguments, you should use either the second or third
@@ -194,8 +194,9 @@
; applications. When applications are used in extensions.conf, they are executed
; by the PBX core. In this case, these applications are executed outside of the
; PBX core, so it does *not* make sense to use any application which has any
-; concept of dialplan flow. Examples of this would be things like Macro, Goto,
-; Background, WaitExten, and many more.
+; concept of dialplan flow. Examples of this would be things like Goto,
+; Background, WaitExten, and many more. The exceptions to this are Gosub and
+; Macro routines which must complete for the call to continue.
;
; Enabling these features means that the PBX needs to stay in the media flow and
; media will not be re-directed if DTMF is sent in the media stream.
Added: team/mjordan/cdrs-of-doom/configs/stasis_http.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/cdrs-of-doom/configs/stasis_http.conf.sample?view=auto&rev=387017
==============================================================================
--- team/mjordan/cdrs-of-doom/configs/stasis_http.conf.sample (added)
+++ team/mjordan/cdrs-of-doom/configs/stasis_http.conf.sample Tue Apr 30 14:53:54 2013
@@ -1,0 +1,25 @@
+[general]
+enabled = yes ; When set to no, stasis-http support is disabled
+;pretty = no ; When set to yes, responses from stasis-http are
+; ; formatted to be human readable
+;allowed_origins = ; Comma separated list of allowed origins, for
+; ; Cross-Origin Resource Sharing. May be set to * to allow
+; ; all origins.
+
+;[user-username]
+;read_only = no ; When set to yes, user is only authorized for
+; ; read-only requests
+;
+; If a password is specified, user must authenticate using HTTP Basic
+; authentication. If no password is specified, then the user may authenticate
+; simply by adding ?api_key=username to their requests.
+;
+;password = ; Crypted or plaintext password (see crypt_password)
+;
+; crypt_password may be set to crypt (the default) or plain. When set to crypt,
+; crypt(3) is used to encrypt the password. A crypted password can be generated
+; using mkpasswd -m sha-512.
+;
+; When set to plain, the password is in plaintext
+;
+;crypt_password = plain
Propchange: team/mjordan/cdrs-of-doom/configs/stasis_http.conf.sample
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/mjordan/cdrs-of-doom/configs/stasis_http.conf.sample
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/mjordan/cdrs-of-doom/configs/stasis_http.conf.sample
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: team/mjordan/cdrs-of-doom/funcs/func_cdr.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/cdrs-of-doom/funcs/func_cdr.c?view=diff&rev=387017&r1=387016&r2=387017
==============================================================================
--- team/mjordan/cdrs-of-doom/funcs/func_cdr.c (original)
+++ team/mjordan/cdrs-of-doom/funcs/func_cdr.c Tue Apr 30 14:53:54 2013
@@ -193,8 +193,7 @@
enum cdr_option_flags {
OPT_UNPARSED = (1 << 1),
- OPT_LAST = (1 << 2),
- OPT_FLOAT = (1 << 4),
+ OPT_FLOAT = (1 << 2),
};
AST_APP_OPTIONS(cdr_func_options, {
@@ -236,27 +235,43 @@
if (ast_test_flag(&flags, OPT_FLOAT) && (!strcasecmp("billsec", args.variable) || !strcasecmp("duration", args.variable))) {
long ms;
double dtime;
- sscanf(tempbuf, "%ld", &ms);
+ if (sscanf(tempbuf, "%30ld", &ms) != 1) {
+ ast_log(AST_LOG_WARNING, "Failed to retrieve %s from the CDR for channel %s\n",
+ args.variable, ast_channel_name(chan));
+ return 0;
+ }
dtime = (double)(ms / 1000.0);
- snprintf(tempbuf, sizeof(*tempbuf), "%lf", dtime);
+ sprintf(tempbuf, "%lf", dtime);
} else if (!ast_test_flag(&flags, OPT_UNPARSED)) {
if (!strcasecmp("start", args.variable)
|| !strcasecmp("end", args.variable)
|| !strcasecmp("answer", args.variable)) {
struct timeval fmt_time;
struct ast_tm tm;
- sscanf(tempbuf, "%ld.%ld", &fmt_time.tv_sec, &fmt_time.tv_usec);
+ if (sscanf(tempbuf, "%ld.%ld", &fmt_time.tv_sec, &fmt_time.tv_usec) != 2) {
+ ast_log(AST_LOG_WARNING, "Failed to retrieve %s from the CDR for channel %s\n",
+ args.variable, ast_channel_name(chan));
+ return 0;
+ }
ast_localtime(&fmt_time, &tm, NULL);
ast_strftime(tempbuf, sizeof(*tempbuf), "%Y-%m-%d %T", &tm);
} else if (!strcasecmp("disposition", args.variable)) {
int disposition;
- sscanf(tempbuf, "%8d", &disposition);
- snprintf(format_buf, sizeof(format_buf), "%s", ast_cdr_disp2str(disposition));
+ if (sscanf(tempbuf, "%8d", &disposition) != 1) {
+ ast_log(AST_LOG_WARNING, "Failed to retrieve %s from the CDR for channel %s\n",
+ args.variable, ast_channel_name(chan));
+ return 0;
+ }
+ sprintf(format_buf, "%s", ast_cdr_disp2str(disposition));
strcpy(tempbuf, format_buf);
} else if (!strcasecmp("amaflags", args.variable)) {
int amaflags;
- sscanf(tempbuf, "%8d", &amaflags);
- snprintf(format_buf, sizeof(format_buf), "%s", ast_channel_amaflags2string(amaflags));
+ if (sscanf(tempbuf, "%8d", &amaflags) != 1) {
+ ast_log(AST_LOG_WARNING, "Failed to retrieve %s from the CDR for channel %s\n",
+ args.variable, ast_channel_name(chan));
+ return 0;
+ }
+ sprintf(format_buf, "%s", ast_channel_amaflags2string(amaflags));
strcpy(tempbuf, format_buf);
}
}
@@ -365,4 +380,4 @@
return res;
}
-AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Call Detail Record (CDR) dialplan function");
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Call Detail Record (CDR) dialplan functions");
Modified: team/mjordan/cdrs-of-doom/include/asterisk/cdr.h
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/cdrs-of-doom/include/asterisk/cdr.h?view=diff&rev=387017&r1=387016&r2=387017
==============================================================================
[... 2293 lines stripped ...]
More information about the asterisk-commits
mailing list