43 lines
9.3 KiB
XML
43 lines
9.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<File>
|
|
<Version>2.1</Version>
|
|
<Variables>
|
|
<ArrayOfVariable xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
<Variable>
|
|
<Name>strDestNo</Name>
|
|
<ShowScopeProperty>true</ShowScopeProperty>
|
|
<DebuggerVisible>true</DebuggerVisible>
|
|
<HelpText />
|
|
</Variable>
|
|
<Variable>
|
|
<Name>strExtensionNo</Name>
|
|
<ShowScopeProperty>true</ShowScopeProperty>
|
|
<DebuggerVisible>true</DebuggerVisible>
|
|
<HelpText />
|
|
</Variable>
|
|
</ArrayOfVariable>
|
|
</Variables>
|
|
<Flows>
|
|
<MainFlow>
|
|
<ns0:MainFlow Description="Callflow execution path." DebugModeActive="False" x:Name="setStateAndFWDestination" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ns0="clr-namespace:TCX.CFD.Classes.Components;Assembly=3CX Call Flow Designer, Version=20.2.84.0, Culture=neutral, PublicKeyToken=7cb95a1a133e706e">
|
|
<ns0:ExecuteCSharpCodeComponent ReturnsValue="True" Code="var ext = PhoneSystem.Root.GetDNByNumber(strExtNr) as Extension;
var profile=ext.FwdProfiles.Where( x => x.Name == "Custom 2").First(); // 'Available', 'Away', 'Out of office', 'Custom 1', 'Custom 2', maybe parameter?

var NewStatus=-1;
if( profile != null ) {
 // DestinationStruct need 3 parameter
 // 1 DestinationType: 'None', 'VoiceMail', 'Extension', 'Queue', 'RingGroup', 'IVR', 'External', 'Fax', 'Boomerang' (external number),
 // 'Deflect', 'VoiceMailOfDestination', 'Callback' (reserved), 'RoutePoint' 
 // 2 internal DN, maybe select by parameter - OR - 
 // 3 external number as string, maybe select by parameter

 // DestinationType anhand der Zielnummer (strDestNr) bestimmen
 bool isInternal = false;
 bool isExtension = false;
 bool isRG = false;
 bool isIVR = false;
 bool isQUEUE = false;
 
 // check if strDestNr is a internal extension
 var extension = PhoneSystem.Root.GetDNByNumber(strDestNr) as Extension;
 if( extension != null ) {
 isInternal = true;
 isExtension = true;
 }
 
 // check if strDestNr is a ringgroup
 var allRGs = PhoneSystem.Root.GetRingGroups();
 foreach (var rg in allRGs)
 {
 if (rg.Number == strDestNr) 
 {
 isInternal = true;
 isRG = true;
 break;
 }
 }
 
 // check if strDestNr is a IVR/receptionist
 var allIVRs = PhoneSystem.Root.GetIVRs();
 foreach (var ivr in allIVRs)
 {
 if (ivr.Number == strDestNr) 
 {
 isInternal = true;
 isIVR = true;
 break;
 }
 }
 
 // check if strDestNr is a Queue
 var allQUEUQs = PhoneSystem.Root.GetQueues();
 foreach (var queue in allQUEUQs)
 {
 if (queue.Number == strDestNr) 
 {
 isInternal = true;
 isQUEUE = true;
 break;
 }
 }



 // define the DestinationStruct depending on the type of the destination target....
 
 var dest = new DestinationStruct();
 if (strExtNr.Equals(strDestNr)) {
 // set state to available if destination number is the number of the extension
 NewStatus = 0;
 }
 else {
 if( isInternal) {
 if( isExtension ) { 
 dest.To=DestinationType.Extension; 
 dest.Internal=PhoneSystem.Root.GetDNByNumber(strDestNr); // needed if internal destination 
 }
 else if( isRG ) { 

 dest.To=DestinationType.RingGroup; 
 dest.Internal=PhoneSystem.Root.GetDNByNumber(strDestNr); // needed if internal destination 
 }
 else if( isIVR ) { 

 dest.To=DestinationType.IVR; 
 dest.Internal=PhoneSystem.Root.GetDNByNumber(strDestNr); // needed if internal destination 
 }
 else if( isQUEUE ) { 

 dest.To=DestinationType.Queue; 
 dest.Internal=PhoneSystem.Root.GetDNByNumber(strDestNr); // needed if internal destination 
 }
 }
 else {

 dest.To=DestinationType.External; 
 dest.External=strDestNr; // needed if external destination
 
 }
 

 NewStatus = 4;
 }

 
 if( NewStatus >0)
 {
 // Depending on the type of status (present or absent), the forwarding must be entered in other target fields
 if( profile.TypeOfRouting == RoutingType.Available) {
 var route=profile.AvailableRoute; // maybe select by parameter?
 route.NoAnswer.AllCalls = dest;
 route.NoAnswer.Internal = dest;
 route.Busy.AllCalls = route.NotRegistered.AllCalls = dest;
 route.Busy.Internal = route.NotRegistered.Internal = dest;
 }
 if( profile.TypeOfRouting == RoutingType.Away) {
 var route=profile.AwayRoute;
 var external = profile.AwayRoute.External;
 route.Internal.AllHours = dest; // maybe select by parameter?
 route.Internal.OutOfOfficeHours = dest;
 route.External.AllHours = dest;
 route.External.OutOfOfficeHours = dest;
 }
 ext.Save();
 }
 
}
return( NewStatus);" ParameterList="<?xml version="1.0" encoding="utf-16"?><ArrayOfScriptParameter xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><ScriptParameter><Name>strExtNr</Name><Value>callflow$.strExtensionNo</Value><Type>String</Type></ScriptParameter><ScriptParameter><Name>strDestNr</Name><Value>callflow$.strDestNo</Value><Type>String</Type></ScriptParameter></ArrayOfScriptParameter>" MethodName="SetExtDNDDest" Tag="" DebugModeActive="False" x:Name="SetExtDNDDest" />
|
|
<ns0:ConditionalComponent Tag="" DebugModeActive="False" x:Name="CreateCondition1">
|
|
<ns0:ConditionalComponentBranch Condition="EQUAL(SetExtDNDDest.ReturnValue,0)" Description="Execution path when the specified condition is met." Tag="" DebugModeActive="False" x:Name="conditionalComponentBranch1">
|
|
<ns0:TcxSetExtensionStatusComponent Status="Available" Tag="" DebugModeActive="False" Extension="callflow$.strExtensionNo" x:Name="SetAvailable" />
|
|
<ns0:PromptPlaybackComponent Tag="" AcceptDtmfInput="True" DebugModeActive="False" PromptList="<?xml version="1.0" encoding="utf-16"?><ArrayOfPrompt xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Prompt xsi:type="AudioFilePrompt"><AudioFileName>Weiterleitung wurde entfernt.wav</AudioFileName></Prompt></ArrayOfPrompt>" x:Name="Weiterleitung_entfernt" />
|
|
</ns0:ConditionalComponentBranch>
|
|
<ns0:ConditionalComponentBranch Condition="EQUAL(SetExtDNDDest.ReturnValue,4)" Description="Execution path when the specified condition is met." Tag="" DebugModeActive="False" x:Name="conditionalComponentBranch2">
|
|
<ns0:TcxSetExtensionStatusComponent Status="BusinessTrip" Tag="" DebugModeActive="False" Extension="callflow$.strExtensionNo" x:Name="SetExtCustom2" />
|
|
<ns0:PromptPlaybackComponent Tag="" AcceptDtmfInput="True" DebugModeActive="False" PromptList="<?xml version="1.0" encoding="utf-16"?><ArrayOfPrompt xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Prompt xsi:type="AudioFilePrompt"><AudioFileName>IhreAnrufeWerdenAufDieFolgendeNummerWeitergeleitet-vicki.wav</AudioFileName></Prompt><Prompt xsi:type="NumberPrompt"><Format>OneByOne</Format><Number>callflow$.strDestNo</Number></Prompt></ArrayOfPrompt>" x:Name="PlayDigits" />
|
|
</ns0:ConditionalComponentBranch>
|
|
</ns0:ConditionalComponent>
|
|
</ns0:MainFlow>
|
|
</MainFlow>
|
|
<ErrorHandlerFlow>
|
|
<ns0:ErrorHandlerFlow Description="Execution path when an error ocurrs." DebugModeActive="False" x:Name="setStateAndFWDestination" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ns0="clr-namespace:TCX.CFD.Classes.Components;Assembly=3CX Call Flow Designer, Version=20.2.84.0, Culture=neutral, PublicKeyToken=7cb95a1a133e706e" />
|
|
</ErrorHandlerFlow>
|
|
<DisconnectHandlerFlow>
|
|
<ns0:DisconnectHandlerFlow Description="Execution path since the call gets disconnected." DebugModeActive="False" x:Name="setStateAndFWDestination" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ns0="clr-namespace:TCX.CFD.Classes.Components;Assembly=3CX Call Flow Designer, Version=20.2.84.0, Culture=neutral, PublicKeyToken=7cb95a1a133e706e" />
|
|
</DisconnectHandlerFlow>
|
|
</Flows>
|
|
</File> |