<div dir="ltr"><div dir="ltr">Hi, <span style="color:rgb(32,33,36);font-size:0.875rem;letter-spacing:0.2px;font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;white-space:nowrap">Răzvan.</span><div><font color="#202124" face="Roboto, RobotoDraft, Helvetica, Arial, sans-serif"><span style="font-size:14px;letter-spacing:0.2px;white-space:nowrap"><br></span></font>Thanks for your reply. According to your advice, I try to do something like this:<br><br>$var(aline) = $(rb{sdp.line,a,9});<br>subst_body("/(a=crypto:1)+(.*)$/$var(aline)/" );<br><br>But I don't know, how to add changed SDP as a result of "subst_body" execution into certain pvar. I could get only execution code, not an SDP.  <br>If I add the string "rtpengine_offer("RTP/SAVP ICE=remove", ,"$var(body)");" next to the script above, I get a crypto string what I need,<br>but everything else SDP strings takes from UA's original SDP (IPs, media ports etc). What do I do wrong?<br><br>Best Regards,<br>Sergey Pysanko.<br><br><br><br><div id="mt-signature">
        <table border="0" cellpadding="8" cellspacing="0" style="user-select: none;">
            <tbody><tr>
                <td>
                    <a id="signatureLink-logo" href="https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&" class="" style="text-decoration:none">
                        <img src="https://s3.amazonaws.com/mailtrack-signature/sender-notified-72.gif" alt="Mailtrack" class="" width="32" height="32">
                    </a>
                </td>
                <td>
                    <span style="color:#777">Sender notified by</span> <br>
                    <a id="signatureLink-text" href="https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&" class="mt-install" style="color:#4374f7">Mailtrack</a>
                    
    </td><td><span style="color:transparent;font-size:0">01/21/22, 11:32:02 AM</span></td>

                
                <td>
                    
                </td>
            </tr>
        </tbody></table>
    </div></div></div><br><img width="0" height="0" class="mailtrack-img" alt="" style="display:flex" src="https://mailtrack.io/trace/mail/8ce8e4ddb7d10a1bfe43cae730b3e48852a0bb08.png?u=6916461"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">ср, 19 янв. 2022 г. в 13:29, Răzvan Crainea <<a href="mailto:razvan@opensips.org">razvan@opensips.org</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi, Sergey!<br>
<br>
Rtpengine uses by default the SDP received in the message, it does not <br>
take into account any "local" changes you make.<br>
What you can try is to replace the body and get the result in a pvar, <br>
and then pass that pvar to the rtpengine_offer function[1], 3rd parameter.<br>
<br>
[1] <br>
<a href="https://opensips.org/html/docs/modules/3.2.x/rtpengine#func_rtpengine_offer" rel="noreferrer" target="_blank">https://opensips.org/html/docs/modules/3.2.x/rtpengine#func_rtpengine_offer</a><br>
<br>
Best regards,<br>
<br>
Răzvan Crainea<br>
OpenSIPS Core Developer<br>
<a href="http://www.opensips-solutions.com" rel="noreferrer" target="_blank">http://www.opensips-solutions.com</a><br>
<br>
On 1/18/22 19:37, Sergey Pisanko wrote:<br>
> <br>
> I tried to remove crypto strings that's not needed with "replace_body()" <br>
> function before rtpengine execution.. And I got the string what I need. <br>
> But despite this, when rtpengine is applied and proxy relays message to <br>
> UA2, rtpengine adds a string what I got rid from SDP on the previous <br>
> step. And I don't have any idea, from where rtpengine get crypto string <br>
> in a changed body. Here is what the script in this part looks like:<br>
> <br>
> branch_route[invite_to_pbx] {<br>
>     xlog("outgoing to pbx");<br>
>       if(has_body("application/sdp")) {<br>
>           if (replace_body_all("a=crypto:([1-9])+( AES_CM_256)+(.*)$", <br>
> "")) {<br>
>              xlog("Replaced");<br>
>           }<br>
>         rtpengine_offer("RTP/SAVP ICE=remove"));<br>
>        }<br>
>   }<br>
> <br>
> I also tried to execute this in a request route, but without changing.<br>
> <br>
> Can you help me to understand why rtpengine ignores changed SDP? Is my <br>
> script logic correct?<br>
> <br>
> Best regards,<br>
> Sergey Pysanko.<br>
> Mailtrack <br>
> <<a href="https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&" rel="noreferrer" target="_blank">https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&</a>> <br>
>       Sender notified by<br>
> Mailtrack <br>
> <<a href="https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&" rel="noreferrer" target="_blank">https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&</a>> <br>
>       01/18/22, 07:13:23 PM   <br>
> <br>
> <br>
> пт, 14 янв. 2022 г. в 17:30, Sergey Pisanko <<a href="mailto:serp87@yandex.ru" target="_blank">serp87@yandex.ru</a> <br>
> <mailto:<a href="mailto:serp87@yandex.ru" target="_blank">serp87@yandex.ru</a>>>:<br>
> <br>
>     Hello.<br>
> <br>
>     I've faced an issue when using rtpengine module with tls transport.<br>
>     When UA originates a call it pointed set of crypto<br>
>     parameters in SDP, like that:<br>
> <br>
>     a=crypto:1 AES_CM_256_HMAC_SHA1_80<br>
>     inline:PZASLY5HoxVo6Ljz2niwxqNJ+3A2mW71SgfL75cRFtShKQIvcKVF2Y39zGd1fQ==<br>
>     a=crypto:2 AES_CM_256_HMAC_SHA1_32<br>
>     inline:LRjGKIj8wvfxDP68+5XOEmlvO2ufqxDkhJ3hUQRWzjFulFr2kBztgSjrPSSACw==<br>
>     a=crypto:3 AES_CM_128_HMAC_SHA1_80<br>
>     inline:Nup7cVUaHGb+oQPf8gg1wDmjVJOZ5K+HZdhyovzz<br>
>     a=crypto:4 AES_CM_128_HMAC_SHA1_32<br>
>     inline:rjLdKaMyQ7+YQWCcIFKkVRLd+GZxkUogGK/4i1L0<br>
> <br>
>     But when Opensips relays original message to UA2, rtpengine removes<br>
>     all the crypto suite strings except the first one.<br>
>     Unfortunately, there is no way to configure client's behaivior to<br>
>     send certain crypto suite.<br>
>     In other side, UA2, that is PBX, doesn't support all crypto suites<br>
>     except AES_CM_128_HMAC_SHA1_80<br>
>     Is there a way to configure Opensips/rtpengine to choose specific<br>
>     crypto string or to leave crypto set without changing at all?<br>
> <br>
>     Best Regards,<br>
>     Sergey Pysanko.<br>
> <br>
> <br>
> <br>
>     Mailtrack<br>
>     <<a href="https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&" rel="noreferrer" target="_blank">https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&</a>><br>
>       Sender notified by<br>
>     Mailtrack<br>
>     <<a href="https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&" rel="noreferrer" target="_blank">https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&</a>><br>
>       01/14/22, 05:28:49 PM   <br>
> <br>
> <br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div></div>