• V20: 3CX Re-engineered. Get V20 for increased security, better call management, a new admin console and Windows softphone. Learn More.

Internal Server Error(500)

Status
Not open for further replies.

ShanA

Joined
Feb 28, 2018
Messages
4
Reaction score
0
Hello,

I updated the server to the latest release this past weekend. Every thing seems to work but when I edit any phone extensions and save the changes it gives me the following error. We are using default templates for Yealink T46 and 48.

Code:
System.NullReferenceException: Object reference not set to an instance of an object.
   at TCX.Configuration.Templates.LocalPhoneDevice.SetDynamicOptionValue(BaseOption option, Object value)
   at ConfigurationManagementModel.CfgTemplateInfo.SetPhoneVlanInfo(PhoneDeviceVlanType type, LocalPhoneDevice phoneDevice, PhoneDeviceVlanInfo info)
   at ConfigurationManagementModel.CfgTemplateInfo.SaveInfoToPhoneDevice(PhoneDeviceInfo info, PhoneDevice phoneDevice, Extension extension)
   at ConfigurationManagementModel.PhoneDeviceInfoExtension.SetPhoneDeviceInfos(Extension ex, PhoneDeviceInfo[] infos, ICfgTemplateInfoProvider templateInfoProvider)
   at ConfigurationManagementModel.CfgExtensionEditor.Serialize_AfterSerialize(Object sender, SerializeEventArgs e)
   at ConfigurationManagementModel.PropertySerializer.FireAfterSerialize(ICfgItemInternal cfgItem, Boolean save)
   at ConfigurationManagementModel.PropertySerializer.Serialize(ICfgItemInternal cfgItem, SerializeParameters serializeParameters)
   at ConfigurationManagementModel.CfgItemBase.Save()
   at ManagementConsoleJS.Services.Editor.Save()
   at ManagementConsoleJS.Services.EditorService.SaveActiveObject(Int32 id)
   at ManagementConsoleJS.Controllers.EditController.Save(Int32 id)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Builder.RouterMiddleware.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ManagementConsoleJS.Middleware.ExceptionWrapperMiddleware.d__3.MoveNext()
 
Were there custom templates being used in the last version?
 
We do use custom template for only a few but this particular phone set did not use custom template in the old system.
 
I would try removing the phone from the provisioning section within the extension settings and re-adding, if that makes sense.
 
Hello @MikeyG.IT

If your custom templates have the same phone user agent then even if you remove and re add the phone to the extension you will face the same issue.
When creating custom templates you need to make sure that the use agent of the phones in the custom templates is different from the default.
If the values are the same on both templates then the management console will not be able to distinguish between the default and custom templates and you will end up with the error you are seeing. The correct way to implement custom templates is outlined in the guide below.
https://www.3cx.com/docs/custom-ip-phone-templates/
 
The custom template have a different name than the default ones. Besides it was working fine prior to upgrading to the latest release.
 
Open the custom template and check the model names in the template. Are they different from the default template?
For example:
2018-03-02_12h22_58.png
 
The custom template shows the following:

<type>phone-template</type>
<version>36097</version>
<time>2014-03-20 09:00:00</time>
<name>Yealink T46/48</name>
<url>http://www.yealink.com</url>
<models>
<model ua="SIP-T46G">Yealink T46 CCAR</model>
<model ua="SIP-T48G">Yealink T48 CCAR</model>
</models>

The default template shows:

<models>
<model ua="SIP-T19P_E2">Yealink T19P E2</model>
<model ua="SIP-T19_E2">Yealink T19 E2</model>
<model ua="SIP-T21P_E2">Yealink T21P E2</model>
<model ua="SIP-T21_E2">Yealink T21 E2</model>
<model ua="SIP-T23P">Yealink T23P</model>
<model ua="SIP-T23G">Yealink T23G</model>
<model ua="SIP-T27P">Yealink T27P</model>
<model ua="SIP-T27G">Yealink T27G</model>
<model ua="SIP-T29G">Yealink T29G</model>
<model ua="SIP-T40P">Yealink T40P</model>
<model ua="SIP-T40G">Yealink T40G</model>
<model ua="SIP-T41S">Yealink T41S</model>
<model ua="SIP-T41P">Yealink T41</model>
<model ua="SIP-T42S">Yealink T42S</model>
<model ua="SIP-T42G">Yealink T42</model>
<model ua="SIP-T46S">Yealink T46S</model>
<model ua="SIP-T46G">Yealink T46</model>
<model ua="SIP-T48S">Yealink T48S</model>
<model ua="SIP-T48G">Yealink T48</model>
<model ua="SIP-T52S">Yealink T52S</model>
<model ua="SIP-T54S">Yealink T54S</model>
</models>
Thanks
 
Since you are using the default templates you can remove the custom templates from the custom templates folder and see if that fixes your issue. If not we might need to take a closer look at the issue.
 
Hi. I came here from a Google search. I removed all of my custom templates from the folder (I think we only used one or two on our 800 extensions, almost all are stock template) Once I removed them and restarted services the error went away. Had the error for stock templates and the two extensions with custom template. Will troubleshoot more, but thought I should put in what I found out. Cheers!
 
Hi. I came here from a Google search. I removed all of my custom templates from the folder (I think we only used one or two on our 800 extensions, almost all are stock template) Once I removed them and restarted services the error went away. Had the error for stock templates and the two extensions with custom template. Will troubleshoot more, but thought I should put in what I found out. Cheers!

Thank you for sharing your findings. Please note that in some cases custom templates use the same user agent for the phones as the defaults. In that case even if you select the default template from the management console the PBX sees 2 templates and can cause issues. So even if a miss-configured custom template is present in the folder it can still cause issues.
 
Status
Not open for further replies.

Getting Started - Admin

Latest Posts

Forum statistics

Threads
141,620
Messages
748,856
Members
144,733
Latest member
julian1234
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.