I feel like the rest of this code would be nicer if you did the cast to `pjsip_sip/tel_uri` here (based on the scheme) and checked those header pointers for `NULL` instead of casting everywhere.