Genesys CTI User Forum > Genesys-related Development
Accessing CME via ActiveX
bublepaw:
Hi Guys,
Some time ago ( 2 years or so ) I wrote configuration synchronizator for A4400 and Genesys. I found COM component called COMCfgManager. It allowed me to manipulate configuration objects ( create, delete, update ) in configuration database. As far as I know it is unsupported but it works as this is foundation for all wizards. Here is sample code to log in to CME. When I find the rest of this project I will post some more usefull demo
Dim y As COMCFGMGRLib.COMCfgManager
Set y = New COMCfgManager
y.Connect "GenesysCore01", "9020", CFGSCE, "default", "default", "password"
y.Disconnect
Set y = Nothing
One more thing this api is very memory consuming under .NET
PS.
In Platform SDK there is separate class for communicating directly with OCS. Also on gendev there is sample how to use it to build web base OCM.
dbudi:
Hi bublepaw,
I am trying to make a function to change password in CME using ActiveX app - because our project deployment does not allow installing CME to every agent just for changing password only.
Is this possible using COMCfgManager? If you have a sample code pls post it here.
Many thanks in advance
victor:
I don't think you can actually pro-actively change something using ActiveX in CME. At least I did not know you could, because I was under the impression it was a read-only component.
If you figure out how to do it, can you please share it with the rest of us?
Best regards,
Vic
bublepaw:
Hi,
I didn't find old code but luckily I've managed to recreate some simple operations. First of all program is based on "COMCfgMgr 1.4.1 Type Library" which is instaled with wizards ( by default in \Program Files\Common Files\GCTI\CFG Wizards y.x ).
All samples are C# because I don't have VB6 installed but it should be fairly easy to convert them to VB
1) Changing password
--- Code: ---
{
COMCFGMGRLib.COMCfgManagerClass server = new COMCFGMGRLib.COMCfgManagerClass();
server.Connect("server", "port", COMCFGMGRLib._CfgAppType.CFGSCE, "default", "user", "password");
// this line is need if You don't want to use standard genesys window for changing password
server.UseGUIElements = 0;
server.ChangePassword("old password", "new password");
server.Disconnect();
}
--- End code ---
2) Finding some object
--- Code: ---
{ COMCFGMGRLib.COMCfgManagerClass server = new COMCFGMGRLib.COMCfgManagerClass();
server.Connect("server", "port", COMCFGMGRLib._CfgAppType.CFGSCE, "default", "user", "password");
COMCFGMGRLib.ICfgQuery query = server.CreateQuery();
// what we want to find
query.ObjectType = COMCFGMGRLib.enum_COMCfgObjectType.COMCFGApplication;
// some filters to narrow search
object value;
// we will be searching for all OCS servers
value = ( object )COMCFGMGRLib._CfgAppType.CFGCMServer;
query.AddFilterValue(COMCFGMGRLib._CfgFilterType.FILTER_APP_TYPE , ref value);
// 1,0 - wait for query to finish for infinity
query.Execute(1, 0);
if (query.Count > 0) {
// we found something
// result is 1 based array
for (int i = 1; i <= query.Count ;i++) {
COMCFGMGRLib.ICfgObject foundObject = (COMCFGMGRLib.ICfgObject)query[i];
Console.WriteLine(" Object :{0} dbid = {1} ", foundObject.Name, foundObject.DBID);
}
}
server.Disconnect();
}
--- End code ---
I will post soon some other samples for changing data.
Victor - as for changing object - this api is internaly used by all wizards so it must be able to change data in configserver :)
Paul
dbudi:
Hi bublepaw,
Thanks for your sample code. I will try the ChangePassword() method. Looking at the class method, there seems to be no return value to check if the change password is successful or not.. but still a very good solution for web based CTI app. Great code!
Regards,
Navigation
[0] Message Index
[#] Next page
Go to full version