Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: ghoo on March 31, 2017, 08:27:44 AM

Title: configSDK | try to create person ... And got a problem
Post by: ghoo on March 31, 2017, 08:27:44 AM
Hello Everybody,
I have been spending hours and hours trying the .net SDK. I am ma newbie with it and it is very very difficult to find informations :-[

I am trying to create a person and the conf server always reply me .

[color=red]10:22:07.422 Trc 04541 Message MSGCFG_ADDOBJECT received from 372 (SCE 'default')
10:22:07.422 Std 23500 Configuration Server Error : Error  [CFGObjectPackingError], object [], property [Unknown] Description Failure to unpack the attribute [DBID], type : [CfgPerson], DBID : [0]
10:22:07.422 Trc 04542 Message MSGCFG_ERROR sent to 372 (SCE 'default')[/color]

  MSGCFG_ERROR
  attr: IATRCFG_ERRORCODE          value:  25
  attr: SATRCFG_DESCRIPTION        value:  "Failure to unpack the attribute [DBID], type : [CfgPerson], DBID : [0]" 
  attr: IATRCFG_REQUESTID          value:  4[/color]

The xml I use is below. I found here a topic about this but that DBID problem makes me crazy.
Would someone have an idea about this ?

[color=orange]XmlReader reader = XmlReader.Create( "d:\\coucou.xml");
System.Xml.Linq.XDocument doc;
RequestCreateObject requestCreateObject = RequestCreateObject.Create((int)CfgObjectType.CFGPerson, doc);
IMessage msg = protocol.Request(requestCreateObject);[/color]

<?xml version="1.0" encoding="utf-8" ?>
<ConfData>
<CfgPerson>
<tenantDBId value="101" />
<lastName value="Name" />
<firstName value="My" />
<employeeID value="001" />
<userName value="001" />
<password value="FF" />
<isAgent value="2" />
<CfgAgentInfo>
<placeDBID value="112" />
<capacityRuleDBID value="0" />
<siteDBID value="0" />
<contractDBID value="0" />
</CfgAgentInfo>
<isAdmin value="1" />
<state value="1" />
<emailAddress value="My.Name@my.host.com" />
</CfgPerson>
</ConfData>
Title: Re: configSDK | try to create person ... And got a problem
Post by: PeteHoyle on March 31, 2017, 11:14:07 AM
Hi,

Try using the Config Object Model (COM) Application Block, it is much easier than trying to form the xml.

                [code]
                CfgTenantQuery qTenant = new CfgTenantQuery();
                qTenant.Dbid = 1;
                CfgTenant tenant = confService.RetrieveObject<CfgTenant>(qTenant);

                CfgPlaceQuery pQuery = new CfgPlaceQuery();
                pQuery.Dbid = 1361;
                CfgPlace place = confService.RetrieveObject<CfgPlace>(pQuery);


                CfgPerson myPerson = new CfgPerson(confService);
                myPerson.FirstName = "My";
                myPerson.LastName = "Name";
                myPerson.EmployeeID = "001";
                myPerson.EmailAddress = "My.Name@my.host.com";
                myPerson.UserName = "001";
                myPerson.Tenant = tenant;
                myPerson.IsAgent = CfgFlag.CFGTrue;
                myPerson.Save();
                myPerson.AgentInfo.Place = place;
                myPerson.Save();[/code]
Title: Re: configSDK | try to create person ... And got a problem
Post by: ghoo on March 31, 2017, 02:49:20 PM
great ! i am unlocked.  :D thanks a lottt