Hi Jarl, I'm not sure but probably you mix up what Kannel do and what Kannel doesn't do (which we must do or create ourselves).
1) If you need to store the outgoing SMS (and its DLR status), you need to stop pursue using Kannel built-in dlr features (I might miss something, but the "group = dlr-db" shows there aren't any field to store the short message itself, at least as of Kannel 1.3.1 which I use). You should create your own database and store the message yourselves. 2) Ditto for incoming messages, if we want to store them in mysql (or other database), we should store them ourselves (Kannel prepare the information for us, but we must specifically pick them for further processing). To do so, we need to have "sms-service" group pointing to a script (via "get-url" or "post-url") that will store the incoming messages. 3) "dlr.php" is just a name used for an example (You need to create it). And this "dlr.php" script task is updating the status field in the table you use to store your outgoing message. "dlr.php" shouldnot store the outgoing SMS itself, the specific SMS record --which expecting delivery report-- must be there in the database table before Kannel call "dlr.php". In other words, you need to store the SMS message in database table before you call /cgi-bin/sendsms. Otherwise "dlrp.php" doesn't know the id or record number of your SMS message when Kannel calls your "dlr.php" (please refer to my yesterday post). About the "dlr.php" itself, it depends on your database table structure (the field / what you store in the table). In my case, it really do one thing only: update the status field according to the id number. Hope this helps ... Regards, Rudy On Tuesday 11 November 2003 07:23, Jarlco wrote: > This is rather embarrassing, however after having read all the great > replies and thinking nothing can go wrong now, things still seem a bit odd. > > > However this is most likely due to some misunderstanding on my side, which > is why I'm going to try to clear this out once and for all. > > > > You might wounder why I'm asking so many (possibly stupid) questions, well > basically I find this to be a very exciting program, however hard to solve > some things without asking people who are more experienced. > > Also I'm doing a SMS based 3rd year project where we're going to handle SMS > voting, so I need to be able to store users (on phone numbers) be able to > check what they wrote, have a script analyse the database etc, check that > they are registered voters, send a reply, count votes etc... > > Obviously if I could get mysql and kannel to work while UNDERSTANDING how > it works, the project would be quite simple. > > > > So, if anyone has the time and patience please follow my (hopefully simple) > questions, and steps below. > > (for kannel.conf and how I installed mysql it's at the bottom, together > with my kannel mysql database.) > > > > I'm sure this is useful not only to myself but others as well, and > hopefully after all this I'll be a bit more qualified myself to answer any > questions. > > > > > > Mysql steps and Questions > > > > 1. > (for Navjot Singh) I've looked through all possible posts and mail archives > I could find, however I don't seem to find the post you were talking about: > "For MORE info, PLEASE follow my posts on mysql+dlr, you will get clear > picture." > Any link to it somewhere? (or was it the one I already posted a link to?) > 2. > > what's the difference between "dlrmask=31" and "dlr-mask=31" > asking this because people say different things in different posts and I > tried dlrmask=31 but then an error message came up in my sms box saying use > "dlr-mask" instead. > 3. > > Does kannel never store messages in mysql unless you add &dlrmask (dlr-mask > ?) to your send command? > 4. > > Now if the above is true (which I suspect) how then does kannel store an > incoming message? > 5. > > Can I add dlrmask or dlr-mask in my kannel.conf file somewhere to make it > store incoming messages? > > 6. > From earlier replies I've gathered a fair bit of information, I know a > dlr.php file is useful for handling messages and mysql, however do I have > to have one to store a message? (seems like it) > 7. > > Of course I'm about to make the above, but I have to ask, just in case some > one already has one they want to share, is this a possibility? > > > 8. > For my general understanding could anyone outline how it actually works > when a message is sent and when a message is delievered and stored. > for example: > message is sent > kannel stores the data in mysql > kannel then either leaves it like this or HAS to call a dlr.php file? > etc etc.. > > and then also for > message delievered > etc... > > > 9. > > I'm sure I lack something. I know the dlr.php file can do basically > anything you program it to do, however how would it know when a message has > been delivered if url isn't specified somewhere? > 10. > > I can see how the dlr.php can send a message, that's not difficult to > understand, it just uses the /sendsms.&to..&dlrmask? &dlr-mask etc. > 11. > > but then when does the thing actually get stored to mysql? > 12. > > hmm my head is spinning surely you don't need dlr.php to just store the > basics, surely kannel knows what the date, time, phone number etc is? And > if kannel didn't store this how would this info be transferred to dlr.php > from kannel? > > > > > If all this is answered I have to thank you all a lot, I know some of it is > probably basic and unfortunatly my understanding is soo limited I probably > wasn't even able to write the proper questions to get a real understanding. > But thank you for trying to help me. > > > > > > ------------------------------------------------- > > Below is tests and how I've configured it all... > > > > 13. > > Tried it all out today and I ended up with nothing in my database and the > following error (debug) messages: > > > -------------------------------------------------------------- > > 2003-11-10 22:03:29 [11] DEBUG: boxc_receiver: sms received > > 2003-11-10 22:03:29 [11] DEBUG: send_msg: sending msg to box: <127.0.0.1> > > 2003-11-10 22:03:30 [7] DEBUG: AT2[wavecom_1]: TP-Validity-Period: 24.0 > hours > > 2003-11-10 22:03:30 [7] DEBUG: AT2[wavecom_1]: --> AT+CMGS=23^M > > 2003-11-10 22:03:30 [7] DEBUG: AT2[wavecom_1]: <-- > > > 2003-11-10 22:03:30 [7] DEBUG: AT2[wavecom_1]: send command status: 1 > > 2003-11-10 22:03:30 [7] DEBUG: AT2[wavecom_1]: --> > 0031000B817018360612F00000A70 AC8329BFD06A9C37236 > > 2003-11-10 22:03:30 [7] DEBUG: AT2[wavecom_1]: --> ^Z > > 2003-11-10 22:03:32 [0] DEBUG: Main Thread: Nothing todo. > > 2003-11-10 22:03:33 [7] DEBUG: AT2[wavecom_1]: <-- > > > 2003-11-10 22:03:33 [7] DEBUG: AT2[wavecom_1]: <-- +CMGS: 33 > > 2003-11-10 22:03:33 [7] DEBUG: AT2[wavecom_1]: <-- OK > > 2003-11-10 22:03:33 [7] DEBUG: AT2[wavecom_1]: send command status: 0 > > 2003-11-10 22:03:33 [7] DEBUG: DLR[mysql]: Adding DLR smsc=wavecom_1, > ts=33, src =07xxxxxxxx, dst=07xxxxxxxxx, mask=31, boxc= > > 2003-11-10 22:03:33 [7] DEBUG: sql: INSERT INTO SmsEvent (smsc, ts, source, > dest ination, service, url, mask, boxc, status) VALUES ('wavecom_1', '33', > '079xxxxxxxx 50', '07xxxxxxxxxx', 'jarl', '', '31', '', '0'); > > 2003-11-10 22:03:33 [7] DEBUG: SMSC[wavecom_1]: creating DLR message > > 2003-11-10 22:03:33 [7] DEBUG: SMSC[wavecom_1]: DLR = > > 2003-11-10 22:03:33 [1] DEBUG: Dumping 1 messages and 0 acks to store > > 2003-11-10 22:03:33 [12] DEBUG: send_msg: sending msg to box: <127.0.0.1> > > 2003-11-10 22:03:33 [12] DEBUG: boxc_sender: sent message to <127.0.0.1> > > 2003-11-10 22:03:33 [11] DEBUG: boxc_receiver: got ack > > 2003-11-10 22:03:35 [11] DEBUG: boxc_receiver: heartbeat with load value 0 > recei ved > > 2003-11-10 22:03:39 [7] DEBUG: AT2[wavecom_1]: <-- +CDS: 25 > > 2003-11-10 22:03:39 [7] DEBUG: AT2[wavecom_1]: <-- > 0006210C914487616320013011011 28591003011011285220000 > > 2003-11-10 22:03:39 [7] DEBUG: AT2[wavecom_1]: got STATUS-REPORT for > message <33 >: > > 2003-11-10 22:03:39 [7] DEBUG: AT2[wavecom_1]: Numeric receiver > (international) <+44xxxxxxxx> > > 2003-11-10 22:03:39 [7] DEBUG: DLR[mysql]: Looking for DLR smsc=wavecom_1, > ts=33 , dst=+44xxxxxxxxx, type=1 > > 2003-11-10 22:03:39 [7] DEBUG: sql: SELECT mask, service, url, source, > destinati on, boxc FROM SmsEvent WHERE smsc='wavecom_1' AND ts='33'; > > 2003-11-10 22:03:39 [7] DEBUG: Found entry, row[0]=31, row[1]=jarl, > row[2]=, row [3]=079xxxxxxxx, row[4]=078xxxxxxxxxx row[5]= > > 2003-11-10 22:03:39 [7] DEBUG: DLR[mysql]: created DLR message for URL <> > > 2003-11-10 22:03:39 [7] DEBUG: removing DLR from database > > 2003-11-10 22:03:39 [7] DEBUG: sql: DELETE FROM SmsEvent WHERE > smsc='wavecom_1' AND ts='33' LIMIT 1; > > 2003-11-10 22:03:39 [7] DEBUG: AT2[wavecom_1]: --> AT+CNMA^M > > 2003-11-10 22:03:39 [12] DEBUG: send_msg: sending msg to box: <127.0.0.1> > > 2003-11-10 22:03:39 [12] DEBUG: boxc_sender: sent message to <127.0.0.1> > > 2003-11-10 22:03:39 [11] DEBUG: boxc_receiver: got ack > > 2003-11-10 22:03:40 [7] DEBUG: AT2[wavecom_1]: <-- OK > > 2003-11-10 22:03:42 [0] DEBUG: Main Thread: Nothing todo. > > 2003-11-10 22:03:52 [0] DEBUG: Main Thread: Nothing todo. > > 2003-11-10 22:04:02 [0] DEBUG: Main Thread: Nothing todo. > > 2003-11-10 22:04:05 [11] DEBUG: boxc_receiver: heartbeat with load value 0 > recei ved > > > > So it tried to add it to the database? But deleted it? I'm confused again? > > > > > > > > Installed it all with: > > ./configure --enable-mysql --with-dlr=mysql > > make > > make install > > > > Then I set up a mysql database with: > > #CREATE TABLE SmsEvent ( > > #smsc VARCHAR(255), > > #ts VARCHAR(255), > > #destination VARCHAR(255), > > #service VARCHAR(255), > > #url VARCHAR(255), > > #mask VARCHAR(255), > > #status VARCHAR(255), > > #boxc VARCHAR(255), > > #source VARCHAR(255), > > #PRIMARY KEY(smsc) ) > > #; > > > > After this I added the following to my kannel.conf file > > # MYSQL CONFIGURATION > > > > group = core > > .. > > dlr-storage = mysql > > > > > > group = mysql-connection > > id = mydlr1 > > host = localhost > > mysql-username = jarl > > mysql-password = jarl > > database = kannel > > > > # STORAGE GROUP > > > > group = dlr-db > > id = mydlr1 > > table = SmsEvent > > field-smsc = smsc > > field-timestamp = ts > > field-destination = destination > > field-service = service > > field-url = url > > field-mask = mask > > field-status = status > > field-boxc-id = boxc > > field-source = source > > > > > > Thank you all once again, you're great, thanks, > Jarl