c# - Return new incoming call uri -
i'm using simple code incoming call , uri of caller. if user have multiple lync sessions open return first 1 because of static index. how i'm able new connection index proper uri of caller?
imports microsoft.lync.model imports microsoft.lync.model.conversation imports lync = microsoft.lync.model.conversation public class mylync private _lyncclient lyncclient public withevents _conversationmgr microsoft.lync.model.conversation.conversationmanager public withevents _conv conversation private sub form1_load(sender object, e eventargs) handles mybase.load try _lyncclient = lyncclient.getclient() _conversationmgr = _lyncclient.conversationmanager catch ex exception end try end sub private sub _conversationmgr_conversationadded(byval sender object, byval e microsoft.lync.model.conversation.conversationmanagereventargs) handles _conversationmgr.conversationadded addhandler e.conversation.modalities(modalitytypes.audiovideo).modalitystatechanged, addressof avmodalitystatechanged end sub private sub avmodalitystatechanged(byval sender object, byval e modalitystatechangedeventargs) select case e.newstate case modalitystate.notified dim uri = _conversationmgr.conversations.item(0).participants.item(1).contact.uri end select end sub
in avmodalitystatechanged(byval sender object, byval e modalitystatechangedeventargs)
sender
parameter can cast type avmodality
there can access participant.
excuse c# like:-
private void participant_modalitystatechanged(object sender, modalitystatechangedeventargs e) { if (e.newstate == modalitystate.connected) { var modality = (avmodality) sender; var participant = modality.participant; var uri = participant.contact.uri; } }
Comments
Post a Comment