diff --git a/apps/app_sendtext.c b/apps/app_sendtext.c index e95ff6158c..f2822711de 100644 --- a/apps/app_sendtext.c +++ b/apps/app_sendtext.c @@ -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 diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 0fa6326955..e6c1d4257a 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -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);