RestComm / Restcomm-Connect

The Open Source Cloud Communications Platform
http://www.restcomm.com/
GNU Affero General Public License v3.0
244 stars 215 forks source link

on restcomm start - update inProgress Call CDRs to completed status. #1675

Closed maria-farooq closed 7 years ago

maria-farooq commented 7 years ago

on start of an instance : restcomm removes all registrations in db belonging to that instance. which is correct bcz restcomm just started and there should be no already existed registration in db.

we can do the same for calls on start of restcomm (not to delete them but update the status of calls of that instance, from in-progress to completed) this needs to be implmenet at CallManager

anhntnguyen commented 7 years ago

Hi @maria-farooq Could I contribute on this issue: Please confirm my idea here:

Pseudo code: in CallManager.java, I need to create a function and call this function in contructor of CallManager class:

firstTimeCleanup(){ CallDetailRecordsDao callDetailRecordsDao = storage.getCallDetailRecordsDao(); List results = callDetailRecordsDao.getCallDetailRecordsByStatus("in-progress"); for (CallDetailRecord result : results) { result.setStatus(completed); callDetailRecordsDao.updateCallDetailRecord(result); } }

maria-farooq commented 7 years ago

Hi @anhntnguyen , Thanks for your interest.

Feedback on Pseudo code:

It is cool that in provided pseudo code you have covered pretty much main idea of this task. There are few things we also need to take care of:

How to proceed:

Thanks again for your interest. Maria

anhntnguyen commented 7 years ago

Hi @maria-farooq I have signed to contributor agreement,Could you assign this ticket to me.

maria-farooq commented 7 years ago

Hi @anhntnguyen ,

It looks like due to some new github rules i am unable to assign you the issue We will have to add you in some contributor group and then it will be possible But no worried we will take care of it with help of administrators.

Meanwhile feel free to check out restcomm repository and play around with it, build locally etc.. We will assign you the issue soon.

Thanks for your cooperation Maria

maria-farooq commented 7 years ago

@deruelle can you help assign this issue to @anhntnguyen Thanks Maria

deruelle commented 7 years ago

@anhntnguyen can you accept the invite at https://github.com/RestComm/Restcomm-Connect/invitations so we can assign the issue to you ?

anhntnguyen commented 7 years ago

Hello @deruelle

I have accepted your invitation.

maria-farooq commented 7 years ago

thanks @anhntnguyen i have assigned you the issue.

anhntnguyen commented 7 years ago

Hi @maria-farooq I have found 3 issues when I test for my code that I need you to confirm: 1/ When Restcomm-connect receives a call, the "status" in db will be saved in upper case String (IN_PROGRESS), I think that they want to do it for convenience when showing the logs-call. It's cause problems in existing API getTotalRunningCallDetailRecordsByConferenceSid ("status" ='in-progress';) is getting a list with size equal to 0. 2/ If the call is in another status like RINGING etc.., do we need to update it to COMPLETED also? 3/ When using Restcomm dashboard to query current call logs info, It just show up the call logs in the past, and does not update to show the current new call is ongoing even I click a lot of times to log call but it does not refresh to get the new one. The log will be updated if I reload the page again. 4/ I see that we are using the restcomm.script to create dummy data for call detail record, but it seems the script is run after the restcomm finished start. So that I cannot create a dummy data before the restcomm start to test my code. Do you have any idea on this?

Best Regards Anh Nguyen

maria-farooq commented 7 years ago

Hi @anhntnguyen , Thanks a lot for updating us with your progress and findings, its highly appreciated.

1.

Yes currently we have status inconsistency between inbound and outbound calls and we have an open issue for that https://github.com/RestComm/Restcomm-Connect/issues/1522 the reason its not impacting conference because conference is joined by an inbound call and for all inbound calls status is in-progress. For your issue: you can use an OR condition to handle both.

2.

Good Question! I would suggest to move all call in (In_progress, ringing and Queued status) to (Completed) @gvagenas would you agree?

3.

@anhntnguyen can you please open an issue with your findings here

4.

First of all add unit test and test your code with that Later for manual testing instead of HSQL, you can install MySql and integrate Restcomm with it. please see this guide

Please feel free to let us know if you need any help or you feel block on any point.

Thanks Maria

maria-farooq commented 7 years ago

Hi @anhntnguyen

Thanks for creating Pull Request. Please see my Comments in https://github.com/RestComm/Restcomm-Connect/pull/1687

Regards Maria

maria-farooq commented 7 years ago

Hello @anhntnguyen ,

For testing mariadb sql (xml mapping) files, we can setup MySql and integrate it with Restcomm. Please see the documentation here. Please feel free to ask if any questions

Thanks Maria

maria-farooq commented 7 years ago

thanks a lot @anhntnguyen for your contribution. this PR is now merged.