Author Message
JanSchmitt
Joined: Apr 14, 2014
Messages: 11
Offline
Hello,

We would like to receive presence notifications in one of our custom applictions. We have already used ACE Web Services to implement make call and set call forwarding functionality.

What we did so far:

1. Looked into ACETrainer
2. Created c# application and referenced web service
3. Created the following methods
3.1 PresenceConsumerServicce()
3.2 SubscribePresence()
3.3 StartPresenceNotification()

When we run the code we get the following error:

SVC0002Invalid input value for message part %1reference

As described in Avaya Agile Communication Environment Web Services documentation we set reference = null;

subscribePresence subscribePresenceArgs = new subscribePresence();
subscribePresenceArgs.reference = null;
...

How can we get the unique correlator?

Could somebody provide a sample application?

Thanks!
DipeshGandhi2 [Avatar]

Joined: Nov 14, 2011
Messages: 35
Offline
The ordering of your API methods looks correct. Also, you are correct in that the reference parameter should be set to null when calling SubscribePresence() API. Your problem appears to lie in startPresenceNotification() method invocation. Your application must provide a unique correlator value for reference parameter that is globally unique to all applications using ACE. There are many schemes that could be used to guarantee uniqueness, including standardized mechanisms such as RFC4122 describing the Universally Unique IDentifier (UUID). Applications can embed additional context information in the correlator, as the correlator will accompany all events delivered to the application. The Avaya ACE Web Services Trainer provides code sample for Presence APIs. You will notice a built in utility that generates a correlator which serves the purpose of the sample. Although for Production deployments, it is advised to use RFC4122 or similar standard.



Dipesh Gandhi Software Engineer, Avaya DevConnect
JanSchmitt
Joined: Apr 14, 2014
Messages: 11
Offline
Thanks for the quick reply!

I have already checked resources on this site (https://www.devconnectprogram.com/site/global/products_resources/avaya_agile_communication_environment/educational_resources/trainer/index.gsp) but I could not find the Avaya ACE Web Service Trainer code sample for Presence APIs.

Could you post a link to code samples?
DipeshGandhi2 [Avatar]

Joined: Nov 14, 2011
Messages: 35
Offline
You have the correct link. You want to select "Avaya ACE Web Services Trainer Release 6.2.2.0 (20.8 MB .zip)" link and download the zip file. I've included the direct link here for you: https://www.devconnectprogram.com/fileMedia/download/8ad9a62b-e048-4af3-a150-c323fea54c80

Once downloaded, unzip the file and navigate to Trainer's Java source code located here:
\ACEWSTrainer_6.2.2.0\src\com\avaya\devconnect\acewstrainer\

You will find the calls to ACE web services ( including presence - startPresNotification method ) located in RequestManager.java. The TrainerGUI.java contains graphical code which is based on event listeners (e.g. button click) which triggers submit by user. Hope this helps!


Thanks,
Dipesh





Dipesh Gandhi Software Engineer, Avaya DevConnect
JanSchmitt
Joined: Apr 14, 2014
Messages: 11
Offline
Thanks!

I will check that tomorrow.

Regards,
Jan
JanSchmitt
Joined: Apr 14, 2014
Messages: 11
Offline
StartPresenceNotification is working now!
startPresenceUriResponse = 0!

But I am still struggling with EventServer. Trying to convert it into c#. Can anybody provide further information on setting up an HttpServer in c# that listens for incoming events from ACE?

At the moment I am trying to get this working with a HttpListener in c#.

Is it possible to check logs if ACE even pushes PresencenNotifications?

Thanks,
Jan
DipeshGandhi2 [Avatar]

Joined: Nov 14, 2011
Messages: 35
Offline
Hi Jan,

One way is to use HTTP Handler. This is probably most equivalent to HttpServer.
http://support.microsoft.com/kb/308001

Another approach would be to use web model such as WCF ( a web service ), or full web MVC framework.
WCF - Create a web service and handle events from ACE: http://msdn.microsoft.com/en-us/library/dd456779(v=vs.110).aspx
MVC - Create contoller which can process ACE events: http://www.w3schools.com/aspnet/mvc_intro.asp

Regardless of the method above, if you observe ACE log file you will notice attempts being made to send events to application side endpoint. This is done periodically and if ACE is unable to send messages to the endpoint and if timeout has reached then ACE will stop sending events.


Dipesh Gandhi Software Engineer, Avaya DevConnect
JanSchmitt
Joined: Apr 14, 2014
Messages: 11
Offline
Hi Dipesh,

I checked presence.log and event browser but could not identify any attempts being made to send events to application side endpoint.

How can be verified that ACE sends messages to the endpoint?

With TcpListener I can get at least some data:
POST /PresenceNotification HTTP/1.1

This is porbably the response from SubscribePresence().


Thanks,
Jan
DipeshGandhi2 [Avatar]

Joined: Nov 14, 2011
Messages: 35
Offline
Hi Jan,

The appcoredebug log file will contains information for events being sent from ACE to your application. In fact that is the primary log file you should reference to for most of the ACE APIs.

/var/avaya/ace/log/AppSrv01/app/appcoredebuglog.log

You will need to enable debug mode in order to view all logging.

1. Login to ACE OAMP Console
2. On the menu bar, choose Configuration, Server. Click the Logger tab.
The Debug Logger Configuration dialog box appears.
3. From the Group list, select the logger group.
4. From the Logger Level list, select the type of log messages to be stored and
generated into a log file (one of TRACE, DEBUG, INFO, WARN or ERROR), for the
selected logger group. Select DEBUG.
5. (Optional) From the Rotation Size list, select the size of the log file that stores the log
messages. When the log file reaches the specified threshold value, the system
closes the log file, opens a new one, and rotates the logs gathering into the new log
file.
6. Click Submit to save the configuration changes. Otherwise, click Reset to roll back
the changes.


Dipesh Gandhi Software Engineer, Avaya DevConnect
JanSchmitt
Joined: Apr 14, 2014
Messages: 11
Offline
Hi Dipesh,

We got it working.
Really appreciate your help!

Thanks,
Jan
JanSchmitt
Joined: Apr 14, 2014
Messages: 11
Offline
Hello Dipesh,

Is there a bug in ACE Presence Notification Service?

After the second outgoing call from one phone no notifications are getting received by neither our custom app nor by ACEWSTrainer_6.2.2.0.

We are running ACE Version 6.2.0.

Errors in appcoredebuglog.log:

2014-04-29 09:26:34,876 ERROR-[PRESENCE_V3-10.108.4.138:5248-2][PNL284] (PresenceEventPublisherTask.java:571) receiveErrorstatusChanged: The host did not accept the connection within timeout of 10000 ms
2014-04-29 09:26:34,876 DEBUG-[PRESENCE_V3-10.108.4.138:5248-2][PNL284] (NotificationExceptionsHandling.java:27) Initiating NotificationsRemoteExceptionHandling ...
2014-04-29 09:26:34,876 ERROR-[PRESENCE_V3-10.108.4.138:5248-2][PNL284] (NotificationExceptionsHandling.java:58) NotificationsRemoteExceptionHandling: Likely cause of failure - the notification listener is either notlistening at the end point registered or the response sent by the listener is incorrect and does not comply to the specification
2014-04-29 09:26:34,876 DEBUG-[PRESENCE_V3-10.108.4.138:5248-2][PNL284] (NotificationExceptionsHandling.java:60) org.apache.axis2.AxisFault: The host did not accept the connection within timeout of 10000 ms

2014-04-29 09:26:42,573 ERROR-[PRESENCE_V3-10.108.4.138:5248-7][PNL284] (PresenceEventPublisherTask.java:571) receiveErrorstatusChanged: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'o' (code 111) in prolog; expected '<'
at [row,col {unknown-source}]: [1,1]
2014-04-29 09:26:42,573 DEBUG-[PRESENCE_V3-10.108.4.138:5248-7][PNL284] (NotificationExceptionsHandling.java:27) Initiating NotificationsRemoteExceptionHandling ...
2014-04-29 09:26:42,573 ERROR-[PRESENCE_V3-10.108.4.138:5248-7][PNL284] (NotificationExceptionsHandling.java:58) NotificationsRemoteExceptionHandling: Likely cause of failure - the notification listener is either notlistening at the end point registered or the response sent by the listener is incorrect and does not comply to the specification
2014-04-29 09:26:42,574 DEBUG-[PRESENCE_V3-10.108.4.138:5248-7][PNL284] (NotificationExceptionsHandling.java:60) org.apache.axis2.AxisFault: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'o' (code 111) in prolog; expected '<'

2014-04-29 09:26:47,505 ERROR-[PresencePool-0-Notifier-1][PNL87] (PresenceNotificationClient.java:284) Exception on initialising with notification proxy
java.lang.NullPointerException
at java.lang.StringBuilder.<init>(StringBuilder.java:77)
at com.nortel.appcore.foundation.bsc.service_notifier.QualifiedEndpoint.toString(QualifiedEndpoint.java:29)
at com.nortel.appcore.service.presence.notifier.PresenceNotificationClient.initNotificationProxy(PresenceNotificationClient.java:245)
at com.nortel.appcore.service.presence.notifier.PresenceNotificationClient.notifyStatusChanged(PresenceNotificationClient.java:165)
at com.nortel.appcore.service.presence.notifier.PresenceEventPublisherTask.notifyStatusChanged(PresenceEventPublisherTask.java:145)
at com.nortel.appcore.service.presence.notifier.PresenceEventPublisherTask.run(PresenceEventPublisherTask.java:95)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:769)
2014-04-29 09:26:47,505 DEBUG-[Notifier-pool-3-thread-1602][CIEDGL-CIE4353] (CallInfoEntryDataGridListener.java:161) Event Call Id: 63b665de-00b9-417f-9bb1-315d6219e77f

2014-04-29 09:26:47,505 ERROR-[PresencePool-0-Notifier-1][PNL87] (PresenceEventPublisherTask.java:269) notifyStatusChanged: send notification to client failed!
java.lang.NullPointerException
at java.lang.StringBuilder.<init>(StringBuilder.java:77)
at com.nortel.appcore.foundation.bsc.service_notifier.QualifiedEndpoint.toString(QualifiedEndpoint.java:29)
at com.nortel.appcore.service.presence.notifier.PresenceNotificationClient.initNotificationProxy(PresenceNotificationClient.java:245)
at com.nortel.appcore.service.presence.notifier.PresenceNotificationClient.notifyStatusChanged(PresenceNotificationClient.java:165)
at com.nortel.appcore.service.presence.notifier.PresenceEventPublisherTask.notifyStatusChanged(PresenceEventPublisherTask.java:145)
at com.nortel.appcore.service.presence.notifier.PresenceEventPublisherTask.run(PresenceEventPublisherTask.java:95)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:769)

Regards,
Jan
DipeshGandhi2 [Avatar]

Joined: Nov 14, 2011
Messages: 35
Offline
Hi Jan,

Your log snippet contains following error message:

2014-04-29 09:26:34,876 ERROR-[PRESENCE_V3-10.108.4.138:5248-2][PNL284] (NotificationExceptionsHandling.java:58) NotificationsRemoteExceptionHandling: Likely cause of failure - the notification listener is either notlistening at the end point registered or the response sent by the listener is incorrect and does not comply to the specification

2014-04-29 09:26:34,876 DEBUG-[PRESENCE_V3-10.108.4.138:5248-2][PNL284] (NotificationExceptionsHandling.java:60) org.apache.axis2.AxisFault: The host did not accept the connection within timeout of 10000 ms


Please check that your listener is receiving the message and that a proper response is being sent back to ACE. For response, I would recommend monitoring the HTTP traffic using tool ( Tcpmon, Wireshark, etc ). If you continue to have issues, please open a support ticket from the DevConnect Portal.


Thank you,
Dipesh


Dipesh Gandhi Software Engineer, Avaya DevConnect
JanSchmitt
Joined: Apr 14, 2014
Messages: 11
Offline
Hi,

the listener is still listening even after the second call and ACEWSTrainer only receives two notifications for two calls, too. Same behavior here...

Wireshark shows that a response is beeing send to ACE for each POST /PresenceNotification HTTP/1.1.


Regards,
Jan
JanSchmitt
Joined: Apr 14, 2014
Messages: 11
Offline
Hi,

we finally got your ACE licence. We had to deploy a new ACE Server (6.2.3) and our user and group settings are gone. At the moment we have configured one Group that has access to all web Services (API Integration Suite). The user in that group can call all these web services except for subscribe presence.

We get an
<v3:ServiceException xmlns:v3="http://www.csapi.org/schema/parlayx/common/v3_1"><messageId>SVC0002</messageId><text>Invalid input value for message part %1</text><variables>reference</variables></v3:ServiceException>

exception.
As described in Avaya Agile Communication Environment™ Web Services guide on page 260 the reference parameter should be null. Therefore we pass it with subscribePresenceArgs.reference = null;

Thanks.

Regards,
Jan
essaybox
Joined: Oct 30, 2017
Messages: 1
Offline
How can we get the unique correlator?

Could somebody provide a sample application?

write my essay
Go to:   
Mobile view