Handle Delivery Report

moceansms API Server always refer to parameter "mocean-dlr-mask" to decide whether DR will be generated and returned to you.

If delivery report is requested, moceansms shall returned delivery report to the callback url submitted under parameter "mocean-dlr-url" in MT SMS request.

After returning delivery report, moceansms API Server is expecting a respond with “HTTP OK” (Status 200) or it will keep on retrying until it expired(36 hours).

HTTP Method Used

PUT - moceansms API Server will act as a HTTP client to issue a HTTP PUT request to your delivery report's callback url. Data will be stuffed inside the HTTP Message Body.

Parameters

Parameter Name

Data Format

Descriptions

mocean-from

number

Phone number of the original SMS recipient.

mocean-to

number

Phone number of the original SMS sender.

mocean-dlr-status

number

Status of the delivery.

1 – Success

2 – Failed

3 – Expired

mocean-msgid

string

Message ID of the message where this report is associated.

mocean-error-code

number

Error code of the submission.


NOTE: The delivery of DLR is not guaranteed because Telco does not guarantee delivery report.

DLR Error Codes

Error Code

Descriptions

000

No error.

001

Absent subscriber.

002

Handset memory capacity exceeded. Handset has run out of free memory to store new message.

003

Equipment protocol error.

004

Equipment not equipped with short-message capability.

005

Unknown subscriber. The IMSI is unknown in the HLR.

006

Illegal subscriber. The mobile station failed authentication.

007

Teleservice not provisioned. Mobile subscription identified by the MSISDN number does include the short message service.

008

Illegal equipment. IMEI check failed, i.e. the IMEI is either black listed or not white listed.

009

Call barred. Operator barred the MSISDN number.

010

Facility not supported. VLR in the PLMN does not support MT short message service.

011

Subscriber busy for MT short message.

012

System failure. Task cannot be completed because of a problem in another entity.

013

Data missing. Necessary parameter is not present in the primitive.

014

Unexpected data value. Necessary data is badly formatted in the primitive.

015

Unidentified subscriber.

016

Absent subscriber. No paging response.

017

Absent subscriber. IMSI detached.

018

Absent subscriber. Roaming restriction.

047

Application context not supported.

050

Temporary error received from peer SMSC.

051

SMS malformed. SMS is not formed correctly. This error is specific to IP-based protocols like SMPP

052

SMS expired.

053

Insufficient credit. The user has insufficient credit/not allowed to send to that destination.

054

Invalid destination. Receiver is not a valid number.

055

Unable to find outbound route for this SMS.

056

SMS buffered.

057

Timeout waiting for response from peer.

058

Throttling error. The user has exceeded allowed message limit.

059

SMS suspected spam message.

061

Subscriber blacklisted.

062

Subscriber not white listed.

069

Invalid sender ID.

071

Subscriber opted out from receiving SMS.

074

SMS rejected. Error received from peer SMSC.

075

SMS rejected. Inappropriate SMS content.

076

Sender ID blacklisted.

077

Sender ID not white listed.

094

URL blacklisted.

095

URL not white listed.

096

Message expired in system with no final status from carrier.

255

Unknown error.

Example Helper

// Get data from PUT request
parse_str(file_get_contents("php://input"), $dlrData);

$delivery_status = array(1 => 'Success', 2 => 'Failed', 3 => 'Expired');

// Print out data
echo "mocean-from => $dlrData['mocean-from'] \n";
echo "mocean-to => $dlrData['mocean-from'] \n";
echo "mocean-dlr-status => $delivery_status[$dlrData['mocean-dlr-status']] \n";
echo "mocean-msgid => $dlrData['mocean-msgid'] \n";
echo "mocean-error-code => $dlrData['mocean-error-code'] \n";