Codecs.conf doesn't seem to take effect?

Hi,

So I decided to try out opus tonight, but for some reason I don’t seem to able to change the settings for it using codecs.conf.

I know asterisk / freepbx is at least able to read the codecs.conf file, as I named the codec to opustest and the call would not go through unless the extension allowed codecs included opuststest.

Regardless if calls are made to or from the phone seems like its always using opus @ 48Khz as shown below. On Zopier changing from opus wide to narrow etc doesn’t make a difference. Am I missing something?

Connected to Asterisk 13.13.1 currently running on localhost (pid = 1166)
localhost*CLI> core show channel PJSIP/6000-0000000b
 -- General --
           Name: PJSIP/6000-0000000b
           Type: PJSIP
       UniqueID: 1515721003.11
       LinkedID: 1515721003.10
      Caller ID: 6000
 Caller ID Name: device
Connected Line ID: 3000
Connected Line ID Name: Kevin
Eff. Connected Line ID: 3000
Eff. Connected Line ID Name: Kevin
    DNID Digits: (N/A)
       Language: en
          State: Up (6)
  NativeFormats: (opus)
    WriteFormat: slin48
     ReadFormat: slin48
 WriteTranscode: Yes (slin@48000)->(opus@48000)
  ReadTranscode: Yes (opus@48000)->(slin@48000)
 Time to Hangup: 0
   Elapsed Time: 0h0m25s
      Bridge ID: afb4e395-bcc1-467b-8e1d-42e794fb497b
 --   PBX   --
        Context: from-internal
      Extension:
       Priority: 1
     Call Group: 0
   Pickup Group: 0
    Application: AppDial
           Data: (Outgoing Line)
 Call Identifer: [C-00000006]
      Variables:

codecs.conf

[opus]
type=opus
fec=yes
cbr=yes
packet_loss=30
max_playback_rate=8000

Not that you won’t get help here but, you may also want to bring this up on the Asterisk forums

Also checkout some of the examples here: asterisk/configs/samples/codecs.conf.sample at master · asterisk/asterisk · GitHub

Thanks for the help, I’ve tried that and set the extension allowed codeces to ‘myopus’ and set it to narrow. Still showing 48Khz unless I’m reading it from the wrong place.

WriteTranscode: Yes (slin@48000)->(opus@48000)
ReadTranscode: Yes (opus@48000)->(slin@48000)

Seems to be a bug? Lots of back and forth but not really sure if this is fixed. Oh well opus and being able to set forward error correction along with max dropped packets would have been a godsend over WiFi or HSPA…

Too bad the implementation just doesn’t seem to be there and the quality of G722 is no where near that of opus wide, super, ultra or full…

https://issues.asterisk.org/jira/browse/ASTERISK-26901

You are running Asterisk 13.13.1

Asterisk is currently at 13.18.5, our RPMs are marked January 7th

When we build Asterisk the configure scripts of Asterisk go out and download the new opus codec. Considering you are on Asterisk 13.13.1 you are on a pretty old version of Asterisk. 13.18.0 was released in October (By us)

So updated via yum to 3.18.3, still unsure if its actually accepting the configuration. Still shows 48Khz but read somewhere opus will always show 48KHz when transcoding. Just would love FEC with the popular zoiper client… According to them:

The implementation of Opus in all Zoiper product comes with FEC enabled by default. However Zoiper will never initiate a call with it. But if the server sends an INVITE with FEC, Zoiper will obey and use it.

You need to update to 13.18.5 as I stated. Asterisk 13.18.4 is marked December 13th. So that would have been before the fixes released by Digium on December 15th.

Well I compiled from source, but it didn’t work out very well there were tons of error when asterisk started. Although it did work, rather be safe than sorry and reverted to a snapshot before.

I’ll just wait till this comes upstream I guess…

Are you not using the FreePBX distro? The distro has 13.18.5 right now (just looked)

What upstream are you waiting for?

Thanks for all your replies - Hmm? I am using a freepbx distro… Is there something else I need to update first?

Kernel -> 2.6.32-642.6.2.el6.x86_64
Framework -> | framework            | 13.0.192.19 | Enabled | GPLv2+     |
Asterisk -> Package asterisk13-13.18.3-1.shmz65.1.188.x86_64 already installed and latest version
Repos ->
repo id                                                                                                    repo name                                                                                                  status
base                                                                                                       SHMZ-6 - Base                                                                                              6,520
extras                                                                                                     SHMZ-6 - Extras                                                                                               38
pbx                                                                                                        pbx                                                                                                        4,056
schmooze-commercial                                                                                        schmooze-commercial                                                                                          197
updates                                                                                                    SHMZ-6 - Updates                                                                                           1,367
repolist: 12,178

We do not support the Opus codec on FreePBX 13 which is the CentOS 6.x distro. We only support the opus codec on the CentOS 7/SNG 7 distros which use FreePBX 14

So upgraded to SNG 7, wen’t fairly well without any major issues. Complains there are a lot of ‘Unsigned modules’ even though I haven’t made any of my own.

Aside from that my codecs.conf specifies a samprate=16000 and max_playback_rate=16000 but in the SDP it always shows 48000. On the active channel this also shows 48Khz. The only good news is from freepbx and from Zoiper they both send useinbandfec=1. It honestly doesn’t seem like fec works as on the OPUS comparison page the quality is still quite good with 30% packet loss, where here even with 10 its complete suffering.

[opus16]
type=opus
fec=yes
cbr=yes
dtx=yes
packet_loss=30
max_playback_rate=16000
samprate=16000
max_bandwidth=wide


localhost*CLI> pjsip show history entry 13
<--- History Entry 13 Sent to 192.168.8.93:37165 at 1515863554 --->
INVITE sip:[email protected]:37165;rinstance=9a9a32ae836bb7f3 SIP/2.0
Via: SIP/2.0/UDP 192.168.8.187:5060;rport;branch=z9hG4bKPjd28fd1eb-3aad-47f9-951e-46ecdbc4bacd
From: "Kevin" <sip:[email protected]>;tag=5661728b-7132-4d72-8471-d99f96ee6936
To: <sip:[email protected];rinstance=9a9a32ae836bb7f3>
Contact: <sip:[email protected]:5060>
Call-ID: 2624d587-f6a6-4422-b18c-20a2e49e1978
CSeq: 22562 INVITE
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: "Kevin" <sip:[email protected]>
Max-Forwards: 70
User-Agent: FPBX-14.0.1.24(13.18.5)
Content-Type: application/sdp
Content-Length:   422

v=0
o=- 774345606 774345606 IN IP4 192.168.8.187
s=Asterisk
c=IN IP4 192.168.8.187
t=0 0
m=audio 18006 RTP/AVP 18 9 0 107 97 111 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:107 opus/48000/2
a=fmtp:107 useinbandfec=1
a=rtpmap:97 iLBC/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:20
a=sendrecv


localhost*CLI> core show channel PJSIP/6000-00000007
 -- General --
           Name: PJSIP/6000-00000007
           Type: PJSIP
       UniqueID: 1515863738.7
       LinkedID: 1515863737.6
      Caller ID: 6000
 Caller ID Name: device
Connected Line ID: 3000
Connected Line ID Name: Kevin
Eff. Connected Line ID: 3000
Eff. Connected Line ID Name: Kevin
    DNID Digits: (N/A)
       Language: en
          State: Up (6)
  NativeFormats: (opus)
    WriteFormat: slin48
     ReadFormat: slin48
 WriteTranscode: Yes (slin@48000)->(opus@48000)
  ReadTranscode: Yes (opus@48000)->(slin@48000)
 Time to Hangup: 0
   Elapsed Time: 0h0m9s
      Bridge ID: 9570e971-31fa-4e43-9689-a4b47e0ff97a
 --   PBX   --
        Context: from-internal
      Extension:
       Priority: 1
     Call Group: 0
   Pickup Group: 0
    Application: AppDial
           Data: (Outgoing Line)
 Call Identifer: [C-00000003]
      Variables:
[email protected]
BRIDGEPEER=PJSIP/3000-00000006
GOSUB_RETVAL=
sipkey=
SIPHEADERKEYS=
DIALEDPEERNUMBER=6000/sip:[email protected]:37165;rinstance=9a9a32ae836bb7f3
KEEPCID=TRUE
CWIGNORE=
CRM_SOURCE=3000
MON_FMT=wav
FROMEXTEN=3000
TIMESTR=20180113-171537
YEAR=2018
MONTH=01
DAY=13
REC_STATUS=INITIALIZED
PICKUPMARK=6000
EXTTOCALL=6000
TTL=64
DIAL_OPTIONS=Ttr
  CDR Variables:
level 1: calledsubaddr=
level 1: callingsubaddr=
level 1: dnid=
level 1: clid="device" <6000>
level 1: src=6000
level 1: dcontext=from-internal
level 1: channel=PJSIP/6000-00000007
level 1: lastapp=AppDial
level 1: lastdata=(Outgoing Line)
level 1: start=1515863738.049306
level 1: answer=1515863739.202826
level 1: end=1515863739.218766
level 1: duration=1
level 1: billsec=0
level 1: disposition=8
level 1: amaflags=3
level 1: uniqueid=1515863738.7
level 1: linkedid=1515863737.6
level 1: sequence=7

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.