<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi Mark,<br>
      <br>
      When calling RTPengine, the changes done by the `codec_delete` are
      lost - this is a typical problem when you try to do several
      changes over the same part of the message.<br>
      <br>
      Have you tried strip the codecs also from rtpengine (there is a
      `strip` option there for removing codes)<br>
      <br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="moz-txt-link-freetext" href="https://www.opensips-solutions.com">https://www.opensips-solutions.com</a>
OpenSIPS Summit 2019
  <a class="moz-txt-link-freetext" href="https://www.opensips.org/events/Summit-2019Amsterdam/">https://www.opensips.org/events/Summit-2019Amsterdam/</a>
</pre>
    <div class="moz-cite-prefix">On 9/27/19 3:05 PM, Mark Farmer wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAOvQDeuXsqy25tu0T6+rVdBFmJPe9tfr+03Os2QtcFboqbsQgA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">I am using rtpengine_offer etc later on. Would that
        add stuff back in?
        <div><br>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Fri, 27 Sep 2019 at 11:28,
          Bogdan-Andrei Iancu <<a href="mailto:bogdan@opensips.org"
            moz-do-not-send="true">bogdan@opensips.org</a>> wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
          <div bgcolor="#FFFFFF"> <tt>Hi MArk,<br>
              <br>
              Simply injecting your SDP in a basic script like:<br>
              <br>
              route{<br>
              <br>
                  # Codecs we do NOT support!<br>
                  $avp(BadCodec) = "G729";<br>
                  $avp(BadCodec) = "G729a";<br>
              <br>
                  for ($var(ToDelete) in $(avp(BadCodec)[*]))<br>
                      if (codec_delete("$var(ToDelete)")) {<br>
                          xlog("CUSTOM_LOG: Invalid codec detected and
              deleted: $var(ToDelete)");<br>
                      }<br>
              <br>
                  forward();<br>
                  exit;<br>
              }<br>
              <br>
              shows that the codec delete works:<br>
              <br>
              v=0<br>
              o=- 1569572039 1569572039 IN IP4 xxx.xxx.xxx.xxx<br>
              s=Polycom IP Phone<br>
              c=IN IP4 xxx.xxx.xxx.xxx<br>
              b=AS:512<br>
              t=0 0<br>
              m=audio 2226 RTP/AVP 9 8 0 18 127<br>
              a=rtpmap:9 G722/8000<br>
              a=rtpmap:8 PCMA/8000<br>
              a=rtpmap:0 PCMU/8000<br>
              a=rtpmap:18 G729/8000<br>
              a=fmtp:18 annexb=no<br>
              a=rtpmap:127 telephone-event/8000<br>
              m=video 2228 RTP/AVP 109 34<br>
              a=rtpmap:109 H264/90000<br>
              a=fmtp:109 profile-level-id=42800d; packetization-mode=0<br>
              a=rtpmap:34 H263/90000<br>
              a=fmtp:34 CIF=1;QCIF=1;SQCIF=1<br>
              <br>
              results in:<br>
              <br>
              v=0<br>
              o=- 1569572039 1569572039 IN IP4 xxx.xxx.xxx.xxx<br>
              s=Polycom IP Phone<br>
              c=IN IP4 xxx.xxx.xxx.xxx<br>
              b=AS:512<br>
              t=0 0<br>
              m=audio 2226 RTP/AVP 9 8 0 127<br>
              a=rtpmap:9 G722/8000<br>
              a=rtpmap:8 PCMA/8000<br>
              a=rtpmap:0 PCMU/8000<br>
              a=rtpmap:127 telephone-event/8000<br>
              m=video 2228 RTP/AVP 109 34<br>
              a=rtpmap:109 H264/90000<br>
              a=fmtp:109 profile-level-id=42800d; packetization-mode=0<br>
              a=rtpmap:34 H263/90000<br>
              a=fmtp:34 CIF=1;QCIF=1;SQCIF=1<br>
              <br>
              <br>
              Are you sure you are not doing any other SDP oriented
              change, like rtpengine / rtpproxy ?<br>
              <br>
              I tested against 2.4 version<br>
              <br>
              Regards,<br>
            </tt>
            <pre class="gmail-m_8835832370106713940moz-signature" cols="72">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="gmail-m_8835832370106713940moz-txt-link-freetext" href="https://www.opensips-solutions.com" target="_blank" moz-do-not-send="true">https://www.opensips-solutions.com</a>
OpenSIPS Summit 2019
  <a class="gmail-m_8835832370106713940moz-txt-link-freetext" href="https://www.opensips.org/events/Summit-2019Amsterdam/" target="_blank" moz-do-not-send="true">https://www.opensips.org/events/Summit-2019Amsterdam/</a>
</pre>
            <div class="gmail-m_8835832370106713940moz-cite-prefix">On
              9/26/19 6:37 PM, Mark Farmer wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr">
                          <div dir="ltr">
                            <div dir="ltr">Been looking at this for a
                              while now and it just won't play ball.
                              <div>I have an avp defined:</div>
                              <div><br>
                              </div>
                              <div>
                                <div># Codecs we do NOT support!</div>
                                <div>$avp(BadCodec) = "G729";</div>
                                <div>$avp(BadCodec) = "G729a";</div>
                                <div><br>
                                </div>
                                <div>Then I use a for each to remove any
                                  instances of the codecs:</div>
                                <div><br>
                                </div>
                                <div>
                                  <div>for ($var(ToDelete) in
                                    $(avp(BadCodec)[*]))</div>
                                  <div>                if
                                    (codec_delete($var(ToDelete))) {</div>
                                  <div>                           
                                    xlog("CUSTOM_LOG: Invalid codec
                                    detected and deleted:
                                    $var(ToDelete)");</div>
                                  <div>                }</div>
                                </div>
                                <div><br>
                                </div>
                                <div>sipmsgops reports that it's trying
                                  to remove codecs:</div>
                                <div><br>
                                </div>
                                <div>DBG:sipmsgops:codec_delete:
                                  deleting codec <G729a> with
                                  clock <><br>
                                </div>
                                <div>---</div>
                                <div>DBG:sipmsgops:codec_delete:
                                  deleting codec <G729> with clock
                                  <><br>
                                </div>
                                <div>---</div>
                                <div><br>
                                </div>
                                <div>My custom logs only generate a
                                  single entry since only G729 is
                                  present in SDP:</div>
                                <div><br>
                                </div>
                                <div>CUSTOM_LOG: Invalid codec detected
                                  and deleted: G729<br>
                                </div>
                                <div><br>
                                </div>
                                <div>But when the call is routed, the
                                  G729 codecs remain in the SDP:</div>
                                <div><br>
                                </div>
                                <div>a=rtpmap:18 G729/8000<br>
                                </div>
                                <div><br>
                                </div>
                                <div>Can anyone suggest why might that
                                  be?</div>
                                <div><br>
                                </div>
                                <div>Regards</div>
                                <div>Mark.</div>
                                <div><br>
                                </div>
                                <div><br>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <br>
              <fieldset
                class="gmail-m_8835832370106713940mimeAttachmentHeader"></fieldset>
              <pre class="gmail-m_8835832370106713940moz-quote-pre">_______________________________________________
Users mailing list
<a class="gmail-m_8835832370106713940moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a>
<a class="gmail-m_8835832370106713940moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
            </blockquote>
            <br>
          </div>
        </blockquote>
      </div>
      <br clear="all">
      <div><br>
      </div>
      -- <br>
      <div dir="ltr" class="gmail_signature">Mark Farmer<br>
        <a href="mailto:farmorg@gmail.com" target="_blank"
          moz-do-not-send="true">farmorg@gmail.com</a></div>
    </blockquote>
    <br>
  </body>
</html>