" /> Descripton of EventType in VB - Genesys CTI User Forum

Author Topic: Descripton of EventType in VB  (Read 9038 times)

Offline Haldane

  • Jr. Member
  • **
  • Posts: 72
  • Karma: 1
Descripton of EventType in VB
« on: October 06, 2006, 11:41:38 AM »
Advertisement
Does anyone know how to get the description of the event type in vb from the eventinfo. I have the following

Dim MyEventType as String
With Eventifo
    MyEventType = .EventType
end with

But MyEventType keeps coming back with the numeric id. eg 53 adn I want the des of "EventRegistered".
Is there a way to enumerate out the description? ??? ???

Offline Genecist

  • Newbie
  • *
  • Posts: 27
  • Karma: 0
    • Screen Pop Software
Re: Descripton of EventType in VB
« Reply #1 on: October 06, 2006, 03:56:22 PM »
Not sure about VB...

But in the t-lib SDK there is a function called TGetMessageTypeName defined as:

const char *TGetMessageTypeName(enum TMessageType msg_type);

usage:

(char *) TGetMessageTypeName(event->Event)

where

TEvent *event is the event structure passed in from the dispatch function.

I know this isn't VB, but maybe it helps...

Offline Haldane

  • Jr. Member
  • **
  • Posts: 72
  • Karma: 1
Re: Descripton of EventType in VB
« Reply #2 on: October 09, 2006, 10:46:38 AM »
Genecist,
    Cheers looks good to me. I'll test it later and let you know.

:)

Offline Haldane

  • Jr. Member
  • **
  • Posts: 72
  • Karma: 1
Re: Descripton of EventType in VB
« Reply #3 on: October 10, 2006, 10:54:52 AM »
Genecist,
      My application is based on the DesktopToolkit. I guess this fuction is not part of the toolkit as I cannot see it in the object browser. Looking like I have to wrtie my own function to return the value.


Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Descripton of EventType in VB
« Reply #4 on: October 10, 2006, 05:02:44 PM »
There is no such funcionality in Activex, in TLib there exists the function that returns the match of the numeric value. Why you need the events name?

Offline Genecist

  • Newbie
  • *
  • Posts: 27
  • Karma: 0
    • Screen Pop Software
Re: Descripton of EventType in VB
« Reply #5 on: October 10, 2006, 11:23:36 PM »
[quote author=Haldane link=topic=1859.msg6083#msg6083 date=1160477692]
Genecist,
      My application is based on the DesktopToolkit. I guess this fuction is not part of the toolkit as I cannot see it in the object browser. Looking like I have to wrtie my own function to return the value.


[/quote]

If you're using VB6, you can still map to the TGetMessageTypeName function in tlib_MD.dll.

It's been a while since I've done VB6 integration with a 'C' library, but it would be along the lines of

Declare Function TGetMessageTypeName Lib "tlib_MD.dll" (ByVal lEvent As Integer) As String

You'll have to play with it, but it should work.


Offline Genecist

  • Newbie
  • *
  • Posts: 27
  • Karma: 0
    • Screen Pop Software
Re: Descripton of EventType in VB
« Reply #6 on: October 10, 2006, 11:27:43 PM »
If you're going to 'roll' your own, the events and their corresponding identifiers are as follows (taken from tlibrary.h):

enum TMessageType {
  RequestRegisterClient,        /*  0 */
  RequestQueryServer,
  RequestQueryAddress,
  RequestRegisterAddress,
  RequestUnregisterAddress,
  RequestRegisterAll,
  RequestUnregisterAll,
  RequestSetInputMask,
  RequestAgentLogin,
  RequestAgentLogout,
  RequestAgentReady,            /*  10 */
  RequestAgentNotReady,
  RequestSetDNDOn,
  RequestSetDNDOff,
  RequestMakeCall,
  RequestMakePredictiveCall,
  RequestAnswerCall,
  RequestReleaseCall,
  RequestHoldCall,
  RequestRetrieveCall,
  RequestInitiateConference,    /*  20 */
  RequestCompleteConference,
  RequestDeleteFromConference,
  RequestInitiateTransfer,
  RequestMuteTransfer,
  RequestSingleStepTransfer,
  RequestCompleteTransfer,
  RequestMergeCalls,
  RequestAlternateCall,
  RequestReconnectCall,
  RequestAttachUserData,        /*  30 */
  RequestUpdateUserData,
  RequestDeleteUserData,
  RequestDeletePair,
  RequestCallForwardSet,
  RequestCallForwardCancel,
  RequestRouteCall,
  RequestGiveMusicTreatment,
  RequestGiveSilenceTreatment,
  RequestGiveRingBackTreatment,
  RequestLoginMailBox,          /*  40 */
  RequestLogoutMailBox,
  RequestOpenVoiceFile,
  RequestCloseVoiceFile,
  RequestPlayVoiceFile,
  RequestCollectDigits,
  RequestSetMessageWaitingOn,
  RequestSetMessageWaitingOff,
  RequestDistributeUserEvent,
  RequestDistributeEvent,

  EventServerConnected,        /*  50 */
  EventServerDisconnected,
  EventError,
  EventRegistered,
  EventUnregistered,
  EventRegisteredAll,
  EventUnregisteredAll,
  EventQueued,
  EventDiverted,
  EventAbandoned,
  EventRinging,                /*  60 */
  EventDialing,
  EventNetworkReached,
  EventDestinationBusy,
  EventEstablished,
  EventReleased,
  EventHeld,
  EventRetrieved,
  EventPartyChanged,
  EventPartyAdded,
  EventPartyDeleted,            /*  70 */
  EventRouteRequest,
  EventRouteUsed,
  EventAgentLogin,
  EventAgentLogout,
  EventAgentReady,
  EventAgentNotReady,
  EventDNDOn,
  EventDNDOff,
  EventMailBoxLogin,
  EventMailBoxLogout,          /*  80 */
  EventVoiceFileOpened,
  EventVoiceFileClosed,
  EventVoiceFileEndPlay,
  EventDigitsCollected,
  EventAttachedDataChanged,
  EventOffHook,
  EventOnHook,
  EventForwardSet,
  EventForwardCancel,
  EventMessageWaitingOn,        /*  90 */
  EventMessageWaitingOff,
  EventAddressInfo,
  EventServerInfo,
  EventLinkDisconnected,
  EventLinkConnected,
  EventUserEvent,

  RequestSendDTMF,              /*  97 */
  EventDTMFSent,

  EventResourceAllocated,      /*  99 */
  EventResourceFreed,

  EventRemoteConnectionSuccess, /* 101 */
  EventRemoteConnectionFailed,

  RequestRedirectCall,          /* 103 */
  RequestListenDisconnect,
  RequestListenReconnect,
  EventListenDisconnected,
  EventListenReconnected,
  RequestQueryCall,
  EventPartyInfo,
  RequestClearCall,

  RequestSetCallInfo,          /* 111 */
  EventCallInfoChanged,

  RequestApplyTreatment,        /* 113 */
  EventTreatmentApplied,
  EventTreatmentNotApplied,
  EventTreatmentEnd,

  EventHardwareError,          /* 117 */
  EventAgentAfterCallWork,
  EventTreatmentRequired,

  RequestSingleStepConference,  /* 120 */
  RequestQuerySwitch,
  EventSwitchInfo,

  RequestGetAccessNumber,      /* 123 */
  RequestCancelReqGetAccessNumber,
  EventAnswerAccessNumber,
  EventReqGetAccessNumberCanceled,

  RequestReserveAgent,          /* 127 */
  EventAgentReserved,
  RequestReserveAgentAndGetAccessNumber,

  RequestAgentSetIdleReason,    /* 130 */
  EventAgentIdleReasonSet,

  EventRestoreConnection,      /* 132 */
  EventPrimaryChanged,
  RequestLostBackupConnection,
  RequestSetDNInfo,

  RequestQueryLocation,        /* 136 */
  EventLocationInfo,

  EventACK,                    /* 138 */

  RequestMonitorNextCall,      /* 139 */
  RequestCancelMonitoring,
  EventMonitoringNextCall,
  EventMonitoringCancelled,

  RequestSetMuteOn,            /* 143 */
  RequestSetMuteOff,
  EventMuteOn,
  EventMuteOff,

  EventDNOutOfService,          /* 147 */
  EventDNBackInService,

  RequestPrivateService,        /* 149 */
  EventPrivateInfo,

  EventBridged, /* added by Epi 7/10/01, ER#23208 */
  EventQueueLogout,                  /* ER#53943 */

  EventReserved_1,              /* 153 */
  EventReserved_2,
  EventReserved_3,
  EventReserved_4,
  EventReserved_5,
  EventReserved_6,
  EventReserved_7,
/*
* Call Monitoring events:
*/
  EventCallCreated,            /* 160 */
  EventCallDataChanged,
  EventCallDeleted,
  EventCallPartyAdded,
  EventCallPartyState,
  EventCallPartyMoved,
  EventCallPartyDeleted,
/*
* Call Monitoring requests:
*/
  RequestStartCallMonitoring,  /* 167 */
  RequestStopCallMonitoring,

  MessageIDMAX
};

Offline Haldane

  • Jr. Member
  • **
  • Posts: 72
  • Karma: 1
Re: Descripton of EventType in VB
« Reply #7 on: October 11, 2006, 09:20:29 AM »
Thanks for your help Genecist... I just wrote my own function for the moment. When I redo the project in VS2005 I'lll try and intergrate the C lib's or I may look at the Genesys .NET server. I just need something quick for the moment.

Thanks Again


Philip Painter

  • Guest
Re: Descripton of EventType in VB
« Reply #8 on: February 22, 2007, 11:20:45 AM »
In .Net if you have any enum you can always use the following, where MessageType is an enum:

MessageType.ToString()


hth