Retrieve incoming sdp context / codecs

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)

Any ideas ?


Anyone ? I see quite a few reads, but no reply ! :cry:

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.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.