Error from Accounting Callback

Error from Accounting Callback SearchSearch
Author Message
Ruben da Costa e Silva
New member
Username: Rubendacosta

Post Number: 1
Registered: 06-2022
Posted on Thursday, June 09, 2022 - 04:21 pm:   

Hello, team.

We're trying to send SMS's from one of our client connected via SMPP, and we are getting the following error:

Error: Error from Accounting Callback -- HTTP Response Error Code 400

We notice that this only happens, if the content of the SMS includes square brackets [ ].
Could you please guide us, on how to solve this problem?

Thank you in advance.
- Ruben Silva
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 8485
Registered: 10-2002
Posted on Thursday, June 09, 2022 - 06:48 pm:   

Hi Ruben,

Are you running the Windows or Linux version of NowSMS?

What is the version number of NowSMS being used?

What environment is the accounting callback running under? (PHP, ASP, ???)

I can see that according to RFC 3986, if a query string includes "[" or "]" characters, they should be "percent encoded" (a.k.a., "escaped") in the URL as %5B and %5D, but current versions of NowSMS are including these characters directly in the URL as they appear. I'm guessing that the environment that processes your accounting callbacks has a strict interpretation and returns a 400 error if these characters are present.

I am checking with our engineering team about an update to correct this behavior. Please advise the version information requested above.

Regards,

Bryce Norwood
NowSMS Support
Ruben da Costa e Silva
New member
Username: Rubendacosta

Post Number: 2
Registered: 06-2022
Posted on Friday, June 10, 2022 - 11:37 am:   

Hello Bryce, and thanks for the quick reply.

We are currently running the Windows version, v2020.07.09.

We're running the accounting callback under REST API HTTP.

From my understanding, we'll need to convert the brackets characters to the "percentage code", in the URL, right?

We'll try this solution, but in case you have a better one, please advise us.


Thank you in advance.
- Ruben Silva
Ruben da Costa e Silva
New member
Username: Rubendacosta

Post Number: 2
Registered: 06-2022
Posted on Friday, June 10, 2022 - 12:15 pm:   

It looks like the characters are being "percent encoded", but we still get the same error.Callback Error
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 6328
Registered: 08-2008
Posted on Friday, June 10, 2022 - 03:40 pm:   

Hi Ruben,

The percent encoding that is missing is in an accounting callback, where NowSMS is generating the URL. It is independent from whether or not percent encoding was used when the message was originally submitted.

The service that is processing the accounting callback URL is returning a 400 error, presumably because it believes the [ and ] characters are not valid in the URL.

Based on my reading of RFC 3986, I agree. NowSMS should be percent encoding these characters (and a few others that NowSMS is handling wrong). Most web servers are tolerant and allow these characters as there is no ambiguity as to intent.

The problem occurs in both the Linux and Windows versions. I expect that we will be able to produce an interim update to address this in the next several days…Tuesday at the latest.

Regards,

Bryce Norwood
NowSMS Support
Ruben da Costa e Silva
New member
Username: Rubendacosta

Post Number: 3
Registered: 06-2022
Posted on Friday, June 10, 2022 - 05:57 pm:   

Thanks for the reply, Bryce.

We'll be waiting for the update.


Best regards,
- Ruben Silva
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 8486
Registered: 10-2002
Posted on Saturday, June 11, 2022 - 01:28 pm:   

Hi Ruben,

We've uploaded an updated release that addresses the issue where "percent encoding” was not being properly applied for some characters when encoding URL parameters used by accounting callbacks, 2-way SMS and HTTP SMSC connections. RFC 3986 defines the characters that should be percent encoded (a.k.a. URL escaped). This update adds encoding for the following characters that were not encoded in previous versions: ‘ $ ( ) / = @ [ ] { } | ^ `

The Windows update can be downloaded at https://nowsms.com/download/nowsms20220609.zip

To update the Linux version, edit SMSGW.INI and under the [SMSGW] header add UpdateChannel=beta ... Reload the "Admin/System Configuration" page in the web interface, and a button should appear near the top right corner to download the update. If the update button is not shown, it may be necessary to wait a few minutes and reload the page again. Remember to remove the UpdateChannel setting after updating to avoid prompts to download future beta updates.

Regards,

Bryce Norwood
NowSMS Support
Ruben da Costa e Silva
New member
Username: Rubendacosta

Post Number: 4
Registered: 06-2022
Posted on Monday, June 13, 2022 - 09:55 am:   

Thank you very much for the great support, Bryce.

We'll install the update, and then let you know if it solved the issue.

Best regards,
- Ruben Silva

Add Your Message Here, or click here to start a new topic.
Post:
Bold text Italics Underline Create a hyperlink Insert a clipart image
Options: Automatically activate URLs in message
Action: