Answered Lync 2010 - Detect a call transfer

  • Monday, August 27, 2012 4:09 PM
     
     

    I have the following scenario:

    • User 1: Running a custom Lync Client (Lync is in UISuppressionMode)
    • User 2: Running the Microsoft Lync Client
    • User 3: Running the Microsoft Lync Client

    User 1 -> Calls -> User 2 -> Answers -> User 2 -> Transfer call to -> User 3

    Below is the states table I developed after getting the avModality state changes and the Conversation state changes.

    As soon as User 3 picks up the call, avModality goes to Disconnected state, the Conversation is also Terminated. Not in any of the tests I've done, the state was "Transferring" or any other state indicative of a call transfer.

    I'm writing a custom wrapper for the Lync SDK and would like to be able to detect a call transfer from the responding user. 

    Please advise,


    • Edited by BassemDy Monday, August 27, 2012 4:12 PM layout fix
    •  

All Replies

  • Tuesday, August 28, 2012 10:58 AM
     
     

    Hello BassemDy,

    you are right, the call workflow in case of different kinds of transfers (albeight, "blind", supervised, and so on) is not straightworward and documented in Lync Client reference. I've built also a wrapper classes around Lync SDK to circumvent this. To be short, in your particular case, you should check for "Notified" and "Connected" states in case of user3 with a checkup whether is call being transferred to him; for user2, you should check for "Transferring" AVModality state.

    Please refer to my blog posts for details:

    http://rcosic.wordpress.com

    Kind regards,
    Ratko.

  • Tuesday, August 28, 2012 7:04 PM
     
     

    Hi Ratko,

    Thank you for the response, I already found your blog posts regarding Lync SDK implementation previously through a google search, and they are highly informative and very well written. Thank you for those :)

    However, my concern is with the custom lync client User 1 is using, I need to detected whenever user 2 transfers the call to user 3 so that I can maybe show a message for User 1 that his call is currently being transferred.

    The avModality state changes from onHold to Disconnected after user 3 picks up the transferred call and this is exactly where my problem starts, how will I know that a new call was established or was completely dropped?!

    Either way the avModality or Conversation states stop changing after user 3 picks up the transferred call which is quite weird...

    The sample application addressed this issue by completely terminating the conversation window and initializing a new one as if it's a new call, but this doesn't work with my custom client at all...

    Best Regards,

    Bassem

  • Wednesday, August 29, 2012 8:13 AM
     
     Proposed Answer

    Hello BassemDy,

    I see. This is the workflow seen from the user1 (in scenario: user1 -> user2, user2 press hold, user2 -> user3, user2 transfers the call to user1):

    - new conversation
    - AV.Connecting (there you should know that it is outgoing call to user2)
    - C.Active
    - AV.Joining
    - AV.Connected
    - C.Inactive
    - *AV.Connecting (there you should know that it is the same call but transferred to you - I'll tell you how!)
    - C.Active
    - AV.Joining
    - AV.Connected

    At the marked point, you shoud check for this property: ParticipantProperty.ReferredByUri, and this will clearly indicate that the call is originally transferred to you.

    I don't know why you have conversation closed when user3 picks up the call. Please explain your workflow in more detail, so I can tell you where is the problem.

    Kind regards,
    Ratko.

  • Wednesday, August 29, 2012 8:13 PM
     
     

    Great yet this still doesn't help me with my scenario:

    user1 -> calls user2 -> user 2 transfers the call to user3

    I want user1 to detect the call transfer from user2 to user3!

    Best Regards,

    Bassem

    • Edited by BassemDy Wednesday, August 29, 2012 8:14 PM
    •  
  • Thursday, August 30, 2012 7:16 AM
     
     Answered

    Hello Bassem,

    Ah, this would not be possible, at least on the client side. You should use UCMA 3.0 SDK and build some kind a 'bot' or service which will monitor the calls and act like a 'user agent'. It will also need to communicate with your custom Lync client app (by your preferred method - I'm using TCP connection) to be able to notify your application that a call has been transferred. This is similar scenario to 'call pickup' - the feature not yet implemented in Lync (except for team call which is somekind different), when you should be aware that someone of your team mates got call offering.

    Kind regards,
    Ratko.

  • Friday, August 31, 2012 8:47 AM
     
     

    Hi Ratko,

    Thank you for constant highly appreciated feedback!

    Using the UCMA SDK to create a bot service is a major design and architecture change which I cannot go through at this point in time. 

    One last question before marking your previous reply as the answer. Why does my avModality state change to Disconnected and ConversationState change to Terminated after user3 picks up the call transferred by user2? Shouldn't the new states be Connected and Active? How does the Microsoft Lync client handle these call transfers?!!

    Best Regards,

    Bassem

  • Friday, August 31, 2012 9:29 AM
     
     Answered

    Hello Bassem,

    This shouldn't the case on the side of user1, but true from the perspective of user2. For user1, the very same call is transferred to someone else, and there these events shouldn't take place (I'm not certain why you have this behavior - I don't). For user2, these are two calls that he has to mediate - first, incoming from user1, and second, outgoing to user3, so in his case, he closes one call and transfers it to another. For user3, it should be as with user1, so no disconnecting in between. Maybe there are some environment settings you have to set on your Lync server - please try to use Lync logging tool or some other sip tracker to debug it and see what really happens.

    Kind regards,
    Ratko.

    • Marked As Answer by BassemDy Friday, August 31, 2012 9:32 AM
    •  
  • Friday, August 31, 2012 9:32 AM
     
     
    Amazing, thank you very much!