-
Notifications
You must be signed in to change notification settings - Fork 214
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
Cleanup SMPP Message ID correlation for messages waiting for DLR #2965
Changes from 14 commits
c25c884
ade56c2
972c96c
79a2dd3
bcca9c4
571724f
ae54ac0
c28dc32
63552c0
b1bf904
7394f86
a94bed4
8bed8ee
f84d178
d9db91b
1e35cdc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,8 @@ | |
<mapper namespace="org.mobicents.servlet.sip.restcomm.dao.SmsMessagesDao"> | ||
<insert id="addSmsMessage" parameterType="map"> | ||
INSERT INTO "restcomm_sms_messages" ("sid", "date_created", "date_updated", "date_sent", "account_sid", "sender", "recipient", "body", "status", "direction", "price", | ||
"api_version", "uri") VALUES (#{sid}, #{date_created}, #{date_updated}, #{date_sent}, #{account_sid}, #{sender}, #{recipient}, #{body}, | ||
#{status}, #{direction}, #{price}, #{api_version}, #{uri}); | ||
"api_version", "uri", "smpp_message_id") VALUES (#{sid}, #{date_created}, #{date_updated}, #{date_sent}, #{account_sid}, #{sender}, #{recipient}, #{body}, | ||
#{status}, #{direction}, #{price}, #{api_version}, #{uri}, #{smpp_message_id}); | ||
</insert> | ||
|
||
<select id="getSmsMessage" parameterType="string" resultType="hashmap"> | ||
|
@@ -117,10 +117,21 @@ | |
AND "date_created" >= #{startTime} | ||
</if> | ||
<if test="endTime != null"> | ||
AND "date_created" <= DATE_ADD(#{endTime},INTERVAL 1 DAY) | ||
AND "date_created" <= DATE_ADD(#{endTime},INTERVAL 1 DAY) | ||
</if> | ||
<if test="smppMessageId != null"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need to make this change for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good point, agree |
||
AND "smpp_message_id"=#{smppMessageId} | ||
</if> | ||
|
||
order by "date_created" | ||
LIMIT #{limit} OFFSET #{offset} | ||
</select> | ||
|
||
<select id="findBySmppMessageIdAndDateCreatedGreaterOrEqualThanOrderedByDateCreatedDesc" parameterType="map" resultType="hashmap"> | ||
SELECT * FROM "restcomm_sms_messages" AS "restcomm_sms_messages" | ||
WHERE "smpp_message_id" = #{smppMessageId} | ||
AND "date_created" >= #{startDate} | ||
ORDER BY "date_created" DESC | ||
</select> | ||
|
||
</mapper> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would prefer a Filter based API approach as in https://github.com/RestComm/Restcomm-Connect/blob/master/restcomm/restcomm.dao/src/main/java/org/restcomm/connect/dao/IncomingPhoneNumbersDao.java#L48
youll see it supports sorting as well https://github.com/RestComm/Restcomm-Connect/blob/master/restcomm/restcomm.dao/src/main/java/org/restcomm/connect/dao/entities/IncomingPhoneNumberFilter.java#L34
the long name of this method is already advising a Filter