Author Topic: Platform SDK 8.1, how to get EventResourceInfo from TServer [JAVA]  (Read 5607 times)

Offline artem.koloskov

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Hi all, hope this not a dull question to ask, but i've failed to find ANY info on the subject.

I'm trying to build a little application on java, that monitors MCP resources and for that i need to get EventResourceInfo from TServer, but i can't find the proper request, that could return to me that event.

Thanks in advance for your help.

Artem.
« Last Edit: August 17, 2014, 11:16:51 PM by artem.koloskov »

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Platform SDK 8.1, how to get EventResourceInfo from TServer [JAVA]
« Reply #1 on: August 18, 2014, 01:38:35 PM »
Not sure what you are trying to monitor but:

http://www.genesyslab.info/repository/PSDK/8.0-Java_API_Reference/com/genesyslab/platform/voice/protocol/tserver/events/EventResourceInfo.html

Offline artem.koloskov

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Platform SDK 8.1, how to get EventResourceInfo from TServer [JAVA]
« Reply #2 on: August 18, 2014, 01:46:12 PM »
[quote author=cavagnaro link=topic=8476.msg37293#msg37293 date=1408369115]
Not sure what you are trying to monitor but:

http://www.genesyslab.info/repository/PSDK/8.0-Java_API_Reference/com/genesyslab/platform/voice/protocol/tserver/events/EventResourceInfo.html

[/quote]

Thanks for reply, but I know what is this event and how to create instances of it. But what I need is for TServer to answer on my request with this event. And I can't find info on which type of request should it be. Or perhaps I could somehow subscribe for this events?

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Platform SDK 8.1, how to get EventResourceInfo from TServer [JAVA]
« Reply #3 on: August 18, 2014, 01:54:50 PM »
As it is a TServer event, guess would be a simple listener of the MessageId:

[code]
switch(response.messageId())
{
case EventResourceInfo.ID:
  //Whatever you wanna here
case EventError.ID:
  //Whatever you wanna here
  ...
}
[/code]

Offline artem.koloskov

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Platform SDK 8.1, how to get EventResourceInfo from TServer [JAVA]
« Reply #4 on: August 18, 2014, 02:05:34 PM »
This is not a problem too. This response should come after some request to TSereverProtocol. The exact type of this request is what I am looking for.

Thank you for trying to help me btw. Really appreciate it.

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Platform SDK 8.1, how to get EventResourceInfo from TServer [JAVA]
« Reply #5 on: August 18, 2014, 02:20:36 PM »
Try to register DN with "Tenant" name. On that level event of type EventResourceInfo should be fired.

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Platform SDK 8.1, how to get EventResourceInfo from TServer [JAVA]
« Reply #6 on: August 18, 2014, 02:25:28 PM »
Also I guess there is no way to "Ask" how many ports are available. Seems to be automatic:

[code]
@13:55:12.7770 [0] 8.0.300.48 distribute_event: message EventResourceInfo
AttributeEventSequenceNumber 00000000000a51cb
AttributeTimeinuSecs 777000
AttributeTimeinSecs 1320481512 (13:55:12)
AttributeExtensions [46] 00 02 01 00..
  'available-ports' 2200
  'total-ports' 2200
AttributeThisDN 'SouthHubSIP05'
13:55:12.777 Trc 04542 EventResourceInfo sent to [508] (00000004 SHAGOBD_OCS01P 10.96.156.30:60898)
13:55:12.777 Trc 04542 EventResourceInfo sent to [488] (00000003 SHAGOBD_OCS01B 10.96.156.39:59998)
[/code]

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Platform SDK 8.1, how to get EventResourceInfo from TServer [JAVA]
« Reply #7 on: August 18, 2014, 03:04:30 PM »
It must be possible - ICON can retrieve these messages/events. As I wrote above, try to Register DN which serves for this purpose.

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Platform SDK 8.1, how to get EventResourceInfo from TServer [JAVA]
« Reply #8 on: August 18, 2014, 03:10:19 PM »
What I meant is that you can "listen" on how many ports are free, but not "ask" as seems SIP Server reports it based on the OPTIONS message

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Platform SDK 8.1, how to get EventResourceInfo from TServer [JAVA]
« Reply #9 on: August 18, 2014, 03:17:50 PM »
Yes, that is right. The event is based on and fired by information received by RM.

Offline artem.koloskov

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Platform SDK 8.1, how to get EventResourceInfo from TServer [JAVA]
« Reply #10 on: August 18, 2014, 11:09:51 PM »
[quote author=Kubig link=topic=8476.msg37297#msg37297 date=1408371636]
Try to register DN with "Tenant" name. On that level event of type EventResourceInfo should be fired.
[/quote]

Yes! That did it! Thank you, guys!