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

Adjust logging according to last part of the message #1141

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions jasmin/managers/listeners.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,12 @@ def submit_sm_resp_event(self, r, amqpMessage):
splitMethod = 'sar'
elif UDHI_INDICATOR_SET and r.request.params['short_message'][:3] == b'\x05\x00\x03':
splitMethod = 'udh'

# create _pdu before splitting, so we can use it in both branches (logging the message according the last part of message)
_pdu = r.request

# Concatenate short_message
if splitMethod is not None:
_pdu = r.request
if splitMethod == 'sar':
short_message = _pdu.params['short_message']
else:
Expand Down Expand Up @@ -328,12 +330,12 @@ def submit_sm_resp_event(self, r, amqpMessage):
r.response.params['message_id'],
r.response.status,
amqpMessage.content.properties['priority'],
r.request.params['registered_delivery'].receipt,
_pdu.params['registered_delivery'].receipt,
'none' if ('headers' not in amqpMessage.content.properties or
'expiration' not in amqpMessage.content.properties['headers'])
else amqpMessage.content.properties['headers']['expiration'],
r.request.params['source_addr'],
r.request.params['destination_addr'],
_pdu.params['source_addr'],
_pdu.params['destination_addr'],
logged_content)
else:
# Message must be retried ?
Expand Down
Loading