<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">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">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>