Discussion:
Getting back a transferred call in TAPI 2.x
(too old to reply)
Jesper Fabricius
2013-09-02 14:45:52 UTC
Permalink
Hello,

I’m developing a TAPI application that must work like a simplified PABX itself: Besides the simple things of accepting/answering/dropping inbound calls and making outbound calls, it may put calls on hold and transfer calls.
However the later procedure of transferring calls leads me to the pesky challenge, since I’m not able to fulfill a basic requirement of the application: It must be possible to transfer back a transferred call!
When the incoming call is transferred to another phone (using lineBlindTransfer) TAPI loses any control with the call.

Following TB20 log shows what happens with my call handle when the transfer is completed (i.e.; the second phone picks up the call):

10:48.52.923 : Calling lineOpen
10:48.52.933 : lineOpen returned SUCCESS
10:49.34.743 : received LINE_CALLSTATE
device=x10266
cbInst=x0
param1=x2, OFFERING
param2=x0,
param3=x4, OWNER
lineGetCallInfo returned x0, hLine=x10299
10:49.40.692 : Calling lineAnswer
10:49.40.732 : lineAnswer returned x10255
10:49.40.732 : received LINE_REPLY
device=x0
cbInst=x0
param1=x10255,
param2=x0,
param3=x0,
10:49.42.284 : received LINE_CALLSTATE
device=x10266
cbInst=x0
param1=x100, CONNECTED
param2=x0,
param3=x0,
10:49.54.161 : Calling lineHold
10:49.54.171 : lineHold returned x10244
10:49.54.181 : received LINE_REPLY
device=x0
cbInst=x0
param1=x10244,
param2=x0,
param3=x0,
10:49.54.922 : received LINE_CALLSTATE
device=x10266
cbInst=x0
param1=x400, ONHOLD
param2=x0,
param3=x0,
10:50.14.551 : Calling lineBlindTransfer
10:50.14.561 : lineBlindTransfer returned x10222
10:50.14.561 : received LINE_REPLY
device=x0
cbInst=x0
param1=x10222,
param2=x0,
param3=x0,
10:50.21.861 : received LINE_CALLSTATE
device=x10266
cbInst=x0
param1=x4000, DISCONNECTED
param2=x1, NORMAL
param3=x0,
10:50.22.362 : received LINE_CALLSTATE
device=x10266
cbInst=x0
param1=x1, IDLE
param2=x0,
param3=x0,
10:50.22.362 : lineGetCallStatus returned SUCCESS

Used PABX: 3CX Phone System
Used TSP: Global IP Tel

So my question is: Is it EVER possible to keep the control of the call handle even after a transfer is completed, so it is possible to transfer it back?
Or should I rather use monitored transfer (lineSetupTransfer / lineDial / lineCompleteTransfer) instead? (Unfortunately my TSP does not support this)
Andreas Marschall [exMVP TAPI]
2013-10-10 08:56:49 UTC
Permalink
Post by Jesper Fabricius
I’m developing a TAPI application that must work like a simplified PABX itself: Besides the simple things of accepting/answering/dropping inbound calls and making outbound calls, it may put calls on hold and transfer calls.
However the later procedure of transferring calls leads me to the pesky challenge, since I’m not able to fulfill a basic requirement of the application: It must be possible to transfer back a transferred call!
When the incoming call is transferred to another phone (using lineBlindTransfer) TAPI loses any control with the call.
Jesper,
that is simply the nature of lineBlindTransfer(). You don't have any control over the call after using it.
Post by Jesper Fabricius
So my question is: Is it EVER possible to keep the control of the call handle even after a transfer is completed, so it is possible to transfer it back?
No, unfortunately not - at least via this line device.
The call handle on this device is useless after transition to LINECALLSTATE_IDLE.

The only thing you can do is to also monitor the line device that the call was transferred to.
There you will find the transferred call in LINECALLSTATE_OFFERING (or LINECALLSTATE_CONNECTED if already answered).
You can then transfer it back or whatever destination is suitable.
Depending on the PBX and TSP implementation you track a transferred call while traveling thorugh the PBX via its LINECALLINFO.dwCallID and/or .dwRelatedCallID.
You may also want to have a look the RedirectionID and RedirectingID strings in LINRCALLINFO to keep track.
Post by Jesper Fabricius
Or should I rather use monitored transfer (lineSetupTransfer / lineDial / lineCompleteTransfer) instead? (Unfortunately my TSP does not support this)
No, after lineCompleteTransfer(...,LINETRANSFERMODE_TRANSFER) you have the very same situation like after lineBlindTransfer().
--
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
* Please post all messages and replies to the group / forum 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.
Jesper Fabricius
2013-10-10 09:58:21 UTC
Permalink
Post by Andreas Marschall [exMVP TAPI]
The only thing you can do is to also monitor the line device that the call was transferred to.
There you will find the transferred call in LINECALLSTATE_OFFERING (or LINECALLSTATE_CONNECTED if already answered).
Where do I find the the ID of that line device?
(I can't see if it should come from the lineBlindTransfer(), the return value is a "positive request identifier" if the function success.)
Post by Andreas Marschall [exMVP TAPI]
Depending on the PBX and TSP implementation you track a transferred call while traveling thorugh the PBX via its LINECALLINFO.dwCallID and/or .dwRelatedCallID.
You may also want to have a look the RedirectionID and RedirectingID strings in LINRCALLINFO to keep track.
I'll try taking a look of this (if they're provided by my TSP).
Andreas Marschall [exMVP TAPI]
2013-10-10 21:36:12 UTC
Permalink
Jesper, you are welcome.
Post by Jesper Fabricius
Post by Andreas Marschall [exMVP TAPI]
The only thing you can do is to also monitor the line device that the call was transferred to.
There you will find the transferred call in LINECALLSTATE_OFFERING (or LINECALLSTATE_CONNECTED if already answered).
Where do I find the the ID of that line device?
(I can't see if it should come from the lineBlindTransfer(), the return value is a "positive request identifier" if the function success.)
You need a 3rd-party TSP for this, i.e. a TSP that supports monitoring multiple / all devices of a PBX.

You don't get a direct reference to the corresponding line device.
You need to search the line device yourself (presumed it is availöable at all).
For this you may want to query all line devices for their LINEADDRESSCAPS and check the Address string whether it is equal to the destination of your transfer.
--
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
* Please post all messages and replies to the group / forum 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.
Loading...