Unable to get slin24 codec to work

Hi,

I’m using Asterisk 12.4.0. I have two Asterisk servers registered to one another using SIP. I specified in both sip.conf to only allow “slin” codec. I used AMI to originate a call from Asterisk server A to the server B and put server B into a conference hosted in server A.

Server A Dial Plan:
[conference]
exten => _XXXX,n,ConfBridge(${EXTEN})

Server B Dial Plan:
[internal]
exten => _1XXX,n,Answer
exten => _1XXX,n,Record(sound.wav,90)
exten => _1XXX,n,Hangup()

The above was tested working. “sip show channels” indicates that “slin” format was used. Then I changed sip.conf to use “slin16” and it worked as well.

When I changed to “slin24” server B threw an error: chan_sip.c:10718 process_sdp: No compatible codecs, not accepting this offer! Same errors when I tried slin32 and slin48.

The following page mentions that these higher sampling rate codecs are supported in Version 10: wiki.asterisk.org/wiki/display/ … io+Formats

Is there any other configuration files that I need to change in order to get slin24 and above working?

Thanks a lot for your attention!

Frankie

Also, “core show codecs” lists slin24 and other higher sampling rate codecs:

ms1*CLI> core show codecs
Disclaimer: this command is for informational purposes only.
It does not indicate anything about your configuration.
ID TYPE NAME DESCRIPTION

100001 audio g723 (G.723.1)
100002 audio gsm (GSM)
100003 audio ulaw (G.711 u-law)
100004 audio alaw (G.711 A-law)
100011 audio g726 (G.726 RFC3551)
100006 audio adpcm (ADPCM)
100019 audio slin (16 bit Signed Linear PCM)
100007 audio lpc10 (LPC10)
100008 audio g729 (G.729A)
100009 audio speex (SpeeX)
100016 audio speex16 (SpeeX 16khz)
100010 audio ilbc (iLBC)
100005 audio g726aal2 (G.726 AAL2)
100012 audio g722 (G722)
100021 audio slin16 (16 bit Signed Linear PCM (16kHz))
300001 image jpeg (JPEG image)
300002 image png (PNG image)
200001 video h261 (H.261 Video)
200002 video h263 (H.263 Video)
200003 video h263p (H.263+ Video)
200004 video h264 (H.264 Video)
200005 video mpeg4 (MPEG4 Video)
400001 text red (T.140 Realtime Text with redundancy)
400002 text t140 (Passthrough T.140 Realtime Text)
100013 audio siren7 (ITU G.722.1 (Siren7, licensed from Polycom))
100014 audio siren14 (ITU G.722.1 Annex C, (Siren14, licensed from Polycom))
100017 audio testlaw (G.711 test-law)
100015 audio g719 (ITU G.719)
100028 audio speex32 (SpeeX 32khz)
100020 audio slin12 (16 bit Signed Linear PCM (12kHz))
100022 audio slin24 (16 bit Signed Linear PCM (24kHz))
100023 audio slin32 (16 bit Signed Linear PCM (32kHz))
100024 audio slin44 (16 bit Signed Linear PCM (44kHz))
100025 audio slin48 (16 bit Signed Linear PCM (48kHz))
100026 audio slin96 (16 bit Signed Linear PCM (96kHz))
100027 audio slin192 (16 bit Signed Linear PCM (192kHz))
100030 audio opus (Opus Codec)
200006 video vp8 (VP8 Video)
100018 audio silk8 (SILK Custom Format 8khz)
100018 audio silk12 (SILK Custom Format 12khz)
100018 audio silk16 (SILK Custom Format 16khz)
100018 audio silk24 (SILK Custom Format 24khz)
100029 audio celt48 (CELT Custom Format 48khz)

Is this output the same on both servers?

Hi dejanst, thanks for your response. Yes, the “core show codecs” output is the same on both servers. One correction: Server A is running on 12.5.0 and Server B on 12.4.0.

I have just downgraded Server A back to 12.4.0. So both servers are now running the same version.

I did some debugging by “sip set debug on” on both servers. When using “slin48” I got the following messages:

Server A:
Audio is at 17868
Adding codec 100025 (slin48) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 10.30.22.121:5060:
INVITE sip:1000@10.30.22.121:5060 SIP/2.0
Via: SIP/2.0/UDP 10.30.23.51:5060;branch=z9hG4bK144ed670
Max-Forwards: 70
From: sip:1001@10.30.23.51;tag=as4f6bea52
To: sip:1000@10.30.22.121:5060
Contact: sip:1001@10.30.23.51:5060
Call-ID: 44476e3a2bff7830337d202e1ad87c93@10.30.23.51:5060
CSeq: 102 INVITE
User-Agent: vocia_mb1/1.0.0
Date: Tue, 26 Aug 2014 10:52:19 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 197

v=0
o=root 1979143601 1979143601 IN IP4 10.30.23.51
s=Asterisk PBX 12.4.0
c=IN IP4 10.30.23.51
t=0 0
m=audio 17868 RTP/AVP 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv

Server B:
<— SIP read from UDP:10.30.23.51:5060 —>
INVITE sip:1000@10.30.22.121:5060 SIP/2.0
Via: SIP/2.0/UDP 10.30.23.51:5060;branch=z9hG4bK144ed670
Max-Forwards: 70
From: sip:1001@10.30.23.51;tag=as4f6bea52
To: sip:1000@10.30.22.121:5060
Contact: sip:1001@10.30.23.51:5060
Call-ID: 44476e3a2bff7830337d202e1ad87c93@10.30.23.51:5060
CSeq: 102 INVITE
User-Agent: vocia_mb1/1.0.0
Date: Tue, 26 Aug 2014 10:52:19 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 197

v=0
o=root 1979143601 1979143601 IN IP4 10.30.23.51
s=Asterisk PBX 12.4.0
c=IN IP4 10.30.23.51
t=0 0
m=audio 17868 RTP/AVP 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
<------------->
— (14 headers 9 lines) —
Sending to 10.30.23.51:5060 (no NAT)
Sending to 10.30.23.51:5060 (no NAT)
Using INVITE request as basis request - 44476e3a2bff7830337d202e1ad87c93@10.30.23.51:5060
Found peer ‘frankie’ for ‘1001’ from 10.30.23.51:5060
== Using SIP RTP TOS bits 216
== Using SIP RTP CoS mark 5
Found RTP audio format 101
Found audio description format telephone-event for ID 101
[Aug 26 10:51:48] NOTICE[22244][C-00000008]: chan_sip.c:10718 process_sdp: No compatible codecs, not accepting this offer!

What I think the problem is… the RTP/AVP profile number i.e. 101 sent by Server A is incorrect (see highlighted above).

Please see my next comment for debug messages when using “slin16”.

When using “slin16”, it was shown below that Server A actually sends the RTP/AVP profile number as “118 101”. The 118 is decoded by Server B as L16/16000 which corresponds to "slin16.

Server A:
Audio is at 19942
Adding codec 100021 (slin16) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 10.30.22.121:5060:
INVITE sip:1000@10.30.22.121:5060 SIP/2.0
Via: SIP/2.0/UDP 10.30.23.51:5060;branch=z9hG4bK57b8d996
Max-Forwards: 70
From: sip:1001@10.30.23.51;tag=as34c6e333
To: sip:1000@10.30.22.121:5060
Contact: sip:1001@10.30.23.51:5060
Call-ID: 51559dd4553506924cf7bb3f16a885f3@10.30.23.51:5060
CSeq: 102 INVITE
User-Agent: vocia_mb1/1.0.0
Date: Tue, 26 Aug 2014 11:09:09 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 250

v=0
o=root 296272494 296272494 IN IP4 10.30.23.51
s=Asterisk PBX 12.4.0
c=IN IP4 10.30.23.51
t=0 0
m=audio 19942 RTP/AVP 118 101
a=rtpmap:118 L16/16000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:70
a=sendrecv

Server B:
<— SIP read from UDP:10.30.23.51:5060 —>
INVITE sip:1000@10.30.22.121:5060 SIP/2.0
Via: SIP/2.0/UDP 10.30.23.51:5060;branch=z9hG4bK57b8d996
Max-Forwards: 70
From: sip:1001@10.30.23.51;tag=as34c6e333
To: sip:1000@10.30.22.121:5060
Contact: sip:1001@10.30.23.51:5060
Call-ID: 51559dd4553506924cf7bb3f16a885f3@10.30.23.51:5060
CSeq: 102 INVITE
User-Agent: vocia_mb1/1.0.0
Date: Tue, 26 Aug 2014 11:09:09 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 250

v=0
o=root 296272494 296272494 IN IP4 10.30.23.51
s=Asterisk PBX 12.4.0
c=IN IP4 10.30.23.51
t=0 0
m=audio 19942 RTP/AVP 118 101
a=rtpmap:118 L16/16000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:70
a=sendrecv
<------------->
— (14 headers 12 lines) —
Sending to 10.30.23.51:5060 (no NAT)
Sending to 10.30.23.51:5060 (no NAT)
Using INVITE request as basis request - 51559dd4553506924cf7bb3f16a885f3@10.30.23.51:5060
Found peer ‘frankie’ for ‘1001’ from 10.30.23.51:5060
== Using SIP RTP TOS bits 216
== Using SIP RTP CoS mark 5
Found RTP audio format 118
Found RTP audio format 101
Found audio description format L16 for ID 118
Found audio description format telephone-event for ID 101
Capabilities: us - (slin16), peer - audio=(slin16)/video=(nothing)/text=(nothing), combined - (slin16)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)

I think you have enough to report that as a bug on issues.asterisk.org/

You should note that the codec list is the list of defined codecs, not the list of installed ones, but, even so, if the codec isn’t present, the call ought to be rejected before sending the INVITE.

Submitted this issue to: issues.asterisk.org/jira/browse/ASTERISK-24274

Note that the maintainers of the official version of Asterisk are not allowed to modify it based on a patch provided in a comment. You must sign the electronic licence grant and you must provide the patch as a unified diff (diff -u, or if using svn, svn diff) as an attachment, flagged as being code or documentation.

Hi David, thanks for the info. Actually I didn’t intend to have my patch accepted by the Asterisk team :wink: I just thought of sharing with the team and hopefully it would help narrow down the issue.