Author Topic: RequestRecordCancel  (Read 5607 times)

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
RequestRecordCancel
« on: September 21, 2007, 10:13:13 PM »
Hi guys,
One question,
I'm trying to implement the Cancel of a record from a Third Party App as this will be executed by a system guy who doesn't have a genesys DN or anything.

What do i need to create on CME for this? I say this because documentation asks for a AppID, can I use the OCS one?

Does anybody has a VB or C example that worked? I'm monitoring the COMMDN and i believe this should work.

Thanks

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: RequestRecordCancel
« Reply #1 on: September 21, 2007, 11:33:10 PM »
I have been testing this code:

My DN is COMMDN
GSW_CM_AttrOriginAppID is the AppID of the OCS

[code]
Dim myEventInfo1 As TEventInfo
        Dim myList1 As CTKVList
        Dim myPair1 As CTKVPair
       
        Set myEventInfo1 = CreateObject("DesktopToolkitX.TEventInfo")
        Set myList1 = CreateObject("TCommObj.CTKVList")
        Set myPair1 = CreateObject("TCommObj.CTKVPair")
       

   
   
    myPair1.Key = "GSW_CM_MessageType"
    myPair1.Type = CKVTypeNum
    myPair1.NumValue = 30
    myList1.AddHead myPair1

    myPair1.Key = "GSW_CM_AttrOriginAppID"
    myPair1.Type = CKVTypeNum
    myPair1.NumValue = appID
    myList1.AddHead myPair1

    myPair1.Key = "GSW_CM_AttrTargetAppID"
    myPair1.Type = CKVTypeNum
    myPair1.NumValue = 0
    myList1.AddHead myPair1

        Dim myList2 As CTKVList
        Dim myPair2 As CTKVPair
       
        Set myList2 = CreateObject("TCommObj.CTKVList")
        Set myPair2 = CreateObject("TCommObj.CTKVPair")

        myPair2.Key = "cancel_record"
        myPair2.Type = CKVTypeList
       
            Dim myList3 As CTKVList
            Dim myPair3 As CTKVPair
           
            Set myList3 = CreateObject("TCommObj.CTKVList")
            Set myPair3 = CreateObject("TCommObj.CTKVPair")
                       
            myPair3.Key = "GSW_PHONE"
            myPair3.Type = CKVTypeString
            myPair3.StringValue = Trim(txtTelefono.Text)
            myList3.AddHead myPair3
           
            myPair3.Key = "GSW_CAMPAIGN_NAME"
            myPair3.Type = CKVTypeString
            myPair3.StringValue = txtCampana.Text
            myList3.AddHead myPair3
           
       
        myPair2.ListValue = myList3
        myList2.AddHead myPair2
       
       
    myPair1.Key = "GSW_CM_AttrProperties"
    myPair1.Type = CKVTypeList
    myPair1.ListValue = myList2
    myList1.AddHead myPair1



Set myEventInfo1.UserData = myList1

myEventInfo1.ThisDN = TExtension1.TDN
TExtension1.TSendUserEvent myEventInfo1


Set myEventInfo1 = Nothing
Set myList1 = Nothing
Set myPair1 = Nothing

'Set myeventinfo2 = Nothing
Set myList2 = Nothing
Set myPair2 = Nothing

'Set myeventinfo3 = Nothing
Set myList3 = Nothing
Set myPair3 = Nothing

[/code]

But this doesn't seem to work at all...

Any ideas why? What am i missing?

Offline bublepaw

  • Sr. Member
  • ****
  • Posts: 283
  • Karma: 10
Re: RequestRecordCancel
« Reply #2 on: September 23, 2007, 11:15:48 AM »
Hi,

There is small excerpt in OCS documentation "OCS accepts only those API requests that come from the following sources:
• Third-party servers included in the OCS Connections tab
• Third-party applications that include the OCS application object in their
Connection tabs.
All other requests are omitted."

Try creating dummy application and connect it to OCS and use its (ThirdPartyApp id in OriginAppId) - this should work or try using appId of OCM ( not tested ).

Regards

Paul

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: RequestRecordCancel
« Reply #3 on: September 23, 2007, 07:04:02 PM »
Oh interesting. Thanks for the pointing. Will try ASAP and let you know  :)

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: RequestRecordCancel
« Reply #4 on: September 25, 2007, 10:43:10 PM »
;D Just to let you know that the code worked perfectly after the creation of the application