<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><span style="font-size:10pt">Hi Michael,</span></p>
    <p><span style="font-size:10pt">Thanks for the reply.</span></p>
    <p><span style="font-size:10pt">I was referring to the scenario you
        named as 'outbound broken'. I didn't get to look at inbound call
        behavior yet, as I got stuck with inability to avoid transcoding
        on outbound calls.<br>
      </span></p>
    <p><span style="font-size:10pt">To be more specific the scenario is
        as follows:</span></p>
    <span style="font-size:10pt">1. a phone initiates a call offering
      g722,g711 to asterisk</span><br>
    <span style="font-size:10pt">2. asterisk creates outbound call to
      carrier offering g711 only (carrier only supports g711)</span><br>
    <span style="font-size:10pt">3. carrier accepts the call and
      outbound call leg is now running on g711</span><br>
    <span style="font-size:10pt">4. asterisk accepts a phone's call with
      g722 since it's allowed on phone's endpoint and was indicated as
      preferred in phone's INVITE and now initial call leg is running on
      g722, resulting in transcoding<br>
    </span>
    <p><span style="font-size:10pt">This is very disappointing. Since
        developers announced their plans to drop chan_sip from future
        asterisk versions I was under impression that chan_pjsip has
        reached feature paritiy with chan_sip. What is needed is an
        ability to tell asterisk which codecs are allowed to be included
        in "200 OK" asterisk sends back to the phone. I guess we need to
        submit a feature request. How do we go about it these days?</span></p>
    <span style="font-size:10pt">Thanks,</span><br>
    <span style="font-size:10pt">Michael<br>
    </span>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">On 7/5/23 14:59, Michael Maier wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:4e4ab8c8-c086-f1a0-6a30-49e8d7459a86@mailbox.org">Hello
      Michael,
      <br>
      <br>
      you are referring to the following behavior - did I get it
      correctly?:
      <br>
      <br>
      outbound broken: asterisk offers g722 / g711 to provider (callee),
      callee answers g711. Asterisk now transcodes between caller and
      callee (g722 <-> g711).
      <br>
      <br>
      inbound works: call from provider: g711 -> asterisk drops g722
      and passes g711 to internal callee -> no transcoding.
      <br>
      <br>
      <br>
      As far as I know, there is no working solution as of now. I
      discussed this problem years ago already here but unfortunately
      nothing usable happened so far (which I would know off). The
      priority is not high enough. I need a solution, too. I understand
      that this behavior is a nogo if you have a lot of calls because
      transcoding is expensive.
      <br>
      <br>
      <br>
      Thanks
      <br>
      Michael
      <br>
      <br>
      <br>
      <br>
      On 05.07.23 at 17:58 Michael Ulitskiy wrote:
      <br>
      <blockquote type="cite">Hello,
        <br>
        <br>
        Anyone? I have hard time to believe this is not possible with
        chan_pjsip.
        <br>
        <br>
        Anyway, may I ask how people handle the following scenario which
        I imagine should be quite common:
        <br>
        <br>
        - I have internal extensions talk to each other using g722. so
        their codec setting (with chan_sip now) is "allow=g722,ulaw"
        <br>
        - I have carriers trunks that handle ulaw only (allow=ulaw)
        <br>
        - calls between internal extensions naturally happen over g722
        as its their preferred codec
        <br>
        - for external calls I now set SIP_CODEC_INBOUND=ulaw to
        influence codec selection on calling channel and the calls set
        up using ulaw end-to-end
        <br>
        <br>
        Can somebody please advise how to achieve the same with
        chan_pjsip?
        <br>
        <br>
        Thanks,
        <br>
        <br>
        Michael
        <br>
        <br>
      </blockquote>
      <br>
    </blockquote>
  </body>
</html>