[asterisk-commits] mmichelson: trunk r150257 - /trunk/apps/app_sms.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 16 17:44:05 CDT 2008


Author: mmichelson
Date: Thu Oct 16 17:44:05 2008
New Revision: 150257

URL: http://svn.digium.com/view/asterisk?view=rev&rev=150257
Log:
Answer the channel prior to checking for the 'a'
option in app_sms.

(closes issue #13675)
Reported by: alecdavis
Patches:
      app_sms.bug13675.148985.diff.txt uploaded by alecdavis (license 585)


Modified:
    trunk/apps/app_sms.c

Modified: trunk/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_sms.c?view=diff&rev=150257&r1=150256&r2=150257
==============================================================================
--- trunk/apps/app_sms.c (original)
+++ trunk/apps/app_sms.c Thu Oct 16 17:44:05 2008
@@ -1958,6 +1958,10 @@
 		res = h.err;
 		goto done;
 	}
+	
+	if (chan->_state != AST_STATE_UP) {		/* make sure channel is answered before any TX */
+		ast_answer(chan);
+	}
 
 	if (ast_test_flag(&flags, OPTION_ANSWER)) {
 		h.framenumber = 1;                  /* Proto 2 */
@@ -1972,10 +1976,6 @@
 		sms_messagetx(&h);
 	}
 
-	if (chan->_state != AST_STATE_UP) {
-		ast_answer(chan);
-	}
-
 	res = ast_set_write_format(chan, __OUT_FMT);
 	if (res >= 0) {
 		res = ast_set_read_format(chan, AST_FORMAT_SLINEAR);




More information about the asterisk-commits mailing list