asterisk-opus icon indicating copy to clipboard operation
asterisk-opus copied to clipboard

Updated for 12.2.0

Open Thulinma opened this issue 10 years ago • 17 comments

Hey there! I went ahead and updated your patch for the latest release. Feel free to copy/modify/blah/whatever. No need to mention me anywhere, just trying to make it easier for folks to use Opus in the latest release. :-)

Thulinma avatar May 10 '14 20:05 Thulinma

@Thulinma thanks for the update! I'll look into it as soon as I can, but rather than merge I think I'll make the patch available in parallel to the one we already have. I'll also try and prepare other patches for more problematic versions of Asterisk (as the one in issue #8) which should help users not have to force changes on uncompliant versions.

lminiero avatar May 11 '14 09:05 lminiero

I figured, yes. I wanted to make it available in parallel as well, but my connection had some issues and I had to use github's web interface to make the commits (yuck!). Hence the mention of feeling free to modify. :-)

I did notice some others have created forks as well, and provided patches for other versions. You may want to look into those - though I suppose they haven't technically given you permission to copy their work... Yay copyright law, right?

Thulinma avatar May 11 '14 09:05 Thulinma

It would be great to have all patches in a single place so I'll definitely look into them, but if that won't be possible, no problem at all! I'm only glad that the work we started helped and motivated so many people so far, so just linking to other patches in the README will be ok as well.

lminiero avatar May 11 '14 09:05 lminiero

Good idea! I was also looking into adding support for .opus files through a new format_ogg_opus.c handler - but put that project on pause for now... The way Asterisk works with formats is... overwhelming, to say the least. Would have been nice, though! I might get back to that, later.

Thulinma avatar May 11 '14 09:05 Thulinma

I thought about .opus files as well, especially considering they basically are .ogg files with a different extension, and Asterisk already has .ogg support for vorbis packets, but then never went for it either. In case you decide to give it another try, you may want to have a look at what we already did for recording Opus stream to .opus files in our WebRTC gateway Janus:

https://github.com/meetecho/janus-gateway/blob/master/plugins/janus_voicemail.c

Opus playout is still missing but it will probably end up in the streaming plugin of the same project. As soon as both will be available, I'll also check if and how difficult integrating those in Asterisk might be.

lminiero avatar May 11 '14 10:05 lminiero

Yeah, that's what stopped me - Asterisk has support for ogg-vorbis, but this is very specifically only ogg-vorbis. The optimizer in me wanted to extend the existing ogg support to be ogg vorbis/opus... But it's quite tightly bound to vorbis at the moment :-( Thanks for the link - it might indeed help. If I get anything working I'll ping back here.

Thulinma avatar May 11 '14 10:05 Thulinma

@lminiero good news about merging with cert version, any update about this? it would be really awesome to have opus unofficial support for asterisk cert-4 (most recent cert version)

SirLouen avatar Aug 20 '14 12:08 SirLouen

We started converting the patch to the latest 11 version, but this was before most of the team went to vacation. We'll probably have something new to share next week.

2014-08-20 14:54 GMT+02:00, SirLouen [email protected]:

@lminiero good news about merging with cert version, any update about this? it would be really awesome to have opus unofficial support for asterisk cert-4 (most recent cert version)


Reply to this email directly or view it on GitHub: https://github.com/meetecho/asterisk-opus/pull/7#issuecomment-52773097

lminiero avatar Aug 20 '14 12:08 lminiero

@lminiero ok, this is awesome :+1: The thing I don't know if the code for 11.11 will serve for 11.6-cert4 since there have been multiple changes specially regarding SRTP issues that I don't know if affect directly to opus exchange.

SirLouen avatar Aug 20 '14 12:08 SirLouen

The patch will most definitely address the latest 11 version as it fixes several DTLS related issues.

2014-08-20 14:58 GMT+02:00, SirLouen [email protected]:

@lminiero ok, this is awesome :+1: The thing I don't know if the code for 11.11 will serve for 11.6-cert4 since there have been multiple changes specially regarding SRTP issues that I don't know if affect directly to opus exchange.


Reply to this email directly or view it on GitHub: https://github.com/meetecho/asterisk-opus/pull/7#issuecomment-52773711

lminiero avatar Aug 20 '14 13:08 lminiero

I'm actually "proxifying" thru rtpengine because Asterisk is failing misserably with webrtc DTLS support. So I prefer to use a stable version of Asterisk, than the latest for production. But I'm looking for opus support despite is unstable, so I will lookout the patch for 11.11 to try to fork it for 11.6-cert4, since the @alexfournier 11.10 patch did not work for me (adapting to 11.10). I will tryout @andrius fork soon (it says it has support for 11.11)

SirLouen avatar Aug 20 '14 13:08 SirLouen

Sure, http://sipjs-test.herokuapp.com

It is asterisk 11.11.0 + opus + webrtc, client is sipjs.com. It works

On Wed, Aug 20, 2014 at 3:21 PM, SirLouen [email protected] wrote:

I'm actually "proxying" thru rtpengine because Asterisk is failing misserably with webrtc. So I prefer to use a stable version of Asterisk, than the latest for production. But I'm looking for opus support despite is unstable, so I will lookout the patch for 11.11 to try to fork it for 11.6-cert4, since the @alexfournier https://github.com/alexfournier 11.10 patch did not work for me (adapting to 11.10). I will tryout @andrius https://github.com/andrius fork soon (it says it has support for 11.11)

— Reply to this email directly or view it on GitHub https://github.com/meetecho/asterisk-opus/pull/7#issuecomment-52776561.

andrius avatar Aug 20 '14 13:08 andrius

You've got the wrong @alexfournier. I'm getting emails for this convo.

alexfournier avatar Aug 20 '14 13:08 alexfournier

@Thulinma @andrius

I'm in the process of attempting to port this to Asterisk 13.0.1 and have the following notes so far :

  • First, Asterisk now supports Opus Passthrough which means the RTP options have partly been implemented
  • Secondly, the transcorders info seem to now require specification of the source and destination codec in structure instead of doing so via ast_format_set()
  • Comparaison behind codecs are now done differently
  • The transcoder format codec definition is done directly instead of with ast_format_set() aswell
  • Asterisk only defines for passthrough Opus on Fullband 48kHz so to limit modding Asterisk i dropped support for other rates at first and forced internal sampling rate to 48kHz
  • There's no sample file for slin48 in Asterisk so one may need to be added
  • I couldn't get the transcoder to work as of now, failing with translate.c:392 framein: no samples for opustolin48 -- apparently both opus_decode and opus_decoder_get_nb_samples return zero samples regardless of the 920 bytes of data thrown into.

Any advice would be appreciated :)

fira avatar Dec 05 '14 17:12 fira

@fira A few notes:

  • Opus passthrough happened in 12 already.
  • Opus always internally uses 48kHz... and each packet can change the stream properties.

As for the rest of your notes... I'm not sure. Would have to look at everything in more detail and I don't have the time for that right now.

Thulinma avatar Dec 05 '14 17:12 Thulinma

Our Grandstream phones support Opus and software phone App (CSipSimple). We run Asterisk on a Linux platfrom with the Opus codec installed. Can someone tell me what version of Asterisk is needed for these phones to get them to use the Opus codec? Do I need the custom build to let them talk to PCMA/G722 streams?

PieterDeBruijn avatar Dec 14 '14 08:12 PieterDeBruijn

@PieterDeBruijn This is not really the place to ask, I think... But in order for them to "work", any version should be fine. For the Opus codec to be usable, version 12+ is what you need. If you want all connections to be Opus (and nothing else to go from the server to the phones), you'll need a patched/custom build as encoding to opus is what is added here. Hope that helps.

Thulinma avatar Jan 02 '15 01:01 Thulinma