Michael Maier
2017-May-13 05:21 UTC
[asterisk-users] pjsip: asterisk can't decide which codec to use
On 05/12/2017 at 08:49 PM, Joshua Colp wrote:> On Fri, May 12, 2017, at 02:46 PM, Michael Maier wrote: > > <snip> > >> >> If I'm doing exactly the same call originated with another extension, >> there can't be seen these frequent changes. But the strange thing is, >> that in both cases the part between extension and asterisk doesn't show >> any codec changes ... . >> >> Deeper investigations show, that if the conference (callee) sends the >> first rtp package (-> g711 - should be g722), things are going choppy, >> if the extension (caller) sends the first package (g722), things are >> running stable. >> >> >> Any idea to convince asterisk always to use the first codec of ok sdp >> or how to convince asterisk to put only one codec to ok sdp (the first). > > This is not currently an option in chan_pjsip but I'd suggest filing an > issue[1] for this scenario with all available information. > > [1] https://issues.asterisk.org/jirahttps://issues.asterisk.org/jira/browse/ASTERISK-26996 Thanks, regards, Michael
Michael Maier
2017-Jun-16 15:29 UTC
[asterisk-users] pjsip: asterisk can't decide which codec to use
On 05/13/2017 at 07:21 AM Michael Maier wrote:> On 05/12/2017 at 08:49 PM, Joshua Colp wrote: >> On Fri, May 12, 2017, at 02:46 PM, Michael Maier wrote: >> >> <snip> >> >>> >>> If I'm doing exactly the same call originated with another extension, >>> there can't be seen these frequent changes. But the strange thing is, >>> that in both cases the part between extension and asterisk doesn't show >>> any codec changes ... . >>> >>> Deeper investigations show, that if the conference (callee) sends the >>> first rtp package (-> g711 - should be g722), things are going choppy, >>> if the extension (caller) sends the first package (g722), things are >>> running stable. >>> >>> >>> Any idea to convince asterisk always to use the first codec of ok sdp >>> or how to convince asterisk to put only one codec to ok sdp (the first). >> >> This is not currently an option in chan_pjsip but I'd suggest filing an >> issue[1] for this scenario with all available information. >> >> [1] https://issues.asterisk.org/jira > > https://issues.asterisk.org/jira/browse/ASTERISK-26996I just tested your fix 2 times w/ using the scenario mentioned in the bug report. It has been working for me. No more flipping. Asterisks indeed commits more than one codec in ok sdp, but always uses the first one afterwards. Hopefully the peer always handles it the same way. I would have thought that the ok sdp contains just one codec (the best). Thanks, Michael
Joshua Colp
2017-Jun-16 15:40 UTC
[asterisk-users] pjsip: asterisk can't decide which codec to use
On Fri, Jun 16, 2017, at 12:29 PM, Michael Maier wrote:> I just tested your fix 2 times w/ using the scenario mentioned in the > bug report. It has been working for me. No more flipping. > > Asterisks indeed commits more than one codec in ok sdp, but always uses > the first one afterwards. Hopefully the peer always handles it the same > way. I would have thought that the ok sdp contains just one codec (the > best).There's actually a feature for just that in master, preferred_codec_only. It'll be available in 15. The new behavior in the branches with multiple codecs in the answer mirrors that of chan_sip, so it's pretty safe. -- 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