<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <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="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/26/19 6:37 PM, Mark Farmer wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAOvQDet_pCwP+NQqvQjnWGCfV6ey5HWUV45x8p1jxXzeXKppaQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <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="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>