Fix issue of multiple registration of the same DID #2265
Changes are done for multiple registration issue for incoming numbers. I tried my best to test all possible cases which are know to me. Please have look and let me know if i missed some case.
Thanks @muhammadbilal19. @maria-farooq can you please review this PR ?
Hi @muhammadbilal19 Thanks a lot for your PR
Sorry about the delay, we have been under some fires lately.
Here are a couple of comments that i have after a quick look:
- query change in mysql/mariadb-sql xml file does not seems to match with hsql.
- I see you provided test which are using HSQL (good work) were you able to test mysql query change locally with mysql to verify syntax?
- Did you check, where else in code this query is being used and possible impact or changes required.
Thanks Maria
Thanks @maria-farooq for your feedback.
- I tested both the queries locally and was working fine for me. Query is change due to syntax and way of working of these two DB's.
- Yes i tested mysql query locally.
- Yes i guess according to my knowledge of the system i checked all the place where this query is used.
Let me know if you have some specific test case in your mind which i need test.
Thanks @muhammadbilal19
Please check, your queries for mysql and hsql are logically different.
here is your mysql query
SELECT * FROM restcomm_incoming_phone_numbers WHERE phone_number=#{phone_number}
or phone_number = "+" + #{phone_number};
here is your hsql query
SELECT * FROM "restcomm_incoming_phone_numbers" WHERE "phone_number"=#{phone_number}
or "phone_number" = '+'||#{phone_number}
or "phone_number" = '00'||#{phone_number}
or "phone_number" = '+'||'00'+#{phone_number};
please review again.
Thanks Maria
Sorry @maria-farooq for late reply i was bit busy. Yes both queries are different but both works correctly and same. I can understand that you are referring about less WHERE conditions in mysql query but it will return the exact result which we want from that query.
Say for example i added a number in mysql 006421969195 now if any user want to add this number or any combination of number like +006421969195 , 6421969195 and +6421969195 system will not allowed. see below results from mysql query
This same query was not working for hsql so i need to change it accordingly. So in terms of functionality both are working same and as per my testing according to the functionality which we want to achieve.Hopefully i understand your concern correctly?
@muhammadbilal19 the queries you changed are corresponding to method MybatisIncomingPhoneNumbersDao .getIncomingPhoneNumber. Did you check the references of this method in project to see where-ever it is used, does that part of code need any changes.. for instance CallManager.java
Hi @muhammadbilal19
do we have an update here
Regards Maria
running ci tests on this branch here
@muhammadbilal19 following tests are failing on ci for this branch.
org.restcomm.connect.testsuite.http.LiveCallModificationAnswerDelayTest.holdCall
org.restcomm.connect.testsuite.http.LiveCallModificationTest.holdCall
org.restcomm.connect.testsuite.http.LiveCallModificationTest.testTerminateDialForkCallWhileRinging_LCM_to_dial_branches
org.restcomm.connect.testsuite.http.LiveCallModificationTest.testTerminateDialForkCallWhileRinging_LCM_to_initial_call
org.restcomm.connect.testsuite.http.LiveCallModificationTest.testTerminateDialForkCallWhileRinging_LCM_to_move_initial_call_to_hangup_rcml
org.restcomm.connect.testsuite.telephony.CallLifecycleTest.testDialClientAlice_InvalidRCML
org.restcomm.connect.testsuite.telephony.CallLifecycleTest.testDialNumberPstn_404NotHere
org.restcomm.connect.testsuite.telephony.CallLifecycleTest.testDialNumberPstn_500ServerInternalError
org.restcomm.connect.testsuite.telephony.CallLifecycleTest.testDialNumberPstn_BusyHere
org.restcomm.connect.testsuite.telephony.CallLifecycleTest.testDialNumberPstnBobDisconnects
org.restcomm.connect.testsuite.telephony.CallLifecycleTest.testDialNumberPstnForbidden
org.restcomm.connect.testsuite.telephony.CallLifecycleTest.testDialNumberPstnNoAnswer
org.restcomm.connect.testsuite.telephony.CallLifecycleTest.testSubAccountClientDialsParentAccountNumber
org.restcomm.connect.testsuite.telephony.ClientsDialAnswerDelayTest.testClientDialOutPstnSimulateWebRTCClientNoAnswer
org.restcomm.connect.testsuite.telephony.DialActionTest.testDialActionInvalidCall
org.restcomm.connect.testsuite.telephony.DialStatusCallbackTest.testDialForkNoAnswerButHenriqueStatusCallbackOnAllPostWithTimeout
org.restcomm.connect.testsuite.telephony.DialStatusCallbackTest.testDialForkNoAnswerExecuteRCML_ReturnedFromActionURLWithStatusCallbacks_BobDisconnects
org.restcomm.connect.testsuite.telephony.TestDialVerbPartOne.testDialUriAliceHangup
Sometimes test fail due to ci env. can you please recheck them on local machine and confirm if they are passing or otherwise..
regards Maria
Hi @muhammadbilal19
I Hope everything is fine. Do we have any update here
Maria