10-06-2004 12:05 PM - edited 03-13-2019 10:29 PM
Hello,
Is there a way to perform some cleanup steps prior to script termination if the call disconnects prematurely (say, the caller hangs up before going through the entire workflow)? I'm hoping to sort of 'roll back' the steps that were taken prior to the call being disconnected. Is this possible?
Your feedback will be greatly appreciated.
Thanks,
Andrew
10-06-2004 08:03 PM
Hi Andrew,
You can use the On Exception Goto step to catch the ContactInactiveException when a caller hangs up.
When the contact terminates, if a media step is executed that relies on a contact, it will trigger this exception handler. This step will catch the exception and go to the label you have specified.
I would strongly recommend that you immediately use the On Exception Clear step to "cancel" the On Exception Goto inside the destination label. This will avoid potentially looping.
Script flow:
--->Accept
--->Exception (ContactInactiveException) Goto ExceptionCatchLabel
--->Some Steps
--->Play Prompt()
--->Terminate()
--->Goto Label1
--->ExceptionCatchLabel:
--->Clear Exception(ContactInactiveException)
--->Some other Steps
--->Label1:
--->End
By "roll back" steps do you mean deleting records in enterprise DBs. If so, it can be performed. But please note that you cannot use any steps that relies on the contact after the contact becomes inactive.
Do let me know if the above meets your requirement.
Regards
Yogi
10-07-2004 06:37 AM
Thanks for the informative reply, Yogi.
What would normally happen to a script when a contact is no longer active (hangs up/disconnected)? Would the progam abort at the first exception if it's not caught or will it continue to flow down until reaching the end?
Thanks,
Andrew
10-07-2004 09:20 PM
Hi Andrew,
You need to note cretain things out here...
Assume the following piece of code...
--->Start
--->Accept
--->Exception (ContactInactiveException) Goto ExceptionCatchLabel
--->Play Prompt(A)
--->Some DB steps(B)
--->Play Prompt(C)
--->Document Steps(D)
--->Terminate(E)
--->Some DB Steps(F)
--->Goto Label1
--->ExceptionCatchLabel:
--->Clear Exception(ContactInactiveException)
--->Some Document Steps(G)
--->Label1:
--->End
In the above case I have marked various alphabets against some steps for reference.
1. Assume a caller calls and the above script starts execution.
2. If the caller hangs up anytime before A/C/E, the contact inactive exception is thrown and the script branches to "ExceptionCatchLabel:".
3. Since the document steps doesnot rely on a contact the step at "G", the same will be executed even after the contact gets disconnected. In other words, the script executes all the steps under "Clear Exception"(as stated in above example)that doesnot rely on the contact till it reaches end step.
Hope its clear now. Do let me know if you have any more queries.
Regards
Yogi
10-07-2004 09:28 PM
Hi
If the contact hangups and scripts tries to execute any media/any step which relies on contact will throw an exception, if the same is not handled the application get aborted and the system will execute the default treatment which will play the "System Problems" message or whatever has been defined as the Default script. You will see exceptions in MIVR logs. To avoid this you need to catch the ContactInactive Exception by using
On Exception Goto step and clear the same.
If you are using some steps that doesn't relies on contact, continues to execute even after
the contact hangups (eg: database steps, XML steps) till it reaches the end step.
Hope it helps.
Regards
Venkat
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide