]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 187363 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 9 Apr 2009 16:41:23 +0000 (16:41 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 9 Apr 2009 16:41:23 +0000 (16:41 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
  r187363 | tilghman | 2009-04-09 11:39:43 -0500 (Thu, 09 Apr 2009) | 10 lines

  Merged revisions 187362 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ........
    r187362 | tilghman | 2009-04-09 11:38:37 -0500 (Thu, 09 Apr 2009) | 3 lines

    Permit zero-length text messages in SIP.
    (Related to an issue posted to the -users list, subject "AEL2, BASE64_DECODE and hexadecimal")
  ........
................

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@187365 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_sendtext.c
channels/chan_sip.c

index e95ff6158cef7aaa1df2713f682d5afd7f2a434c..f2822711deba3626d123f149fdb9282dbbbfed9b 100644 (file)
@@ -60,7 +60,9 @@ static int sendtext_exec(struct ast_channel *chan, void *data)
                AST_APP_ARG(text);
        );
 
-       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)\n");
                return -1;
        } else
index 0fa6326955095f77a372f94a890cf22591b93fd3..e6c1d4257a702f150be7541891db51afe78bb8f4 100644 (file)
@@ -3730,7 +3730,9 @@ static int sip_sendtext(struct ast_channel *ast, const char *text)
                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);