Recent SVN version of Kannel does this for you. No need todo anything, check metadata field in your DLR.
Alex Am 11.04.2012 um 10:46 schrieb spameden: > How I can get this value without parsing msgdata field of incoming DLR? > > (I'm on sqlbox, inserting records to send sms, sqlbox is between berarerbox > and smsbox). > > > 2012/4/11 Alexander Malysh <amal...@kannel.org> > Hi, > > rejected will be generated in the upper layer so no need to patch anything. > As to the status codes: you don't really need status code what you need is > the error code, check meta data errorcode field. > > Alex > > Am 10.04.2012 um 23:22 schrieb spameden: > > > Hello, list. > > > > Sometimes it's good to know the exact reason why sms was failed. > > > > Is there any way I can get extended information about message delivery > > status? > > > > i.e. if it was REJECTED / UNDELIVERABLE / DELETED / EXPIRED > > > > According to SMPP v3.4 message states are: > > > > Message State Value Description > > ENROUTE 1 The message is in enroute > > state. > > DELIVERED 2 Message is delivered to > > destination > > EXPIRED 3 Message validity period has > > expired. > > DELETED 4 Message has been deleted. > > UNDELIVERABLE 5 Message is undeliverable > > ACCEPTED 6 Message is in accepted state > > (i.e. has been manually read > > on behalf of the subscriber by > > customer service) > > UNKNOWN 7 Message is in invalid state > > REJECTED 8 Message is in a rejected state > > > > Kannel seems to give status = 1 for delivered messages and status = 2 for > > all other failed messages (i.e. EXPIRED / REJECTED / UNDELIVERABLE, etc). > > > > Kannel's documentation says there is a 16 status for REJECTED messages, but > > kannel still gives status 2 instead. SMSC sends correct message state 8. > > > > I checked the source also it seems there is no handling of additional > > statuses in code (from gw/smsc/smsc_smpp.c): > > > > /* first check for SMPP v3.4 and above */ > > 1291 if (smpp->version > 0x33 && receipted_message_id) { > > 1292 msgid = octstr_duplicate(receipted_message_id); > > 1293 switch(message_state) { > > 1294 case 1: /* ENROUTE */ > > 1295 case 6: /* ACCEPTED */ > > 1296 dlrstat = DLR_BUFFERED; > > 1297 break; > > 1298 case 2: /* DELIVERED */ > > 1299 dlrstat = DLR_SUCCESS; > > 1300 break; > > 1301 case 3: /* EXPIRED */ > > 1302 case 4: /* DELETED */ > > 1303 case 5: /* UNDELIVERABLE */ > > 1304 case 7: /* UNKNOWN */ > > 1305 case 8: /* REJECTED */ > > 1306 dlrstat = DLR_FAIL; > > 1307 break; > > 1308 case -1: /* message state is not present, partial SMPP v3.4 */ > > 1309 debug("bb.sms.smpp", 0, "SMPP[%s]: Partial SMPP v3.4, > > receipted_message_id present but not message_state.", > > 1310 octstr_get_cstr(smpp->conn->id)); > > 1311 dlrstat = -1; > > 1312 break; > > 1313 default: > > 1314 warning(0, "SMPP[%s]: Got DLR with unknown 'message_state' > > (%ld).", > > 1315 octstr_get_cstr(smpp->conn->id), message_state); > > 1316 dlrstat = DLR_FAIL; > > 1317 break; > > 1318 } > > 1319 } > > > > > > What's the right way to get additional information about message state from > > kannel? > > > > Should I modify source or I can use somehow msgdata field from DLR somehow > > with stat code (REJECTD/DELIVRD/etc) ? > > > > Thanks in advance. > > > > > > > >