Cambia facilmente lo stato del tuo interno componendo un codice di composizione.
Questo set di script consente agli utenti di cambiare lo stato del proprio interno – Disponibile, Non disponibile, Assente, Personalizzato 1 o Personalizzato 2 – componendo un codice personalizzato. Questo script offre agli utenti un modo rapido per aggiornare la propria disponibilità senza dover navigare nell’interfaccia 3CX.
Il sistema include anche codici di chiamata predefiniti per cambiare lo stato del profilo, che possono essere usati al posto dei codici personalizzati. Questo script dimostra la flessibilità degli script di elaborazione delle chiamate e può essere modificato per ottenere ulteriori funzionalità.
Come impostare lo script per la modifica dello stato dell’estensione
- Andare alla console amministrativa > Integrazioni > Script chiamate.
- Aggiungere dall’archivio e selezionare Imposta stato disponibile estensione.
- Assegnare un nome per una facile identificazione, ad esempio “Disponibile”.
- Eseguire questo script quando un utente compone un codice di chiamata.
- Aggiungere un codice di composizione a scelta, ad esempio 57.
- Selezionare “System Wide”.
Come impostare gli script per altri stati
- Seguire gli stessi passaggi di cui sopra.
- Al punto 3, utilizzare un nome unico per ogni script, ad esempio “setaway”.
- Al punto 5, assegnare un codice di chiamata univoco per ogni script, ad esempio 58 per Fuori ufficio, 59 per Personalizzato 1.
Perché utilizzare questo script?
- Aggiornamenti rapidi dello stato: Modificate la vostra disponibilità senza dover accedere al client Web o all’applicazione mobile.
- Opzioni personalizzabili: Personalizzate i codici e gli stati per adattarli alle vostre esigenze.
- Flessibile e scalabile: Espandete la funzionalità con script aggiuntivi, a seconda delle necessità.
Esempio di script
AVVERTENZA! Questo script è solo a scopo di riferimento. Per la versione più recente, scaricare dal negozio.
Script: Disponibile
using System;
using System.Threading.Tasks;
using TCX.Configuration;
using CallFlow;
using System.Linq;
using System.Collections.Generic;
namespace dummy
{
public class SetAvailableStatus : ScriptBase
{
public override async Task StartAsync()
{
var profileName = "Available";
var prompt = "ST_AVAILABLE_SET";
//-----call is direct from the extension and profile extension has required profile
if (MyCall.Caller.DN is Extension ext
&& MyCall.ReferredByDN is not DN
&& ext.FwdProfiles.FirstOrDefault(x=>x.Name.Equals(profileName)) is FwdProfile fwdProfile)
{
//set current status
ext.CurrentProfile = fwdProfile;
//reset profile override
ext.ResetCurrentProfileOverride();
ext.Save();
//----play system prompt about current status
try
{
MyCall.Info($"Extension {ext.Number} is set to {profileName}");
await MyCall.AssureMedia()
.ContinueWith(_ => MyCall.PlayPrompt(ext.GetPropertyValue("PROMPTSETID"), [prompt], PlayPromptOptions.Blocked))
.Unwrap();
}
catch
{
//ignore prompt playback failures. action is performed
}
//we made modifications
return true;
}
//we did not make any modifications
return false;
}
}
}
Script: Non disponibile
using System;
using System.Threading.Tasks;
using TCX.Configuration;
using CallFlow;
using System.Linq;
using System.Collections.Generic;
namespace dummy
{
public class SetAwayStatus : ScriptBase
{
public override async Task StartAsync()
{
var profileName = "Away";
var prompt = "ST_AWAY_SET";
//-----call is direct from the extension and profile extension has required profile
if (MyCall.Caller.DN is Extension ext
&& MyCall.ReferredByDN is not DN
&& ext.FwdProfiles.FirstOrDefault(x=>x.Name.Equals(profileName)) is FwdProfile fwdProfile)
{
//set current status
ext.CurrentProfile = fwdProfile;
//reset profile override
ext.ResetCurrentProfileOverride();
ext.Save();
//----play system prompt about current status
try
{
MyCall.Info($"Extension {ext.Number} is set to {profileName}");
await MyCall.AssureMedia()
.ContinueWith(_ => MyCall.PlayPrompt(ext.GetPropertyValue("PROMPTSETID"), [prompt], PlayPromptOptions.Blocked))
.Unwrap();
}
catch
{
//ignore prompt playback failures. action is performed
}
//we made modifications
return true;
}
//we did not make any modifications
return false;
}
}
}
Script: Assente
using System;
using System.Threading.Tasks;
using TCX.Configuration;
using CallFlow;
using System.Linq;
using System.Collections.Generic;
namespace dummy
{
public class SetDNDStatus : ScriptBase
{
public override async Task StartAsync()
{
var profileName = "Out of office";
var prompt = "ST_OUTOFFICE_SET";
//-----call is direct from the extension and profile extension has required profile
if (MyCall.Caller.DN is Extension ext
&& MyCall.ReferredByDN is not DN
&& ext.FwdProfiles.FirstOrDefault(x=>x.Name.Equals(profileName)) is FwdProfile fwdProfile)
{
//set current status
ext.CurrentProfile = fwdProfile;
//reset profile override
ext.ResetCurrentProfileOverride();
ext.Save();
//----play system prompt about current status
try
{
MyCall.Info($"Extension {ext.Number} is set to {profileName}");
await MyCall.AssureMedia()
.ContinueWith(_ => MyCall.PlayPrompt(ext.GetPropertyValue("PROMPTSETID"), [prompt], PlayPromptOptions.Blocked))
.Unwrap();
}
catch
{
//ignore prompt playback failures. action is performed
}
//we made modifications
return true;
}
//we did not make any modifications
return false;
}
}
}
Script: Peronalizzato 1
using System;
using System.Threading.Tasks;
using TCX.Configuration;
using CallFlow;
using System.Linq;
using System.Collections.Generic;
namespace dummy
{
public class SetCustom1Status : ScriptBase
{
public override async Task StartAsync()
{
var profileName = "Custom 1";
var prompt = "ST_CUSTOM1_SET";
//-----call is direct from the extension and profile extension has required profile
if (MyCall.Caller.DN is Extension ext
&& MyCall.ReferredByDN is not DN
&& ext.FwdProfiles.FirstOrDefault(x=>x.Name.Equals(profileName)) is FwdProfile fwdProfile)
{
//set current status
ext.CurrentProfile = fwdProfile;
//reset profile override
ext.ResetCurrentProfileOverride();
ext.Save();
//----play system prompt about current status
try
{
MyCall.Info($"Extension {ext.Number} is set to {profileName}");
await MyCall.AssureMedia()
.ContinueWith(_ => MyCall.PlayPrompt(ext.GetPropertyValue("PROMPTSETID"), [prompt], PlayPromptOptions.Blocked))
.Unwrap();
}
catch
{
//ignore prompt playback failures. action is performed
}
//we made modifications
return true;
}
//we did not make any modifications
return false;
}
}
}
Script: Personalizzato 2
using System;
using System.Threading.Tasks;
using TCX.Configuration;
using CallFlow;
using System.Linq;
using System.Collections.Generic;
namespace dummy
{
public class SetCustom2Status : ScriptBase
{
public override async Task StartAsync()
{
var profileName = "Custom 2";
var prompt = "ST_CUSTOM2_SET";
//-----call is direct from the extension and profile extension has required profile
if (MyCall.Caller.DN is Extension ext
&& MyCall.ReferredByDN is not DN
&& ext.FwdProfiles.FirstOrDefault(x=>x.Name.Equals(profileName)) is FwdProfile fwdProfile)
{
//set current status
ext.CurrentProfile = fwdProfile;
//reset profile override
ext.ResetCurrentProfileOverride();
ext.Save();
//----play system prompt about current status
try
{
MyCall.Info($"Extension {ext.Number} is set to {profileName}");
await MyCall.AssureMedia()
.ContinueWith(_ => MyCall.PlayPrompt(ext.GetPropertyValue("PROMPTSETID"), [prompt], PlayPromptOptions.Blocked))
.Unwrap();
}
catch
{
//ignore prompt playback failures. action is performed
}
//we made modifications
return true;
}
//we did not make any modifications
return false;
}
}
}



