<div dir="ltr"><div dir="ltr">On Wed, Mar 31, 2021 at 11:56 AM Alexander Traud <<a href="mailto:pabstraud@compuserve.com">pabstraud@compuserve.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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?<br>
<br>
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?<br></blockquote><div><br></div><div>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).</div></div><div><br></div>[1] <a href="https://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__SDP__NEG.htm#gad2ee6d1a7bf2976c1ac9642b70b9a2fc">https://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__SDP__NEG.htm#gad2ee6d1a7bf2976c1ac9642b70b9a2fc</a><div>[2] <a href="https://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__SDP__NEG.htm#ga86557cce0d6db9e67d17f1b2554bbce6">https://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__SDP__NEG.htm#ga86557cce0d6db9e67d17f1b2554bbce6</a><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-family:tahoma,sans-serif"><div><font color="#073763">Joshua C. Colp</font></div><div><font color="#073763">Asterisk Technical Lead</font></div><div><font color="#073763">Sangoma Technologies</font></div><div><font color="#073763">Check us out at <a href="http://www.sangoma.com/" target="_blank">www.sangoma.com</a> and <a href="http://www.asterisk.org/" target="_blank">www.asterisk.org</a></font></div></div></div></div></div></div></div></div></div></div></div></div></div>