Example #1
0
        private void InitializeRainbowSDK()
        {
            rainbowApplication = new Rainbow.Application();;

            // Set Application Id, Secret Key and Host Name
            rainbowApplication.SetApplicationInfo(APP_ID, APP_SECRET_KEY);
            rainbowApplication.SetHostInfo(HOST_NAME);

            // Get Rainbow main objects
            rainbowTelephony = rainbowApplication.GetTelephony();
            rainbowContacts  = rainbowApplication.GetContacts();

            // EVENTS WE WANT TO MANAGE SOME EVENTS
            rainbowApplication.ConnectionStateChanged += RainbowApplication_ConnectionStateChanged;

            rainbowTelephony.TelephonyStatusUpdated     += RainbowTelephony_TelephonyStatusUpdated;
            rainbowTelephony.CallForwardStatusUpdated   += RainbowTelephony_CallForwardStatusUpdated;
            rainbowTelephony.NomadicStatusUpdated       += RainbowTelephony_NomadicStatusUpdated;
            rainbowTelephony.VoiceMessagesNumberUpdated += RainbowTelephony_VoiceMessagesNumberUpdated;

            rainbowTelephony.CallUpdated += RainbowTelephony_CallUpdated;
            rainbowTelephony.CallFailed  += RainbowTelephony_CallFailed;

            // Init other objects
            voiceMessagesList = null;

            pbxCall1 = null;
            pbxCall2 = null;
        }