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)); }
public PresenceApiIntegerResult ExtendEndpointRegistration(string sessionId, int endPointId, int expiration) { registerEndPoint registrationMessage = new registerEndPoint { expiration = fixExpiration(expiration), endPointID = endPointId }; return(performEndPointRegistration(sessionId, registrationMessage)); }
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); }