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 RCML download failure, CDR is not updated and stays to RINGING state #1848

Open gvagenas opened 7 years ago

maria-farooq commented 7 years ago

Hi @anhntnguyen ,

Thanks a lot for your previous contribution. You did a great job there. Would you be interesting in contributing to this task.

Best Regards Maria

anhntnguyen commented 7 years ago

Hi @maria-farooq

I'm really sorry for late response. Thank you for all your words. Currently, my current company's project is in deliverable state, and I'm quite busy with that activities. All issue is interesting from my site. I will try my best to spend time on this, but I'm not much quite sure. RCML download failure: Could you give me more detail on this, how to reproduce the issue ? I can find: http://documentation.telestax.com/connect/rcml/index.html but dont know what is download failure mean.

Best Regards Anh Nguyen

anhntnguyen commented 7 years ago

Hi @maria-farooq ,

Now I know how to use RCML in Restcomm, but I cannot find "On RCML download failure" meaning. Could you give me some hint here.

Best regards Anh Nguyen

maria-farooq commented 7 years ago

Hi @anhntnguyen

Thanks a lot for your interest. RCML (Restcomm Markup Language) is downloaded by Restcomm actors to execute the application logic. In this particular case we are talking about Voice Call Application. Voice Application RCML is downloaded and executed by VoiceInterpreter.java. I would suggest following here:

Please feel free to ask for help Regards Maria

anhntnguyen commented 7 years ago

Hi @maria-farooq

Thank you so much for your suggestion. It's helping me a lot. Currently After reading VoiceInterpreter::onReceive() function, I understand about the state machine of making a call to RVD app.

I have tried to modify the path file which is pointing to RCML file in Restcomm-connect::Number to wrong path which does not exist. This thing, I was trying to make the download RCML failure, But what I see is the call will be marked as failed status and not ringing. I can understand this.

Do we have another download RCML failure ? and How can I do it ?

Best Regards Anh Nguyen

maria-farooq commented 7 years ago

Thanks a lot @anhntnguyen that was a smart hack to reproduce the issue. From your test it seems issue is not happening for inbound calls, @gvagenas is on vacation so would you like to test if we can reproduce the issue with outbound call. Thanks Maria

anhntnguyen commented 7 years ago

Hi @maria-farooq

I see that when I make a call to my simple app, the direction status in restcomm-connect showing a arrow pointing to inside of square --> I think this is the meaning of inbound call ?

I also make an app that after receiving a call from out side, it will call to another app's number and this app is using wrong path of RCML file. what I see now is: 1/ The direction status is showing a arrow pointing to outside of square --> is this outbound call? 2/ The status is still FAILED.

If you have any idea, please tell me. Or maybe we can wait until @gvagenas come back from vacation to help me on the way to reproduce the issue.

gvagenas commented 7 years ago

Hi @anhntnguyen , thanks for contributing for this issue. I believe you should try to reproduce the issue with the testsuite.

You can provide a test case in the org.restcomm.connect.testsuite.telephony.CallLifecycleTest, maybe extend the org.restcomm.connect.testsuite.telephony.CallLifecycleTest#testDialClientAlice

At the testDialClientAlice test case, Wiremock (http://wiremock.org) mocks the RVD and serves the RCML application to Restcomm. For your test case, wiremock should return 500 Internal Server error or even timeout, in order to simulate the RCML Download failure.

Next, the test case should expect bob to get disconnect from Restcomm instead of 200 OK etc.

Last, you should check the CDR record status. You can see how we check the CDR for test case testDialClientAlice here https://github.com/RestComm/Restcomm-Connect/blob/711eeea802cf4d2143cf8677fb2dc699e2f5a00e/restcomm/restcomm.testsuite/src/test/java/org/restcomm/connect/testsuite/telephony/CallLifecycleTest.java#L406-L406

After you prepare the proper test case to reproduce the issue, it will be very easy to prepare a patch having the test case. Using the test case, you can place breakpoints in the code and then run the test case in debug mode.

Let me know if you need more help on that.

gvagenas commented 7 years ago

Also @anhntnguyen , keep in mind that every PR should contain the patch for the issue, one or more non-regression test case (that before the patch is failing and applying the patch is passing) and if the patch is for a new feature, PR should include documentation.

Thanks George

anhntnguyen commented 7 years ago

Thank you so much on giving a hint @gvagenas and @maria-farooq I have created a new PR for #1848 and #2013: Here is the link: https://github.com/RestComm/Restcomm-Connect/pull/2097 Please help me to review and give me comments.