Change phones' codec priority through templates

Status
Not open for further replies.

George Ts

Free User
Advanced Certified
Joined
Jul 3, 2017
Messages
184
Reaction score
12
Hello,

We are using latest 15.5 SP6 for our 3cx and latest provisioning templates for our Polycom VVX 4xx,6xx and Yealinks T2xP (version 80502).

We have been trying to change the priority of the G.711a-law codec on the phones, so that it is used first in the SDP. Our target is to change the codec priority via the template, and not by going under Phone Provisioning - - > Codecs for each single extension/phone.

In the Yealinks we have managed to do this, by setting the following parameters:
account.1.codec.1.enable = 1
account.1.codec.1.payload_type = %%payload2%%
account.1.codec.1.priority = 1
account.1.codec.1.rtpmap = %%codec2%%

(We are using codec2 and payload2, which by default seems to apply for G711a-law, instead of codec1 and payload1 which applies for G.711u-law)

Question1:
Is there a more efficient way to do this for the Yealinks?

Now, we are having trouble to set this for the Polycoms however. This is the first entry their provisioning templates:

<Codecspriorities>
<Codecspriority variableName="codec1" priority="1">
<!--The first entry is the selected entry in management console-->
<option value="voice.codecPref.G711_Mu=&quot;1&quot;">PCMU</option>
<option value="voice.codecPref.G711_A=&quot;1&quot;">PCMA</option>
<option value="voice.codecPref.G722=&quot;1&quot;">G722</option>
<option value="voice.codecPref.G729_AB=&quot;1&quot;">G729A/B</option>

Trying to swap the first two lines above so that G711_A goes on top of G711_Mu does not work.

Any ideas?

Thank you,
George
 
Have you tried changing the order of the codecs, under Phone Provisioning tab for the phone
 
Hi @Saqqara
We want to avoid this, because in such case, we will have to go under 150 extensions, one-by-one and change the codec priority. This is why we want to do this via the templates.
However, just for the record, changing the priority under the extension works.
 
Under your extensions tab hit ctrl and multi-select your extensions. You should see the extensions listed at the top of the screen (for example 101,102,103 etc) this means you are in multi-select mode.

Go to the provisioning tab and see what options are provided to you. Most standard options are available for multi-select however can be limited on the provisioning tab for obvious reasons. It might contain the codecs however.

If so it might get you around this - I do not have access to a 3CX system where I am currently but would of confirmed this for you myself if I did.

The reason this would be preferable is because modifying templates voids the support unfortunately.
 
Hi @eddv123
Thank you for your recommendation. I did not know we can edit multiple extensions like that ;)
However, we are still interested in doing this via the templates. Any recommendation focused on that would be helpful.
 
Yes, the multi-tick mechanism has saved me a lot of time in the past.

On Yealinks like you I have achieved this without issue - however I have never customized Polycom templates on 3CX before. A couple of thoughts however.

Yealinks are a fully supported/preferred phone, where Polycoms are not https://www.3cx.com/sip-phones/ this could mean that the Yealinks templates are kept up to date where (possibly) the Polycoms are not - just a thought. The same could be said in regards to firmware releases.

If the templates are OK the only time I have known certain codecs to be ignored is when calling out to a trunking provider or device who does not support that codec. As you are probably aware during the SDP setup process the devices negotiate what codec to use from a list given in SDP.

For example one list could state G.729 as the preferred codec where the other might not even contain that codec, they would then have to negotiate to the first codec supported by both devices.

This is not what is happening in your case however similarly you could do a Wireshark capture of the call and see if you can identify in the SDP why this is not being accepted. I would first as a check login to the GUI of the phone and confirm whether the settings you have specified in the template for codecs have taken in the GUI of the Polycom.
 
Last edited:
@eddv123 Apologies if my post was unclear.
We are not having issues with our providers: No codec is neglected in the SDP.
We just need to prioritize G.711 a-law across all of our Polycoms by using the provisioning templates.
I have checked SDP, and u-law is suggested first. This needs to change, so that a-law is suggested first by the Polycoms. And again, we need to fix that via the provisioning templates.
Please let me know if I could provide any further clarifications.

Thank you,
George
 
I know, I am just saying that this is the only other time I have known codec order priority to be ignored.

Are the settings being accepted for codec order in the phone when provisioned ? if not then you know for sure that it is a template issue.
 
Changing the settings under the extension works, so the templates do their job.
Beside, they have been very slightly customized (almost default) and tested ever since we deplyed SP6 on 3cx, so I wouldn't say that this is a problem on the templates. It is just one or a combo of parameters that need to change.

Codecspriority variableName="codec1" priority="1"

In the line above, I have tried swapping codec1 (G711 u-law) with codec2 (G711 a-law).
I have also tried swapping the %%codec1%% and %%codec2%% parameters found under the voice.codecPref xml tree, but still without any luck:

<voice>
<voice.codecPref
%%codec2%%
%%codec1%%
%%codec3%%
%%codec4%%
voice.codecPref.G719.32kbps=""
voice.codecPref.G719.48kbps=""
voice.codecPref.G719.64kbps=""

I am sure it's somewhere out there. If anyone has some feedback, please let me know.
 
@George Ts

So let's stop focusing on the codec order in the SDP is irrelevant in the sense that even if G711alaw is first on your phones and G711u is second if the other end doesn't support alaw but supports ulaw that is what is going to be used. I assume you are trying to use alaw between the phones and 3CX? Have you tried changing the Codec Priority under Settings > PBX
 
Also if you are just trying to edit the polycom template then just ask on the polycom forums. They are the polycom template experts. You can just comment out or delete the entire codec block since it's basically looking at the codec order from the 3CX provisioning tab and then parsing it through the template. If you want alaw first or only just comment out the whole block and then confirm in the polycom forums or admin guide the correct format.
 
As I am still learning the 3cx IP-PBX, I had missed the codec configuration under Settings - - > PBX.
I believe this will work, and will save us from customizing both the Yealink and the Polycom templates.
I will post the results after testing your recommendation by Monday. Thank you @cobaltit
 
Hi @cobaltit and @Andyshawn
Unfortunately the change did not do the trick. I prioritized G.711a-law over any othe rcodec both for internal and external calls under Settings - - > PBX.

Still, the phone templates include the same information:

<Codecspriorities>
<Codecspriority variableName="codec1" priority="1">
<!--The first entry is the selected entry in management console-->
<option value="voice.codecPref.G711_Mu=&quot;1&quot;">PCMU</option>
<option value="voice.codecPref.G711_A=&quot;1&quot;">PCMA</option>
<option value="voice.codecPref.G722=&quot;1&quot;">G722</option>
<option value="voice.codecPref.G729_AB=&quot;1&quot;">G729A/B</option>

And indeed, G.711 U-law is eventually the codec with the highest priority after reprovisioning phones.
I have restarted services, but neither that helped.

Which brings me back to my very first question:
How can I customize Polyccom VVX templates so that they make the phone use a-law first?
 
Hello,

Anyone?

@YiannisH_3CX tagging you here, as you may have some useful feedback.

Thank you.
 
@YiannisH_3CX tagging you here, as you may have some useful feedback.
As you know custom templates are not supported by 3CX so what i can recommend is to stick to the default templates and change the codec order manually.
 
@YiannisH_3CX this neither worked for the default Polycom VVX templates.
Changing the codecs priority under Settings - - > PBX still advises a Polycom (with a default template) to use PCMU first, then PCMA.
 
@YiannisH_3CX this neither worked for the default Polycom VVX templates.
Changing the codecs priority under Settings - - > PBX still advises a Polycom (with a default template) to use PCMU first, then PCMA.
I just tested this and the config file created reflects the changes made in the order of the codecs through the management console.
 
Hi @YiannisH_3CX
Can you paste the output of your config file?

I followed the process below:
- Set PCMA as primary codec under Settings - - > PBX - - > Codec priority BOTH for internal and external calls
- Factory reset Polycom VVX410 and provisioned it with the default polycomvvx.ph.xml template.
- Went under Phones tab, found my VVX 410 and pressed +Config.

This is the result I got:
<voice>
<voice.codecPref
voice.codecPref.G711_Mu="1"
voice.codecPref.G711_A="2"
voice.codecPref.G722="3"
voice.codecPref.G729_AB="4"



So, I am curious to see what is wrong here.

Thank you,
George
 
The setting under Settings - - > PBX - - > Codec priority will not change the codec priority of the phones. To change the codec priority for the phones you need to do it from the extension settings / Phone provisioning tab.
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,358
Messages
592,092
Members
165,527
Latest member
jmarshall