Author Message
CameliaSuciu
Joined: Nov 27, 2013
Messages: 0
Offline
Up until now I used the acsEventNotify to get notifications of incoming messages to my TSAPI applications.

In my current project I would like to use acsSetESR and I was wondering if there is any drawback in using this method, as most of the TSAPI examples I've seen use the Windows messaging acsEventNotify method.

Many thanks.
Camelia
AshishTiwari
Joined: Oct 22, 2008
Messages: 0
Offline
Hi Camelia,

There are no drawbacks in using acsSetESR method that I am aware of. The difference is around how the application is notified; acsSetESR requires registering a callback method. Upon getting callback, the application can continue to use the similar logic of pulling the event out from the client queue as with acsEventNotify.

Please ask any specific question you may have, if this doesn't answers your question.

-Ashish
AbdulKA
Joined: Nov 6, 2013
Messages: 35
Offline
Hi Ashish,

In the documentation it is said that , TSAPI functions should not be called from ESR , is it applicable to eventNotify also? can we call a function from esr which will call TSAPI functions? i have to do an application which need to invoke singlestepconference once the esr receive an Established event on call monitor. can i call the singlestepconference from another function which can be called from esr? or else should i try eventNotify instead of esr

Thanks and Regards
Rasheed
AshishTiwari
Joined: Oct 22, 2008
Messages: 0
Offline
Hi Abdul,

The acsEventNotify uses windows messaging framework whereas acsSetESR uses callback function. ESR callback will only indicate that there is an event available in the client queue. The application still needs to use acsGetEventBlock or acsGetEventPoll to get the actual event. It is not recommended to make a call to get the event from the same thread that calls the callback function. However, an application can choose to make a call to get the event, if the application specifies to receive event notification only when queue becomes non-empty by passing FALSE as the last parameter in acsSetESR method. In that case the application needs to continue to get events from the queue till the queue becomes empty and then wait for the ESR callback.

The application shouldn't call TSAPI functions either from the ESR callback method or from the callback method registered to handle the windows message.

-Ashish
AbdulKA
Joined: Nov 6, 2013
Messages: 35
Offline
Hi Ashish,
So i assume that any tsapi call like singlestepconference should be done from a seperate thread which can be initiated from ESR on receiving some event like established. is that right?

THanks and Regards
Rasheed
AshishTiwari
Joined: Oct 22, 2008
Messages: 0
Offline
Hi Rasheed,

Normally, any of the TSAPI calls are made as a result of some external action. For example, clicking a button on a UI places a call. Some applications (such as predictive dialing application) may not have an external action. In such case applications can have separate thread to make TSAPI request. Such thread will wait till the stream is opened successfully, and upon getting the confirmation event the thread can be signaled to continue with sending TSAPI request.

As I mentioned earlier, ESR callback will only indicate that there is an event available in the client queue. The application still needs to use acsGetEventBlock or acsGetEventPoll to get the actual event. The application needs to wait till confirmation event of opening of ACS stream received. After verifying that stream has opened successfully, the application can send TSAPI requests.

-Ashish
AngusComber2
Joined: Feb 10, 2005
Messages: 0
Offline
I don't know i this helps but I spin off a separate thread to listen for events. This thread basically sits in a loop useing acsGetEventBlock.

So you have a 'main' thread if you like where you can perfvorm your single step conference from etc. Then a separate thread listening out for events from the switch. Eg a conformation that the single step conference completed or an event relating to the conference happened.

Obviously you have the usual multi-threading issues. So you need to concern yourself with access to resources from the different threads. In windows a common way round this is to post the event (in separate event thread) to the 'main' thread window.

Hope this helps. However, like another poster on here this is a general programming question really.
Go to:   
Mobile view