kneodev / ksmppd

Kurt's SMPP Daemon (SMPP Server for Kannel)
Other
56 stars 38 forks source link

dlr-url doesn't work? #119

Closed Enzo-life closed 4 years ago

Enzo-life commented 5 years ago

Good day.

I try to set a dlr-url parameter for routing, but in dlr-storage table is stored default value like 'smppusera%7C1468405837%7C7a9a1271-7ed4-4c6f-af6f-8652252010ab'.

In logs i can see that it tries to set msg->sms.dlr_url, but somehow it remains the default value.

2019-06-18 15:49:56 [21405] [22] DEBUG: HTTP: Status line: <HTTP/1.1 200 OK> 2019-06-18 15:49:56 [21405] [22] DEBUG: HTTP: Received response: 2019-06-18 15:49:56 [21405] [22] DEBUG: Octet string at 0x7fa558001480: 2019-06-18 15:49:56 [21405] [22] DEBUG: len: 298 2019-06-18 15:49:56 [21405] [22] DEBUG: size: 1024 2019-06-18 15:49:56 [21405] [22] DEBUG: immutable: 0 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 53 65 72 76 65 72 3a 20 6e 67 69 6e 78 2f 31 2e Server: nginx/1. 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 34 2e 31 0d 0a 44 61 74 65 3a 20 54 75 65 2c 20 4.1..Date: Tue, 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 31 38 20 4a 75 6e 20 32 30 31 39 20 31 32 3a 34 18 Jun 2019 12:4 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 39 3a 35 36 20 47 4d 54 0d 0a 43 6f 6e 74 65 6e 9:56 GMT..Conten 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 74 2d 54 79 70 65 3a 20 74 65 78 74 2f 68 74 6d t-Type: text/htm 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 6c 3b 20 63 68 61 72 73 65 74 3d 55 54 46 2d 38 l; charset=UTF-8 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 0d 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74 68 ..Content-Length 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 3a 20 30 0d 0a 43 6f 6e 6e 65 63 74 69 6f 6e 3a : 0..Connection: 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 20 6b 65 65 70 2d 61 6c 69 76 65 0d 0a 58 2d 50 keep-alive..X-P 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 6f 77 65 72 65 64 2d 42 79 3a 20 50 48 50 2f 35 owered-By: PHP/5 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 2e 36 2e 33 30 0d 0a 58 2d 4b 53 4d 50 50 44 2d .6.30..X-KSMPPD- 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 52 6f 75 74 65 2d 53 74 61 74 75 73 3a 20 31 0d Route-Status: 1. 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 0a 58 2d 4b 53 4d 50 50 44 2d 52 6f 75 74 65 2d .X-KSMPPD-Route- 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 43 6f 73 74 3a 20 31 2e 30 0d 0a 58 2d 4b 53 4d Cost: 1.0..X-KSM 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 50 50 44 2d 53 4d 53 43 2d 49 44 3a 20 36 0d 0a PPD-SMSC-ID: 6.. 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 58 2d 4b 53 4d 50 50 44 2d 44 4c 52 2d 4d 41 53 X-KSMPPD-DLR-MAS 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 4b 3a 20 33 31 0d 0a 58 2d 4b 53 4d 50 50 44 2d K: 31..X-KSMPPD- 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 44 4c 52 2d 55 52 4c 3a 20 61 6e 79 5f 74 65 78 DLR-URL: any_tex 2019-06-18 15:49:56 [21405] [22] DEBUG: data: 74 5f 68 65 72 65 0d 0a 0d 0a t_here.... 2019-06-18 15:49:56 [21405] [22] DEBUG: Octet string dump ends. 2019-06-18 15:49:56 [21405] [6] DEBUG: Received request result 2019-06-18 15:49:56 [21405] [6] DEBUG: HTTP route result setting msg->sms.smsc_id to 6 2019-06-18 15:49:56 [21405] [6] DEBUG: HTTP route result setting msg->sms.dlr_mask to 31 2019-06-18 15:49:56 [21405] [6] DEBUG: HTTP route result setting msg->sms.dlr_url to any_text_here 2019-06-18 15:49:56 [21405] [6] INFO: SMPP[ololo] Successfully routed message for +4915750917826 to 6 for cost 1.000000 2019-06-18 15:49:56 [21405] [11] DEBUG: BB[main] Adding b521241e-fc2c-4cbd-a1e3-581bf0989cb3 to open acks 2019-06-18 15:49:56 [21405] [10] DEBUG: Got msg from bearerbox 2019-06-18 15:49:56 [21405] [10] DEBUG: BB[main] Message type ack b521241e-fc2c-4cbd-a1e3-581bf0989cb3

Am i doing something wrong?

Enzo-life commented 5 years ago

As i see in sources, ksmppd supports only one dlr-url format, but i can't get how we can monitoring sms statuses from kannel.

In dlr-url we send our callback url, such http://some.host/callback?id=123&route_id=%i&status=%d&phone=%q&sign=%Q&message=%A&message_id=%F&ts=%T&meta=%D. I can't found how we can use the same for routing by ksmppd.

Enzo-life commented 5 years ago

I've find out that for my case we can use a HTTP SMSC, whose send-url sends a message to needed SMPP SMSC with correct dlr-url. It adds one more failure point to connecting scheme, looks like a kludge, but it works.

But anyway it will be better to use a callback in dlr-url for routed message. Whom can we pay for this development? :)

donald-jackson commented 5 years ago

Where are you setting the dlr-url you require?

Consider using https://github.com/donald-jackson/kannel-pluginbox

It allows you to intercept and process all messages in and out

Enzo-life commented 5 years ago

We are an sms provider.

When we need to send sms, we store it first in database and then add its id to dlr-url. So, we send to kannel such dlr-url: http://some.host/dlr.acceptor?id=12345&route_id=%i&status=%d&phone=%q&sender=%Q&message=%A&message_id=%F&ts=%T&meta=%D

In this way our dlr acceptor will receive all dlrs from kannel and will update sms status with that id.

When we use ksmppd, our HTTP ROUTE URL make all validations and stores sms in database, so we need to send to kannel correct dlr-url with our sms id. This is the problem, we can't change dlr-url from http route, although we see it logs: 2019-06-18 15:49:56 [21405] [6] DEBUG: HTTP route result setting msg->sms.dlr_url to any_text_here Here "any_text_here" was set up by header X-KSMPPD-DLR-URL.

donald-jackson commented 4 years ago

ok I undertand, ksmppd uses dlr-url internally for DLR tracking to the correct ESME. I suggest using pluginbox for your needs.

india-india commented 3 years ago

hello sir iam using ksmppd , and iam doing authentication + routing via database , every this is working but iam unable to set the dlr_url param and dlr-mask , kindly please tell me how i can do this things.

thanks in Advance sir .