Skip to content
Snippets Groups Projects
Commit 261d1eeb authored by Mark Michelson's avatar Mark Michelson
Browse files

The -1 return value from incomplete or improper

headers for the SipNotify manager command was
causing the current manager session to become
disconnected. Change the return value to 0 for
these cases.

Also change a test for a NULL pointer to be
ast_strlen_zero instead.

(closes issue #13351)
Reported by: Laureano
Patches:
      sipnotify_action_fix.patch uploaded by Laureano (license 265)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@139563 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 060f6d5c
Branches
Tags
No related merge requests found
...@@ -9470,9 +9470,9 @@ static int manager_sipnotify(struct mansession *s, const struct message *m) ...@@ -9470,9 +9470,9 @@ static int manager_sipnotify(struct mansession *s, const struct message *m)
struct ast_variable *vars = astman_get_variables(m); struct ast_variable *vars = astman_get_variables(m);
struct sip_pvt *p; struct sip_pvt *p;
   
if (!channame) { if (ast_strlen_zero(channame)) {
astman_send_error(s, m, "SIPNotify requires a channel name"); astman_send_error(s, m, "SIPNotify requires a channel name");
return -1; return 0;
} }
   
if (!strncasecmp(channame, "sip/", 4)) { if (!strncasecmp(channame, "sip/", 4)) {
...@@ -9481,7 +9481,7 @@ static int manager_sipnotify(struct mansession *s, const struct message *m) ...@@ -9481,7 +9481,7 @@ static int manager_sipnotify(struct mansession *s, const struct message *m)
   
if (!(p = sip_alloc(NULL, NULL, 0, SIP_NOTIFY))) { if (!(p = sip_alloc(NULL, NULL, 0, SIP_NOTIFY))) {
astman_send_error(s, m, "Unable to build sip pvt data for notify (memory/socket error)"); astman_send_error(s, m, "Unable to build sip pvt data for notify (memory/socket error)");
return -1; return 0;
} }
   
if (create_addr(p, channame, NULL, 0)) { if (create_addr(p, channame, NULL, 0)) {
...@@ -9490,7 +9490,7 @@ static int manager_sipnotify(struct mansession *s, const struct message *m) ...@@ -9490,7 +9490,7 @@ static int manager_sipnotify(struct mansession *s, const struct message *m)
dialog_unref(p, "unref dialog inside for loop" ); dialog_unref(p, "unref dialog inside for loop" );
/* sip_destroy(p); */ /* sip_destroy(p); */
astman_send_error(s, m, "Could not create address"); astman_send_error(s, m, "Could not create address");
return -1; return 0;
} }
   
/* Notify is outgoing call */ /* Notify is outgoing call */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment