예제 #1
0
 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;
 }
예제 #3
0
        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;
            }
        }
예제 #4
0
 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);
 }
예제 #5
0
 public HeaderBaseWithHash(LocalSipUserAgentServer localSipUas, SipProtocol sipProtocol) : base(localSipUas, sipProtocol)
 {
 }
예제 #6
0
 public RequestLine(LocalSipUserAgentServer localSipUas, SipProtocol sipProtocol, SipMethod sipMethod) : base(localSipUas, sipProtocol)
 {
     HeaderPrefix   = "Request-Line:";
     this.sipMethod = sipMethod;
 }
예제 #7
0
 public RouteHeader(LocalSipUserAgentServer localSipUas, SipProtocol sipProtocol) : base(localSipUas, sipProtocol)
 {
     HeaderPrefix = "Route:";
 }
예제 #8
0
 public ToHeader(LocalSipUserAgentServer localSipUas, SipProtocol sipProtocol) : base(localSipUas, sipProtocol)
 {
     HeaderPrefix = "To:";
 }
예제 #9
0
 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);
 }
예제 #10
0
 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);
 }
예제 #11
0
 public ContactHeader(LocalSipUserAgentServer localSipUas, SipProtocol sipProtocol) : base(localSipUas, sipProtocol)
 {
     HeaderPrefix = "Contact:";
 }
예제 #12
0
 public HeaderBaseWithSipUri(LocalSipUserAgentServer localSipUas, SipProtocol sipProtocol)
 {
     this.Address     = localSipUas.Address;
     this.Port        = DefineSipPortBasedOnProtocol(sipProtocol, localSipUas);
     this.SipProtocol = sipProtocol;
 }
예제 #13
0
 public StatusLine(LocalSipUserAgentServer localSipUas, SipProtocol sipProtocol, SipResponseCode sipResponse) : base(localSipUas, sipProtocol)
 {
     HeaderPrefix     = "Status-Line:";
     this.sipResponse = sipResponse;
 }