<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <tt>Hi, Alain!<br>
      <br>
      You could use the SDP transformations combine with regular
      expresions. I am thinking at something like:<br>
      <br>
      if ($(rb{sdp.line,m}) =~ "AVP\s*8")<br>
          xlog("PCMA is first codec!\n");<br>
      <br>
      Hope this is useful :)<br>
      <br>
      Best regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 01/05/2017 12:42 PM, Alain Bieuzent
      wrote:<br>
    </div>
    <blockquote cite="mid:A0CCED7E-F478-4BCE-A3F3-E904D7A1A0E6@free.fr"
      type="cite">
      <meta name="Titre" content="">
      <meta name="Mots clés" content="">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Calibri;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:595.0pt 842.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
      <div class="WordSection1">
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:Calibri;mso-fareast-language:EN-US">Ok,
            but how can i extract the value of first codec,<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:Calibri;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:Calibri;mso-fareast-language:EN-US">Actually
            i’m using codec_exist function, but this one only retrun
            TRUE or FALSE, but in case of true, i want know if it’s the
            first codec or no.<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:Calibri;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:Calibri;mso-fareast-language:EN-US">Regards<o:p></o:p></span></p>
        <div style="border:none;border-top:solid #B5C4DF
          1.0pt;padding:3.0pt 0cm 0cm 0cm">
          <p class="MsoNormal"><b><span
                style="font-family:Calibri;color:black">De : </span></b><span
              style="font-family:Calibri;color:black">Users
              <a class="moz-txt-link-rfc2396E" href="mailto:users-bounces@lists.opensips.org"><users-bounces@lists.opensips.org></a> au nom de Aqs
              Younas <a class="moz-txt-link-rfc2396E" href="mailto:aqsyounas@gmail.com"><aqsyounas@gmail.com></a><br>
              <b>Répondre à : </b>OpenSIPS users mailling list
              <a class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a><br>
              <b>Date : </b>jeudi 5 janvier 2017 à 11:35<br>
              <b>À : </b>OpenSIPS users mailling list
              <a class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a><br>
              <b>Objet : </b>Re: [OpenSIPS-Users] Codecs Order<o:p></o:p></span></p>
        </div>
        <div>
          <p class="MsoNormal"><o:p> </o:p></p>
        </div>
        <div>
          <p class="MsoNormal">media line(m) shows codec preference in
            order. <o:p></o:p></p>
          <div>
            <p class="MsoNormal"><span style="font-size:11.0pt">m=audio
                13406 RTP/AVP 8 0 101</span><o:p></o:p></p>
          </div>
          <div>
            <p class="MsoNormal">8 for<span style="font-size:11.0pt"> PCMA</span><o:p></o:p></p>
          </div>
          <div>
            <p class="MsoNormal"><span style="font-size:11.0pt">0 for
                PCMU</span><o:p></o:p></p>
          </div>
        </div>
        <div>
          <p class="MsoNormal"><o:p> </o:p></p>
          <div>
            <p class="MsoNormal">On 5 January 2017 at 15:19, Alain
              Bieuzent <<a moz-do-not-send="true"
                href="mailto:alain.bieuzent@free.fr" target="_blank">alain.bieuzent@free.fr</a>>
              wrote:<o:p></o:p></p>
            <blockquote style="border:none;border-left:solid #CCCCCC
              1.0pt;padding:0cm 0cm 0cm
              6.0pt;margin-left:4.8pt;margin-right:0cm">
              <div>
                <div>
                  <p class="MsoNormal"
                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                      style="font-size:11.0pt">Hi all,</span><o:p></o:p></p>
                  <p class="MsoNormal"
                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                      style="font-size:11.0pt"> </span><o:p></o:p></p>
                  <p class="MsoNormal"
                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                      style="font-size:11.0pt">Is there a way to know
                      the order of the codecs?</span><o:p></o:p></p>
                  <p class="MsoNormal"
                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                      style="font-size:11.0pt"> </span><o:p></o:p></p>
                  <p class="MsoNormal"
                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                      style="font-size:11.0pt">For exemple in this SDP :</span><o:p></o:p></p>
                  <p class="MsoNormal"
                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                      style="font-size:11.0pt">m=audio 13406 RTP/AVP 8 0
                      101</span><o:p></o:p></p>
                  <p class="MsoNormal"
                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                      style="font-size:11.0pt">a=rtpmap:8 PCMA/8000</span><o:p></o:p></p>
                  <p class="MsoNormal"
                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                      style="font-size:11.0pt">a=rtpmap:0 PCMU/8000</span><o:p></o:p></p>
                  <p class="MsoNormal"
                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                      style="font-size:11.0pt">a=rtpmap:101
                      telephone-event/8000</span><o:p></o:p></p>
                  <p class="MsoNormal"
                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                      style="font-size:11.0pt"> </span><o:p></o:p></p>
                  <p class="MsoNormal"
                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                      style="font-size:11.0pt">How i know that the
                      prefered codec is PCMA ?</span><o:p></o:p></p>
                  <p class="MsoNormal"
                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                      style="font-size:11.0pt"> </span><o:p></o:p></p>
                  <p class="MsoNormal"
                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                      style="font-size:11.0pt">Regards,</span><o:p></o:p></p>
                  <p class="MsoNormal"
                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                      style="font-size:11.0pt;color:#888888"> </span><span
                      style="color:#888888"><o:p></o:p></span></p>
                  <p class="MsoNormal"
                    style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                      style="font-size:11.0pt;color:#888888">Alain</span><span
                      style="color:#888888"><o:p></o:p></span></p>
                </div>
              </div>
              <p class="MsoNormal" style="margin-bottom:12.0pt"><br>
                _______________________________________________<br>
                Users mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
                <a moz-do-not-send="true"
                  href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                  target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></p>
            </blockquote>
          </div>
          <p class="MsoNormal"><o:p> </o:p></p>
        </div>
        <p class="MsoNormal">_______________________________________________
          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> <o:p></o:p></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <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>