Author Message
BrianLaw2
Joined: Oct 24, 2013
Messages: 2
Offline
Use this forum to post general questions about developing small and midsize contact center solutions using the Avaya IP Office Contact Center Web Services Collection, and to share answers with fellow DevConnect members and Avaya engineers. The WSC interface comprises a set of SOAP-based Web services that allow developers to build custom contact center agent, monitoring and supervisor applications. For more information and developer resources see the IP Office Contact Center content on the DevConnect portal.
yossyseptiandy
Joined: Dec 27, 2016
Messages: 14
Offline
Hi Team,

Please advise on how to create token session to get agentLoginId and endpointObserverUrl

image

Open Agent
sessionToken, taskType, surveilSession

image

Agent Login

endpointToken, initiatorId

image


Sadashiv
Joined: Nov 29, 2016
Messages: 27
Offline
Hello,

createSession must be the first call to WSC Web Service which returns sessionToken, which needs to be used to call other APIs of the same web service.

createSession of task web service takes 3 input parameter as below,
1. agentLoginId (login name of agent)
2. password (password of agent)
3. endpointObserverUrl (this is the URL of locally deployed application web service which will be called by WSC to send incoming events)

This will create session with task web service and it will return the sessionToken

Now openAgent api can be called

openAgent API takes 4 input parameters as below,
1. sessionToken (which is same, returned by createSession API)
2. agentId (This is not login name. To get this id, you can call Directory web service API getAgentByName which will return AgentBasicInfo and this will have getId)
3. taskType (it can be Voice, Chat OR Email as per requirement)
4. surveilSession (it can be true or false as per requirement)

This API will return endpointToken which needs to be used for loginAgent and all other Task web service APIs.

Now you can call loginAgent api

loginAgent API takes 3 input parameters as below,
1. endpointToken ( which is same token returned by openAgent API)
2. phoneId (This is phone id. To get phone id, you can call getAllPhones OR getPhoneByName of Directory web service and can get id for your phone number)
3. initiatorId (This can be agent id which has used in openAgent API call)

After successful call to this API, you are ready to call other APIs of Task Web Service.

For more API details, please check API dos under doc/api directory of zip file. Also you can have a look at sample application bundled with zip file. It shows how those APIs can be used.

Thanks,
Sadashiv
yossyseptiandy
Joined: Dec 27, 2016
Messages: 14
Offline
Thank Sadashiv,

As for point 3. endpointObserverUrl (this is the URL of locally deployed application web service which will be called by WSC to send incoming events), from WSC side what kind of data sent ? is it in xml format or other format ?

Do you have URL sample for this ?
Sadashiv
Joined: Nov 29, 2016
Messages: 27
Offline
Hi,

WSC calls observer web service deployed on local system. Task Web Service calls EndpointObserver for events like onAgentLogin, onAgentLogout, onAgentPauseOn, onEPTCAlerting (i.e. incoming call), onEPTCConnected, onEPTCDropped. It contains data relevant to that event e.g. endpointToken, taskId ,taskConnId , attributes ,cause. All this data will be sent in SOAP based XML format.
Under API doc, you can find detail information about which API will send what data.

Sample observer URLS will be like below,
VariablesObserver http://<IP Addr>:<port>/WSCChecker/WSC/VariablesObserver
MonitoringObserver http://<IP Addr>:<port>/WSC/MonitoringObserver
EndpointObserver http://<IP Addr>:<port>/WSCChecker/WSC/EndpointObserver
UMRObserver http://<IP Addr>:<port>/WSCChecker/WSC/UMRObserver

Here WSCChecker is locally deployed application name.

You can try by deploying sample application WSCChecker included in the zip file.

Thanks,
Sadashiv
yossyseptiandy
Joined: Dec 27, 2016
Messages: 14
Offline
Hi Sadashiv,

we try call loginAgent API with 3 input parameters as below,
1. endpointToken ( which is same token returned by openAgent API)
2. phoneId (This is phone id. To get phone id, you can call getAllPhones OR getPhoneByName of Directory web service and can get id for your phone number)
3. initiatorId (This can be agent id which has used in openAgent API call)

with capture below,

On open agent API,

Request :
<task:openAgent>
<task:sessionToken>650d6cab-e24b-4676-aac8-afa6dffe5bd1</task:sessionToken>
<task:agentId>3e175b5842005700</task:agentId>
<task:taskType>Voice</task:taskType>
<task:surveilSession>true</task:surveilSession>
</task:openAgent>

Result :

<openAgentResponse xmlns="http://task.wsc.cc.comergo.com" xmlns:ns2="http://types.wsc.cc.comergo.com" xmlns:ns3="http://umr.wsc.cc.comergo.com">
<endpointToken>f02f708e-5355-4930-a10e-a453fe446fe5</endpointToken>
</openAgentResponse>


On Login Agent API

Request :

<task:loginAgent>
<task:endpointToken>f02f708e-5355-4930-a10e-a453fe446fe5</task:endpointToken>
<task:phoneId>3e175b5843005800<</task:phoneId> ==> Phoneid
<task:initiatorId>3e175b5842005700</task:initiatorId> ==> agent id which has used in openAgent


but reply error from wsc below,

Result :

<faultstring>javax.xml.bind.UnmarshalException
- with linked exception:
[com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '<' (code 60) in content after '<' (malformed start element?).
at [row,col {unknown-source}]: [6,41]]</faultstring>
</S:Fault>

what wrong, and please advice
Thanks








yossyseptiandy
Joined: Dec 27, 2016
Messages: 14
Offline
sorry for double posting
yossyseptiandy
Joined: Dec 27, 2016
Messages: 14
Offline
sorry for double posting
yossyseptiandy
Joined: Dec 27, 2016
Messages: 14
Offline
sorry for double posting
yossyseptiandy
Joined: Dec 27, 2016
Messages: 14
Offline
Sorry for double posting
yossyseptiandy
Joined: Dec 27, 2016
Messages: 14
Offline
Sorry fro double posting
yossyseptiandy
Joined: Dec 27, 2016
Messages: 14
Offline
Sorry fro double posting
yossyseptiandy
Joined: Dec 27, 2016
Messages: 14
Offline
sorry for double posting
Sadashiv
Joined: Nov 29, 2016
Messages: 27
Offline
Hi,

I don't know how you are sending the request but from error message it shows that there is some problem with posted XML. WSC is unable to parse the XML. At row 6 and column 41 there is some character which is causing problem.

In IPOCC TTconsole, you can enable WSC_SOAP_Trace and WSC_SessionObjects log categories for TaskWS. After sending the SOAP request, you can see the sent XML. You can copy the same XML printed and check what is missing there. You can try to open that xml in browser OR xml validation tool to check XML is valid or not.

In short, SOAP XML sent for login request is not valid, please ensure XML sent is valid.

Thanks,
Sadashiv
yossyseptiandy
Joined: Dec 27, 2016
Messages: 14
Offline
Hi Shadiv,

Thanks for your advise, and we any question about other web service IPOCC.

1. Maketask

request :
<task:makeTask>
<task:endpointToken>687374c8-5ef3-4587-80e0-47976db7a2a0</task:endpointToken>
<task:address>82475b5843000000</task:address>
<task:outboundTopicId>3e175b5842005700</task:outboundTopicId>
</task:makeTask>

Result :
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<makeTaskResponse xmlns="http://task.wsc.cc.comergo.com" xmlns:ns2="http://types.wsc.cc.comergo.com" xmlns:ns3="http://umr.wsc.cc.comergo.com"/>
</S:Body>
</S:Envelope>

But maketask cannot running

question : how to create address and outboundTopicId

2. makeTaskExtOAD
<task:makeTaskExtOAD>
<task:endpointToken>687374c8-5ef3-4587-80e0-47976db7a2a0</task:endpointToken>
<task:address>82475b5843000000</task:address>
<task:outboundTopicId>3e175b5842005700</task:outboundTopicId>
<task:extOAD>400</task:extOAD>
</task:makeTaskExtOAD>

question : how to create address and outboundTopicId,ExtOAD

3. answerTC
request :
<task:answerTC>
<task:endpointToken>687374c8-5ef3-4587-80e0-47976db7a2a0</task:endpointToken>
<task:taskConnId>82475b5843000000</task:taskConnId>
</task:answerTC>

result :
<S:Body>
<answerTCResponse xmlns="http://task.wsc.cc.comergo.com" xmlns:ns2="http://types.wsc.cc.comergo.com" xmlns:ns3="http://umr.wsc.cc.comergo.com"/>
</S:Body>

answer cannot running

question : how to create taskConnId


4.dropTask
<soapenv:Body>
<task:dropTask>
<task:endpointToken>?</task:endpointToken>
<task:taskId>?</task:taskId>
</task:dropTask>
</soapenv:Body>

question : how to create taskId

5.conferenceTask
<task:conferenceTask>
<task:endpointToken>?</task:endpointToken>
<task:taskId1>?</task:taskId1>
<task:taskId2>?</task:taskId2>
</task:conferenceTask>

question : how to create taskId1,taskId2

6. consultationTask
<task:consultationTask>
<task:endpointToken>?</task:endpointToken>
<task:activeTaskConnId>?</task:activeTaskConnId>
<task:address>?</task:address>
</task:consultationTask>

question : how to create activeTaskConnId,address

Please advise and thanks before


Go to:   
Mobile view