public static String GetDisplayName(String uri) { String displayname = null; if (!String.IsNullOrEmpty(uri)) { Contact contact = UriUtils.ServiceManager.ContactService.ContactFind(uri); if (contact != null && (displayname = contact.DisplayName) != null) { return displayname; } SipUri sipUri = new SipUri(uri); if (sipUri.isValid()) { displayname = sipUri.getUserName(); } sipUri.Dispose(); } return (displayname == null ? uri : displayname); }
public bool call(SipUri remoteUri, twrap_media_type_t media, ActionConfig config) { bool ret = tinyWRAPPINVOKE.CallSession_call__SWIG_2(swigCPtr, SipUri.getCPtr(remoteUri), (int)media, ActionConfig.getCPtr(config)); return ret; }
public bool callMsrp(SipUri remoteUri) { bool ret = tinyWRAPPINVOKE.MsrpSession_callMsrp__SWIG_3(swigCPtr, SipUri.getCPtr(remoteUri)); return ret; }
public bool setToUri(SipUri toUri) { return(tinyWRAPPINVOKE.SipSession_setToUri__SWIG_1(this.swigCPtr, SipUri.getCPtr(toUri))); }
internal static HandleRef getCPtr(SipUri obj) { return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr); }
// very dirty public static String GetValidPhoneNumber(String uri) { if (uri != null && (uri.StartsWith("sip:") || uri.StartsWith("sip:") || uri.StartsWith("tel:"))) { SipUri sipUri = new SipUri(uri); if (sipUri.isValid()) { String userName = sipUri.getUserName(); if (userName != null) { try { String scheme = sipUri.getScheme(); if (scheme != null && scheme.Equals("tel")) { userName = userName.Replace("-", ""); } long result = Convert.ToInt64(userName.StartsWith("+") ? userName.Substring(1) : userName); if (result < UriUtils.MAX_PHONE_NUMBER) { return userName; } } catch (FormatException ) { } catch (Exception e) { LOG.Error(e); } } } sipUri.Dispose(); } else { try { uri = uri.Replace("-", ""); long result = Convert.ToInt64(uri.StartsWith("+") ? uri.Substring(1) : uri); if (result < UriUtils.MAX_PHONE_NUMBER) { return uri; } } catch (FormatException ) { } catch (Exception e) { LOG.Error(e); } } return null; }
public bool setToUri(SipUri toUri) { bool ret = tinyWRAPPINVOKE.SipSession_setToUri__SWIG_1(swigCPtr, SipUri.getCPtr(toUri)); return(ret); }
public bool callVideo(SipUri remoteUri, ActionConfig config) { bool ret = tinyWRAPPINVOKE.CallSession_callVideo__SWIG_2(swigCPtr, SipUri.getCPtr(remoteUri), ActionConfig.getCPtr(config)); return ret; }
public bool callVideo(SipUri remoteUri, int mediaAttr, ActionConfig config) { return(tinyWRAPPINVOKE.CallSession_callVideo__SWIG_2(this.swigCPtr, SipUri.getCPtr(remoteUri), mediaAttr, ActionConfig.getCPtr(config))); }
public bool callAudioVideo(SipUri remoteUri, int mediaAttr) { return(tinyWRAPPINVOKE.CallSession_callAudioVideo__SWIG_3(this.swigCPtr, SipUri.getCPtr(remoteUri), mediaAttr)); }
public bool call(SipUri remoteUri, twrap_media_type_t media, int mediaAttr) { return(tinyWRAPPINVOKE.CallSession_call__SWIG_3(this.swigCPtr, SipUri.getCPtr(remoteUri), (int)media, mediaAttr)); }
public bool callAudioVideo(SipUri remoteUri, ActionConfig config) { bool ret = tinyWRAPPINVOKE.CallSession_callAudioVideo__SWIG_2(swigCPtr, SipUri.getCPtr(remoteUri), ActionConfig.getCPtr(config)); return(ret); }
public bool callAudio(SipUri remoteUri) { bool ret = tinyWRAPPINVOKE.CallSession_callAudio__SWIG_3(swigCPtr, SipUri.getCPtr(remoteUri)); return(ret); }
public bool call(SipUri remoteUri, twrap_media_type_t media) { bool ret = tinyWRAPPINVOKE.CallSession_call__SWIG_3(swigCPtr, SipUri.getCPtr(remoteUri), (int)media); return(ret); }
public bool call(SipUri remoteUri, twrap_media_type_t media) { bool ret = tinyWRAPPINVOKE.CallSession_call__SWIG_3(swigCPtr, SipUri.getCPtr(remoteUri), (int)media); return ret; }
public bool callMsrp(SipUri remoteUri, ActionConfig config) { return(tinyWRAPPINVOKE.MsrpSession_callMsrp__SWIG_2(this.swigCPtr, SipUri.getCPtr(remoteUri), ActionConfig.getCPtr(config))); }
public bool callAudioVideo(SipUri remoteUri) { bool ret = tinyWRAPPINVOKE.CallSession_callAudioVideo__SWIG_3(swigCPtr, SipUri.getCPtr(remoteUri)); return ret; }
public bool callMsrp(SipUri remoteUri) { return(tinyWRAPPINVOKE.MsrpSession_callMsrp__SWIG_3(this.swigCPtr, SipUri.getCPtr(remoteUri))); }
private rlsservices CreateRLSDocument() { rlsservices rls = new rlsservices(); rls.service = new serviceType[] { // RCS service this.CreatePresenceService(SpecialNames.SHARED_RCS), // OMA services this.CreatePresenceService(SpecialNames.SHARED_OMA_BUDDYLIST), this.CreatePresenceService(SpecialNames.SHARED_OMA_POCBUDDYLIST) }; String documentUrl; lock (this.xcapSelector) { this.xcapSelector.reset(); this.xcapSelector.setAUID(XcapService.XCAP_AUID_IETF_RLS_SERVICES_ID); documentUrl = this.xcapSelector.getString(); } byte[] payload = this.Serialize(rls, true, true, this.GetSerializerNSFromAUID(XcapService.XCAP_AUID_IETF_RLS_SERVICES_ID)); MyXcapMessage xcapMessage = this.xcapStack.PutDocument(documentUrl, payload, (uint)payload.Length, XcapService.XCAP_AUID_IETF_RLS_SERVICES_MIME_TYPE); if (xcapMessage != null) { if (XcapService.IsSuccessCode(xcapMessage.Code)) { return rls; } else if (xcapMessage.Content != null && xcapMessage.Code == 409/*Conflict*/ || xcapMessage.Code == 415/*Unsupported Media Type*/) { object content = this.Deserialize(xcapMessage.Content, typeof(xcaperror)); xcaperror xerror; if (content != null && ((xerror = content as xcaperror) != null)) { LOG.Error(String.Format("XCAP Error={0}", xerror.ErrorPhrase)); if (xerror.ErrorType == xcaperror.xcaperrorItemType.ErrorElementUniquenessfailure) { xcaperrorErrorelementUniquenessfailure errorUniquenessfailure = xerror.Item as xcaperrorErrorelementUniquenessfailure; if (errorUniquenessfailure != null && errorUniquenessfailure.exists != null && errorUniquenessfailure.exists.Length > 0) { xcaperrorErrorelementUniquenessfailureExists errorUniquenessfailureExists = errorUniquenessfailure.exists[0]; if (errorUniquenessfailureExists != null) { String field = errorUniquenessfailureExists.field; String altvalue = (errorUniquenessfailureExists.altvalue != null && errorUniquenessfailureExists.altvalue.Length > 0) ? errorUniquenessfailureExists.altvalue[0] : null; if (String.IsNullOrEmpty(altvalue)) { SipUri sipUri = new SipUri(this.xcapStack.XUI); if (sipUri.isValid()) { altvalue = String.Format(CultureInfo.CurrentCulture, "{0}:{1}_alt{2}", sipUri.getScheme(), sipUri.getUserName(), DateTime.Now.Ticks); } else { altvalue = "sip:[email protected]"; } } rls.service[0].uri = altvalue; payload = this.Serialize(rls, true, true, this.GetSerializerNSFromAUID(XcapService.XCAP_AUID_IETF_RLS_SERVICES_ID)); xcapMessage = this.xcapStack.PutDocument(documentUrl, payload, (uint)payload.Length, XcapService.XCAP_AUID_IETF_RLS_SERVICES_MIME_TYPE); if (xcapMessage != null && XcapService.IsSuccessCode(xcapMessage.Code)) { return rls; } } } } } } } return null; }
internal static HandleRef getCPtr(SipUri obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }
public bool setToUri(SipUri toUri) { bool ret = tinyWRAPPINVOKE.SipSession_setToUri__SWIG_1(swigCPtr, SipUri.getCPtr(toUri)); return ret; }
public bool callMsrp(SipUri remoteUri) { bool ret = tinyWRAPPINVOKE.MsrpSession_callMsrp__SWIG_3(swigCPtr, SipUri.getCPtr(remoteUri)); return(ret); }