" /> fetching binary data in scxml/ors/composer - Genesys CTI User Forum

Author Topic: fetching binary data in scxml/ors/composer  (Read 2662 times)

Offline smile

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: 6
fetching binary data in scxml/ors/composer
« on: November 25, 2013, 02:08:04 PM »
Advertisement
Hi All

i'd like to use get/attach binary file function with UCS. There are corresponding ESP functions, but all of them are expecting parameter of type "binary" for content.
for example:
          'AppName' [str] = "UCS_p"
          'AppType' [str] = "CONTACT_SERVER"
          'Service' [str] = "OMInteractions"
          'Method' [str] = "GetDocument"
          'Parameters' [list] = (size=7561)
              'MimeType' [str] = "application/unknown"
              'TheName' [str] = "test.pdf"
              'Content' [bin] = (size=7477)
                0x25 0x50 0x44 0x46 0x2D 0x31 0x2E 0x34 0x0A 0x25 0xC3 0xA4 0xC3 0xBC 0xC3 0xB6 0xC3 0x9F 0x0A 0x32
....

When calling this method, ORS even can't evaluate result in _event.data.content ;)

The thing is that in case of IRD i can set data type using modifier like {b}Content. In case of javascript/scxml it's impossible to use type other than int or string. If i submit request to UCS with content of type string, UCS reply with error.

The example of call for add document function:
<session:fetch requestid="App_ExternalService1['requestid']" srcexpr="'\\' + 'CFGContactServer' + '\\' + 'OMInteractions' + '\\' + 'AddDocument'"  timeout="30" method="'esp'">
<content _expr="App_ExternalService1_content" />

The following block is used to prepare content
var App_ExternalService1_content = {
params: {
MimeType: 'application/unknown',
TheName: 'attach.pdf',
TheSize: 32,
Content: var_content2,
InteractionId: system.InteractionID
},
udata: {
}
};

where var_content2 should be binary rather than string. I've tried to use array object, but ORS doesn't know about ArrayBuffer ;(

The question is: how to get/put binary content or does other way exist to submit attached document to interaction?
[/list]

Offline Adam G.

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 12
  • Still Gorgeous.......
Re: fetching binary data in scxml/ors/composer
« Reply #1 on: November 28, 2013, 04:27:30 PM »
How about looking around the problem.

Save the pdf with a uid name and set the URL as a variable i.e. \\server\share\uid1234.pdf rather than the file itself?


Offline smile

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: 6
Re: fetching binary data in scxml/ors/composer
« Reply #2 on: November 28, 2013, 08:17:24 PM »
[quote author=Pavel link=topic=8100.msg35671#msg35671 date=1385656050]
How about looking around the problem.

Save the pdf with a uid name and set the URL as a variable i.e. \\server\share\uid1234.pdf rather than the file itself?
[/quote]
Thank you ,Pavel. This was my first suggestion to customer, but for some reasons they want have attached file to email.
i'm verging towards to get contacts sdk and write custom web service ;(((

Offline smile

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: 6
Re: fetching binary data in scxml/ors/composer
« Reply #3 on: November 28, 2013, 08:44:06 PM »
btw, does anybody know: is it possible to attach file (document) to interaction using context services api?