[asterisk-commits] may: branch may/ooh323_qsig r368561 - in /team/may/ooh323_qsig: ./ apps/ chan...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 5 18:51:22 CDT 2012


Author: may
Date: Tue Jun  5 18:51:15 2012
New Revision: 368561

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=368561
Log:
Multiple revisions 368500,368519,368529

........
  r368500 | mmichelson | 2012-06-05 02:12:19 +0400 (Tue, 05 Jun 2012) | 19 lines
  
  Relay proper SIP responses on calling side.
  
  Revision 351130 broke corect HANGUPCAUSE setting
  for the 404 case in chan_sip. Other cases were also
  potentially broken. This patch fixes the relaying
  of causes to be what they used to be.
  
  (closes issue ASTERISK-19914)
  Reported by Pavel Troller
  Tested by Walter Doekes (via a reviewboard test to be committed later)
  Patches:
  	chan_sip.diff uploaded by Pavel Troller (license #6302)
  ........
  
  Merged revisions 368498 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 368499 from http://svn.asterisk.org/svn/asterisk/branches/10
........
  r368519 | kmoore | 2012-06-05 18:41:43 +0400 (Tue, 05 Jun 2012) | 11 lines
  
  Convert AST_FLAG_ANSWERED_ELSEWHERE usage to AST_CAUSE_ANSWERED_ELSEWHERE
  
  This was essentially duplicated functionality where normal channels used
  AST_CAUSE_ANSWERED_ELSEWHERE while local channels and queues used
  AST_FLAG_ANSWERED_ELSEWHERE.  This removes the flag and converts that usage
  into AST_CAUSE_ANSWERED_ELSEWHER usage.
  
  Review: https://reviewboard.asterisk.org/r/1944
  (closes issue ASTERISK-19865)
  Patch-by: Birger Harzenetter
........
  r368529 | kmoore | 2012-06-05 19:23:43 +0400 (Tue, 05 Jun 2012) | 14 lines
  
  Ensure that pages and emails are sent using RFC822-compliant date format
  
  When localization was added to app_voicemail, these headers were altered
  when they should have remained in en_US format for RFC compliance. This
  reverts the changes to those two lines.
  
  (closes issue ASTERISK-19876)
  ........
  
  Merged revisions 368520 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 368524 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 368500,368519,368529 from http://svn.asterisk.org/svn/asterisk/trunk

Modified:
    team/may/ooh323_qsig/   (props changed)
    team/may/ooh323_qsig/apps/app_dial.c
    team/may/ooh323_qsig/apps/app_queue.c
    team/may/ooh323_qsig/apps/app_voicemail.c
    team/may/ooh323_qsig/channels/chan_local.c
    team/may/ooh323_qsig/channels/chan_sip.c
    team/may/ooh323_qsig/channels/chan_unistim.c
    team/may/ooh323_qsig/include/asterisk/channel.h
    team/may/ooh323_qsig/main/channel_internal_api.c
    team/may/ooh323_qsig/main/features.c

Propchange: team/may/ooh323_qsig/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Propchange: team/may/ooh323_qsig/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun  5 18:51:15 2012
@@ -1,2 +1,2 @@
 /team/mmichelson/private/phones-trunk:358764-361321
-/trunk:357542,368421,368435-368500
+/trunk:357542,368421,368435-368529

Propchange: team/may/ooh323_qsig/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jun  5 18:51:15 2012
@@ -1,1 +1,1 @@
-/trunk:1-368372,368421,368435-368472
+/trunk:1-368372,368421,368435-368472,368500-368529

Modified: team/may/ooh323_qsig/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/apps/app_dial.c?view=diff&rev=368561&r1=368560&r2=368561
==============================================================================
--- team/may/ooh323_qsig/apps/app_dial.c (original)
+++ team/may/ooh323_qsig/apps/app_dial.c Tue Jun  5 18:51:15 2012
@@ -133,8 +133,7 @@
 					<para>Reset the call detail record (CDR) for this call.</para>
 				</option>
 				<option name="c">
-					<para>If the Dial() application cancels this call, always set the flag to tell the channel
-					driver that the call is answered elsewhere.</para>
+					<para>If the Dial() application cancels this call, always set HANGUPCAUSE to 'answered elsewhere'</para>
 				</option>
 				<option name="d">
 					<para>Allow the calling user to dial a 1 digit extension while waiting for
@@ -727,8 +726,6 @@
 		/* Hangup any existing lines we have open */
 		if (outgoing->chan && (outgoing->chan != exception)) {
 			if (answered_elsewhere) {
-				/* The flag is used for local channel inheritance and stuff */
-				ast_set_flag(ast_channel_flags(outgoing->chan), AST_FLAG_ANSWERED_ELSEWHERE);
 				/* This is for the channel drivers */
 				ast_channel_hangupcause_set(outgoing->chan, AST_CAUSE_ANSWERED_ELSEWHERE);
 			}
@@ -2515,12 +2512,12 @@
 		if (outbound_group)
 			ast_app_group_set_channel(tc, outbound_group);
 		/* If the calling channel has the ANSWERED_ELSEWHERE flag set, inherit it. This is to support local channels */
-		if (ast_test_flag(ast_channel_flags(chan), AST_FLAG_ANSWERED_ELSEWHERE))
-			ast_set_flag(ast_channel_flags(tc), AST_FLAG_ANSWERED_ELSEWHERE);
+		if (ast_channel_hangupcause(chan) == AST_CAUSE_ANSWERED_ELSEWHERE)
+			ast_channel_hangupcause_set(tc, AST_CAUSE_ANSWERED_ELSEWHERE);
 
 		/* Check if we're forced by configuration */
 		if (ast_test_flag64(&opts, OPT_CANCEL_ELSEWHERE))
-			 ast_set_flag(ast_channel_flags(tc), AST_FLAG_ANSWERED_ELSEWHERE);
+			 ast_channel_hangupcause_set(tc, AST_CAUSE_ANSWERED_ELSEWHERE);
 
 
 		/* Inherit context and extension */
@@ -3079,11 +3076,11 @@
 	}
 
 	ast_channel_early_bridge(chan, NULL);
-	hanguptree(&out_chans, NULL, 0); /* In this case, there's no answer anywhere */
+	hanguptree(&out_chans, NULL, ast_channel_hangupcause(chan)==AST_CAUSE_ANSWERED_ELSEWHERE ? 1 : 0 ); /* forward 'answered elsewhere' if we received it */
 	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(ast_channel_whentohangup(chan), 0, sizeof(*ast_channel_whentohangup(chan)));

Modified: team/may/ooh323_qsig/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/apps/app_queue.c?view=diff&rev=368561&r1=368560&r2=368561
==============================================================================
--- team/may/ooh323_qsig/apps/app_queue.c (original)
+++ team/may/ooh323_qsig/apps/app_queue.c Tue Jun  5 18:51:15 2012
@@ -3103,7 +3103,7 @@
 		/* Hangup any existing lines we have open */
 		if (outgoing->chan && (outgoing->chan != exception)) {
 			if (exception || cancel_answered_elsewhere) {
-				ast_set_flag(ast_channel_flags(outgoing->chan), AST_FLAG_ANSWERED_ELSEWHERE);
+				ast_channel_hangupcause_set(outgoing->chan, AST_CAUSE_ANSWERED_ELSEWHERE);
 			}
 			ast_hangup(outgoing->chan);
 		}
@@ -3357,7 +3357,7 @@
 	ast_channel_lock_both(tmp->chan, qe->chan);
 
 	if (qe->cancel_answered_elsewhere) {
-		ast_set_flag(ast_channel_flags(tmp->chan), AST_FLAG_ANSWERED_ELSEWHERE);
+		ast_channel_hangupcause_set(tmp->chan, AST_CAUSE_ANSWERED_ELSEWHERE);
 	}
 	ast_channel_appl_set(tmp->chan, "AppQueue");
 	ast_channel_data_set(tmp->chan, "(Outgoing Line)");
@@ -4825,10 +4825,10 @@
 		qe->cancel_answered_elsewhere = 1;
 	}
 
-	/* if the calling channel has the ANSWERED_ELSEWHERE flag set, make sure this is inherited. 
+	/* if the calling channel has AST_CAUSE_ANSWERED_ELSEWHERE set, make sure this is inherited.
 		(this is mainly to support chan_local)
 	*/
-	if (ast_test_flag(ast_channel_flags(qe->chan), AST_FLAG_ANSWERED_ELSEWHERE)) {
+	if (ast_channel_hangupcause(qe->chan) == AST_CAUSE_ANSWERED_ELSEWHERE) {
 		qe->cancel_answered_elsewhere = 1;
 	}
 

Modified: team/may/ooh323_qsig/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/apps/app_voicemail.c?view=diff&rev=368561&r1=368560&r2=368561
==============================================================================
--- team/may/ooh323_qsig/apps/app_voicemail.c (original)
+++ team/may/ooh323_qsig/apps/app_voicemail.c Tue Jun  5 18:51:15 2012
@@ -4839,7 +4839,7 @@
 	}
 
 	snprintf(dur, sizeof(dur), "%d:%02d", duration / 60, duration % 60);
-	ast_strftime_locale(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm), S_OR(vmu->locale, NULL));
+	ast_strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm));
 	fprintf(p, "Date: %s" ENDL, date);
 
 	/* Set date format for voicemail mail */
@@ -5214,7 +5214,7 @@
 		snprintf(who, sizeof(who), "%s@%s", srcemail, host);
 	}
 	snprintf(dur, sizeof(dur), "%d:%02d", duration / 60, duration % 60);
-	ast_strftime_locale(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm), S_OR(vmu->locale, NULL));
+	ast_strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm));
 	fprintf(p, "Date: %s\n", date);
 
 	/* Reformat for custom pager format */

Modified: team/may/ooh323_qsig/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/channels/chan_local.c?view=diff&rev=368561&r1=368560&r2=368561
==============================================================================
--- team/may/ooh323_qsig/channels/chan_local.c (original)
+++ team/may/ooh323_qsig/channels/chan_local.c Tue Jun  5 18:51:15 2012
@@ -37,6 +37,7 @@
 #include <sys/signal.h>
 
 #include "asterisk/lock.h"
+#include "asterisk/causes.h"
 #include "asterisk/channel.h"
 #include "asterisk/config.h"
 #include "asterisk/module.h"
@@ -909,9 +910,9 @@
 
 	ast_channel_cc_params_init(chan, ast_channel_get_cc_config_params(owner));
 
-	/* Make sure we inherit the ANSWERED_ELSEWHERE flag if it's set on the queue/dial call request in the dialplan */
-	if (ast_test_flag(ast_channel_flags(ast), AST_FLAG_ANSWERED_ELSEWHERE)) {
-		ast_set_flag(ast_channel_flags(chan), AST_FLAG_ANSWERED_ELSEWHERE);
+	/* Make sure we inherit the AST_CAUSE_ANSWERED_ELSEWHERE if it's set on the queue/dial call request in the dialplan */
+	if (ast_channel_hangupcause(ast) == AST_CAUSE_ANSWERED_ELSEWHERE) {
+		ast_channel_hangupcause_set(chan, AST_CAUSE_ANSWERED_ELSEWHERE);
 	}
 
 	/* copy the channel variables from the incoming channel to the outgoing channel */
@@ -1028,9 +1029,9 @@
 
 	isoutbound = IS_OUTBOUND(ast, p); /* just comparing pointer of ast */
 
-	if (p->chan && ast_test_flag(ast_channel_flags(ast), AST_FLAG_ANSWERED_ELSEWHERE)) {
-		ast_set_flag(ast_channel_flags(p->chan), AST_FLAG_ANSWERED_ELSEWHERE);
-		ast_debug(2, "This local call has the ANSWERED_ELSEWHERE flag set.\n");
+	if (p->chan && ast_channel_hangupcause(ast) == AST_CAUSE_ANSWERED_ELSEWHERE) {
+		ast_channel_hangupcause_set(p->chan, AST_CAUSE_ANSWERED_ELSEWHERE);
+		ast_debug(2, "This local call has AST_CAUSE_ANSWERED_ELSEWHERE set.\n");
 	}
 
 	if (isoutbound) {

Modified: team/may/ooh323_qsig/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/channels/chan_sip.c?view=diff&rev=368561&r1=368560&r2=368561
==============================================================================
--- team/may/ooh323_qsig/channels/chan_sip.c (original)
+++ team/may/ooh323_qsig/channels/chan_sip.c Tue Jun  5 18:51:15 2012
@@ -6369,11 +6369,8 @@
 		ast_debug(1, "Asked to hangup channel that was not connected\n");
 		return 0;
 	}
-	if (ast_test_flag(ast_channel_flags(ast), AST_FLAG_ANSWERED_ELSEWHERE) || ast_channel_hangupcause(ast) == AST_CAUSE_ANSWERED_ELSEWHERE) {
+	if (ast_channel_hangupcause(ast) == AST_CAUSE_ANSWERED_ELSEWHERE) {
 		ast_debug(1, "This call was answered elsewhere\n");
-		if (ast_channel_hangupcause(ast) == AST_CAUSE_ANSWERED_ELSEWHERE) {
-			ast_debug(1, "####### It's the cause code, buddy. The cause code!!!\n");
-		}
 		append_history(p, "Cancel", "Call answered elsewhere");
 		p->answered_elsewhere = TRUE;
 	}

Modified: team/may/ooh323_qsig/channels/chan_unistim.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/channels/chan_unistim.c?view=diff&rev=368561&r1=368560&r2=368561
==============================================================================
--- team/may/ooh323_qsig/channels/chan_unistim.c (original)
+++ team/may/ooh323_qsig/channels/chan_unistim.c Tue Jun  5 18:51:15 2012
@@ -4856,7 +4856,7 @@
 	refresh_all_favorite(s); /* Update favicons in case of DND keys */
 	if (s->state == STATE_RINGING && sub->subtype == SUB_RING) {
 		send_no_ring(s);
-		if (!ast_test_flag(ast_channel_flags(ast), AST_FLAG_ANSWERED_ELSEWHERE) && ast_channel_hangupcause(ast) != AST_CAUSE_ANSWERED_ELSEWHERE) {
+		if (ast_channel_hangupcause(ast) != AST_CAUSE_ANSWERED_ELSEWHERE) {
 			d->missed_call++;
 			write_history(s, 'i', 1);
 		}

Modified: team/may/ooh323_qsig/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/include/asterisk/channel.h?view=diff&rev=368561&r1=368560&r2=368561
==============================================================================
--- team/may/ooh323_qsig/include/asterisk/channel.h (original)
+++ team/may/ooh323_qsig/include/asterisk/channel.h Tue Jun  5 18:51:15 2012
@@ -835,9 +835,10 @@
 	/*! This is set to tell the channel not to generate DTMF begin frames, and
 	 *  to instead only generate END frames. */
 	AST_FLAG_END_DTMF_ONLY = (1 << 14),
-	/*! Flag to show channels that this call is hangup due to the fact that the call
+	/* OBSOLETED in favor of AST_CAUSE_ANSWERED_ELSEWHERE
+	Flag to show channels that this call is hangup due to the fact that the call
 	    was indeed answered, but in another channel */
-	AST_FLAG_ANSWERED_ELSEWHERE = (1 << 15),
+	/* AST_FLAG_ANSWERED_ELSEWHERE = (1 << 15), */
 	/*! This flag indicates that on a masquerade, an active stream should not
 	 *  be carried over */
 	AST_FLAG_MASQ_NOSTREAM = (1 << 16),

Modified: team/may/ooh323_qsig/main/channel_internal_api.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/main/channel_internal_api.c?view=diff&rev=368561&r1=368560&r2=368561
==============================================================================
--- team/may/ooh323_qsig/main/channel_internal_api.c (original)
+++ team/may/ooh323_qsig/main/channel_internal_api.c Tue Jun  5 18:51:15 2012
@@ -250,7 +250,6 @@
 	ast_data_add_bool(tree, "IN_DTMF", ast_test_flag(ast_channel_flags(chan), AST_FLAG_IN_DTMF));
 	ast_data_add_bool(tree, "EMULATE_DTMF", ast_test_flag(ast_channel_flags(chan), AST_FLAG_EMULATE_DTMF));
 	ast_data_add_bool(tree, "END_DTMF_ONLY", ast_test_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY));
-	ast_data_add_bool(tree, "ANSWERED_ELSEWHERE", ast_test_flag(ast_channel_flags(chan), AST_FLAG_ANSWERED_ELSEWHERE));
 	ast_data_add_bool(tree, "MASQ_NOSTREAM", ast_test_flag(ast_channel_flags(chan), AST_FLAG_MASQ_NOSTREAM));
 	ast_data_add_bool(tree, "BRIDGE_HANGUP_RUN", ast_test_flag(ast_channel_flags(chan), AST_FLAG_BRIDGE_HANGUP_RUN));
 	ast_data_add_bool(tree, "BRIDGE_HANGUP_DONT", ast_test_flag(ast_channel_flags(chan), AST_FLAG_BRIDGE_HANGUP_DONT));

Modified: team/may/ooh323_qsig/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/main/features.c?view=diff&rev=368561&r1=368560&r2=368561
==============================================================================
--- team/may/ooh323_qsig/main/features.c (original)
+++ team/may/ooh323_qsig/main/features.c Tue Jun  5 18:51:15 2012
@@ -7690,8 +7690,8 @@
 
 	ast_channel_queue_connected_line_update(chan, &connected_caller, NULL);
 
-	/* setting this flag to generate a reason header in the cancel message to the ringing channel */
-	ast_set_flag(ast_channel_flags(chan), AST_FLAG_ANSWERED_ELSEWHERE);
+	/* setting the HANGUPCAUSE so the ringing channel knows this call was not a missed call */
+	ast_channel_hangupcause_set(chan, AST_CAUSE_ANSWERED_ELSEWHERE);
 
 	if (ast_channel_masquerade(target, chan)) {
 		ast_log(LOG_WARNING, "Unable to masquerade '%s' into '%s'\n", chan_name,




More information about the asterisk-commits mailing list