Custom error codes for undelivered receipts

Custom error codes for undelivered receipts SearchSearch
Author Message
Srikanth M
New member
Username: Srikanthm

Post Number: 5
Registered: 11-2014
Posted on Saturday, July 16, 2016 - 05:30 am:   

Hello Team,

We have a license for nowsms. I want to know if it is possible to block certain numbers submitted by smpp client from getting forwarded to upstream gateway and return a custom error code like 250 in error code field with status UNDELIV as a delivery receipt back to the submitting client?

Looking forward for your reply

Regards,
Srikanth.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5693
Registered: 08-2008
Posted on Monday, July 18, 2016 - 09:09 pm:   

Hi,

If you implement accounting callbacks, you can return an SMPP error to the client directly and refuse to accept the message.

More info here: http://www.nowsms.com/understanding-sms-accounting-callbacks

An example that blocks on sender is here: http://support.nowsms.com/discus/messages/1/71175.html


That example tests the sender address using $_REQUEST['Sender'], but you would look at the destination which is in the To parameter (in PHP $_REQUEST['To'])

--
Des
NowSMS Support
Srikanth M
New member
Username: Srikanthm

Post Number: 6
Registered: 11-2014
Posted on Monday, July 25, 2016 - 01:04 pm:   

Hi Des,

Thanks for the info. I have tried several ways to simulate a Delivery report customer error code 222 and Reject message as SPAM. Unable to get it work, always getting standard errors like esme reject or esme unknown.

What I need is to validate mobile numbers submitted by smpp client before sending it for upstream gateway if the end numbers in our block list, we want to return the submitting smpp client a delivery report as below

id:101010101010 sub:001 dlvrd:000 submit date:160725095926 done date:160725155939 stat:UNDELIV err:222 text

Let me know how we can accomplish this

Regards,
Srikanth.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5698
Registered: 08-2008
Posted on Monday, July 25, 2016 - 08:10 pm:   

Here's an example accounting callback that blocks +1234567890 and rejects with hex error code 222


<?php 
header ("Content-Type: text/plain");

$response = "OK";

if (isset($_REQUEST['Type'])) {
if ($_REQUEST['Type'] == "SMSSend") {
if (isset($_REQUEST['PreAuth'])) {
if ($_REQUEST['PreAuth'] == "Yes") {
if (isset($_REQUEST['To'])) {
$to = $_REQUEST['To'];
if (!strcmp ($to, "+12345678901")) {
$response = "PreAuth=Deny\r\nSMPPErrorCode=0x222\r\n";
}
}
}
}
}
}

echo $response;
?>
Srikanth M
New member
Username: Srikanthm

Post Number: 7
Registered: 11-2014
Posted on Friday, July 29, 2016 - 06:29 pm:   

Hello Des,

Thanks, this definitely rejects the message but this does not assign a message and reply back a pure delivery report back to the customer. When a message gets submitted to us the client smpp software keeps on retrying.

Can we send a pure delivery report back to customer?

Thanks

Regards