kneodev / ksmppd

Kurt's SMPP Daemon (SMPP Server for Kannel)
Other
57 stars 39 forks source link

Payload Parameter Issue #131

Closed harshpareek closed 4 years ago

harshpareek commented 4 years ago

If someone send double sms(more then 160 character) using payload parameter then ksmmpd deduct only 1 credit, but its should deduct as per sms size, but in this case sms size not working.

donald-jackson commented 4 years ago

This is incorrect. You'll see on line 250 and 252 of smpp_queues.c that this is deducted correctly.

If you're using an http router that isn't calculating the credits correctly thats an external issue

harshpareek commented 4 years ago

But in my case client send more then 304 character sms and it deduct only single sms and no udh data found on database.

harshpareek commented 4 years ago

Please check the attached database extracted in excel file, it deduct only single credit for long sms.

reportnew.xlsx

donald-jackson commented 4 years ago

I'm not sure how your system is configured but I can assure you this works. How are you deducting credits? can you share your config files?

harshpareek commented 4 years ago

131 Sample configuration for ksmppd

Uses database for all functionality (authentication + routing)

#

group=ksmppd log-file=/var/log/kannel/smppd.log log-level=4 smpp-port=5050 database-type=mysql database-config=demo database-enable-queue=1 id=KANNELSMPP inbound-queue-threads=8 outbound-queue-threads=8 auth-method=1

smsbox-max-pending=100

group=mysql-connection id=demo host=localhost username=user password=pass database=kannel max-connections=50

group=bearerbox-connection id=SMPP host=localhost port=5205

group=bearerbox-connection id=SMPP host=localhost port=5205

group=http-server port=14010 password=pass

group=smpp-routing

1 = Database

routing-method=1

donald-jackson commented 4 years ago

OK, set your log-level to 0 and make sure you are running the latest version. Then send an example log from submit_sm to submit_sm_resp then we can see whats going on

harshpareek commented 4 years ago

Please find submit sm

original sms is

Hello, Thank you for placing your order with us, we at abcdkart believe in delivering happiness. Your order number is 34277, we will notify you once it is processed. If you have anything to share or have any query, please reach out to us at order@abcdkart.com or call/WhatsApp us directly on +999999999.http://abcdkart.com/index.php?route=account/imageupload to upload your Photographs.

Submit_sm.txt

donald-jackson commented 4 years ago

This is not a complete log, it should contain phrases like 'Found outbound route ' and 'MySQL deducting credit from'

please share complete information

harshpareek commented 4 years ago

2020-07-29 16:40:50 [21392] [15] DEBUG: data: 68 6f 74 6f 67 72 61 70 68 73 2e hotographs. 2020-07-29 16:40:50 [21392] [20] DEBUG: SMPP[prootp:24386] Got outbound queued PDU (1) seq 0: 2020-07-29 16:40:50 [21392] [15] DEBUG: Octet string dump ends. 2020-07-29 16:40:50 [21392] [20] DEBUG: SMPP[prootp] Sending deliver_sm: 2020-07-29 16:40:50 [21392] [15] DEBUG: SMPP PDU dump ends. 2020-07-29 16:40:50 [21392] [13] DEBUG: Current load is ok 0.000000 2020-07-29 16:40:50 [21392] [15] DEBUG: data: 63 6b 6f 6b 61 72 74 2e 63 6f 6d 2f 69 6e 64 65 ckokart.com/inde 2020-07-29 16:40:50 [21392] [6] DEBUG: new group created smpp' 2020-07-29 16:40:50 [21392] [15] DEBUG: data: 78 2e 70 68 70 3f 72 6f 75 74 65 3d 61 63 63 6f x.php?route=acco 2020-07-29 16:40:50 [21392] [6] DEBUG: group=smpp' key=dlr_err' value=^C' 2020-07-29 16:40:50 [21392] [15] DEBUG: data: 75 6e 74 2f 69 6d 61 67 65 75 70 6c 6f 61 64 20 unt/imageupload 2020-07-29 16:40:50 [21392] [15] DEBUG: data: 74 6f 20 75 70 6c 6f 61 64 20 79 6f 75 72 20 50 to upload your P 2020-07-29 16:40:50 [21392] [6] DEBUG: Added ack callback for 105853 2020-07-29 16:40:50 [21392] [15] DEBUG: data: 68 6f 74 6f 67 72 61 70 68 73 2e hotographs. 2020-07-29 16:40:50 [21392] [20] DEBUG: SMPP[prootp:24386] Got outbound queued PDU (1) seq 0: 2020-07-29 16:40:50 [21392] [15] DEBUG: Octet string dump ends. 2020-07-29 16:40:50 [21392] [20] DEBUG: SMPP[prootp] Sending deliver_sm: 2020-07-29 16:40:50 [21392] [15] DEBUG: SMPP PDU dump ends. 2020-07-29 16:40:50 [21392] [20] DEBUG: SMPP PDU 0x7efca8645200 dump: 2020-07-29 16:40:50 [21392] [15] DEBUG: Current load is ok 1.000000 2020-07-29 16:40:50 [21392] [20] DEBUG: type_name: deliver_sm 2020-07-29 16:40:50 [21392] [20] DEBUG: command_id: 5 = 0x00000005 2020-07-29 16:40:50 [21392] [20] DEBUG: command_status: 0 = 0x00000000 2020-07-29 16:40:50 [21392] [20] DEBUG: sequence_number: 105853 = 0x00019d7d 2020-07-29 16:40:50 [21392] [20] DEBUG: service_type: NULL 2020-07-29 16:40:50 [21392] [20] DEBUG: source_addr_ton: 5 = 0x00000005 2020-07-29 16:40:50 [21392] [20] DEBUG: source_addr_npi: 0 = 0x00000000 2020-07-29 16:40:50 [21392] [20] DEBUG: source_addr: "SSTMRT" 2020-07-29 16:40:50 [21392] [13] DEBUG: MySQL deducting credit from prootp value 2.000000 2020-07-29 16:40:50 [21392] [20] DEBUG: dest_addr_ton: 2 = 0x00000002 2020-07-29 16:40:50 [21392] [20] DEBUG: dest_addr_npi: 1 = 0x00000001 2020-07-29 16:40:50 [21392] [20] DEBUG: destination_addr: "917799778806" 2020-07-29 16:40:50 [21392] [20] DEBUG: esm_class: 4 = 0x00000004 2020-07-29 16:40:50 [21392] [20] DEBUG: protocol_id: 0 = 0x00000000 2020-07-29 16:40:50 [21392] [20] DEBUG: priority_flag: 0 = 0x00000000 2020-07-29 16:40:50 [21392] [20] DEBUG: schedule_delivery_time: NULL 2020-07-29 16:40:50 [21392] [20] DEBUG: validity_period: NULL 2020-07-29 16:40:50 [21392] [20] DEBUG: registered_delivery: 0 = 0x00000000 2020-07-29 16:40:50 [21392] [20] DEBUG: replace_if_present_flag: 0 = 0x00000000 2020-07-29 16:40:50 [21392] [20] DEBUG: data_coding: 0 = 0x00000000 2020-07-29 16:40:50 [21392] [20] DEBUG: sm_default_msg_id: 0 = 0x00000000 2020-07-29 16:40:50 [21392] [20] DEBUG: sm_length: 144 = 0x00000090 2020-07-29 16:40:50 [21392] [20] DEBUG: short_message: 2020-07-29 16:40:50 [21392] [20] DEBUG: Octet string at 0x7efca8080a30: 2020-07-29 16:40:50 [21392] [15] DEBUG: MySQL deducting credit from prootp value 3.000000

harshpareek commented 4 years ago

I found one row which says Mysql deduct 3 credit, but in kannel database MT record shows only 1 row, so it is impossible to count total delivered sms or total failure, because in current scenario we calculate total by number from udh data. but in this case no udh data found on database.

donald-jackson commented 4 years ago

OK so as I said this isn't an issue with ksmppd, this is an issue with the way you are counting the messages. Using udhdata isn't reliable as it isn't the only way multipart messages can be sent. You will need to fix your code to calculate correctly.