" /> Outbound Contact Server SCXML Treatments - Cycle Attempts - Genesys CTI User Forum

Author Topic: Outbound Contact Server SCXML Treatments - Cycle Attempts  (Read 4776 times)

Offline dw75

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Outbound Contact Server SCXML Treatments - Cycle Attempts
« on: May 13, 2013, 11:03:32 AM »
Advertisement
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.

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Outbound Contact Server SCXML Treatments - Cycle Attempts
« Reply #1 on: May 13, 2013, 06:11:19 PM »
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

Offline dw75

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: Outbound Contact Server SCXML Treatments - Cycle Attempts
« Reply #2 on: May 13, 2013, 06:48:34 PM »
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.

Offline rpenney

  • Jr. Member
  • **
  • Posts: 64
  • Karma: 2
Re: Outbound Contact Server SCXML Treatments - Cycle Attempts
« Reply #3 on: May 13, 2013, 08:28:08 PM »
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

Offline dw75

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: Outbound Contact Server SCXML Treatments - Cycle Attempts
« Reply #4 on: May 15, 2013, 07:35:15 PM »
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) &amp;&amp; (_data.retry &lt;= _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) &amp;&amp; (_data.retry &gt; _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.

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2755
  • Karma: 44
Re: Outbound Contact Server SCXML Treatments - Cycle Attempts
« Reply #5 on: May 20, 2013, 01:45:38 PM »
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.