[asterisk-commits] jpeeler: trunk r260437 - in /trunk: ./ channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 30 17:36:53 CDT 2010


Author: jpeeler
Date: Fri Apr 30 17:36:49 2010
New Revision: 260437

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=260437
Log:
Merged revisions 260434 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r260434 | jpeeler | 2010-04-30 17:22:46 -0500 (Fri, 30 Apr 2010) | 11 lines
  
  Ensure channel state is not incorrectly set in the case of a very early answer.
  
  The needringing bit was being read in dahdi_read after answering thereby
  setting the state to ringing from up. This clears needringing upon answering
  so that is no longer possible.
  
  (closes issue #17067)
  Reported by: tzafrir
  Patches: 
        needringing.diff uploaded by tzafrir (license 46)
........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_dahdi.c
    trunk/channels/sig_analog.c
    trunk/channels/sig_analog.h

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=260437&r1=260436&r2=260437
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Fri Apr 30 17:36:49 2010
@@ -2625,6 +2625,12 @@
 	return dahdi_set_hook(p->subs[SUB_REAL].dfd, DAHDI_OFFHOOK);
 }
 
+static void my_set_needringing(void *pvt, int value)
+{
+	struct dahdi_pvt *p = pvt;
+	p->subs[SUB_REAL].needringing = value;
+}
+
 static int my_start(void *pvt)
 {
 	struct dahdi_pvt *p = pvt;
@@ -3129,6 +3135,7 @@
 	.confmute = my_confmute,
 	.set_pulsedial = my_set_pulsedial,
 	.get_orig_dialstring = my_get_orig_dialstring,
+	.set_needringing = my_set_needringing,
 };
 
 static struct dahdi_pvt *round_robin[32];
@@ -7599,6 +7606,7 @@
 				p->subs[idx].f.frametype = AST_FRAME_CONTROL;
 				p->subs[idx].f.subclass.integer = AST_CONTROL_ANSWER;
 				/* Make sure it stops ringing */
+				p->subs[SUB_REAL].needringing = 0;
 				dahdi_set_hook(p->subs[idx].dfd, DAHDI_OFFHOOK);
 				ast_debug(1, "channel %d answered\n", p->channel);
 				if (p->cidspill) {

Modified: trunk/channels/sig_analog.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_analog.c?view=diff&rev=260437&r1=260436&r2=260437
==============================================================================
--- trunk/channels/sig_analog.c (original)
+++ trunk/channels/sig_analog.c Fri Apr 30 17:36:49 2010
@@ -517,6 +517,13 @@
 		return p->calls->off_hook(p->chan_pvt);
 	}
 	return -1;
+}
+
+static void analog_set_needringing(struct analog_pvt *p, int value)
+{
+	if (p->calls->set_needringing) {
+		return p->calls->set_needringing(p->chan_pvt, value);
+	}
 }
 
 static int analog_dsp_set_digitmode(struct analog_pvt *p, enum analog_dsp_digitmode mode)
@@ -2662,6 +2669,7 @@
 				p->subs[index].f.frametype = AST_FRAME_CONTROL;
 				p->subs[index].f.subclass.integer = AST_CONTROL_ANSWER;
 				/* Make sure it stops ringing */
+				analog_set_needringing(p, 0);
 				analog_off_hook(p);
 				ast_debug(1, "channel %d answered\n", p->channel);
 				analog_cancel_cidspill(p);

Modified: trunk/channels/sig_analog.h
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_analog.h?view=diff&rev=260437&r1=260436&r2=260437
==============================================================================
--- trunk/channels/sig_analog.h (original)
+++ trunk/channels/sig_analog.h Fri Apr 30 17:36:49 2010
@@ -144,6 +144,7 @@
 	int (* const on_hook)(void *pvt);
 	/*! \brief Set channel off hook */
 	int (* const off_hook)(void *pvt);
+	void (* const set_needringing)(void *pvt, int value);
 	/* We're assuming that we're going to only wink on ANALOG_SUB_REAL - even though in the code there's an argument to the index
 	 * function */
 	int (* const wink)(void *pvt, enum analog_sub sub);




More information about the asterisk-commits mailing list