res_pjsip: Use ast_sip_is_content_type() where appropriate

Change-Id: If3ab0d73d79ac4623308bd48508af2bfd554937d
This commit is contained in:
Sean Bright
2017-09-22 11:02:11 -04:00
parent 63a3d17f0b
commit ebd0a4bebf
4 changed files with 13 additions and 17 deletions

View File

@@ -605,8 +605,7 @@ static int asterisk_publication_devicestate_state_change(struct ast_sip_publicat
}
/* We only accept JSON for content */
if (pj_strcmp2(&body->content_type.type, "application") ||
pj_strcmp2(&body->content_type.subtype, "json")) {
if (!ast_sip_is_content_type(&body->content_type, "application", "json")) {
ast_debug(2, "Received unsupported content type for Asterisk event on resource '%s'\n",
ast_sorcery_object_get_id(config));
return -1;
@@ -697,8 +696,7 @@ static int asterisk_publication_mwi_state_change(struct ast_sip_publication *pub
}
/* We only accept JSON for content */
if (pj_strcmp2(&body->content_type.type, "application") ||
pj_strcmp2(&body->content_type.subtype, "json")) {
if (!ast_sip_is_content_type(&body->content_type, "application", "json")) {
ast_debug(2, "Received unsupported content type for Asterisk event on resource '%s'\n",
ast_sorcery_object_get_id(config));
return -1;