On Wed, Mar 31, 2021 at 11:56 AM Alexander Traud <pabstr...@compuserve.com>
wrote:

> In the function res_pjsip_sdp_rtp:setup_sdes_srtp(.), an upcoming patch of
> mine needs to determine whether that code processes an SDP answer or an SDP
> offer. Is there (somewhere) a flag or condition which I can check?
>
> In chan_sip, I can use AST_LIST_EMPTY(sip_pvt->offered_media). Does a
> similar trick work with via the struct pjmedia_sdp_media?
>

No, you can't use what is passed in to determine this. Passing in the
session however would give access to the INVITE session and the SDP
negotiator. It allows you to query state using pjmedia_sdp_neg_get_state[1]
which can tell you whether there is a remote offer or not. There are also
other SDP negotiator calls such as pjmedia_sdp_neg_was_answer_remote[2].
Which is applicable depends on when the function is called, during
negotiation or after negotiation is complete (which are two separate steps).

[1]
https://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__SDP__NEG.htm#gad2ee6d1a7bf2976c1ac9642b70b9a2fc
[2]
https://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__SDP__NEG.htm#ga86557cce0d6db9e67d17f1b2554bbce6

-- 
Joshua C. Colp
Asterisk Technical Lead
Sangoma Technologies
Check us out at www.sangoma.com and www.asterisk.org
-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to