コード例 #1
0
        public PresenceApiIntegerResult RegisterEndPoint(string sessionId, int expiration, string address = null)
        {
            registerEndPoint registrationMessage = new registerEndPoint
            {
                expiration = fixExpiration(expiration),
                url        = (string.IsNullOrEmpty(address) ? callbckServerAddress : address)
            };

            return(performEndPointRegistration(sessionId, registrationMessage));
        }
コード例 #2
0
        public PresenceApiIntegerResult ExtendEndpointRegistration(string sessionId, int endPointId, int expiration)
        {
            registerEndPoint registrationMessage = new registerEndPoint
            {
                expiration = fixExpiration(expiration),
                endPointID = endPointId
            };

            return(performEndPointRegistration(sessionId, registrationMessage));
        }
コード例 #3
0
        private PresenceApiIntegerResult performEndPointRegistration(string sessionId, registerEndPoint registrationMessage)
        {
            PresenceApiIntegerResult result = new PresenceApiIntegerResult();

            try
            {
                registerEndPointResponse endpointRes = server.registerEndPoint(sessionId, registrationMessage);
                result.IntegerId  = endpointRes.endPointID;
                result.ResultCode = GenericPresenceApiResultCode.Success;
            }
            catch (FaultException f)
            {
                log("API error during registerEndPoint: " + f.Message, 2);
                result.ResultCode = GenericPresenceApiResultCode.ApiFault;
            }
            catch (CommunicationException c)
            {
                log("Communication error: " + c.Message, 2);
                result.ResultCode = GenericPresenceApiResultCode.CommunicationError;
            }
            return(result);
        }