<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1164390653;
        mso-list-template-ids:130448148;}
@list l1
        {mso-list-id:1604072269;
        mso-list-template-ids:-1484912098;}
@list l1:level1
        {mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level2
        {mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level3
        {mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level4
        {mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level5
        {mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level6
        {mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level7
        {mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level8
        {mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level9
        {mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style>
</head>
<body lang="EN-AU" link="#0563C1" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-GB" style="color:black">OK, I know this might be better served on the rtpengine list but just wanted to quickly post a debug log incase you get a chance to take a look overnight (my night hehe).
<a href="https://pastebin.com/iHRQSTuD">https://pastebin.com/iHRQSTuD</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:black">Thanks!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:black">Rhys.</span><span lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">sr-users <sr-users-bounces@lists.kamailio.org> on behalf of Rhys Hanrahan <rhys@nexusone.com.au><br>
<b>Reply to: </b>"Kamailio (SER) - Users Mailing List" <sr-users@lists.kamailio.org><br>
<b>Date: </b>Friday, 4 March 2022 at 1:29 am<br>
<b>To: </b>"Kamailio (SER) - Users Mailing List" <sr-users@lists.kamailio.org><br>
<b>Subject: </b>Re: [SR-Users] rtpengine - SRTP <> RTP missing a=crypto</span><span style="font-size:12.0pt;color:black;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><span lang="EN-GB">Awesome, thank you for this. I did take a look at the rtpengine logs earlier but they didn’t seem particularly useful at the time. I will have to take a look tomorrow at how to enable debug logs, and will likely post
 on the rtpengine list for further advice, so thanks for pointing that out. </span>
<o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">Thanks,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">Rhys.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">sr-users <sr-users-bounces@lists.kamailio.org> on behalf of Richard Fuchs <rfuchs@sipwise.com><br>
<b>Organisation: </b>Sipwise GmbH<br>
<b>Reply to: </b>"Kamailio (SER) - Users Mailing List" <sr-users@lists.kamailio.org><br>
<b>Date: </b>Friday, 4 March 2022 at 1:17 am<br>
<b>To: </b>"sr-users@lists.kamailio.org" <sr-users@lists.kamailio.org><br>
<b>Subject: </b>Re: [SR-Users] rtpengine - SRTP <> RTP missing a=crypto</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">On 03/03/2022 08.47, [EXT] Rhys Hanrahan wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-GB">Hi Richard,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">Yes, from what I’ve seen in the logs there are multiple branches happening. One between Teams and Kamailio and one between Kamailio and Asterisk.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">In terms of the rtpengine processing, I’ve tried lots of different variations, but right now I’ve got:</span><o:p></o:p></p>
<ol style="margin-top:0cm" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l1 level1 lfo3"><span lang="EN-GB">Rtpengine_manage() by itself for new branches and replies (MANAGE_BRANCH, MANAGE_REPLY)
</span><o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l1 level1 lfo3"><span lang="EN-GB">Rtpengine_manage(“RTP/AVP”) or rtpengine_manage(“RTP/SAVP”) essentially in request_route for the initial invites to/from Teams
</span><o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l1 level1 lfo3"><span lang="EN-GB">I do also have the stock NATMANAGE using rtpengine but there’s no NAT involved here so I don’t think it applies.
</span><o:p></o:p></li></ol>
<div>
<div>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-GB">So as far as I can tell, I shouldn’t be calling rtpengine_manage multiple times. Is this bad to do? I did have previous configs where I was doing this. E.g. during RELAY I would call
 it with general options and then just modify AVP or SAVP in another section.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:black;mso-fareast-language:EN-GB">Interestingly, I noticed that a new branch is created just as I answer the call, and this is when it fails, so perhaps the issue is with how I’m handling new branches then? Below is a
 bit of a log to try and summarise what’s happening. Unfortunately it’s not logging the MS Teams side of the call except for the initial invite.</span><o:p></o:p></p>
</div>
</div>
</blockquote>
<p>What usually happens (and this is a common mistake that can be confirmed by looking at the logs produced by rtpengine) is that rtpengine is invoked multiple times for the same invite (once in each branch) with different options, but without telling rtpengine
 that these are branches. From rtpengine's POV these invites are all in the same branch then, and the options used in a later invocation are simply overriding the options used in previous invocations. So when the last invocation was using plain RTP and then
 the reply is using SRTP belonging to a different invocations, then rtpengine would not know about the SRTP attributes any more.<o:p></o:p></p>
<p>But without detailed logs this is just a speculation. You can see the actual signalling to rtpengine in the logs produced by rtpengine (especially with debug logging enabled). It's also possible that the signalling direction is reversed for example.<o:p></o:p></p>
<p>BTW we have a mailing list dedicated to rtpengine questions: <a href="https://rtpengine.com/mailing-list">
https://rtpengine.com/mailing-list</a><o:p></o:p></p>
<p>Cheers<o:p></o:p></p>
</div>
</body>
</html>