diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c
index 4a24fa689fc42b2b6481e5dc89513aedd4bb873d..677dfd3dd3b20e1eb708271c611db854bce6cc0d 100644
--- a/channels/chan_pjsip.c
+++ b/channels/chan_pjsip.c
@@ -1484,14 +1484,14 @@ static struct topology_change_refresh_data *topology_change_refresh_data_alloc(
 
 static int on_topology_change_response(struct ast_sip_session *session, pjsip_rx_data *rdata)
 {
-	if (rdata->msg_info.msg->line.status.code == 200) {
+	if (PJSIP_IS_STATUS_IN_CLASS(rdata->msg_info.msg->line.status.code, 200)) {
 		/* The topology was changed to something new so give notice to what requested
 		 * it so it queries the channel and updates accordingly.
 		 */
 		if (session->channel) {
 			ast_queue_control(session->channel, AST_CONTROL_STREAM_TOPOLOGY_CHANGED);
 		}
-	} else if (rdata->msg_info.msg->line.status.code != 100) {
+	} else if (300 <= rdata->msg_info.msg->line.status.code) {
 		/* The topology change failed, so drop the current pending media state */
 		ast_sip_session_media_state_reset(session->pending_media_state);
 	}