Opus codec not taking codec.conf entries

Hai All,

I have an asterisk server installed with Version 16 on centos 7.9 OS and also installed an opus codec for WebRTC calls.

But noticed that when am using opus codec it’s not taking the codecs.conf entries. I wanted to limit the bandwidth but was unable to do with change. Is there any other option or is there anything am missing?

codec.conf

[opus]
type=opus
complexity=10
max_bandwidth=narrow
signal=auto
application=voip
max_playback_rate=8000
bitrate=8000
cbr=yes
fec=yes
packet_loss=5
dtx=yes

sip.conf

disallow=all
allow=opus

asterisk -rx " module show like opus"
Module Description Use Count Status Support Level
codec_opus.so OPUS Coder/Decoder 0 Running extended
format_ogg_opus.so OGG/Opus audio 0 Running core
res_format_attr_opus.so Opus Format Attribute Module 1 Running core
3 modules loaded

Below the sip set debug logs

ip-Asterisk1CLI> sip set debug peer 123456
SIP Debugging Enabled for IP: 10.10.10.10
ip-Asterisk1
CLI>
== DTLS ECDH initialized (automatic), faster PFS enabled
== Using SIP RTP CoS mark 5
Audio is at 16038
Adding codec opus to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 10.10.10.10:36304:
INVITE sip:0ep9jnua@192.0.2.12;transport=wss SIP/2.0
Via: SIP/2.0/WS 10.10.10.11:0;branch=z9hG4bK7f8dc5c6;rport
Max-Forwards: 70
From: sip:+12332123@10.10.10.11:0;tag=as0ccacec7
To: sip:0ep9jnua@192.0.2.12;transport=wss
Contact: sip:+12332123@10.10.10.11:0;transport=ws
Call-ID: 47fb0b4644315b09652663b1591af060@10.10.10.11:0
CSeq: 102 INVITE
User-Agent: Asterisk Telephony
Date: Mon, 08 Aug 2022 16:01:14 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Remote-Party-ID: “+12332123” sip:+12332123@10.10.10.11;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 839

v=0
o=root 109215508 109215508 IN IP4 10.10.10.11
s=Asterisk PBX 16.20.0
c=IN IP4 10.10.10.11
t=0 0
m=audio 16038 RTP/SAVPF 107 101
a=rtpmap:107 opus/48000/2
a=fmtp:107 maxaveragebitrate=8000;cbr=1;useinbandfec=1;usedtx=1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:20
a=ice-ufrag:3a4e3fe134619020606dcef67d0b80b5
a=ice-pwd:4322c3052e4f97d02c16008939c8c79b
a=candidate:Ha0a0518 1 UDP 2130706431 10.10.5.24 16038 typ host
a=candidate:Ha0a070d 1 UDP 2130706431 10.10.7.13 16038 typ host
a=candidate:Ha0a0518 2 UDP 2130706430 10.10.5.24 16039 typ host
a=candidate:Ha0a070d 2 UDP 2130706430 10.10.7.13 16039 typ host
a=connection:new
a=setup:actpass
a=fingerprint:SHA-256 08:22:5A:64:74:43:FB:46:61:B8:42:B4:39:F7:77:2B:D6:42:E6:C2:2E:5C:88:A7:B6:D7:D9:A8:42:6D:14:48
a=rtcp-mux
a=sendrecv


-- Called 123456

== Begin MixMonitor Recording SIP/123456-00000000
ip-Asterisk1CLI>
ip-Asterisk1
CLI>

<— SIP read from WS:10.10.10.10:36304 —>
SIP/2.0 100 Trying
Via: SIP/2.0/WS 10.10.10.11:0;branch=z9hG4bK7f8dc5c6;rport
From: sip:+12332123@10.10.10.11:0;tag=as0ccacec7
To: sip:0ep9jnua@192.0.2.12;transport=wss
CSeq: 102 INVITE
Call-ID: 47fb0b4644315b09652663b1591af060@10.10.10.11:0
Supported: outbound
User-Agent: Browser Phone 0.3.8 (SIPJS - 0.20.0)
Content-Length: 0

<------------->
— (9 headers 0 lines) —

<— SIP read from WS:10.10.10.10:36304 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/WS 10.10.10.11:0;branch=z9hG4bK7f8dc5c6;rport
From: sip:+12332123@10.10.10.11:0;tag=as0ccacec7
To: sip:0ep9jnua@192.0.2.12;transport=wss;tag=o3cbvngtdc
CSeq: 102 INVITE
Call-ID: 47fb0b4644315b09652663b1591af060@10.10.10.11:0
Supported: outbound
User-Agent: Browser Phone 0.3.8 (SIPJS - 0.20.0)
Contact: sip:0ep9jnua@192.0.2.12;transport=wss
Content-Length: 0

<------------->
— (10 headers 0 lines) —
sip_route_dump: route/path hop: sip:0ep9jnua@192.0.2.12;transport=wss
– SIP/123456-00000000 is ringing
ip-Asterisk1CLI>
ip-Asterisk1
CLI>
> 0x7fad64004ce0 – Strict RTP learning after remote address set to: 10.10.6.11:46816
> 0x7fad64004ce0 – Strict RTP learning after remote address set to: 10.10.6.11:60231

<— SIP read from WS:10.10.10.10:36304 —>
SIP/2.0 200 OK
Via: SIP/2.0/WS 10.10.10.11:0;branch=z9hG4bK7f8dc5c6;rport
From: sip:+12332123@10.10.10.11:0;tag=as0ccacec7
To: sip:0ep9jnua@192.0.2.12;transport=wss;tag=o3cbvngtdc
CSeq: 102 INVITE
Call-ID: 47fb0b4644315b09652663b1591af060@10.10.10.11:0
Supported: outbound
User-Agent: Browser Phone 0.3.8 (SIPJS - 0.20.0)
Allow: ACK,BYE,CANCEL,INFO,INVITE,MESSAGE,NOTIFY,OPTIONS,PRACK,REFER,REGISTER,SUBSCRIBE
Contact: sip:0ep9jnua@192.0.2.12;transport=wss
Content-Type: application/sdp
Content-Length: 903

v=0
o=mozilla…THIS_IS_SDPARTA-99.0 4491336765413867321 0 IN IP4 0.0.0.0
s=-
t=0 0
a=sendrecv
a=fingerprint:sha-256 95:85:80:0B:48:7F:38:65:09:72:3C:D0:41:93:0B:94:2F:7E:34:BA:B5:59:72:82:91:0D:47:13:9F:06:77:D8
a=ice-options:trickle
a=msid-semantic:WMS *
m=audio 60231 RTP/SAVPF 107 101
c=IN IP4 10.10.10.11
a=candidate:1 1 UDP 92086271 10.10.10.11 46816 typ relay raddr 10.10.10.11 rport 46816
a=candidate:2 1 UDP 92217343 10.10.10.11 60231 typ relay raddr 10.10.10.11 rport 60231
a=sendrecv
a=fmtp:107 maxplaybackrate=48000;stereo=1;useinbandfec=1
a=fmtp:101 0-15
a=ice-pwd:b00bd232b4fa8843979c78fec8035281
a=ice-ufrag:3fe689c5
a=mid:0
a=msid:{2e556998-eda7-481a-b460-a6b5c3d39fb3} {075f289a-940d-4839-b039-a4b368ccad16}
a=rtcp-mux
a=rtpmap:107 opus/48000/2
a=rtpmap:101 telephone-event/8000
a=setup:active
a=ssrc:3772994326 cname:{fe9df83a-acf2-4253-a46a-3d35b64554df}
<------------->
— (12 headers 24 lines) —
Got SDP version 0 and unique parts [mozilla…THIS_IS_SDPARTA-99.0 4491336765413867321 IN IP4 0.0.0.0]
Found RTP audio format 107
Found RTP audio format 101
Found audio description format opus for ID 107
Found audio description format telephone-event for ID 101
Capabilities: us - (opus), peer - audio=(opus)/video=(nothing)/text=(nothing), combined - (opus)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 10.10.10.11:60231
sip_route_dump: route/path hop: sip:0ep9jnua@192.0.2.12;transport=wss
Transmitting (NAT) to 10.10.10.10:36304:
ACK sip:0ep9jnua@192.0.2.12;transport=wss SIP/2.0
Via: SIP/2.0/WS 10.10.10.11:0;branch=z9hG4bK6db53fd5;rport
Max-Forwards: 70
From: sip:+12332123@10.10.10.11:0;tag=as0ccacec7
To: sip:0ep9jnua@192.0.2.12;transport=wss;tag=o3cbvngtdc
Contact: sip:+12332123@10.10.10.11:0;transport=ws
Call-ID: 47fb0b4644315b09652663b1591af060@10.10.10.11:0
CSeq: 102 ACK
User-Agent: Asterisk Telephony
Content-Length: 0


-- SIP/123456-00000000 answered

What opus codec are you using?

@jcolp - I have installed from make menuslect - The default

And how are you determining that it’s not taking your configuration into account?

Am not able to see the option max_bandwidth option sip debug and in 200 OK of SIP message able to see that a=fmtp:107 maxplaybackrate=48000;stereo=1;useinbandfec=1

Or is there any other option where ic can verify it is taking less bandwidth only?

That is from the WebRTC client, not from Asterisk. From the perspective of Asterisk it appears at first glance that the SDP does reflect what you’ve configured and other aspects are part of opus itself.

@jcolp - Thanks for the reply. I will check at the WebRTC client end. is there anywhere I can the narrow is being used for bandwidth?

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