I wonder whether the PJSIP utilities are the right thing to use here after all - it feels like PJSIP is doing work to convert the SIP body to a data structure and we're then doing a lot of work to convert it back to a string. Could we just take msg->body and process it by hand (split on newlines; first character of every line is the SDP type; third character to the end is the value) and match on those?