diff -u -r1.677 chan_sip.c --- chan_sip.c 17 Mar 2005 23:03:07 -0000 1.677 +++ chan_sip.c 20 Mar 2005 02:56:46 -0000 @@ -8436,9 +8437,9 @@ } else { /* Initialize tag */ p->tag = rand(); - if (!strcmp(get_header(req, "Accept"), "application/dialog-info+xml")) + if (strcasestr(get_header(req, "Accept"), "application/dialog-info+xml")) { p->subscribed = 2; - else if (!strcmp(get_header(req, "Accept"), "application/simple-message-summary")) { + } else if (strcasestr(get_header(req, "Accept"), "application/simple-message-summary")) { /* Looks like they actually want a mailbox */ /* At this point, we should check if they subscribe to a mailbox that @@ -8465,8 +8466,13 @@ ast_set_flag(p, SIP_NEEDDESTROY); } return 0; - } else + } else if (strcasestr(get_header(req, "Accept"), "application/xpidf+xml")) { p->subscribed = 1; + } else { + p->subscribed = 0; + transmit_response(p, "489 Bad Event", req); + ast_set_flag(p, SIP_NEEDDESTROY); + } if (p->subscribed) p->stateid = ast_extension_state_add(p->context, p->exten, cb_extensionstate, p); }