Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ACD agent login with lineSetAgentGroup

26 views
Skip to first unread message

Thomas Marotzki

unread,
Nov 12, 2009, 9:50:53 AM11/12/09
to
Hello,

I really need help! Recently, my boss decided that it would be a great idea
to have some special customized super-duper
piece of software to better control our telephone agents and selected me to
program that. - Well. I'm the sysadmin, not a programmer and I have no
experience with the Tapi interface and the last windows version, I did some
programming for, must have been Windows 3.1. But I won't complain...

And after all, I think I really made some progress until
now: I'm able to do several things with TAPI. Initialization and line
opening are okay. Dialling, setting 'ready'/'not ready', giving reason codes
and even logging out, work like a charm. But when I try to use
lineSetAgentGroup to login an agent, I always get "operation failed", no
matter what I try. The same thing is absolutely no problem, when I use
Julmar's fabulous phone.exe. Our PBX is a Nortel Meridian 61C with Symposium
5 and Nortel Tapi Provider (including ACD proxy service).

PLEASE, can someone look at my code and tell me what I'm
missing? Btw. the line is opened with owner privileges.

ANY help/suggestion is very appreciated!


Thanks in advance,

Thomas Marotzki

// ---------------------------------------------------

long testTAPI::agentLogin (/* TCHAR* tszAgtID */)
{
TCHAR tszAgtID[] = L"1234";
DWORD dwAgtIdSize = (lstrlen(tszAgtID)+1)*sizeof(TCHAR);

DWORD dwGLSize = sizeof (LINEAGENTGROUPLIST)
+ sizeof (LINEAGENTGROUPENTRY)
+ dwAgtIdSize;

LPLINEAGENTGROUPLIST pAGList;
LPLINEAGENTGROUPENTRY pAGEntry;

pAGList= (LPLINEAGENTGROUPLIST) calloc (1, dwGLSize);

pAGList->dwTotalSize = dwGLSize;
pAGList->dwUsedSize = dwGLSize;
pAGList->dwNeededSize = dwGLSize;
pAGList->dwNumEntries = 1;
pAGList->dwListOffset = sizeof (LINEAGENTGROUPLIST);
pAGList->dwListSize = sizeof (LINEAGENTGROUPENTRY)
+ dwAgtIdSize;

pAGEntry = (LPLINEAGENTGROUPENTRY) ((LPBYTE) pAGList
+ pAGList->dwListOffset);
pAGEntry->GroupID.dwGroupID1 = 0;
pAGEntry->GroupID.dwGroupID2 = 0;
pAGEntry->GroupID.dwGroupID3 = 0;
pAGEntry->GroupID.dwGroupID4 = 0;
pAGEntry->dwNameOffset = sizeof (LINEAGENTGROUPENTRY);
pAGEntry->dwNameSize = dwAgentIdSize;

lstrcpy ((LPTSTR) ( (LPBYTE) pAGList
+ pAGList->dwListOffset
+ pAGEntry->dwNameOffset),
tszAgentID);

/* -> privHLine defined elsewhere (by 'lineOpen')
-> privDwAddressID defined elsewhere (is: 0x01) */

long lResult = lineSetAgentGroup (privHLine,
privDwAddressID,
pAgentGroupList);

return lResult;
}

// ---------------------------------------------------

url:http://www.ureader.com/gp/1481-1.aspx

Andreas Marschall [exMVP TAPI]

unread,
Nov 12, 2009, 11:45:15 AM11/12/09
to
"Thomas Marotzki" <t...@nullspam.com> schrieb im Newsbeitrag
news:f23a2c9902c84efb...@newspe.com...

> But when I try to use
> lineSetAgentGroup to login an agent, I always get "operation failed", no
> matter what I try. The same thing is absolutely no problem, when I use
> Julmar's fabulous phone.exe.

Thomas,
in case you don't know: the JulMar TAPI tools are all available with open
source.
So you may just want to compare what you do and what Phone.exe does.
There is another JulMar TAPI tool named Agent.exe that might be of interest
too.

--
Best Regards
Andreas Marschall
Microsoft MVP for TAPI / Windows SDK / Visual C++ 2003-2008
TAPI / TSP Developer and Tester
My TAPI and TSPI FAQ:
http://www.I-B-A-M.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm
My Toto� Tools (a collection of free, mostly TAPI related tools):
http://www.i-b-a-m.de/Andreas_Marschall's_Toto_Tools.htm
TAPI development around the world (Frappr! map):
http://www.frappr.com/TAPIaroundTheWorld
* Please post all messages and replies to the newsgroup so all may
* benefit from the discussion. Private mail is usually not replied to.
* This posting is provided "AS IS" with no warranties, and confers no
rights.

tmaro

unread,
Nov 12, 2009, 1:50:19 PM11/12/09
to
On 12 Nov., 17:45, "Andreas Marschall [exMVP TAPI]"
<Andreas.Marsch...@I-B-A-M.de> wrote:

> Thomas,
> in case you don't know: the JulMar TAPI tools are all available with open
> source.
> So you may just want to compare what you do and what Phone.exe does.
> There is another JulMar TAPI tool named Agent.exe that might be of interest
> too.

Hello Andreas,

thnk you for your quick reply. Yes I've looked at these sources. But
I'm
afraid, I can't see any significant differences. Furthermore because
Julmar uses all those MFC things, I can not compile these sources
and go step by step through the program. That would have
most certainly lead me to the solution of my problem. :-(

As far as I can see, all I've got to do is:

- call lineInitializeEx()

- call lineOpen()

- prepare the data block, constisting of a LineAgentGroupList directly
followed by
one LineAgentGroupEntry, directly followed by one cstring containing
the login id

- call lineSetAgentGroup()

But that doesn't seam to work at all. Is there any additional
requirement
for lineSetAgentGroup? When all the other things (like
lineSetAgentState) work ok,
then my initialization (with hidden window option) must have been
correct (?).

When I use Julmar's programs, I'm also able to see the Login/Logout
messages
in my own callback procedure.

What can I do?

Best regards,

Thomas Marotzki

dev

unread,
Nov 13, 2009, 3:54:02 AM11/13/09
to

Thomas,

I can see three things that are different from our code, which has
been successfully logging into Nortel phones since the year 2000 :
- Firstly, we allow an extra byte throughout for the null terminator
on the end of the user id.
- Secondly, we found that dwNameOffset is an offset from the beginning
of the group list, not the group entry. Strange, but true.
- Lastly, we always use the address id 0 in the call to
lineSetAgentGroup, though that may be dependent on the configuration
of your system. This is because you need to log into the ACD address
for your phone, not the direct dial address.


So you can compare for yourself, this is the code we use ...
First I create a struct to encompass the group list and group entry :

typedef struct
{
LINEAGENTGROUPLIST group_list;
LINEAGENTGROUPENTRY group_entry;
char extra[256];
}
LINEAGENTGROUPDATA, *PLINEAGENTGROUPDATA;

Then this actually performs the login :

LINEAGENTGROUPDATA lagd;
memset( &lagd, 0, sizeof(lagd) );
// Fill in group list
lagd.group_list.dwTotalSize = sizeof(lagd);
lagd.group_list.dwNumEntries = 1;
lagd.group_list.dwListSize = sizeof(LINEAGENTGROUPENTRY);
lagd.group_list.dwListOffset = sizeof(LINEAGENTGROUPLIST);
// Fill in the one and only group entry
lagd.group_entry.dwNameSize = strlen(szUserId) + 1;
lagd.group_entry.dwNameOffset = sizeof(LINEAGENTGROUPLIST) + sizeof
(LINEAGENTGROUPENTRY);
strcpy( lagd.extra, szUserId );
// Perform the remote login
lTapiResult = ::lineSetAgentGroup( hLine, 0, &lagd.group_list );


Hopefully, this should get you working.

Regards,

Tim Dale
BRE

dev_@_cav_en_dish._co._uk
(remove underscores to use email address)

tmaro

unread,
Nov 13, 2009, 5:37:52 AM11/13/09
to
Hello Tim!

Splendid: now it's working! I made two mistakes:

1. As you said, the name offset is measured from the beginning
of the group list, not from the group entry.

2. The proxy handler seams to persist on ASCII (not wchar)
strings.

Thank you so much, you saved my weekend!

Best regards,

Thomas Marotzki

0 new messages