Index: gw/smsc/smsc_smpp.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_smpp.c,v
retrieving revision 1.123
diff -u -r1.123 smsc_smpp.c
--- gw/smsc/smsc_smpp.c	2 Sep 2009 13:10:50 -0000	1.123
+++ gw/smsc/smsc_smpp.c	3 Sep 2009 22:49:04 -0000
@@ -1593,6 +1593,11 @@
             }
             msg = smpp_msg->msg;
             smpp_msg_destroy(smpp_msg, 0);
+            if (msg->sms.meta_data == NULL)
+                msg->sms.meta_data = octstr_create("");
+            meta_data_set_value(msg->sms.meta_data, "smpp", octstr_imm("dlr_status"),
+                                octstr_format("0x%08lx", pdu->u.submit_sm_resp.command_status), 1);
+
             if (pdu->u.submit_sm_resp.command_status != 0) {
                 error(0, "SMPP[%s]: SMSC returned error code 0x%08lx (%s) "
                       "in response to submit_sm.",
