[asterisk-commits] jpeeler: branch 1.6.2 r246073 - in /branches/1.6.2: ./ channels/chan_local.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 10 10:59:00 CST 2010


Author: jpeeler
Date: Wed Feb 10 10:58:55 2010
New Revision: 246073

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=246073
Log:
Merged revisions 246070 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r246070 | jpeeler | 2010-02-10 10:47:37 -0600 (Wed, 10 Feb 2010) | 22 lines
  
  Change channel state on local channels for busy,answer,ring.
    
  Previously local channels channel state never changed. This became problematic
  when the state of the other side of the local channel was lost, for example
  during a masquerade. Changing the state of the local channel allows for the
  scenario to be detected when the channel state is set to ringing, but the peer
  isn't ringing. The specific problem scenario is described in 164201. Although
  this was noted on one of the issues, here is the tested dialplan verified to
  work:
  
  exten => 9700,1,Dial(Local/*9700 at default&Local/0009700 at default)
  
  exten => *9700,1,Set(GLOBAL(TESTCHAN)=${CHANNEL:0:${MATH(${LEN(${CHANNEL})}-1):0:2}}1)
  exten => *9700,n,wait(3) ;3 works, 1 did not
  exten => *9700,n,Dial(SIP/5001)
  
  exten => 0009700,1,Wait(1) ;1 works, 3 did not
  exten => 0009700,n,ChannelRedirect(${TESTCHAN},parkedcalls,701,1)
  
  (closes issue #14992)
  Reported by: davidw
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/channels/chan_local.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_local.c?view=diff&rev=246073&r1=246072&r2=246073
==============================================================================
--- branches/1.6.2/channels/chan_local.c (original)
+++ branches/1.6.2/channels/chan_local.c Wed Feb 10 10:58:55 2010
@@ -251,6 +251,42 @@
 	}
 
 	if (other) {
+		if (f->frametype == AST_FRAME_CONTROL) {
+			switch (f->subclass) {
+			case AST_CONTROL_RINGING:
+				ast_setstate(other, AST_STATE_RINGING);
+				break;
+			case AST_CONTROL_ANSWER:
+				ast_setstate(other, AST_STATE_UP);
+				break;
+			case AST_CONTROL_BUSY:
+				ast_setstate(other, AST_STATE_BUSY);
+				break;
+
+			/* not going to handle these */
+			case AST_CONTROL_HANGUP:
+			case AST_CONTROL_RING:
+			case AST_CONTROL_TAKEOFFHOOK:
+			case AST_CONTROL_OFFHOOK:
+			case AST_CONTROL_CONGESTION:
+			case AST_CONTROL_FLASH:
+			case AST_CONTROL_WINK:
+			case AST_CONTROL_OPTION:
+			case AST_CONTROL_RADIO_KEY:
+			case AST_CONTROL_RADIO_UNKEY:
+			case AST_CONTROL_PROGRESS:
+			case AST_CONTROL_PROCEEDING:
+			case AST_CONTROL_HOLD:
+			case AST_CONTROL_UNHOLD:
+			case AST_CONTROL_VIDUPDATE:
+			case AST_CONTROL_SRCUPDATE:
+			case AST_CONTROL_T38_PARAMETERS:
+				break;
+			default:
+				/* since we're switching on an int, we can't rely on the compiler */
+				ast_log(LOG_WARNING, "New unhandled control frame added!!!\n");
+			}
+		}
 		ast_queue_frame(other, f);
 		ast_channel_unlock(other);
 	}




More information about the asterisk-commits mailing list