Search FAQs
PME2020 - Why twilio SMS notifications is not working?
Environment:
PME2020 SMS notification using Twilio.
-----------------------------------------------------------------------------------------------
Issue:
sending SMS fails. The AppMod eventlog extended information shows the below message.
LogClientException: Twilio.Exceptions.ApiConnectionException: Connection Error: POSThttps://api.twilio.com/2010-04-01/Accounts/ACef60b67fa407ccd4d729a65182200bf0/Messages.json ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
at System.Net.PooledStream.EndWrite(IAsyncResult asyncResult)
at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at Twilio.Http.SystemNetHttpClient.MakeRequest(Request request)
at Twilio.Clients.TwilioRestClient.Request(Request request)
--- End of inner exception stack trace ---
at Twilio.Clients.TwilioRestClient.Request(Request request)
at Twilio.Rest.Api.V2010.Account.MessageResource.Create(CreateMessageOptions options, ITwilioRestClient client)
at Twilio.Rest.Api.V2010.Account.MessageResource.Create(PhoneNumber to, String pathAccountSid, PhoneNumber from, String messagingServiceSid, String body, List`1 mediaUrl, Uri statusCallback, String applicationSid, Nullable`1 maxPrice, Nullable`1 provideFeedback, Nullable`1 validityPeriod, String maxRate, Nullable`1 forceDelivery, String providerSid, ContentRetentionEnum contentRetention, AddressRetentionEnum addressRetention, Nullable`1 smartEncoded, String interactiveData, Nullable`1 forceOptIn, ITwilioRestClient client)
at Notifications.Core.Delivery.DeliverToSmsViaTwilio.SendSmsMessage(String toPhoneNumber, String message)
LogClient: Notifications.Core::Notifications.Core.Delivery.DeliverToSmsViaTwilio::SendSmsMessage
-----------------------------------------------------------------------------------------------
Cause:
This may happen if there is a restriction in connecting to the remote server.
eg. It happens when the PME server is located in a VM and the VM is connected to Schneider's internal network. There is a restriction to connect to any external website without SSO sign in. Due to this when PME tries to send SMS then it fails to connect the remote server.
-----------------------------------------------------------------------------------------------
Resolution:
PME2020 SMS notification using Twilio.
-----------------------------------------------------------------------------------------------
Issue:
sending SMS fails. The AppMod eventlog extended information shows the below message.
LogClientException: Twilio.Exceptions.ApiConnectionException: Connection Error: POSThttps://api.twilio.com/2010-04-01/Accounts/ACef60b67fa407ccd4d729a65182200bf0/Messages.json ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
at System.Net.PooledStream.EndWrite(IAsyncResult asyncResult)
at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at Twilio.Http.SystemNetHttpClient.MakeRequest(Request request)
at Twilio.Clients.TwilioRestClient.Request(Request request)
--- End of inner exception stack trace ---
at Twilio.Clients.TwilioRestClient.Request(Request request)
at Twilio.Rest.Api.V2010.Account.MessageResource.Create(CreateMessageOptions options, ITwilioRestClient client)
at Twilio.Rest.Api.V2010.Account.MessageResource.Create(PhoneNumber to, String pathAccountSid, PhoneNumber from, String messagingServiceSid, String body, List`1 mediaUrl, Uri statusCallback, String applicationSid, Nullable`1 maxPrice, Nullable`1 provideFeedback, Nullable`1 validityPeriod, String maxRate, Nullable`1 forceDelivery, String providerSid, ContentRetentionEnum contentRetention, AddressRetentionEnum addressRetention, Nullable`1 smartEncoded, String interactiveData, Nullable`1 forceOptIn, ITwilioRestClient client)
at Notifications.Core.Delivery.DeliverToSmsViaTwilio.SendSmsMessage(String toPhoneNumber, String message)
LogClient: Notifications.Core::Notifications.Core.Delivery.DeliverToSmsViaTwilio::SendSmsMessage
-----------------------------------------------------------------------------------------------
Cause:
This may happen if there is a restriction in connecting to the remote server.
eg. It happens when the PME server is located in a VM and the VM is connected to Schneider's internal network. There is a restriction to connect to any external website without SSO sign in. Due to this when PME tries to send SMS then it fails to connect the remote server.
-----------------------------------------------------------------------------------------------
Resolution:
- Use a network without any such restriction.
- Make sure the group policy is applied to the computer and the computer has applications like "Global Protect" and "Zscaler" installed and registered. In some scenarios, it may require to check the Antivirus setting as well.
- Make sure it is possible to open any external website without requiring to do SSO login.
Released for:Schneider Electric Ireland
Explore more
Range:
Explore more
Range: