diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 856fe24033ee178c74214b3e51f1c8cfd611ad3e..4770f57b412205ed2f0c6a5f92227f4c47e9cbfb 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -9362,19 +9362,16 @@ static int sip_do_debug(int fd, int argc, char *argv[])
 	if (argc != 2) {
 		if (argc != 4) 
 			return RESULT_SHOWUSAGE;
-		else if (strncmp(argv[2], "ip", 3) == 0)
+		else if (strcmp(argv[2], "ip") == 0)
 			return sip_do_debug_ip(fd, argc, argv);
-		else if (strncmp(argv[2], "peer", 5) == 0)
+		else if (strcmp(argv[2], "peer") == 0)
 			return sip_do_debug_peer(fd, argc, argv);
 		else
 			return RESULT_SHOWUSAGE;
 	}
 	ast_set_flag(&global_flags[1], SIP_PAGE2_DEBUG_CONSOLE);
 	memset(&debugaddr, 0, sizeof(debugaddr));
-	if (oldsipdebug)
-		ast_cli(fd, "SIP Debugging re-enabled\n");
-	else
-		ast_cli(fd, "SIP Debugging enabled\n");
+	ast_cli(fd, "SIP Debugging %senabled\n", oldsipdebug ? "re-" : "");
 	return RESULT_SUCCESS;
 }