Genesys CTI User Forum
Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: dw75 on May 13, 2013, 11:03:32 AM
-
I'm trying to build some SCXML treatments in OCS. I've got the gist of how they work but I'm wondering if anyone knows what "Cycle Attempt" would be in SCXML? I can't seem to find any documentation on this.
-
A little more detail Kubig please? I'm not very good at it neither yet so trying to understand what you mean is confusing right now...sorry
-
I'm not entirely sure that answers my question. Here's my scenario:
[list]
[li]An outbound call is made on a record and the call_result is "SIT_Detected".
The "SIT_Detected" treatment has a "Cycle Attempt" value of 2 with an "Interval" value of 5 minutes. [/li]
[li][/li]
[/list]
The traditional treatment will mark the record and call it back in 5 minutes. I need to know how to do that with SCXML.
-
I think you want to use <ocs.timeout delay="300"> in the SCXML script
There are some SCXML examples that get installed with OCS 8.0 or higher.
Use these in conjunction with the Custom Actions and Events detailed in the OCS deployment manual as well as a lot of experimentation (and swearing). The documentation is not great >:(
Russell
-
I believe I've gotten this to work, in theory at least.
As you noted, there are examples that get installed. Sample02.scxml has an example of using a "Cycle Attempt" equivalent. Basically, it's a loop counter that you'll need to increment each time the call goes into a state. For example, I'm trying to catch SIT tone calls. If one is received, I'm pushing the call to a "sit_state" state and applying a delay (using ocs:timeout). If you utilize the <onexit> tag, the counter variable can be incremented. You then use the expr attribute of the <transition> tag to evaluate it.
Delcare counters
[code]
<datamodel>
<data ID="record_id" expr="'0'"/>
<data ID="retry" expr="0" />
<data ID="max_retry" expr="3" />
</datamodel>
[/code]
Validation Code
[code]
<transition event="ocs.callresult" cond="isSIT(_event.data.callresult) && (_data.retry <= _data.max_retry)" target="sit_state">
<log expr="'retry value is: '+ _data.retry + '...retrying call'" />
</transition>
<transition event="ocs.callresult" cond="isSIT(_event.data.callresult) && (_data.retry > _data.max_retry)" target="NextRecord">
<log expr="'retry value is: '+ _data.retry + '...not retrying call'" />
</transition>
[/code]
Incremental Code
[code]
<state id="sit_state">
<onentry>
<ocs:timeout delay="60" />
</onentry>
<transition event="ocs.timeout" target="MakeCall"/>
<onexit>
<assign location="_data.retry" expr="_data.retry+1" />
</onexit>
</state>
[/code]
I'm sure it can get much more complex than this but I actually got this to cycle through like I expected it to.
Thanks for the help, guys.
-
Try to read the doc, where is all described very well. In OCS dep guide is chapter about SCXML based treatments and within this section is description of possible action too.