[asterisk-commits] tilghman: branch 1.4 r187362 - in /branches/1.4: apps/ channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 9 11:38:40 CDT 2009


Author: tilghman
Date: Thu Apr  9 11:38:37 2009
New Revision: 187362

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=187362
Log:
Permit zero-length text messages in SIP.
(Related to an issue posted to the -users list, subject "AEL2, BASE64_DECODE and hexadecimal")

Modified:
    branches/1.4/apps/app_sendtext.c
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/apps/app_sendtext.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/apps/app_sendtext.c?view=diff&rev=187362&r1=187361&r2=187362
==============================================================================
--- branches/1.4/apps/app_sendtext.c (original)
+++ branches/1.4/apps/app_sendtext.c Thu Apr  9 11:38:37 2009
@@ -78,7 +78,9 @@
 		
 	u = ast_module_user_add(chan);	
 
-	if (ast_strlen_zero(data)) {
+	/* NOT ast_strlen_zero, because some protocols (e.g. SIP) MUST be able to
+	 * send a zero-length message. */
+	if (!data) {
 		ast_log(LOG_WARNING, "SendText requires an argument (text[|options])\n");
 		ast_module_user_remove(u);
 		return -1;

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=187362&r1=187361&r2=187362
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Thu Apr  9 11:38:37 2009
@@ -2413,7 +2413,9 @@
 		ast_verbose("Sending text %s on %s\n", text, ast->name);
 	if (!p)
 		return -1;
-	if (ast_strlen_zero(text))
+	/* NOT ast_strlen_zero, because a zero-length message is specifically
+	 * allowed by RFC 3428 (See section 10, Examples) */
+	if (!text)
 		return 0;
 	if (debug)
 		ast_verbose("Really sending text %s on %s\n", text, ast->name);




More information about the asterisk-commits mailing list