Why is there a codec change when putting myself on hold? One way audio after. GXP2130/GXP2160

Hi,

I have a GXP2130 and GXP2160 phone.

I set opus as a priority codec in FreePBX as well as in the phone settings. When I call myself, it works great. However, if I put the call on hold and then pick it back up, it picks back up as PCMU, and sounds considerably worse.

If I set the phone to only use OPUS, when you pick up there will be one way audio.

Is there a way to prevent the codec from changing when you put someone on hold? Why is it unable to place someone on hold and then pick the call back up with OPUS? If I force the phone to use OPUS by not listing any other codec in the priority, why does it not provide audio at all when I pick a call up after placing it on hold?

That is probably because the MOH’s codec is not opus.

I disabled call on hold music for inbound and outbound route, same behavior with no hold music. If I place myself on hold and then resume the call, it switches from OPUS to PCMU. You can tell the codec change has occurred since the difference in sound quality is drastic from before being placed on hold, to after being placed on hold.

As a test, why don’t you disable opus and leave ulaw enabled only? That way you can discard codec mismatch issues.

What would I be testing there? When ulaw is allowed , one way audio is not an issue: it switches to ulaw after you pick the call up from hold and works.

You would be testing that the issue is precisely a codec mismatch and somehow either the codec is not being transcoded or correctly negotiated. You can try converting the MOH file to opus codec too.

If I disable opus and allow ulaw only it works fine. Same for g.722. It is only when i use opus that this problem exists.

I’m going to try a sangoma phone on Monday to see if it solves the problem to see if it is pbx or buggy phone.

Try converting the files to opus

To amplify this - with Chan-SCCP-B, the system will try to switch the call to GSM if it’s available. If the call is processed as a GSM call and you switch the “wav” or “ulaw” on-hold music, then call will switch out of GSM and not switch back. Not having your “on hold” music in GSM causes exactly the same problem. The two solutions there are to disable GSM as one of your codecs, or make sure your on-hold music matches the codec you’re using for your calls.

Why do you want Opus on a desk phone? If you are talking on a trunk using ulaw, then Asterisk will transcode and quality will be slightly worse than using ulaw on the phone, and it also puts a significant load on the server.

You might want it if your trunking provider supports wideband calls, e.g. VoLTE and has Opus available as a codec. Or, if users in the field are using Opus on SIP apps connecting via mobile data. Or, to improve quality of internal calls e.g. if some users are not native speakers of your primary language.

Otherwise, I’d just use ulaw or g722 and call it a day.

1 Like

I turned off hold music all together so hold music codec should not matter anymore. In terms of why I would want this, most cell phone providers will utilize Opus if the PBX supports it. If I make a phone call in to the store and the phone and pbx use opus it sounds worlds better than ulaw.

AFAIK, no mobile network operator uses Opus; see Voice Codec Options for VoLTE Services - Techplayon .

Of course, a SIP app on your mobile can use any codec that its author implements; Opus is commonly available. Is that what you’re doing?

Or, it’s also possible that your SIP trunking provider gets wideband calls from one or more mobile operators in your country and transcodes them to Opus before delivering them to you. Is that your situation? If so, what country are you in and who is the provider?

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.