//private SIPNotifyManager m_notifyManager; public SIPAppServerCore( SIPTransport sipTransport, GetCanonicalDomainDelegate getCanonicalDomain, SIPAssetGetDelegate <SIPAccount> getSIPAccount, SIPMonitorLogDelegate proxyLog, SIPCallManager callManager, SIPDialogueManager sipDialogueManager, //SIPNotifyManager notifyManager, SIPAuthenticateRequestDelegate sipAuthenticateRequest, SIPEndPoint outboundProxy) { try { m_sipTransport = sipTransport; m_callManager = callManager; m_sipDialogueManager = sipDialogueManager; //m_notifyManager = notifyManager; m_sipTransport.SIPTransportRequestReceived += GotRequest; m_sipTransport.SIPTransportResponseReceived += GotResponse; m_outboundProxy = outboundProxy; GetCanonicalDomain_External = getCanonicalDomain; GetSIPAccount_External = getSIPAccount; SIPMonitorLogEvent_External = proxyLog; SIPRequestAuthenticator_External = sipAuthenticateRequest; } catch (Exception excp) { logger.Error("Exception SIPAppServerCore (ctor). " + excp.Message); throw excp; } }
public SIPNonInviteServerUserAgent( SIPTransport sipTransport, SIPEndPoint outboundProxy, string sipUsername, string sipDomain, SIPCallDirection callDirection, SIPAssetGetDelegate<SIPAccount> getSIPAccount, SIPAuthenticateRequestDelegate sipAuthenticateRequest, SIPMonitorLogDelegate logDelegate, SIPNonInviteTransaction transaction) { m_sipTransport = sipTransport; m_outboundProxy = outboundProxy; m_sipUsername = sipUsername; m_sipDomain = sipDomain; m_sipCallDirection = callDirection; GetSIPAccount_External = getSIPAccount; SIPAuthenticateRequest_External = sipAuthenticateRequest; Log_External = logDelegate ?? Log_External; m_transaction = transaction; m_transaction.TransactionTraceMessage += TransactionTraceMessage; //m_uasTransaction.UASInviteTransactionTimedOut += ClientTimedOut; //m_uasTransaction.UASInviteTransactionCancelled += UASTransactionCancelled; //m_uasTransaction.TransactionRemoved += new SIPTransactionRemovedDelegate(UASTransaction_TransactionRemoved); //m_uasTransaction.TransactionStateChanged += (t) => { logger.Debug("Transaction state change to " + t.TransactionState + ", uri=" + t.TransactionRequestURI.ToString() + "."); }; }
public SipMessageCore( SIPTransport sipTransport, SIPAssetGetDelegate <SIPAccount> getSIPAccount, GetCanonicalDomainDelegate getCanonicalDomain, bool mangleUACContact, bool strictRealmHandling, SIPUserAgentConfigurationManager userAgentConfigs, SIPAuthenticateRequestDelegate sipRequestAuthenticator, string switchboarduserAgentPrefix, List <string> deviceList) { m_sipTransport = sipTransport; GetSIPAccount_External = getSIPAccount; GetCanonicalDomain_External = getCanonicalDomain; m_mangleUACContact = mangleUACContact; m_strictRealmHandling = strictRealmHandling; m_userAgentConfigs = userAgentConfigs; SIPRequestAuthenticator_External = sipRequestAuthenticator; m_switchboarduserAgentPrefix = switchboarduserAgentPrefix; m_userAgent = m_userAgentConfigs.DefaultUserAgent ?? SIPConstants.SIP_USER_AGENT; MonitorItems = new Dictionary <string, SipMonitorCore>(500); foreach (string device in deviceList) { SipMonitorCore monitor = new SipMonitorCore(this, m_sipTransport, device); MonitorItems.Add(device, monitor); } }
//private SIPNotifyManager m_notifyManager; public SIPAppServerCore( SIPTransport sipTransport, GetCanonicalDomainDelegate getCanonicalDomain, SIPAssetGetDelegate<SIPAccount> getSIPAccount, SIPMonitorLogDelegate proxyLog, SIPCallManager callManager, SIPDialogueManager sipDialogueManager, //SIPNotifyManager notifyManager, SIPAuthenticateRequestDelegate sipAuthenticateRequest, SIPEndPoint outboundProxy) { try { m_sipTransport = sipTransport; m_callManager = callManager; m_sipDialogueManager = sipDialogueManager; //m_notifyManager = notifyManager; m_sipTransport.SIPTransportRequestReceived += GotRequest; m_sipTransport.SIPTransportResponseReceived += GotResponse; m_outboundProxy = outboundProxy; GetCanonicalDomain_External = getCanonicalDomain; GetSIPAccount_External = getSIPAccount; SIPMonitorLogEvent_External = proxyLog; SIPRequestAuthenticator_External = sipAuthenticateRequest; } catch (Exception excp) { logger.Error("Exception SIPAppServerCore (ctor). " + excp.Message); throw excp; } }
public SIPNonInviteServerUserAgent( SIPTransport sipTransport, SIPEndPoint outboundProxy, string sipUsername, string sipDomain, SIPCallDirection callDirection, SIPAssetGetDelegate <SIPAccount> getSIPAccount, SIPAuthenticateRequestDelegate sipAuthenticateRequest, SIPMonitorLogDelegate logDelegate, SIPNonInviteTransaction transaction) { m_sipTransport = sipTransport; m_outboundProxy = outboundProxy; m_sipUsername = sipUsername; m_sipDomain = sipDomain; m_sipCallDirection = callDirection; GetSIPAccount_External = getSIPAccount; SIPAuthenticateRequest_External = sipAuthenticateRequest; Log_External = logDelegate ?? Log_External; m_transaction = transaction; m_transaction.TransactionTraceMessage += TransactionTraceMessage; //m_uasTransaction.UASInviteTransactionTimedOut += ClientTimedOut; //m_uasTransaction.UASInviteTransactionCancelled += UASTransactionCancelled; //m_uasTransaction.TransactionRemoved += new SIPTransactionRemovedDelegate(UASTransaction_TransactionRemoved); //m_uasTransaction.TransactionStateChanged += (t) => { logger.Debug("Transaction state change to " + t.TransactionState + ", uri=" + t.TransactionRequestURI.ToString() + "."); }; }
public SIPRegistrarDaemon( GetCanonicalDomainDelegate getDomain, SIPAssetGetDelegate <SIPAccount> getSIPAccount, SIPAuthenticateRequestDelegate sipRequestAuthenticator, List <string> deviceList) { GetCanonicalDomain_External = getDomain; GetSIPAccount_External = getSIPAccount; SIPAuthenticateRequest_External = sipRequestAuthenticator; _deviceList = deviceList; Initialize(); }
public SIPRegistrarDaemon( GetCanonicalDomainDelegate getDomain, SIPAssetGetDelegate<SIPAccount> getSIPAccount, //SIPAssetGetFromDirectQueryDelegate<SIPAccount> getSIPAccountFromQuery, SIPAssetPersistor<SIPRegistrarBinding> registrarBindingsPersistor, SIPAuthenticateRequestDelegate sipRequestAuthenticator ) { GetCanonicalDomain_External = getDomain; GetSIPAccount_External = getSIPAccount; //GetSIPAccountFromQuery_External = getSIPAccountFromQuery; m_registrarBindingsPersistor = registrarBindingsPersistor; SIPAuthenticateRequest_External = sipRequestAuthenticator; }
public SIPRegistrarDaemon( GetCanonicalDomainDelegate getDomain, SIPAssetGetDelegate <SIPAccountAsset> getSIPAccount, SIPAssetPersistor <SIPRegistrarBinding> registrarBindingsPersistor, SIPAuthenticateRequestDelegate sipRequestAuthenticator, SIPAssetPersistor <Customer> customerPersistor) { GetCanonicalDomain_External = getDomain; GetSIPAccount_External = getSIPAccount; m_registrarBindingsPersistor = registrarBindingsPersistor; SIPAuthenticateRequest_External = sipRequestAuthenticator; CustomerPersistor_External = customerPersistor; }
public SIPNotifyManager( SIPTransport sipTransport, SIPEndPoint outboundProxy, SIPMonitorLogDelegate logDelegate, SIPAssetGetDelegate <SIPAccountAsset> getSIPAccount, SIPAssetGetListDelegate <SIPRegistrarBinding> getSIPAccountBindings, GetCanonicalDomainDelegate getCanonicalDomain) { m_sipTransport = sipTransport; m_outboundProxy = outboundProxy; Log_External = logDelegate; GetSIPAccount_External = getSIPAccount; GetSIPAccountBindings_External = getSIPAccountBindings; GetCanonicalDomain_External = getCanonicalDomain; ThreadPool.QueueUserWorkItem(delegate { ProcessNewNotifications(PROCESS_NOTIFICATIONS_THREAD_NAME); }); }
public SIPNotifyManager( SIPTransport sipTransport, SIPEndPoint outboundProxy, SIPMonitorLogDelegate logDelegate, SIPAssetGetDelegate<SIPAccount> getSIPAccount, SIPAssetGetListDelegate<SIPRegistrarBinding> getSIPAccountBindings, GetCanonicalDomainDelegate getCanonicalDomain) { m_sipTransport = sipTransport; m_outboundProxy = outboundProxy; Log_External = logDelegate; GetSIPAccount_External = getSIPAccount; GetSIPAccountBindings_External = getSIPAccountBindings; GetCanonicalDomain_External = getCanonicalDomain; ThreadPool.QueueUserWorkItem(delegate { ProcessNewNotifications(PROCESS_NOTIFICATIONS_THREAD_NAME); }); }
public void Initialize(string switchboarduserAgentPrefix, SIPAuthenticateRequestDelegate sipRequestAuthenticator, GetCanonicalDomainDelegate getCanonicalDomain, SIPAssetGetDelegate <SIPAccount> getSIPAccount, SIPUserAgentConfigurationManager userAgentConfigs, SIPRegistrarBindingsManager registrarBindingsManager, Dictionary <string, string> devList) { m_registrarCore = new RegistrarCore(Transport, registrarBindingsManager, getSIPAccount, getCanonicalDomain, true, true, userAgentConfigs, sipRequestAuthenticator, switchboarduserAgentPrefix); m_registrarCore.Start(1); MonitorService = new Dictionary <string, ISIPMonitorService>(); foreach (var item in devList) { ISIPMonitorService monitor = new SIPMonitorCore(this, item.Key, item.Value); monitor.OnSIPServiceChanged += monitor_OnSIPServiceChanged; MonitorService.Add(item.Key, monitor); } }
public SIPNotifierDaemon( SIPAssetGetDelegate <Customer> getCustomer, SIPAssetGetListDelegate <SIPDialogueAsset> getDialogues, SIPAssetGetByIdDelegate <SIPDialogueAsset> getDialogue, GetCanonicalDomainDelegate getDomain, SIPAssetPersistor <SIPAccount> sipAsssetPersistor, SIPAssetGetListDelegate <SIPRegistrarBinding> getSIPRegistrarBindings, SIPAssetGetListDelegate <SIPAccount> getSIPAccounts, SIPAssetCountDelegate <SIPRegistrarBinding> getBindingsCount, SIPAuthenticateRequestDelegate sipRequestAuthenticator, ISIPMonitorPublisher publisher) { GetCustomer_External = getCustomer; GetDialogues_External = getDialogues; GetDialogue_External = getDialogue; GetCanonicalDomain_External = getDomain; m_sipAssetPersistor = sipAsssetPersistor; GetSIPRegistrarBindings_External = getSIPRegistrarBindings; GetBindingsCount_External = getBindingsCount; SIPAuthenticateRequest_External = sipRequestAuthenticator; m_publisher = publisher ?? new SIPMonitorUDPSink(m_udpNotificationReceiverSocket); }
public RegistrarCore( SIPTransport sipTransport, SIPRegistrarBindingsManager registrarBindingsManager, SIPAssetGetDelegate <SIPAccountAsset> getSIPAccount, GetCanonicalDomainDelegate getCanonicalDomain, bool mangleUACContact, bool strictRealmHandling, SIPMonitorLogDelegate proxyLogDelegate, SIPUserAgentConfigurationManager userAgentConfigs, SIPAuthenticateRequestDelegate sipRequestAuthenticator, string switchboarduserAgentPrefix, SIPAssetPersistor <Customer> customerPersistor) { m_sipTransport = sipTransport; m_registrarBindingsManager = registrarBindingsManager; GetSIPAccount_External = getSIPAccount; GetCanonicalDomain_External = getCanonicalDomain; m_mangleUACContact = mangleUACContact; m_strictRealmHandling = strictRealmHandling; m_registrarLogEvent = proxyLogDelegate; m_userAgentConfigs = userAgentConfigs; SIPRequestAuthenticator_External = sipRequestAuthenticator; m_switchboarduserAgentPrefix = switchboarduserAgentPrefix; CustomerPersistor_External = customerPersistor; //try //{ // if (!switchboardCertificateName.IsNullOrBlank()) // { // X509Certificate2 switchboardCertificate = AppState.LoadCertificate(StoreLocation.LocalMachine, switchboardCertificateName, false); // m_switchbboardRSAProvider = (RSACryptoServiceProvider)switchboardCertificate.PrivateKey; // logger.Debug("Switchboard RSA provider successfully loaded from " + switchboardCertificateName + " certificate."); // } //} //catch (Exception excp) //{ // logger.Error("Exception loading switchboard certificate using " + switchboardCertificateName + ". " + excp.Message); //} }
public SIPNotifierDaemon( SIPAssetGetDelegate<Customer> getCustomer, SIPAssetGetListDelegate<SIPDialogueAsset> getDialogues, SIPAssetGetByIdDelegate<SIPDialogueAsset> getDialogue, GetCanonicalDomainDelegate getDomain, SIPAssetPersistor<SIPAccount> sipAsssetPersistor, SIPAssetGetListDelegate<SIPRegistrarBinding> getSIPRegistrarBindings, SIPAssetGetListDelegate<SIPAccount> getSIPAccounts, SIPAssetCountDelegate<SIPRegistrarBinding> getBindingsCount, SIPAuthenticateRequestDelegate sipRequestAuthenticator, ISIPMonitorPublisher publisher) { GetCustomer_External = getCustomer; GetDialogues_External = getDialogues; GetDialogue_External = getDialogue; GetCanonicalDomain_External = getDomain; m_sipAssetPersistor = sipAsssetPersistor; GetSIPRegistrarBindings_External = getSIPRegistrarBindings; GetBindingsCount_External = getBindingsCount; SIPAuthenticateRequest_External = sipRequestAuthenticator; m_publisher = publisher ?? new SIPMonitorUDPSink(m_udpNotificationReceiverSocket); }
public NotifierCore( SIPMonitorLogDelegate logDelegate, SIPTransport sipTransport, SIPAssetGetDelegate <Customer> getCustomer, SIPAssetGetListDelegate <SIPDialogueAsset> getDialogues, SIPAssetGetByIdDelegate <SIPDialogueAsset> getDialogue, GetCanonicalDomainDelegate getCanonicalDomain, SIPAssetPersistor <SIPAccount> sipAssetPersistor, SIPAssetCountDelegate <SIPRegistrarBinding> getBindingsCount, SIPAuthenticateRequestDelegate sipRequestAuthenticator, SIPEndPoint outboundProxy, ISIPMonitorPublisher publisher) { MonitorLogEvent_External = logDelegate; m_sipTransport = sipTransport; GetCustomer_External = getCustomer; m_sipAssetPersistor = sipAssetPersistor; GetCanonicalDomain_External = getCanonicalDomain; SIPRequestAuthenticator_External = sipRequestAuthenticator; m_outboundProxy = outboundProxy; m_subscriptionsManager = new NotifierSubscriptionsManager(MonitorLogEvent_External, getDialogues, getDialogue, m_sipAssetPersistor, getBindingsCount, m_sipTransport, m_outboundProxy, publisher); ThreadPool.QueueUserWorkItem(delegate { ProcessSubscribeRequest(NOTIFIER_THREAD_NAME_PREFIX + "1"); }); }
public SIPDialogueManager( SIPTransport sipTransport, SIPEndPoint outboundProxy, SIPMonitorLogDelegate logDelegate, SIPAssetPersistor<SIPDialogueAsset> sipDialoguePersistor, SIPAssetPersistor<SIPCDRAsset> sipCDRPersistor, SIPAuthenticateRequestDelegate authenticateRequestDelegate, SIPAssetGetDelegate<SIPAccount> getSIPAccount, GetCanonicalDomainDelegate getCanonicalDomain) { m_sipTransport = sipTransport; m_outboundProxy = outboundProxy; Log_External = logDelegate; m_sipDialoguePersistor = sipDialoguePersistor; m_sipCDRPersistor = sipCDRPersistor; SIPAuthenticateRequest_External = authenticateRequestDelegate; GetSIPAccount_External = getSIPAccount; GetCanonicalDomain_External = getCanonicalDomain; }
public RegistrarCore( SIPTransport sipTransport, SIPRegistrarBindingsManager registrarBindingsManager, SIPAssetGetDelegate<SIPAccount> getSIPAccount, GetCanonicalDomainDelegate getCanonicalDomain, bool mangleUACContact, bool strictRealmHandling, SIPMonitorLogDelegate proxyLogDelegate, SIPUserAgentConfigurationManager userAgentConfigs, SIPAuthenticateRequestDelegate sipRequestAuthenticator, string switchboardCertificateName) { m_sipTransport = sipTransport; m_registrarBindingsManager = registrarBindingsManager; GetSIPAccount_External = getSIPAccount; GetCanonicalDomain_External = getCanonicalDomain; m_mangleUACContact = mangleUACContact; m_strictRealmHandling = strictRealmHandling; m_registrarLogEvent = proxyLogDelegate; m_userAgentConfigs = userAgentConfigs; SIPRequestAuthenticator_External = sipRequestAuthenticator; try { if (!switchboardCertificateName.IsNullOrBlank()) { X509Certificate2 switchboardCertificate = AppState.LoadCertificate(StoreLocation.LocalMachine, switchboardCertificateName, false); m_switchbboardRSAProvider = (RSACryptoServiceProvider)switchboardCertificate.PrivateKey; logger.Debug("Switchboard RSA provider successfully loaded from " + switchboardCertificateName + " certificate."); } } catch (Exception excp) { logger.Error("Exception loading switchboard certificate using " + switchboardCertificateName + ". " + excp.Message); } }
public static IPAddress PublicIPAddress; // If the app server is behind a NAT then it can set this address to be used in mangled SDP. /// <summary> /// /// </summary> /// <param name="sipTransport"></param> /// <param name="owner"></param> /// <param name="sipAccount">The SIP account that was called and resulted in the dialplan executing. Will be null if the /// execution was not initated by a call to a SIP account call such as if a web callback occurs.</param> /// <param name="sipProviders"></param> /// <param name="getSIPAccount"></param> /// <param name="getRegistrarBindings"></param> /// <param name="getCanonicalDomainDelegate"></param> /// <param name="logDelegate"></param> /// <param name="dialplanName">Used to ensure that a call leg cannot create a B2B call that loops into the same dial plan.</param> public DialStringParser( SIPTransport sipTransport, string owner, SIPAccount sipAccount, List<SIPProvider> sipProviders, SIPAssetGetDelegate<SIPAccount> getSIPAccount, SIPAssetGetListDelegate<SIPRegistrarBinding> getRegistrarBindings, GetCanonicalDomainDelegate getCanonicalDomainDelegate, SIPMonitorLogDelegate logDelegate, string dialplanName) { m_sipTransport = sipTransport; m_username = owner; m_sipAccount = sipAccount; m_sipProviders = sipProviders; GetSIPAccount_External = getSIPAccount; GetRegistrarBindings_External = getRegistrarBindings; GetCanonicalDomain_External = getCanonicalDomainDelegate; Log_External = logDelegate; m_dialPlanName = dialplanName; }
public SIPCallManager( SIPTransport sipTransport, SIPEndPoint outboundProxy, SIPMonitorLogDelegate logDelegate, SIPDialogueManager sipDialogueManager, SIPAssetPersistor<SIPDialogueAsset> sipDialoguePersistor, SIPAssetPersistor<SIPCDRAsset> sipCDRPersistor, DialPlanEngine dialPlanEngine, SIPAssetGetDelegate<SIPDialPlan> getDialPlan, SIPAssetGetDelegate<SIPAccount> getSIPAccount, SIPAssetGetListDelegate<SIPRegistrarBinding> getSIPAccountBindings, SIPAssetGetListDelegate<SIPProvider> getSIPProviders, GetCanonicalDomainDelegate getCanonicalDomain, SIPAssetPersistor<Customer> customerPersistor, SIPAssetPersistor<SIPDialPlan> dialPlanPersistor, string traceDirectory, bool monitorCalls, int dailyCallLimit) { m_sipTransport = sipTransport; m_outboundProxy = outboundProxy; Log_External = logDelegate; m_sipDialogueManager = sipDialogueManager; m_sipDialoguePersistor = sipDialoguePersistor; m_sipCDRPersistor = sipCDRPersistor; m_dialPlanEngine = dialPlanEngine; GetDialPlan_External = getDialPlan; GetSIPAccount_External = getSIPAccount; GetSIPAccountBindings_External = getSIPAccountBindings; GetSIPProviders_External = getSIPProviders; GetCanonicalDomain_External = getCanonicalDomain; m_customerPersistor = customerPersistor; m_dialPlanPersistor = dialPlanPersistor; m_traceDirectory = traceDirectory; m_monitorCalls = monitorCalls; m_pid = Process.GetCurrentProcess().Id; m_dailyCallLimit = dailyCallLimit; m_sipDialogueManager.OnCallHungup += OnCallHungup; }
public NotifierCore( SIPMonitorLogDelegate logDelegate, SIPTransport sipTransport, SIPAssetGetDelegate<Customer> getCustomer, SIPAssetGetListDelegate<SIPDialogueAsset> getDialogues, SIPAssetGetByIdDelegate<SIPDialogueAsset> getDialogue, GetCanonicalDomainDelegate getCanonicalDomain, SIPAssetPersistor<SIPAccount> sipAssetPersistor, SIPAssetCountDelegate<SIPRegistrarBinding> getBindingsCount, SIPAuthenticateRequestDelegate sipRequestAuthenticator, SIPEndPoint outboundProxy, ISIPMonitorPublisher publisher) { MonitorLogEvent_External = logDelegate; m_sipTransport = sipTransport; GetCustomer_External = getCustomer; m_sipAssetPersistor = sipAssetPersistor; GetCanonicalDomain_External = getCanonicalDomain; SIPRequestAuthenticator_External = sipRequestAuthenticator; m_outboundProxy = outboundProxy; m_subscriptionsManager = new NotifierSubscriptionsManager(MonitorLogEvent_External, getDialogues, getDialogue, m_sipAssetPersistor, getBindingsCount, m_sipTransport, m_outboundProxy, publisher); ThreadPool.QueueUserWorkItem(delegate { ProcessSubscribeRequest(NOTIFIER_THREAD_NAME_PREFIX + "1"); }); }