Restcomm-Connect icon indicating copy to clipboard operation
Restcomm-Connect copied to clipboard

Fix issue of multiple registration of the same DID #2265

Open muhammadbilal19 opened this issue 8 years ago • 10 comments

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.

muhammadbilal19 avatar Jun 26 '17 09:06 muhammadbilal19

Thanks @muhammadbilal19. @maria-farooq can you please review this PR ?

deruelle avatar Jun 28 '17 08:06 deruelle

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

maria-farooq avatar Jul 03 '17 18:07 maria-farooq

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.

muhammadbilal19 avatar Jul 03 '17 21:07 muhammadbilal19

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

maria-farooq avatar Jul 04 '17 06:07 maria-farooq

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

screen shot 2017-07-14 at 10 53 21 pm screen shot 2017-07-14 at 10 55 43 pm screen shot 2017-07-14 at 10 57 10 pm screen shot 2017-07-14 at 10 58 55 pm

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 avatar Jul 14 '17 11:07 muhammadbilal19

@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

maria-farooq avatar Jul 20 '17 14:07 maria-farooq

Hi @muhammadbilal19

do we have an update here

Regards Maria

maria-farooq avatar Jul 25 '17 10:07 maria-farooq

running ci tests on this branch here

maria-farooq avatar Jul 25 '17 13:07 maria-farooq

@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

maria-farooq avatar Jul 26 '17 11:07 maria-farooq

Hi @muhammadbilal19

I Hope everything is fine. Do we have any update here

Maria

maria-farooq avatar Aug 18 '17 15:08 maria-farooq