diff --git a/channels/chan_sip.c b/channels/chan_sip.c index e6b5193484..0c5752add2 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -9672,7 +9672,7 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho } else { if (sipmethod == SIP_NOTIFY && !ast_strlen_zero(p->theirtag)) { /* If this is a NOTIFY, use the From: tag in the subscribe (RFC 3265) */ - snprintf(to, sizeof(to), "<%s%s>;tag=%s", (strncasecmp(p->uri, "sip:", 4) ? "sip:" : ""), p->uri, p->theirtag); + snprintf(to, sizeof(to), "<%s%s>;tag=%s", (!strncasecmp(p->uri, "sip:", 4) ? "sip:" : ""), p->uri, p->theirtag); } else if (p->options && p->options->vxml_url) { /* If there is a VXML URL append it to the SIP URL */ snprintf(to, sizeof(to), "<%s>;%s", p->uri, p->options->vxml_url); @@ -19680,7 +19680,7 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req, parse_ok_contact(p, req); build_contact(p); - if (strcmp(event, "message-summary") && gotdest) { + if (gotdest) { transmit_response(p, "404 Not Found", req); pvt_set_needdestroy(p, "subscription target not found"); if (authpeer)