public SipSession(SipUser sipUser, LocalSipUserAgentServer localSipUas, RemoteSipUserAgentServer remoteSipUas) { this.LocalSipUas = localSipUas; this.RemoteSipUas = remoteSipUas; this.TransportManager = new SipTransportManager(LocalSipUas.SipPort, RemoteSipUas.SipServerAddress, RemoteSipUas.SipPort); this.SipMessage = new SipMessage(sipUser, LocalSipUas, TransportManager, SipMethod.INVITE); }
private int DefineSipPortBasedOnProtocol(SipProtocol sipProtocol, LocalSipUserAgentServer localSipUac) { //if (sipProtocol == SipProtocol.sip) return(localSipUac.SipPort); //else // return localSipUac.SipsPort; }
public FromHeader(SipUser sipUser, LocalSipUserAgentServer localSipUas, SipProtocol sipProtocol) : base(localSipUas, sipProtocol) { HeaderPrefix = "From:"; if (!string.IsNullOrWhiteSpace(sipUser.Name)) { this.friendlyName = $"\"{sipUser.Name}\" "; } else { this.friendlyName = string.Empty; } }
private void CreateCommonHeaders(SipUser sipUser, LocalSipUserAgentServer localSipUas, SipTransportManager sipTransportManager) { this.viaHeader = new ViaHeader(localSipUas, sipTransportManager.SipProtocol, sipTransportManager.SipTransport); this.fromHeader = new FromHeader(sipUser, localSipUas, sipTransportManager.SipProtocol); this.toHeader = new ToHeader(localSipUas, sipTransportManager.SipProtocol); this.callIdHeader = new CallIdHeader(); this.contactHeader = new ContactHeader(localSipUas, sipTransportManager.SipProtocol); this.routeHeader = new RouteHeader(localSipUas, sipTransportManager.SipProtocol); this.userAgent = new UserAgentHeader(); this.expiresHeader = new ExpiresHeader(); this.maxForwards = new MaxForwardsHeader(); this.allowHeader = new AllowHeader(); this.contentLength = new ContentLength(body); }
public HeaderBaseWithHash(LocalSipUserAgentServer localSipUas, SipProtocol sipProtocol) : base(localSipUas, sipProtocol) { }
public RequestLine(LocalSipUserAgentServer localSipUas, SipProtocol sipProtocol, SipMethod sipMethod) : base(localSipUas, sipProtocol) { HeaderPrefix = "Request-Line:"; this.sipMethod = sipMethod; }
public RouteHeader(LocalSipUserAgentServer localSipUas, SipProtocol sipProtocol) : base(localSipUas, sipProtocol) { HeaderPrefix = "Route:"; }
public ToHeader(LocalSipUserAgentServer localSipUas, SipProtocol sipProtocol) : base(localSipUas, sipProtocol) { HeaderPrefix = "To:"; }
public SipMessage(SipUser sipUser, LocalSipUserAgentServer localSipUas, SipTransportManager sipTransportManager, SipResponseCode sipResponse) { this.messageType = MessageType.Response; this.statusLine = new StatusLine(localSipUas, sipTransportManager.SipProtocol, sipResponse); CreateCommonHeaders(sipUser, localSipUas, sipTransportManager); }
public SipMessage(SipUser sipUser, LocalSipUserAgentServer localSipUas, SipTransportManager sipTransportManager, SipMethod sipMethod) { this.messageType = MessageType.Request; this.requestLine = new RequestLine(localSipUas, sipTransportManager.SipProtocol, sipMethod); CreateCommonHeaders(sipUser, localSipUas, sipTransportManager); }
public ContactHeader(LocalSipUserAgentServer localSipUas, SipProtocol sipProtocol) : base(localSipUas, sipProtocol) { HeaderPrefix = "Contact:"; }
public HeaderBaseWithSipUri(LocalSipUserAgentServer localSipUas, SipProtocol sipProtocol) { this.Address = localSipUas.Address; this.Port = DefineSipPortBasedOnProtocol(sipProtocol, localSipUas); this.SipProtocol = sipProtocol; }
public StatusLine(LocalSipUserAgentServer localSipUas, SipProtocol sipProtocol, SipResponseCode sipResponse) : base(localSipUas, sipProtocol) { HeaderPrefix = "Status-Line:"; this.sipResponse = sipResponse; }