[svn-commits] kpfleming: branch mnicholson/new-v21-detect r349246 - in /team/mnicholson/new...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Dec 28 11:24:32 CST 2011


Author: kpfleming
Date: Wed Dec 28 11:24:27 2011
New Revision: 349246

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=349246
Log:
Fix various minor issues found during review.

* Update Doxygen docs for fax_gateway_new() to document the 'chan' parameter.

* Rather than using an undocumented return value from a fax tech's write()
  operation to indicate that a V.21 preamble was detected, instead add a new
  flag to the fax session details structure that can be set and later read.


Modified:
    team/mnicholson/new-v21-detect/include/asterisk/res_fax.h
    team/mnicholson/new-v21-detect/res/res_fax.c
    team/mnicholson/new-v21-detect/res/res_fax_spandsp.c

Modified: team/mnicholson/new-v21-detect/include/asterisk/res_fax.h
URL: http://svnview.digium.com/svn/asterisk/team/mnicholson/new-v21-detect/include/asterisk/res_fax.h?view=diff&rev=349246&r1=349245&r2=349246
==============================================================================
--- team/mnicholson/new-v21-detect/include/asterisk/res_fax.h (original)
+++ team/mnicholson/new-v21-detect/include/asterisk/res_fax.h Wed Dec 28 11:24:27 2011
@@ -162,6 +162,8 @@
 			uint32_t send_cng:1;
 			/*! send a T.38 reinvite */
 			uint32_t request_t38:1;
+			/*! a V.21 preamble was detected */
+			uint32_t v21_detected:1;
 		};
 	} option;
 	/*! override the minimum transmission rate with a channel variable */

Modified: team/mnicholson/new-v21-detect/res/res_fax.c
URL: http://svnview.digium.com/svn/asterisk/team/mnicholson/new-v21-detect/res/res_fax.c?view=diff&rev=349246&r1=349245&r2=349246
==============================================================================
--- team/mnicholson/new-v21-detect/res/res_fax.c (original)
+++ team/mnicholson/new-v21-detect/res/res_fax.c Wed Dec 28 11:24:27 2011
@@ -2459,6 +2459,7 @@
 }
 
 /*! \brief Create a new fax gateway object.
+ * \param chan the channel the gateway object will be attached to
  * \param details the fax session details
  * \return NULL or a fax gateway object
  */
@@ -2591,7 +2592,8 @@
 		return f;
 	}
 
-	if (active_v21_session->tech->write(active_v21_session, f) == 1) {
+	if (active_v21_session->tech->write(active_v21_session, f) == 0 &&
+	    active_v21_session->details->option.v21_detected) {
 		gateway->detected_v21 = 1;
 	}
 

Modified: team/mnicholson/new-v21-detect/res/res_fax_spandsp.c
URL: http://svnview.digium.com/svn/asterisk/team/mnicholson/new-v21-detect/res/res_fax_spandsp.c?view=diff&rev=349246&r1=349245&r2=349246
==============================================================================
--- team/mnicholson/new-v21-detect/res/res_fax_spandsp.c (original)
+++ team/mnicholson/new-v21-detect/res/res_fax_spandsp.c Wed Dec 28 11:24:27 2011
@@ -623,7 +623,7 @@
 	struct spandsp_pvt *p = s->tech_pvt;
 
 	if (p->v21_detected) {
-		return p->v21_detected;
+		return 0;
 	}
 
 	/*invalid frame*/
@@ -633,7 +633,11 @@
 
 	modem_connect_tones_rx(p->tone_state, f->data.ptr, f->samples);
 
-	return p->v21_detected;
+	if (p->v21_detected) {
+		s->details->option.v21_detected = 1;
+	}
+
+	return 0;
 }
 
 /*! \brief Write a frame to the spandsp fax stack.




More information about the svn-commits mailing list