<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <font face="Calibri Light">I have without ^ and $ before, i have now
      tried again like you suggested but it does not work.<br>
      It goes in the if loop ("search_body") but it does not replace
      inactive with sendonly.<br>
      I have also look at return code from replace_body and it gives me
      "-1".<br>
    </font><br>
    <div class="moz-cite-prefix">Stas Kobzar je 6/18/2021 ob 1:04
      PM napisal:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAB3fea=gXChvTSsOgb6mgnXVkKDwx0PMNCEhnavPjukfY2RoKQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hello,
        <div>Just do not use ^ and $ in the search pattern. It is
          probably trying to match the whole SDP packet, not single
          line.</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Fri, Jun 18, 2021 at 5:09
          AM Miha via Users <<a
            href="mailto:users@lists.opensips.org" target="_blank"
            moz-do-not-send="true">users@lists.opensips.org</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div> <font face="Calibri Light">Hello<br>
              <br>
               have issue with replace_body as it does not change SDP.<br>
              My code looks like this:<br>
              <br>
              if (has_body("application/sdp")){           <br>
                          if(search_body("a=inactive")){<br>
                               <b>replace_body("^a=inactive$",
                "a=sendonly");</b><br>
                          <br>
                          }<br>
              <br>
                               $var(rtpengine_flags) ="trust-address
              replace-origin replace-session-connection  ICE=remove
              RTP/AVP rtcp-mux-demux";<br>
                               rtpengine_offer("$var(rtpengine_flags)");<br>
                               <br>
                                if(is_audio_on_hold()) {<br>
                               <br>
                                  rtpengine_play_media("callee
              file=/home/ringback.wav");<br>
                                }<br>
                  <br>
                           t_on_reply("1");<br>
              }<br>
              <br>
              What could be wrong that inactive is not replaced by
              sendonly?<br>
              On a leg I can see "a=inactive" and also on b leg
              "a=inactive".<br>
              <br>
              <br>
              thank you<br>
              miha<br>
            </font> </div>
          _______________________________________________<br>
          Users mailing list<br>
          <a href="mailto:Users@lists.opensips.org" target="_blank"
            moz-do-not-send="true">Users@lists.opensips.org</a><br>
          <a
            href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
            rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>