/**
 * SMPP statuses supported in deliver_sm request of the fake SMPP to ESME.
 * see http://smpp.w2wts.com/SMPP_Developers.aspx
 */
function Statuses(list) {
    this.availabile_delivery_statuses = {
        'delivered': {stat: 'DELIVRD', err: "000"},
        'provider_failure': {stat: 'UNKNOWN', err: "02f"},
        'undelivered': {stat: 'UNDELIV',  err: "023"},
        'phone_not_exists': {stat: 'REJECTD', err: "035"},
        'billing_error': {stat: 'REJECTD', err: "038"},
        'spam_rejected': {stat: 'REJECTD', err: "039"},
        'flooding': {stat: 'REJECTD', err: "03a"},
        'blacklisted': {stat: 'REJECTD', err: "03c"},
        'retrying': {stat: 'ACCEPTD', err: "044"},
        'canceled': {stat: 'REJECTD', err: "052"},
        'expired': {stat: 'EXPIRED', err: "058"},
        'deleted_by_sender': {stat: 'DELETED', err: "05f"},
        'deleted_by_admin': {stat: 'DELETED', err: "060"},
        'invalid_format': {stat: 'REJECTD', err: "778"},
    };
    this.items = [];
    for(var i in list) {
        if (list[i] in this.availabile_delivery_statuses) {
            this.items.push(list[i]);
        }
    }
    if (this.items.length == 0) {
        throw 'Empty statuses list.';
    }
    this.i = -1;
}
Statuses.prototype.next = function() {
    this.i++;
    if (this.i >= this.items.length) {
        this.i = 0;
    }
    return this.availabile_delivery_statuses[this.items[this.i]];
}

exports.Statuses = Statuses;

@@ -240,18 +240,16 @@
  err: %220
-00
 %22%7D,%0A    
@@ -300,11 +300,10 @@
 r: %22
-02f
+47
 %22%7D,%0A
@@ -354,11 +354,10 @@
 r: %22
-02
 3
+5
 %22%7D,%0A
@@ -412,11 +412,10 @@
 r: %22
-03
 5
+3
 %22%7D,%0A
@@ -467,11 +467,10 @@
 r: %22
-038
+56
 %22%7D,%0A
@@ -522,11 +522,10 @@
 r: %22
-039
+57
 %22%7D,%0A
@@ -572,11 +572,10 @@
 r: %22
-03a
+58
 %22%7D,%0A
@@ -625,11 +625,10 @@
 r: %22
+6
 0
-3c
 %22%7D,%0A
@@ -675,11 +675,10 @@
 r: %22
-044
+68
 %22%7D,%0A
@@ -721,18 +721,17 @@
 , err: %22
-05
+8
 2%22%7D,%0A   
@@ -770,18 +770,17 @@
 , err: %22
-05
+8
 8%22%7D,%0A   
@@ -833,11 +833,10 @@
 r: %22
-05f
+95
 %22%7D,%0A
@@ -891,11 +891,10 @@
 r: %22
-060
+96
 %22%7D,%0A

update status code from hex to dec format