" /> Dropped Call routing in SCXML treatment - Genesys CTI User Forum

Author Topic: Dropped Call routing in SCXML treatment  (Read 3090 times)

Offline PFCCWA

  • Hero Member
  • *****
  • Posts: 655
  • Karma: -7
Dropped Call routing in SCXML treatment
« on: April 01, 2014, 02:40:47 PM »
Advertisement
Hello,

We are using Advanced (SCXML) treatments for a campaign however results such as Dropped, GeneralError are routing through to agents, with Dropped/General error as the call outcome.
Having observed the calling list, the record is initially Campaign Rescheduled but in my SCXML treatment file it should be completed (as Dropped).
The scxml is as follows:

[b][i]<?xml version="1.0" encoding="utf-8"?>
<!--

This SCXML script demonstrates the usage of time ranges. At the start of processing a record with specific phone type is
selected depending upon current time range. If no record with the required phone type could be found, any record is selected.

-->
<scxml xmlns="http://www.w3.org/2005/07/scxml"
xmlns:ocs="http://genesyslabs.com/schemas/ocs/treatments"
version="1.0"
profile="ecmascript"
initial="begin">
<datamodel>
  <data ID="record_id" expr="'0'"/>
</datamodel>
<state id="begin">
  <transition target="DoProcessing" />
</state>
<script>
  function isSIT( call_result  )
  {
    if(call_result == 'SIT_Detected' || call_result == 'SIT_Invalid_Num'    ||
        call_result == 'SIT_Vacant'  || call_result == 'SIT_Oper_Intercept' ||
        call_result == 'SIT_Unknown'  || call_result == 'SIT_No_Circuit'    ||
        call_result == 'SIT_Reorder')
        return true;
      else
return false;
  }
</script>
<state id="DoProcessing">
  <initial>
    <transition target="GetRange" />
  </initial>
  <state id="GetRange">
    <onentry>
      <ocs:get_daytime/>
    </onentry>
    <transition event="ocs.daytime_change" cond="(_event.data.daytime_code == 'BBH') || (_event.data.daytime_code == 'ABH')" target="NextRecordAtHome"/>
    <transition event="ocs.daytime_change" cond="_event.data.daytime_code == 'BH'"  target="NextRecordAtWork" />
    <transition event="ocs.daytime_change" cond="(_event.data.daytime_code == 'WEND') || (_event.data.daytime_code == 'HDAY')"  target="NextRecordOther" />
  </state>
  <state id="NextRecordAtHome">
    <onentry>
<ocs:next_record>
<ocs:contact_info_type type_name="'HOME'"/>
</ocs:next_record>
    </onentry>
    <transition event="ocs.next_record" cond= "_event.data.record_id == '0'"  target="NextRecordAny"/>
    <transition event="ocs.next_record" cond= "_event.data.record_id != '0'"  target="MakeCall">
    <assign location="_data.record_id" expr = "_event.data.record_id" />
    </transition>
  </state>
  <state id="NextRecordAtWork">
    <onentry>
<ocs:next_record>
<ocs:contact_info_type type_name="'DIRECT_BUSINESS'"/>
<ocs:contact_info_type type_name="'BUSINESS_WITH_EXTENSION'"/>
<ocs:contact_info_type type_name="'MOBILE'"/>
</ocs:next_record>
    </onentry>
    <transition event="ocs.next_record" cond= "_event.data.record_id == '0'"  target="NextRecordAny"/>
    <transition event="ocs.next_record" cond= "_event.data.record_id != '0'"  target="MakeCall">
    <assign location="_data.record_id" expr = "_event.data.record_id" />
    </transition>
  </state>
    <state id="NextRecordOther">
      <onentry>
  <ocs:next_record>
  <ocs:contact_info_type type_name="'HOME'" exclude="'yes'"/>
  <ocs:contact_info_type type_name="'DIRECT_BUSINESS'" exclude="'yes'"/>
  <ocs:contact_info_type type_name="'BUSINESS_WITH_EXTENSION'" exclude="'yes'"/>
<ocs:contact_info_type type_name="'MOBILE'" exclude="'yes'"/>
  </ocs:next_record>
      </onentry>
      <transition event="ocs.next_record" cond= "_event.data.record_id == '0'"  target="NextRecordAny"/>
      <transition event="ocs.next_record" cond= "_event.data.record_id != '0'"  target="MakeCall">
      <assign location="_data.record_id" expr = "_event.data.record_id" />
      </transition>
  </state>
    <state id="NextRecordAny">
      <onentry>
  <ocs:next_record />
      </onentry>
      <transition event="ocs.next_record" cond= "_event.data.record_id == '0'"  target="end"/>
      <transition event="ocs.next_record" cond= "_event.data.record_id != '0'"  target="MakeCall">
          <assign location="_data.record_id" expr = "_event.data.record_id" />
      </transition>
  </state>
  <state id="MakeCall">
    <onentry>
      <ocs:make_call record_id="_data.record_id"/>
    </onentry>
    <transition event="ocs.callresult" cond="_event.data.callresult == 'Answer'" target="end" />
    <transition event="ocs.callresult" cond="_event.data.callresult == 'AnswMachine'" target="end" />
    <transition event="ocs.callresult" cond="_event.data.callresult == 'Abandoned'" target="end" />
    <transition event="ocs.callresult" cond="_event.data.callresult == 'Dropped'" target="end" />
    <transition event="ocs.callresult" cond="_event.data.callresult == 'Silence'" target="end" />
    <transition event="ocs.callresult" cond="_event.data.callresult == 'GeneralError'" target="end" />
    <transition event="ocs.callresult" cond="_event.data.callresult == 'Fax'" target="end" />
    <transition event="ocs.callresult" cond="_event.data.callresult == 'NoAnswer'" target="end" />
    <transition event="ocs.callresult" cond="_event.data.callresult == 'Busy'" target="end" />
    <transition event="ocs.callresult" cond="isSIT(_event.data.callresult)" target="NextRecordAny" />
    <transition event="ocs.callresult" cond="(_event.data.callresult != 'Answer') &amp;&amp; (_event.data.callresult != 'Abandoned') &amp;&amp; (_event.data.callresult != 'Dropped') &amp;&amp; (_event.data.callresult != 'Silence') &amp;&amp; (_event.data.callresult != 'GeneralError') &amp;&amp; (_event.data.callresult != 'NoAnswer') &amp;&amp; (_event.data.callresult != 'Fax') &amp;&amp; (_event.data.callresult != 'AnswMachine') &amp;&amp; (!isSIT(_event.data.callresult)) &amp;&amp; (_event.data.callresult != 'Busy')" target="Delay60" />
  </state>
  <state id="Delay60">
    <onentry>
      <ocs:timeout delay="60" />
    </onentry>
    <transition event="ocs.timeout" target="MakeCall"/>
  </state>
  <state id="Delay15">
    <onentry>
      <ocs:timeout delay="15" />
    </onentry>
    <transition event="ocs.timeout" target="MakeCall"/>
  </state>
</state>
<final id="end"/>
</scxml>[/i][/b]

Any thoughts on why it is rescheduling the record? looks like 60 seconds later so is not taking into account the the request to end.
If we dont use the scxml, record is correctly updated as Dropped.

ocs logs seems to only accept these results:

[b][i]-> SCXML : 00000133-04000259-0001  METRIC <eval_condition condition="_event.data.callresult == 'Answer'" result="false" />

-> SCXML : 00000133-04000259-0001  METRIC <eval_condition condition="_event.data.callresult == 'AnswMachine'" result="false" />

-> SCXML : 00000133-04000259-0001  METRIC <eval_condition condition="_event.data.callresult == 'Fax'" result="false" />

-> SCXML : 00000133-04000259-0001  METRIC <eval_condition condition="_event.data.callresult == 'NoAnswer'" result="false" />

-> SCXML : 00000133-04000259-0001  METRIC <eval_condition condition="_event.data.callresult == 'Busy'" result="false" />

-> SCXML : 00000133-04000259-0001  METRIC <eval_condition condition="isSIT(_event.data.callresult)" result="false" />[/i][/b]
thank you.
« Last Edit: April 01, 2014, 03:03:04 PM by PFCCWA »

Offline PFCCWA

  • Hero Member
  • *****
  • Posts: 655
  • Karma: -7
Re: Dropped Call routing in SCXML treatment
« Reply #1 on: April 08, 2014, 10:10:10 AM »
Found the problem.
Changes to the scxml file were not being applied/refreshed.
Changing annex tab/treatment-uri option value resolved issue.

thanks.