<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body>
    <div class="moz-cite-prefix">On 03.03.22 12:07, Rhys Hanrahan wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:947b402041b0486581710b0ed3a8e0aa@nexusone.com.au">
      <p class="MsoNormal">Any advice appreciated, as this is my first
        time dealing with SRTP (and rtpengine). Feeling very stuck.
        Thanks!<o:p></o:p></p>
    </blockquote>
    <p>Yeah, me too. ;-)</p>
    <p>Basically you need to call "rtpengine_manage" with the correct
      parameter, i.e. either RTP/AVP or RTP/SAVP, based on whether audio
      to the destination of the message is to be encrypted or not. This
      applies to basically any message with "application/sdp" content,
      i.e. both the INVITE *and* the 183 or 200 reply.</p>
    <p>Thus if you relay from encrypted to plaintext, the INVITE's
      handler needs to call rtpengine_manage("… RTP/AVP") and the
      response handler needs to call rtpengine_manage("… RTP/SAVP").</p>
    <p>In my code I discover these settings (for both call source and
      destination) during the INVITE, then I save them in a couple of
      XAVU variables. All the other handlers just select source /
      destination based on whether the message's source IP address is
      the same as the INVITE's.<br>
    </p>
    <p>IMHO it's way easier to program the whole thing in Python instead
      of Kamailio's language. This in turn would be much simpler if
      Kamailio used threads instead of separate processes and shared
      memory, but apparently you can't have everything. :-P<br>
    </p>
    <pre class="moz-signature" cols="72">-- 
-- Matthias Urlichs</pre>
  </body>
</html>