public SIPCall(SIPCallProvider callProvider, SipekResources resources, int sipekCallId, IActionProvider actionProvider) { _resources = resources; _sipekCallId = sipekCallId; _callProvider = callProvider; _actionProvider = actionProvider; _date = DateTime.Now; }
public void Initialize() { if(_resources != null) Dispose(); InitThread(); _initialized.WaitOne(); _dispatcher.Invoke( DispatcherPriority.Normal, (MethodInvoker)delegate { _log.Info("Initializing SIPCallProvider"); _resources = new SipekResources(); _resources.CallManager.CallStateRefresh += onCallStateChanged; _resources.CallManager.IncomingCallNotification += new DIncomingCallNotification(resources_CallManager_IncomingCallNotification); _resources.Registrar.AccountStateChanged += new DAccountStateChanged(resources_Registrar_AccountStateChanged); int status = _resources.CallManager.Initialize(); _resources.CallManager.CallLogger = _resources.CallLogger; if (status != 0) throw new CallProviderException("Init SIP stack problem! \r\nPlease, check configuration and start again! \r\nStatus code " + status); // initialize Stack _resources.Registrar.registerAccounts(); int noOfCodecs = _resources.StackProxy.getNoOfCodecs(); for (int i = 0; i < noOfCodecs; i++) { string codecname = _resources.StackProxy.getCodec(i); if (_resources.Configurator.CodecList.Contains(codecname)) { // leave default _resources.StackProxy.setCodecPriority(codecname, 128); } else { // disable _resources.StackProxy.setCodecPriority(codecname, 0); } } pjsipCallProxy.OnWavPlayerCompleted += delegate(int callId) { _log.Info("Wav playback for call '{0}' ended", callId); SIPCall call = FindCallById(callId); if(call != null) call.AudioPlaybackCompleted(); }; }); }
public void Dispose() { _log.Info("Shuting down SIPCallProvider"); if (_resources != null) { _dispatcher.Invoke( DispatcherPriority.Normal, (MethodInvoker) delegate { _resources.StackProxy.shutdown(); _resources.CallManager.Shutdown(); _resources = null; }); } }
public SIPIncomingCall(SIPCallProvider callProvider, SipekResources resources, int sipekCallId, String remoteIdentifier, IActionProvider actionProvider) : base(callProvider, resources, sipekCallId, actionProvider) { _remoteIdentifier = remoteIdentifier; }
public SIPIncomingCall(SIPCallProvider callProvider, SipekResources resources, int sipekCallId, String remoteIdentifier, IActionProvider actionProvider) :base(callProvider, resources, sipekCallId, actionProvider) { _remoteIdentifier = remoteIdentifier; }
public void Dispose() { _log.Info("Shuting down SIPCallProvider"); if(_resources != null) { _dispatcher.Invoke( DispatcherPriority.Normal, (MethodInvoker)delegate { _resources.StackProxy.shutdown(); _resources.CallManager.Shutdown(); _resources = null; }); } }
public void Initialize() { if (_resources != null) { Dispose(); } InitThread(); _initialized.WaitOne(); _dispatcher.Invoke( DispatcherPriority.Normal, (MethodInvoker) delegate { _log.Info("Initializing SIPCallProvider"); _resources = new SipekResources(); _resources.CallManager.CallStateRefresh += onCallStateChanged; _resources.CallManager.IncomingCallNotification += new DIncomingCallNotification(resources_CallManager_IncomingCallNotification); _resources.Registrar.AccountStateChanged += new DAccountStateChanged(resources_Registrar_AccountStateChanged); int status = _resources.CallManager.Initialize(); _resources.CallManager.CallLogger = _resources.CallLogger; if (status != 0) { throw new CallProviderException("Init SIP stack problem! \r\nPlease, check configuration and start again! \r\nStatus code " + status); } // initialize Stack _resources.Registrar.registerAccounts(); int noOfCodecs = _resources.StackProxy.getNoOfCodecs(); for (int i = 0; i < noOfCodecs; i++) { string codecname = _resources.StackProxy.getCodec(i); if (_resources.Configurator.CodecList.Contains(codecname)) { // leave default _resources.StackProxy.setCodecPriority(codecname, 128); } else { // disable _resources.StackProxy.setCodecPriority(codecname, 0); } } pjsipCallProxy.OnWavPlayerCompleted += delegate(int callId) { _log.Info("Wav playback for call '{0}' ended", callId); SIPCall call = FindCallById(callId); if (call != null) { call.AudioPlaybackCompleted(); } }; }); }