예제 #1
0
        public SIPB2BUserAgentCore(SIPTransport sipTransport, GetB2BDestinationDelegate getDestination)
        {
            if (sipTransport == null)
            {
                throw new ArgumentNullException(nameof(sipTransport));
            }
            else if (getDestination == null)
            {
                throw new ArgumentNullException(nameof(getDestination));
            }

            _sipTransport   = sipTransport;
            _getDestination = getDestination;
            _sipCallManager = new SIPCallManager(_sipTransport, null);
        }
예제 #2
0
        public SIPHostedService(ILogger <SIPHostedService> logger, IConfiguration config)
        {
            Logger        = logger;
            Configuration = config;

            _sipTransport     = new SIPTransport();
            _bindingsManager  = new SIPRegistrarBindingsManager(MAX_REGISTRAR_BINDINGS);
            _registrarCore    = new RegistrarCore(_sipTransport, false, false);
            _b2bUserAgentCore = new SIPB2BUserAgentCore(_sipTransport, _getB2BDestination);
            _sipCallManager   = new SIPCallManager(_sipTransport, null);
            _cdrDataLayer     = new CDRDataLayer();

            SIPCDR.CDRCreated  += _cdrDataLayer.Add;
            SIPCDR.CDRAnswered += _cdrDataLayer.Update;
            SIPCDR.CDRUpdated  += _cdrDataLayer.Update;
            SIPCDR.CDRHungup   += _cdrDataLayer.Update;
        }