public override void OnIncomingTransfer(CallButler.Telecom.TelecomProviderBase telcomProvider, CallButler.Telecom.TransferEventArgs e) { if (e.ReplacementLineNumber != 0) { // Find the ts interface for the call from this extension to our remote caller TelecomScriptInterface remoteTsInterface = scriptService.TelecomScriptInterfaces[e.ReplacementLineNumber]; // Find the ts interface for the remote caller if (remoteTsInterface.ScriptProcessor is TransferConferenceScriptProcessor) { TransferConferenceScriptProcessor remoteProcessor = (TransferConferenceScriptProcessor)remoteTsInterface.ScriptProcessor; int remoteLineNumber = remoteProcessor.callerTsInterface.LineNumber; remoteProcessor.callerTsInterface = null; if (scriptService.TelecomScriptInterfaces[remoteLineNumber].ScriptProcessor is TransferConferenceScriptProcessor) { remoteTsInterface = scriptService.TelecomScriptInterfaces[remoteLineNumber]; remoteProcessor = (TransferConferenceScriptProcessor)remoteTsInterface.ScriptProcessor; // Conference the two lines together remoteProcessor.callerTsInterface = callerTsInterface; if (callerTsInterface.ScriptProcessor is TransferConferenceScriptProcessor) ((TransferConferenceScriptProcessor)callerTsInterface.ScriptProcessor).callerTsInterface = remoteProcessor.tsInterface; remoteProcessor.conferenceID = conferenceID; telcomProvider.AddLineToConference(conferenceID, remoteProcessor.tsInterface.LineNumber); telcomProvider.RemoveLineFromConference(tsInterface.LineNumber); // Tell the other caller to stop hold music callerTsInterface.IMLInterpreter.SignalExternalEvent(TransferConferenceExternalEvents.CALLBUTLERINTERNAL_UnholdCall.ToString()); //this.conferenceID = 0; this.callerTsInterface = null; telcomProvider.EndCall(e.ReplacementLineNumber); telcomProvider.EndCall(tsInterface.LineNumber); return; } } callerTsInterface.IMLInterpreter.SignalTransferFailure(); } else { TransferCaller(telcomProvider, e.CallingToNumber); } }