diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-09 16:39:43 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-09 16:39:43 +0000 |
commit | f207dd463c6c9ecca2c8a6014e0fd860d684b7f6 (patch) | |
tree | 87896c76a101ac416ebace0f54b3726cf718b67a | |
parent | 909e050f4854eeb322834a657d6842e8a3f70e5b (diff) |
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: http://svn.digium.com/svn/asterisk/trunk@187363 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | apps/app_sendtext.c | 4 | ||||
-rw-r--r-- | channels/chan_sip.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/apps/app_sendtext.c b/apps/app_sendtext.c index 91273b45a..f890ae4bf 100644 --- a/apps/app_sendtext.c +++ b/apps/app_sendtext.c @@ -81,7 +81,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 diff --git a/channels/chan_sip.c b/channels/chan_sip.c index c255f5edc..30a0e73da 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4187,7 +4187,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); |