kukidon
kukidon

Reputation: 21

Lync SDK ModalityStateChanged status codes

I write program which uses lync 2013 via Lync 2013 SDK. I call (audio) to another users and I need to automatically detect the end of my call (drop after answered, voice mail, reject, no answer, invalid number). I use event of class AVModality ModalityStateChanged(object sender, ModalityStateChangedEventArgs e). Event data has NewState property of ModalityState enum type (which have only disconnect for the end of call), OldState property (the same type) and StatusCode property. I think if I want to detect the reason of the end of the call I should know possible status codes. Where can I find it? Or maybe there is another way to detect reason of the end of call Thanks.

private void ModalityStateChanged(object sender, ModalityStateChangedEventArgs e)
    {
        if (e.NewState == ModalityState.Disconnected && e.StatusCode == 1/*Status code*/)
        {
            //No answer. Do something

        }
        if (e.NewState == ModalityState.Disconnected && e.StatusCode == 2/*Status code*/)
        {
            //Voice mail. Do something

        }
    }

Upvotes: 2

Views: 254

Answers (0)

Related Questions