Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforcing DLR is not working #1110

Open
WEBudoGT opened this issue Apr 19, 2023 · 2 comments · Fixed by #1159
Open

Enforcing DLR is not working #1110

WEBudoGT opened this issue Apr 19, 2023 · 2 comments · Fixed by #1159

Comments

@WEBudoGT
Copy link

I configured interception as per docs: https://docs.jasminsms.com/en/latest/interception/index.html
Added the script for the mtinterceptor as per instructions, and it seems it's using it correctly because on interceptor.log shows:

`2023-04-19 16:08:22 INFO 254017 Running with a CommandId.submit_sm (from:XXXXXX, to:b'YYYYYYYY').
2023-04-19 16:08:22 DEBUG 254017 Running [from smpp.pdu.pdu_types import RegisteredDeliveryReceipt, RegisteredDelivery

routable.pdu.params['registered_delivery'] = RegisteredDelivery(
RegisteredDeliveryReceipt.SMSC_DELIVERY_RECEIPT_REQUESTED)
]
2023-04-19 16:08:22 DEBUG 254017 ... having routable with pdu: PDU [command: CommandId.submit_sm, sequence_number: None, command_status: CommandStatus.ESME_ROK
service_type: None
source_addr_ton: <AddrTon.NATIONAL: 3>
source_addr_npi: <AddrNpi.ISDN: 2>
source_addr: 'XXXXXXXX'
dest_addr_ton: <AddrTon.INTERNATIONAL: 2>
dest_addr_npi: <AddrNpi.ISDN: 2>
destination_addr: b'YYYYYYYY'
esm_class: EsmClass[mode: EsmClassMode.STORE_AND_FORWARD, type: EsmClassType.DEFAULT, gsmFeatures: set()]
protocol_id: None
priority_flag: <PriorityFlag.LEVEL_0: 1>
schedule_delivery_time: None
validity_period: None
registered_delivery: RegisteredDelivery[receipt: RegisteredDeliveryReceipt.NO_SMSC_DELIVERY_RECEIPT_REQUESTED, smeOriginatedAcks: set(), intermediateNotification: False]
replace_if_present_flag: <ReplaceIfPresentFlag.DO_NOT_REPLACE: 1>
data_coding: 0
sm_default_msg_id: 0
short_message: b'Prueba2'
]
2023-04-19 16:08:22 DEBUG 254017 ... took 0 seconds.`

Since I don't know how to interpret the rest of the log, only the part that shows that the enforcing-dlr script is running when sending the message, I don't know if the script is doing or not what's supposed to.

Thanks in advance

@Kisuke-CZE
Copy link
Contributor

Kisuke-CZE commented Nov 1, 2023

Hi,

not sure if your problem is actual so far. Based of information from @farirat at in #1122, I believe correct way to enforce DLR using interceptor should be:

"This script will enforce sending message while asking for DLR"

from smpp.pdu.pdu_types import RegisteredDeliveryReceipt, RegisteredDelivery

pdu = routable.pdu
pdu.params['registered_delivery'] = RegisteredDelivery(RegisteredDeliveryReceipt.SMSC_DELIVERY_RECEIPT_REQUESTED)
while hasattr(pdu, 'nextPdu'):
  pdu = pdu.nextPdu
  pdu.params['registered_delivery'] = RegisteredDelivery(RegisteredDeliveryReceipt.SMSC_DELIVERY_RECEIPT_REQUESTED)

OR

"This script will enforce sending message while asking for DLR - on last PDU only"

from smpp.pdu.pdu_types import RegisteredDeliveryReceipt, RegisteredDelivery

pdu = routable.pdu
while hasattr(pdu, 'nextPdu'):
  pdu = pdu.nextPdu

pdu.params['registered_delivery'] = RegisteredDelivery(RegisteredDeliveryReceipt.SMSC_DELIVERY_RECEIPT_REQUESTED)

The way it is mentioned in documentation will only work for messages which are not "multipart" (shorter than ~150 characters, without non-ASCII characters).
BUT be avare that unpatched version of jasmin is logging DLR information (in messages.log) in a bad way. See #1136

Anyway if you managed to solve it somehow, please close the issue.

@Kisuke-CZE
Copy link
Contributor

Kisuke-CZE commented Nov 21, 2023

Just tested it in real world, and it really does not work.
When I update registered_delivery using interceptor script, it is not passed into real PDUs for some reason. Not sure why this happens. Maybe @farirat can have some explanation?

EDIT: Oh, this seems to be the problem. Jasmin is setting DLR based on http request dlr param.

I believe intercept section should be moved AFTER jasmind decides about those params. But I am not sure exactly how to do that safely now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants