I'm not sure if this is the correct behavior (I'm using internal DLR storage), but I can't seem to accept multiple DLRs for a single message. I'm using dlr-mask=31 in sending an MT (using HTTP to Kannel). My dlr-url is called when the submit_sm_resp is received, but it isn't called on the succeeding DLRs. I'm using Kannel with the meta-data and %w patches implemented. Here's what happens:
1. The MT is sent to the SMSC. 2. The submit_sm_resp is treated as a DLR, so this works fine. 3. Then a second DLR is sent to say that the message was accepted at the operator level. I get this warning message: 2008-10-30 07:36:14 [14684] [6] DEBUG: DLR[internal]: Looking for DLR smsc=X, ts=YYYYY, dst=XXXXX, type=4 2008-10-30 07:36:14 [14684] [6] WARNING: DLR[internal]: DLR from SMSC<X> for DST<XXXXX> not found. 2008-10-30 07:36:14 [14684] [6] ERROR: SMPP[X]: got DLR but could not find message or was not interested in it id<YYYYY> dst<XXXXX>, type<4> 4. Then I get a third DLR that says the message was delivered to the phone. I get the same warning message. 2008-10-30 07:36:18 [14684] [6] DEBUG: SMPP[X] handle_pdu, got DLR 2008-10-30 07:36:18 [14684] [6] DEBUG: DLR[internal]: Looking for DLR smsc=X, ts=YYYYY, dst=XXXXX, type=1 2008-10-30 07:36:18 [14684] [6] WARNING: DLR[internal]: DLR from SMSC<X> for DST<XXXXX> not found. 2008-10-30 07:36:18 [14684] [6] ERROR: SMPP[X]: got DLR but could not find message or was not interested in it id<YYYYY> dst<XXXXX>, type<1> Is this the expected behavior? If so, how can I handle the multiple DLRs? Eds. -----Original Message----- From: Eds Encarnacion [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 28, 2008 6:00 AM To: 'Alejandro Guerrieri' Cc: '[email protected]' Subject: RE: Cannot retrieve receipted_message_id in deliver_sm using meta-datapatch Importance: High Thanks for this! I'll try it out and let you know what happens. Eds. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alejandro Guerrieri Sent: Tuesday, October 28, 2008 5:07 AM To: Eds Encarnacion Cc: [email protected] Subject: Re: Cannot retrieve receipted_message_id in deliver_sm using meta-datapatch Sorry for the delay, but didn't have a chance to test this against a real link before. You're right, since Kannel captures the TLV before, it doesn't make it into the TLV handler. The receipted_message_id TLV is somewhat "special" since it's used internally by kannel as well. Please use this small patch that extends my "%w" patch and allows the parameter also on deliver_sm and data_sm PDU's. You'll then be able to access the parameter on the %w variable as well. =CUT HERE======================================================= Index: gw/smsc/smsc_smpp.c =================================================================== RCS file: /home/cvs/gateway/gw/smsc/smsc_smpp.c,v retrieving revision 1.101.2.5 diff -u -r1.101.2.5 smsc_smpp.c --- gw/smsc/smsc_smpp.c 21 Oct 2008 12:50:46 -0000 1.101.2.5 +++ gw/smsc/smsc_smpp.c 27 Oct 2008 20:47:15 -0000 @@ -463,6 +464,9 @@ msg->sms.binfo = pdu->u.deliver_sm.service_type; pdu->u.deliver_sm.service_type = NULL; + msg->sms.smsc_msg_id = pdu->u.deliver_sm.receipted_message_id; + pdu->u.deliver_sm.receipted_message_id = NULL; + if (pdu->u.deliver_sm.esm_class & ESM_CLASS_SUBMIT_RPI) msg->sms.rpi = 1; @@ -627,6 +631,9 @@ msg->sms.binfo = pdu->u.data_sm.service_type; pdu->u.data_sm.service_type = NULL; + msg->sms.smsc_msg_id = pdu->u.data_sm.receipted_message_id; + pdu->u.data_sm.receipted_message_id = NULL; + if (pdu->u.data_sm.esm_class & ESM_CLASS_SUBMIT_RPI) msg->sms.rpi = 1; =CUT HERE======================================================= I'll rewrite my "%w" patch and submit it later, so there's no need to apply two patches to get it working. Hope it helps, Alejandro Guerrieri On Tue, Oct 21, 2008 at 1:19 PM, Eds Encarnacion <[EMAIL PROTECTED]> wrote: I copied and pasted a segment of code from the dlr handling part of smsc_smpp.c into the pdu_to_msg function and it seems to work. I used a version with Alejandro's %w patch, so the smsc_msg_id variable was already available from his patch. The receipted_message_id can be retrieved using %w, just like in submit_sm_response. I'm still not sure why I can't seem to get the receipted_message_id tag using the meta-data patch. I'll still try to find out, though. Eds. Octstr *tmp; /* check if msg_id is C string, decimal or hex for this SMSC */ if (smpp->smpp_msg_id_type == -1) { /* the default, C string */ tmp = octstr_duplicate(pdu->u.deliver_sm.receipted_message_id); } else { if ((smpp->smpp_msg_id_type & 0x01) || (!octstr_check_range(pdu->u.deliver_sm.receipted_message_id, 0, octstr_len(pdu->u.deliver_sm.receipted_message_id), gw_isdigit))) { tmp = octstr_format("%lu", strtoll( /* hex */ octstr_get_cstr(pdu->u.deliver_sm.receipted_message_id), NULL, 16)); } else { tmp = octstr_format("%lu", strtoll( /* decimal */ octstr_get_cstr(pdu->u.deliver_sm.receipted_message_id), NULL, 10)); } } msg->sms.smsc_msg_id = octstr_duplicate( tmp ); octstr_destroy(tmp); -----Original Message----- From: Eds Encarnacion [mailto:[EMAIL PROTECTED] Sent: Thursday, October 16, 2008 3:31 PM To: [email protected] Subject: Cannot retrieve receipted_message_id in deliver_sm using meta-datapatch Hello, I'm quite new to using Kannel to connect via SMPP. I've recently implemented the meta-data patch (from Alex) and the %w patch (from Alejandro). Everything works well except that I can't seem to get the receipted_message_id from the deliver_sm PDU using the %D meta-data option. The only thing that is returned by %D is ?smpp?. I'm no C/C++ expert, but I'm trying to figure out how to fix it. I'm not sure if I'll be successful, though. I'll paste some parts of the kannel.conf and some of the output that I have below. If anyone has time, please do let me know if I'm doing anything wrong. Thanks! Eds. ***** kannel.conf ***** # Additional TLV Definitions group = smpp-tlv name = XXBillingType tag = 0x1400 type = octetstring length = 3 group = smpp-tlv name = XXMessageID tag = 0x001E type = nulterminated (also tried octetstring, but same result) length = 65 # SMPP Configuration group = smsc smsc = smpp host = xx.xx.xx.xx port = xxxxx smsc-id = XXXXXX smsc-username = xxxxxxxx smsc-password = xxxxxxxx system-type = transceiver-mode = true # SEND-SMS USERS group = sendsms-user username=xxxxx password=xxxxx dlr-url = http://localhost/dump.php?p=%p <http://localhost/dump.php?p=%25p&P=%25P&i=%25i&I=%25I&o=%25o&B=%25B&u=%25u& D=%25D&w=%25w> &P=%P&i=%i&I=%I&o=%o&B=%B&u=%u&D=%D&w=%w" # SERVICES group = sms-service keyword = default max-messages = 0 get-url = "http://localhost/dump.php?p=%p <http://localhost/dump.php?p=%25p&P=%25P&i=%25i&I=%25I&o=%25o&B=%25B&u=%25u& a=%25a&w=%25w&D=%25D> &P=%P&i=%i&I=%I&o=%o&B=%B&u=%u&a=%a&w=%w&D=%D" ***** dump from kannel.log ***** 2008-10-15 07:43:58 [19509] [6] DEBUG: Optional parameter tag (0x001e) 2008-10-15 07:43:58 [19509] [6] DEBUG: Optional parameter length read as 19 2008-10-15 07:43:58 [19509] [6] DEBUG: SMPP[SMPP:xx.xx.xx.xx:xxxxx/xxxxx:xxxxx:]: Got PDU: 2008-10-15 07:43:58 [19509] [6] DEBUG: SMPP PDU 0x92e0b38 dump: 2008-10-15 07:43:58 [19509] [6] DEBUG: type_name: deliver_sm 2008-10-15 07:43:58 [19509] [6] DEBUG: command_id: 5 = 0x00000005 2008-10-15 07:43:58 [19509] [6] DEBUG: command_status: 0 = 0x00000000 2008-10-15 07:43:58 [19509] [6] DEBUG: sequence_number: 6613 = 0x000019d5 2008-10-15 07:43:58 [19509] [6] DEBUG: service_type: "Roger" 2008-10-15 07:43:58 [19509] [6] DEBUG: source_addr_ton: 0 = 0x00000000 2008-10-15 07:43:58 [19509] [6] DEBUG: source_addr_npi: 0 = 0x00000000 2008-10-15 07:43:58 [19509] [6] DEBUG: source_addr: "xxxxxxxxxx" 2008-10-15 07:43:58 [19509] [6] DEBUG: dest_addr_ton: 0 = 0x00000000 2008-10-15 07:43:58 [19509] [6] DEBUG: dest_addr_npi: 0 = 0x00000000 2008-10-15 07:43:58 [19509] [6] DEBUG: destination_addr: "xxxxx" 2008-10-15 07:43:58 [19509] [6] DEBUG: esm_class: 0 = 0x00000000 2008-10-15 07:43:58 [19509] [6] DEBUG: protocol_id: 0 = 0x00000000 2008-10-15 07:43:58 [19509] [6] DEBUG: priority_flag: 0 = 0x00000000 2008-10-15 07:43:58 [19509] [6] DEBUG: schedule_delivery_time: NULL 2008-10-15 07:43:58 [19509] [6] DEBUG: validity_period: NULL 2008-10-15 07:43:58 [19509] [6] DEBUG: registered_delivery: 0 = 0x00000000 2008-10-15 07:43:58 [19509] [6] DEBUG: replace_if_present_flag: 0 = 0x00000000 2008-10-15 07:43:58 [19509] [6] DEBUG: data_coding: 0 = 0x00000000 2008-10-15 07:43:58 [19509] [6] DEBUG: sm_default_msg_id: 0 = 0x00000000 2008-10-15 07:43:58 [19509] [6] DEBUG: sm_length: 10 = 0x0000000a 2008-10-15 07:43:58 [19509] [6] DEBUG: short_message: "Test MO #3" 2008-10-15 07:43:58 [19509] [6] DEBUG: receipted_message_id: "MO-001224001905452" 2008-10-15 07:43:58 [19509] [6] DEBUG: SMPP PDU dump ends. 2008-10-15 07:43:58 [19509] [6] DEBUG: SMPP[SMPP:xx.xx.xx.xx:xxxxx/xxxxx:xxxxx:]:: Sending PDU: 2008-10-15 07:43:58 [19509] [6] DEBUG: SMPP PDU 0x92e0c40 dump: 2008-10-15 07:43:58 [19509] [6] DEBUG: type_name: deliver_sm_resp 2008-10-15 07:43:58 [19509] [6] DEBUG: command_id: 2147483653 = 0x80000005 2008-10-15 07:43:58 [19509] [9] DEBUG: send_msg: sending msg to box: <127.0.0.1> 2008-10-15 07:43:58 [19509] [6] DEBUG: command_status: 0 = 0x00000000 2008-10-15 07:43:58 [19509] [6] DEBUG: sequence_number: 6613 = 0x000019d5 2008-10-15 07:43:58 [19509] [6] DEBUG: message_id: NULL 2008-10-15 07:43:58 [19509] [6] DEBUG: SMPP PDU dump ends.
