Discussion:
[asterisk-dev] "telephone-event" at rates other than 8000?
Stephen Davies
2017-06-08 14:35:18 UTC
Permalink
Hi,

Reviewing rtp_engine.c it appears that we only support telephone-event rtp
with a sample rate of 8000?

JSSIP using Opus offers Opus as "opus/48000/2" and then (by necessity, I
think), telephone-event/48000.

EG (this is a JSSIP using WebRTC behind a Freeswitch system):

v=0
o=FreeSWITCH 1496895595 1496895596 IN IP4 x.y.250.156
s=FreeSWITCH
c=IN IP4 x.y.250.156
t=0 0
m=audio 28302 RTP/AVP 102 101
a=rtpmap:102 opus/48000/2
a=fmtp:102 useinbandfec=1; maxaveragebitrate=30000;
maxplaybackrate=48000; ptime=20; minptime=10; maxptime=40
a=rtpmap:101 telephone-event/48000
a=fmtp:101 0-16
a=ptime:20

Asterisk (13) responds with:

v=0
o=root 615288785 615288785 IN IP4 x.y.250.132
s=Telviva
c=IN IP4 x.y.250.132
t=0 0
m=audio 11824 RTP/AVP 102
a=rtpmap:102 opus/48000/2
a=fmtp:102 maxaveragebitrate=30000;useinbandfec=1
a=ptime:20
a=maxptime:60
a=sendrecv

So drops the telephone-event.

In rtp_engine.c there is only:

set_next_mime_type(NULL, AST_RTP_DTMF, "audio", "telephone-event", 8000);

Has this come up before?

Can any other developer point me as to where I'd need to look to try to add
48000 too?

Thanks,
Steve
Joshua Colp
2017-06-08 15:08:39 UTC
Permalink
Post by Stephen Davies
Hi,
Reviewing rtp_engine.c it appears that we only support telephone-event rtp
with a sample rate of 8000?
JSSIP using Opus offers Opus as "opus/48000/2" and then (by necessity, I
think), telephone-event/48000.
<snip>
Post by Stephen Davies
set_next_mime_type(NULL, AST_RTP_DTMF, "audio", "telephone-event", 8000);
Has this come up before?
Not that I can remember.
Post by Stephen Davies
Can any other developer point me as to where I'd need to look to try to add
48000 too?
Things really aren't written at all to handle this case. You'd like need
to change code in rtp_engine.c to add it as 48000, and then also in the
channel driver (or res_pjsip_sdp_rtp in the case of PJSIP) to handle it.
You'd also need to add logic to determine when exactly to use it. It's
uncharted territory for the DTMF support in RTP in Asterisk.
--
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
Loading...