2015-08-12 8:03 GMT+03:00 Sergey Yudin <[email protected]>: > 2015-08-07 22:42 GMT+03:00 spameden <[email protected] >> <mailto:[email protected]>>: >> >> 2015-08-07 22:41 GMT+03:00 spameden <[email protected] >> <mailto:[email protected]>>: >> >> 2015-08-07 21:06 GMT+03:00 Sergey Yudin <[email protected] >> <mailto:[email protected]>>: >> >> Can you give some tips about using "charset" field ? >> Provider wants UCS-2BE encoding and database in CP1251 >> encoding >> >> for this you need to use coding=2 and charset='utf-8' and also >> msgdata=urlencode(utf-8 encoded text) this way you'll get on the >> handset correct text. >> >> make sure to use latest kannel 1.4.4 (you can build it as well >> from SVN, SVN is production ready). >> >> >> About cp1251 i have no idea, since I'm always using UTF-8. But you >> can try replacing UTF-8 with CP1251 and encoding text in CP1251. Not >> sure if it'd work. >> >> > 2 more questions about sqlbox fields: > > * What fields of SMS_SENT dlr records indicates, that Delivery is OK ? Or > should I parse msgdata field for provider reply ? > > On stock sqlbox status of the sent_sms is in the DLR record (momt='DLR') in sent_sms table in dlr_mask field.
dlr_mask can be: 1 == sent 2 == error 8 == buffered (means submitted to smsc) 16 == blocked by smsc for all statuses you can check kannel guide (i don't remember them all now) for status = 2 there is usually some extended info in msgdata of DLR record. I'd recommend adding status field to the sent_sms and just updating relevant MT record with info from arriving DLR and not keeping DLR record at all because it's not needed. Here is how I do it myself: when DLR record arrives I'm just updating MT record with the same dlr_url (dlr_url is generated automatically when you insert MT into table) setting status, number of parts in original MT and updating meta_data field (which im not using) with msgdata from DLR. you'd need to modify both kannel and sqlbox to achieve this. in the end to get certain MT status I just query sent_sms table and check for status field. but if you don't want to touch kannel's source code or not very familiar with C you can add a trigger on MySQL and update table the same way I believe or add some external http script for processing via same dlr_url functionality. > * How to interpret field "ts" (field-timestamp) in DLR table ? Is it > unixtime in hex ? > No, ts filed in dlr table is a foreign id of MT at SMSC. Some SMSC providers use UNIX_TIMESTAMP though as foreign id, but not everyone. Though, you can add create_date to dlr table to track down when DLR has arrived, e.g. (for MySQL): ALTER table `dlr` add column create_date timestamp default CURRENT_TIMESTAMP; > > -- > Regards.. >
