I am successfully using Kurento's RtpEndpoint
type to connect to several Asterisk SIP servers as well as directly to several models of SIP phone, but connections to Avaya SIP servers do not work, and I am trying to figure out why. The symptom is that the connection is made but there is no media.
For the RTP Endpoint, Kurento generates the following SDP (which I munge to include the public IP address and remove the video portion) which I then include in the SIP INVITE
:
v=0
o=- 3807878922 3807878922 IN IP4 192.0.2.95
s=Kurento Media Server
c=IN IP4 192.0.2.95
t=0 0
m=audio 18848 RTP/AVPF 96 0 97
a=setup:actpass
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=rtpmap:96 opus/48000/2
a=rtpmap:97 AMR/8000
a=rtcp:18849
a=sendrecv
a=mid:audio0
a=ssrc:2835743000 cname:user3268188862@host-ad591d54
A working connection with an Asterisk server returns the following SDP back to Kurento:
v=0
o=root 55778749 55778749 IN IP4 198.51.100.252
s=Asterisk PBX 13.28.1
c=IN IP4 198.51.100.252
t=0 0
m=audio 11704 RTP/AVPF 0
a=rtpmap:0 PCMU/8000
a=maxptime:150
a=sendrecv
In the Kurento log, I see that it says it is transcoding this connection.
A non-working connection with an Avaya server returns the following SDP back to Kurento:
v=0
o=- 1598890119 2 IN IP4 203.0.113.100
s=-
c=IN IP4 0.0.0.0
b=AS:64
t=0 0
m=audio 0 RTP/AVP 96 0 97
a=inactive
a=rtpmap:96 opus/48000/2
a=rtpmap:97 AMR/8000
a=ptime:20
As you can see, the Avaya server responds that it cannot use any of the available codecs and therefore will not send or receive media (a=inactive
).
According to some Avaya documentation I found, Avaya SBCE supports transcoding at least the following codecs:
- OPUS 12kbps narrowband
- OPUS 16kbps narrowband
- OPUS 18kbps wideband
- G.722
- G.711ulaw
- G.711alaw
- G.726
- G.729AB
Kurento supports using PCMU (a.k.a. G.711ulaw) as shown in the working Asterisk sample, but Avaya seems to reject it. (Note: I previously thought that it wasn't included in the SDP, but it is there as the 0
in the m=audio
line.) I tried to get it to force using PCMU using rtpEndpoint.setAudioFormat(AudioCaps(AudioCodec.PCMU, 8000))
, but that didn't help.
My second thought was to change the OPUS bitrate using rtpEndpoint.setAudioFormat(AudioCaps(AudioCodec.OPUS, 18000))
. When I tried this, not only did it not work with the Avaya phones, but it also stopped working with Asterisk since Asterisk was using PCMU. I thought of munging the SDP to change it to opus/18000
, but that's not allowed, as RFC 7587 explicitly states:
The media subtype ("opus") goes in SDP "a=rtpmap" as the encoding
name. The RTP clock rate in "a=rtpmap" MUST be 48000, and the
number of channels MUST be 2.
How can I get Kurento and the Avaya SBCE to send media between themselves?
In the end, the only way I could get it to work was to put a Kamailio/RTPEngine server in between them and allow it to negotiate separately with both sides.