Hi
In a fairly complex situation, I need to retrieve the codecs offered by the remote for an incoming call. This info is in the sdp context of the invite. Though I can retrieve all headers via PJSIP_HEADER, I fail to see how to get the codecs offered (before negotioation) - they are in the content, not in an header ! I’ve tried CHANNEL(audioreadformat), PJSIP_MEDIA_OFFER(audio) , but it does now work !
(currently working with asterisk 15.7 & pjsip)
I don’t think there is a way currently do this in Asterisk. I believe the closest you can get is to use PJSIP_MEDIA_OFFER. However, as you’ve probably surmised that will only return the intersection of the offer, and what you have configured on your endpoint in the “allow” setting. I guess if you configured your endpoint to “allow=all” then PJSIP_MEDIA_OFFER should return all offered codecs.
Perhaps if you describe why you need to retrieve the full list of offered codecs, or what you are trying to accomplish someone will know of a better/another way to do it and achieve the same expected result.