NotifyAction : global
L’API NotifyAction vous permet de définir des actions à envoyer à un fournisseur de téléphonie.
Vous ajoutez des actions à un objet NotifyAction en appelant la fonction d’ajout respective pour chaque type d’action. Chaque fonction add renvoie un objet Action, tel qu’un objet SayAction pour la méthode addSay( ). Reportez-vous à chaque exemple de méthode pour plus d’informations sur les objets renvoyés.
NotifyAction : addConference()
Ajoute une action de conférence pour déplacer l’appel actuel vers la téléconférence actuelle.
| Nom | Type | Description |
|---|---|---|
| Néant |
| Type | Description |
|---|---|
| Action de conférence | Action ajoutée à l’objet NotifyAction. Utilisez l’objet ConferenceAction pour définir le nom de la téléconférence et le comportement de la téléconférence lorsqu’un participant la rejoint ou la quitte. |
Cet exemple montre comment ajouter une action de conférence et définir le nom de la conférence.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a conference call action and set its name
var conference = notifyAction.addConference();
conference.setName('Brown Bag: Week 3');
NotifyAction : addConference.setEndOnExit(booléen endOnExit)
Définit si la téléconférence doit prendre fin lorsqu’un appelant spécifié quitte la téléconférence.
| Nom | Type | Description |
|---|---|---|
| endOnExit | Booléen | Marqueur indiquant si la téléconférence doit prendre fin lorsque l’appelant désigné quitte la téléconférence en cours.
|
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment ajouter une action de téléconférence, puis la définir de sorte que la téléconférence se termine lorsque l’appelant spécifié sort.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a conference call action and set the caller that starts the meeting
var conference = notifyAction.addConference();
// retrieve the participant for which the conference call should exit when they leave
var notifyParticipantGr = new GlideRecord('notify_participant');
notifyParticipantGr.get('active participant sys id');
if (notifyParticipantGr.isValid) {
conference.setEndOnExit(true);
}
NotificationAction : addConference.setHangupOnStar(booléen hangupOnStar)
Définit si la téléconférence doit prendre fin lorsqu’un participant appuie sur la touche étoile (*).
| Nom | Type | Description |
|---|---|---|
| hangupOnStar | Booléen | Marqueur indiquant si la téléconférence doit prendre fin lorsqu’un participant appuie sur la touche étoile (*). Valeurs valides :
|
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment ajouter une action de conférence, puis enregistrer la téléconférence.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a conference call action and set the hang up action
var conference = notifyAction.addConference();
conference.setHangupOnStar(true);
NotificationAction : addConference.setMuted(booléen désactivé)
Définit si le micro de l’appelant spécifié doit être désactivé lors de la téléconférence en cours.
Si vous n’appelez pas cette méthode, le micro de l’appelant n’est pas désactivé par défaut.
| Nom | Type | Description |
|---|---|---|
| Désactivé | Booléen | Marqueur indiquant si le micro de l’appelant spécifié doit être désactivé lors de la téléconférence en cours.
|
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment ajouter une action de conférence, puis désactiver le micro d’un appelant spécifié.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a conference call action and set it to mute the specified participant
var conference = notifyAction.addConference();
var notifyParticipantGr = new GlideRecord('notify_participant');
notifyParticipantGr.get('active participant sys id');
if (notifyParticipantGr.isValid) {
conference.setMuted(true);
}
NotifyAction : addConference.setName(nom de chaîne)
Définit le nom de la téléconférence en cours sur le nom spécifié.
| Nom | Type | Description |
|---|---|---|
| nom | Chaîne | Nom à associer à la téléconférence en cours. |
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment ajouter une action de conférence et définir le nom de la téléconférence.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a conference call action and set its name
var conference = notifyAction.addConference();
conference.setName('Brown Bag: Week 3');
NotifyAction : addConference.setRecord(Enregistrement booléen)
Définit si la téléconférence associée doit être enregistrée.
Si vous n’appelez pas cette méthode, la téléconférence n’est pas enregistrée par défaut.
| Nom | Type | Description |
|---|---|---|
| enregistrement | Booléen | Marqueur indiquant si la téléconférence en cours doit être enregistrée.
|
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment ajouter une action de conférence, puis enregistrer la téléconférence.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a conference call action and set it to be recorded
var conference = notifyAction.addConference();
conference.setRecord(true);
NotificationAction : addConference.setStartOnEnter(booléen startOnEnter)
Définit si la téléconférence doit démarrer lorsque l’appelant spécifié rejoint la téléconférence.
Par défaut, la téléconférence commence chaque fois qu’il y a deux appelants ou plus. Pour faire en sorte que la téléconférence ne démarre que lorsqu’un appelant spécifique rejoint la conférence, vous devez appeler cette méthode pour chacun des autres appelants et définir la valeur sur « faux ». Ainsi, la téléconférence ne démarre pas tant que la personne souhaitée n’a pas rejoint la téléconférence.
| Nom | Type | Description |
|---|---|---|
| startOnEnter | Booléen | Marqueur indiquant si la téléconférence doit démarrer lorsque l’appelant sélectionné rejoint la téléconférence actuelle.
|
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment ajouter une action de conférence, puis la configurer de sorte que la téléconférence ne démarre pas tant que l’appelant spécifié ne l’a pas rejointe.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a conference call action and set the caller that starts the meeting
var conference = notifyAction.addConference();
// retrieve the participant for which the conference call should start when they arrive
var notifyParticipantGr = new GlideRecord('notify_participant');
notifyParticipantGr.get('active participant sys id');
if (notifyParticipantGr.isValid) {
conference.setStartOnEnter(true);
}
NotifyAction : addDial()
Transfère un appel vers un numéro de téléphone spécifié ou le client de Notification.
Une fois l’action addDial créée, le numéro de téléphone associé (setPhoneNumber()) ou le client de notification (setClientRecord()) doit également être défini.
| Nom | Type | Description |
|---|---|---|
| Néant |
| Type | Description |
|---|---|
| Action de numérotation | Action ajoutée à l’objet NotifyAction. |
Cet exemple montre comment effectuer un appel sortant et enregistrer l’appel.
// Initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Call addDial() to connect to another party – this returns an object of type DialAction
var dialAction = notifyAction.addDial();
// Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
dialAction.setPhoneNumber('+919765xxxxxxx');
// Invoke setRecord(Boolean record) to record the call to this new number +919765xxxxxxx
dialAction.setRecord(true);
NotifyAction : addDial.setCallerID(String callerID)
Définit l’ID de l’appelant pour l’appel sortant.
| Nom | Type | Description |
|---|---|---|
| callerID | Chaîne | Identificateur de l’appelant à définir pour l’appel sortant. |
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment effectuer un appel sortant et définir un délai d’expiration.
// Initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Call addDial() to connect to another party – this returns an object of type DialAction
var dialAction = notifyAction.addDial();
// Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
dialAction.setPhoneNumber('+919765xxxxxxx');
// Set the caller ID
dialAction.setCallerID('Planning Conf Call');
NotifyAction : addDial.setClientRecord(String tableName, String sysID)
Définit l’appelant actuel sur un appelant de notification en spécifiant la table dans laquelle trouver l’enregistrement de l’appelant de notification et l’identificateur unique de l’appelant.
| Nom | Type | Description |
|---|---|---|
| tableName | Chaîne | Nom de la table qui contient les informations de l’appelant souhaité. |
| sysID | Chaîne | Identificateur unique (sys_id) de l’appelant de Notification souhaité. |
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment définir l’appelant actuel sur un appelant de Notification à l’aide de setClientRecord().
// set up a dial action to forward the
// call to the specified client
var action = new SNC.NotifyAction();
var dial = action.addDial();
dial.setClientRecord(notifyClientRecord.getTableName(), notifyClientRecord.getUniqueValue());
dial.setTimeout(activity.vars.timeout);
dial.setRecord(activity.vars.record);
NotifyAction : addDial.setDTMF(valeur de chaîne)
Définit les tonalités DTMF à émettre lorsque l’appel se connecte.
| Nom | Type | Description |
|---|---|---|
| valide | Chaîne | Chiffres DTMF valides à lire lorsque l’appel se connecte. |
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment effectuer un appel sortant et définit les tonalités DTMF à émettre lorsque l’appel se connecte.
// Initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Call addDial() to connect to another party - this returns an object of type DialAction
var dialAction = notifyAction.addDial();
// Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
dialAction.setPhoneNumber('+919765xxxxxxx');
// DTMF tones to play when call connects
dialAction.setDTMF("1246AF");
NotificationAction : addDial.setHangupOnStar(booléen hangupOnStar)
Définit si l’appel doit se terminer lorsque la touche étoile (*) est enfoncée.
| Nom | Type | Description |
|---|---|---|
| hangupOnStar | Booléen | Marqueur indiquant si l’appel doit se terminer lorsque la touche étoile (*) est enfoncée.
|
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment passer un appel sortant et définir la touche de raccrochage sur Étoile.
// Initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Call addDial() to connect to another party – this returns an object of type DialAction
var dialAction = notifyAction.addDial();
// Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
dialAction.setPhoneNumber('+919765xxxxxxx');
// End call by pressing star
dialAction.setHangupOnStar(true);
NotifyAction : addDial.setPhoneNumber(chaîne phoneNumber)
Définit le numéro de téléphone à appeler.
| Nom | Type | Description |
|---|---|---|
| phoneNumber | Chaîne | Numéro de téléphone conforme à la norme E.164 à appeler. |
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment effectuer un appel sortant et définir un délai d’expiration.
// Initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Call addDial() to connect to another party – this returns an object of type DialAction
var dialAction = notifyAction.addDial();
// Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
dialAction.setPhoneNumber('+919765xxxxxxx');
NotifyAction : addDial.setRecord(enregistrement booléen)
Définit si l’appel sortant doit être enregistré.
| Nom | Type | Description |
|---|---|---|
| enregistrement | Marqueur indiquant si l’appel sortant doit être enregistré. Valeurs valides :
|
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment effectuer un appel sortant et enregistrer l’appel.
// Initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Call addDial() to connect to another party – this returns an object of type DialAction
var dialAction = notifyAction.addDial();
// Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
dialAction.setPhoneNumber('+919765xxxxxxx');
// Record the call
dialAction.setRecord(true);
NotifyAction : addDial.setTimeout(délai d’expiration de l’entier)
Définit le nombre de secondes après lesquelles l’appel sortant expire.
| Nom | Type | Description |
|---|---|---|
| timeout | Entier | Nombre de secondes après lesquelles l’appel sortant expire. Par défaut : 30 |
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment effectuer un appel sortant et définir un délai d’expiration.
// Initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Call addDial() to connect to another party – this returns an object of type DialAction
var dialAction = notifyAction.addDial();
// Call setPhoneNumber(String phoneNumber)in DialAction.java to specify the phone number to dial
dialAction.setPhoneNumber('+919765xxxxxxx');
// Set the number of seconds to wait before timing out
dialAction.setTimeout(45);
NotifyAction : addGather()
Présente un menu téléphonique interactif spécifié à l’appelant.
| Nom | Type | Description |
|---|---|---|
| Néant |
| Type | Description |
|---|---|
| GatherAction | Action ajoutée à l’objet NotifyAction. Utilisez l’objet GatherAction pour définir les paramètres de menu et les options à présenter à l’utilisateur. |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// present the user with a menu
var gather = notifyAction.addGather();
gather.setNumberOfDigits(1); // the user can type 1 digit
gather.setFinishKey('#'); // # or *, useful for > 1 digit
gather.setTimeout(10); // time to enter answer, in seconds
// add first menu item
var usSay = gather.addSay();
usSay.setText('Press 1 for english');
usSay.setLanguage('en-US');
// add second menu item
var nlSay = gather.addSay();
nlSay.setText('Kies 2 voor Nederlands');
nlSay.setLanguage('nl-NL');
// add third menu item
var frSay = gather.addSay();
frSay.setText('Choisissez 3 pour le français.');
frSay.setLanguage('fr-FR');
// and finish off with an applause
var play = gather.addPlay();
play.setURL('http://www.wavsource.com/snds_2015-04-12_5971820382841326/sfx/applause_y.wav');
NotifyAction : addGather.addPlay()
Lit un fichier audio lors de l’appel.
Consultez la méthode addPlay() de NotifyAction pour une description des méthodes enfants prises en charge.
| Nom | Type | Description |
|---|---|---|
| Néant |
| Type | Description |
|---|---|
| PlayAction | Action ajoutée à l’objet NotifyAction. Utilisez l’objet PlayAction pour définir l’URL du fichier audio et le nombre de mises en boucle de l’audio. |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// Create the gather action object
var gather = notifyAction.addGather();
// Play an audio file
var play = gather.addPlay();
play.setURL('http://www.wavsource.com/snds_2015-04-12_5971820382841326/sfx/applause_y.wav');
NotifyAction : addGather.addSay()
Définit la synthèse vocale à lire lors de l’appel.
Consultez la méthode addSay() de NotifyAction pour une description des méthodes enfants prises en charge.
| Nom | Type | Description |
|---|---|---|
| Néant |
| Type | Description |
|---|---|
| SayAction (en anglais) | Action ajoutée à l’objet NotifyAction. Utilisez l’objet SayAction pour définir le texte et la langue à lire. |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// present the user with a menu
var gather = notifyAction.addGather();
gather.setNumberOfDigits(1); // the user can type 1 digit
gather.setTimeout(20); // time to enter answer, in seconds
// add first menu item
var gatherSay = gather.addSay();
gatherSay.setText('Press 1 for english');
gatherSay.setLanguage('en-US');
NotifyAction : addGather.setFinishKey(String finishKey)
Définit la clé que l’appelant entre pour indiquer la fin de son entrée.
| Nom | Type | Description |
|---|---|---|
| finishKey | Chaîne | Clé qui indique la fin de l’entrée de l’appelant. Valeurs valides :
|
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment ajouter une action de collecte et définir la clé qui désigne la fin de l’entrée de l’appelant.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
var gather = notifyAction.addGather();
gather.setNumberOfDigits(4); // the user can type four digit
gather.setFinishKey('#'); // # or *, useful for > 1 digit
NotificationAction : addGather.setNumberOfDigits(nombre entier numberOfDigits)
Définit le nombre de chiffres à collecter.
| Nom | Type | Description |
|---|---|---|
| nombre de chiffres | Entier | Nombre de chiffres à collecter. Zéro n’est pas une valeur valide. |
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment ajouter une action de collecte et définir le nombre de frappes clavier à collecter.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// present the user with a menu
var gather = notifyAction.addGather();
gather.setNumberOfDigits(4); // the user can type four digit
gather.setFinishKey('#'); // # or *, useful for > 1 digits
gather.setTimeout(20); // time to enter answer, in seconds
NotifyAction : addGather.setTimeout(délai d’expiration de l’entier)
Définit le délai d’expiration après lequel la collecte des entrées expire.
| Nom | Type | Description |
|---|---|---|
| timeout | Entier | Nombre de secondes d’attente de l’entrée de l’appelant avant expiration. Valeur par défaut : 10 |
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment ajouter une action de collecte et définir la valeur du délai d’expiration d’entrée.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// present the user with a menu
var gather = notifyAction.addGather();
gather.setNumberOfDigits(4); // the user can type 1 digit
gather.setFinishKey('#'); // # or *, useful for > 1 digits
gather.setTimeout(20); // time to enter answer, in seconds
NotifyAction : addHangUp()
Met fin à un appel téléphonique actif.
| Nom | Type | Description |
|---|---|---|
| Néant |
| Type | Description |
|---|---|
| HangUpAction (Raccrocher) | Action ajoutée à l’objet NotifyAction. |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// hang up
notifyAction.addHangUp();
NotifyAction : addQueue()
Met l’appel en file d’attente, ce qui le met en attente.
| Nom | Type | Description |
|---|---|---|
| Néant |
| Type | Description |
|---|---|
| Action de file d’attente | Action ajoutée à l’objet NotifyAction. Utilisez l’objet QueueAction pour définir le nom de la file d’attente et le comportement de mise en file d’attente ou de retrait de la file d’attente. |
Cet exemple montre comment ajouter l’appel à la file d’attente spécifiée.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// queue the call
var queue = notifyAction.addQueue();
queue.setName('my queue');
Cet exemple montre comment supprimer l’appel de la file d’attente.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// dequeue the call
var queue = notifyAction.addQueue();
queue.setDequeue(true);
NotifyAction : addQueue.setDequeue(booléen retirer de la file d’attente)
Supprime l’appel de la file d’attente des appels actuelle (le retire de « En attente »).
| Nom | Type | Description |
|---|---|---|
| Retirer de la file d’attente | Booléen | Marqueur indiquant s’il faut supprimer l’appel actuel de la file d’attente.
|
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment supprimer l’appel de la file d’attente.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// dequeue the call
var queue = notifyAction.addQueue();
queue.setDequeue(true);
NotifyAction : addQueue.setName(nom de chaîne)
Définit le nom associé à une file d’attente.
| Nom | Type | Description |
|---|---|---|
| nom | Chaîne | Nom à associer à la file d’attente. |
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment définir le nom d’une file d’attente.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// queue the call
var queue = notifyAction.addQueue();
queue.setName('my queue');
Action de notification : addPlay()
Lit un fichier audio lors de l’appel.
| Nom | Type | Description |
|---|---|---|
| Néant |
| Type | Description |
|---|---|
| PlayAction | Action ajoutée à l’objet NotifyAction. Utilisez l’objet PlayAction pour définir l’URL du fichier audio et le nombre de mises en boucle de l’audio. |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a play action
var play = notifyAction.addPlay();
play.setURL('http://www.moviesounds.com/2001/imsorry.wav');
play.setLoop(1);
NotifyAction : addPlay.setLoop(boucle d’entier)
Définit le nombre de fois qu’il faut lire (parcourir en boucle) le fichier audio.
| Nom | Type | Description |
|---|---|---|
| en boucle | Entier | Nombre de lectures du fichier audio. |
| Type | Description |
|---|---|
| nul |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a play action
var play = notifyAction.addPlay();
play.setURL('http://www.moviesounds.com/2001/imsorry.wav');
play.setLoop(2);
NotifyAction : addPlay.setURL(URL de chaîne)
Définit l’URL où obtenir le fichier audio à lire.
| Nom | Type | Description |
|---|---|---|
| URL | Chaîne | URL du fichier audio à lire. |
| Type | Description |
|---|---|
| nul |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a play action
var play = notifyAction.addPlay();
play.setURL('http://www.moviesounds.com/2001/imsorry.wav');
play.setLoop(1);
NotifyAction : addRecord()
Ajoute une action pour enregistrer l’appel à l’objet NotifyAction actuel.
L’enregistrement se termine automatiquement lorsque l’appel est terminé ou lorsqu’une terminaison spécifiée est enfoncée (setFinishKey()). L’enregistrement est ensuite placé dans la table notify_record pour l’appel associé.
| Nom | Type | Description |
|---|---|---|
| Néant |
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment enregistrer un appel.
// First we initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Call addRecord() of NotifyAction – This returns an object of type RecordAction
var recordAction = notifyAction.addRecord();
// Optional. Define the key that callers use to stop the recording
recordAction.setFinishKey('#'); // Stop the call recording when caller presses the '#' key.
NotifyAction : addRecord.setFinishKey(String finishKey)
Définit la clé qui met fin à l’enregistrement.
| Nom | Type | Description |
|---|---|---|
| finishKey | Chaîne | Clé qui met fin à l’enregistrement. Valeurs valides :
|
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment enregistrer un appel et définir la clé de terminaison d’appel.
// First we initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Then we call addRecord() of NotifyAction
var recordAction = notifyAction.addRecord();
// Set the key that terminates the recording
recordAction.setFinishKey('#'); // This means that we stop the call recording when user presses the '#' key.
NotifyAction : addRecord.setMaxDuration(secondes entières)
Définit la durée maximale de l’enregistrement.
| Nom | Type | Description |
|---|---|---|
| secondes | Entier | Durée maximale de l’enregistrement en secondes. Par défaut : 3600 |
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment enregistrer un appel et définir la clé de terminaison d’appel.
// First we initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Then we call addRecord() of NotifyAction
var recordAction = notifyAction.addRecord();
// Set the maximum length of the recording
recordAction.setMaxDuration(4800);
NotifyAction : addRecord.setTimeout(délai d’expiration de l’entier)
Définit le nombre de secondes de silence, après quoi l’enregistrement prend fin.
| Nom | Type | Description |
|---|---|---|
| timeout | Entier | Nombre de secondes de silence sur l’appel, après quoi l’enregistrement prend fin. Valeur par défaut : 10 |
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment enregistrer un appel et définir la valeur du délai d’expiration d’enregistrement.
// First we initialize NotifyAction
var notifyAction = new SNC.NotifyAction();
// Then we call addRecord() of NotifyAction
var recordAction = notifyAction.addRecord();
// Set the recoding timeout value
recordAction.setTimeout(360);
NotifyAction : addReject()
Rejette un appel entrant.
| Nom | Type | Description |
|---|---|---|
| Néant |
| Type | Description |
|---|---|
| Rejeter l’action | Action ajoutée à l’objet NotifyAction. Utilisez l’objet RejectAction pour définir la raison du rejet de l’appel. |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// reject the call
var rejectAction = notifyAction.addReject();
rejectAction.setReason('busy'); // 'busy' or 'rejected'
NotifyActon : addReject.setReason(String reason)
Définit la raison pour laquelle l’appel a été rejeté.
| Nom | Type | Description |
|---|---|---|
| motif | Chaîne | Motif du rejet de l’appel. Valeurs valides :
|
| Type | Description |
|---|---|
| nul |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// reject the call
var rejectAction = notifyAction.addReject();
rejectAction.setReason('busy'); // 'busy' or 'rejected'
NotifyAction : addSay()
Définit la synthèse vocale à lire lors de l’appel.
Plusieurs langues sont prises en charge avec la synthèse vocale. Les langues disponibles dépendent du fournisseur de téléphonie.
| Nom | Type | Description |
|---|---|---|
| Néant |
| Type | Description |
|---|---|
| SayAction (en anglais) | Action ajoutée à l’objet NotifyAction. Utilisez l’objet SayAction pour définir le texte et la langue à lire. |
Cet exemple illustre la lecture de texte dans plusieurs langues.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a say action to say something in US English
var usSay = notifyAction.addSay();
usSay.setText('Welcome. I can speak english');
usSay.setLanguage('en-US');
// add a say action to say something in Dutch
var nlSay = notifyAction.addSay();
nlSay.setText('Ik spreek ook vloeiend nederlands');
nlSay.setLanguage('nl-NL');
// and german
var deSay = notifyAction.addSay();
deSay.setText('Und ich kan auch deutsch sprechen');
deSay.setLanguage('de-DE');
NotifyAction : addSay.setLanguage(String language)
Définit la langue dans laquelle prononcer le texte.
Utilisez cette méthode en conjonction avec la méthode setText() pour définir le verbiage à prononcer.
| Nom | Type | Description |
|---|---|---|
| language | Chaîne | Code de langue ISO 3166 qui définit la langue dans laquelle prononcer le texte associé. Par exemple, « en-US » ou « nl-NL ». |
| Type | Description |
|---|---|
| nul |
Cet exemple illustre la lecture de texte dans plusieurs langues.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a say action to say something in US English
var usSay = notifyAction.addSay();
usSay.setText('Welcome. I can speak english');
usSay.setLanguage('en-US');
// add a say action to say something in Dutch
var nlSay = notifyAction.addSay();
nlSay.setText('Ik spreek ook vloeiend nederlands');
nlSay.setLanguage('nl-NL');
// and german
var deSay = notifyAction.addSay();
deSay.setText('Und ich kan auch deutsch sprechen');
deSay.setLanguage('de-DE');
NotifyAction : addSay.setText(texte de chaîne)
Définit le texte à lire dans l’appel actuel.
Utilisez cette méthode en conjonction avec la méthode setLanguage() pour définir la langue dans laquelle prononcer le texte fourni.
| Nom | Type | Description |
|---|---|---|
| Texte | Chaîne | Texte à lire à haute voix dans l’appel actuel. |
| Type | Description |
|---|---|
| nul |
Cet exemple illustre la lecture de texte dans plusieurs langues.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// add a say action to say something in US English
var usSay = notifyAction.addSay();
usSay.setText('Welcome. I can speak english');
usSay.setLanguage('en-US');
// add a say action to say something in Dutch
var nlSay = notifyAction.addSay();
nlSay.setText('Ik spreek ook vloeiend nederlands');
nlSay.setLanguage('nl-NL');
// and german
var deSay = notifyAction.addSay();
deSay.setText('Und ich kan auch deutsch sprechen');
deSay.setLanguage('de-DE');
NotifyAction : addSMS()
Envoie un SMS.
| Nom | Type | Description |
|---|---|---|
| Néant |
| Type | Description |
|---|---|
| SMSAction | Action ajoutée à l’objet NotifyAction. Utilisez l’objet SMSAction pour définir le texte du message et le numéro de téléphone auquel envoyer le message. |
// Instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// Define where to send the SMS to
var number = new GlideElementPhoneNumber();
number.setPhoneNumber('+31612345678', true);
// Add an SMS action
var sms = notifyAction.addSMS();
sms.setMessage('Lorem ipsum dolor sit amet, consectetur adipiscing elit.');
sms.setTo(number);
NotifyAction : addSMS.setMessage(message de chaîne)
Définit le texte du message SMS à envoyer.
| Nom | Type | Description |
|---|---|---|
| message | Chaîne | Texte du message SMS à envoyer. |
| Type | Description |
|---|---|
| nul |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// define where to send the sms to
var number = new GlideElementPhoneNumber();
number.setPhoneNumber('+31612345678', true);
// add a SMS action
var sms = notifyAction.addSMS();
sms.setMessage('Lorem ipsum dolor sit amet, consectetur adipiscing elit.');
sms.setTo(number);
NotifyAction : addSMS.setTo(chaîne vers)
Définit le numéro de téléphone auquel le message SMS doit être envoyé.
| Nom | Type | Description |
|---|---|---|
| à | Chaîne | Numéro de téléphone conforme à la norme E.164 vers lequel envoyer le message SMS. |
| Type | Description |
|---|---|
| nul |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// define where to send the sms to
var number = new GlideElementPhoneNumber();
number.setPhoneNumber('+31612345678', true);
// add a SMS action
var sms = notifyAction.addSMS();
sms.setMessage('Lorem ipsum dolor sit amet, consectetur adipiscing elit.');
sms.setTo(number);
NotifyAction : ajouter (action NotifyAction)
Ajoute l’objet NotifyAction spécifié à l’objet NotifyAction du client actuel.
- PlayAction
- Action d’enregistrement
- SayAction (en anglais)
- SMSAction
Toutes les autres actions de notification sont terminales. Si vous essayez d’ajouter une autre action de notification après une action de terminal, l’appel échoue.
| Nom | Type | Description |
|---|---|---|
| action | Action de notification | Objet NotifyAction à ajouter à l’objet NotifyAction de l’appelant actuel. |
| Type | Description |
|---|---|
| nul |
NotifyAction : fromJson(chaîne JSON)
Désérialiser un objet NotifyAction à partir d’une chaîne JSON.
| Nom | Type | Description |
|---|---|---|
| JSON | Chaîne | Représentation de chaîne JSON d’un objet NotifyAction . |
| Type | Description |
|---|---|
| nul |
Cet exemple illustre la désérialisation d’un objet NotifyAction.
var json = ".... some json obtained from toJson ....";
// instantiate notify action
var notifyAction = new SNC.NotifyAction();
// deserialize and reconstruct the notify action instance
notifyAction.fromJson(json);
Cet exemple illustre à la fois la sérialisation et la désérialisation d’un objet NotifyAction.
// instantiate notify action
var notifyAction = new SNC.NotifyAction();
// add a queue
var queue = notifyAction.addQueue();
queue.setName('myQueueName');
queue.setDequeue(false);
// serialize to json
var json = notifyAction.toJson();
gs.log('serialization result: ' + json);
// instantiate a new notify action
var newAction = new SNC.NotifyAction();
// deserialize the json generated above
newAction.fromJson(json);
// serialize the new object and log the result
newJson = newAction.toJson();
gs.log('new serialization result: ' + newJson);
gs.log('the same: ' + (json == newJson));
Sortie : *** Script : résultat de sérialisation : {"fClassName » :"NotifyAction »,"fActions » :[{"fClassName » :"QueueAction »,"fDequeue » :true,"fQueueName » :"myQueueName"}]} *** Script : nouveau résultat de sérialisation : {"fClassName » :"NotifyAction »,"fActions » :[{"fClassName » :"QueueAction »,"fDequeue » :true,"fQueueName » :"myQueueName » :"myQueueName"}]} *** Script : le même : vrai
NotifyAction : setCallRecord(GlideRecord callRecord)
Définit l’enregistrement de l’appel de Notification dans lequel ajouter les actions ultérieures.
| Nom | Type | Description |
|---|---|---|
| callRecord | GlideRecord | GlideRecord contenant l’enregistrement de l’appelant (dans la table notify_call) pour lequel ajouter des actions. Cet appelant reste actif jusqu’à ce que cette méthode soit appelée à nouveau avec un autre appelant. |
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment définir l’appelant auquel vous souhaitez ajouter des actions.
public NotifyAction runIncomingCallWorkflow(NotifyPhoneNumber notifyPhoneNumber, GlideRecord callRecord) throws NoWorkflowConfiguredException, NoSuchNotifyGroupRecordException {
NotifyAction notifyAction = runWorkflow(notifyPhoneNumber, COL_INCOMING_CALL_WF, callRecord);
notifyAction.setCallRecord(callRecord);
return notifyAction;
}
NotifyAction : toJson()
Sérialiser l’objet NotifyAction en une chaîne JSON.
| Nom | Type | Description |
|---|---|---|
| Néant |
| Type | Description |
|---|---|
| Chaîne | Représentation JSON de cet objet NotifyAction. |
Cet exemple illustre la sérialisation d’un objet NotifyAction.
// instantiate notify action
var notifyAction = new SNC.NotifyAction();
// add one or more notify actions
// ...
// and serialize to json
var json = notifyAction.toJson();
Cet exemple illustre à la fois la sérialisation et la désérialisation d’un objet NotifyAction.
// instantiate notify action
var notifyAction = new SNC.NotifyAction();
// add a queue
var queue = notifyAction.addQueue();
queue.setName('myQueueName');
queue.setDequeue(false);
// serialize to json
var json = notifyAction.toJson();
gs.log('serialization result: ' + json);
// instantiate a new notify action
var newAction = new SNC.NotifyAction();
// deserialize the json generated above
newAction.fromJson(json);
// serialize the new object and log the result
newJson = newAction.toJson();
gs.log('new serialization result: ' + newJson);
gs.log('the same: ' + (json == newJson));
Sortie : *** Script : résultat de sérialisation : {"fClassName » :"NotifyAction »,"fActions » :[{"fClassName » :"QueueAction »,"fDequeue » :true,"fQueueName » :"myQueueName"}]} *** Script : nouveau résultat de sérialisation : {"fClassName » :"NotifyAction »,"fActions » :[{"fClassName » :"QueueAction »,"fDequeue » :true,"fQueueName » :"myQueueName » :"myQueueName"}]} *** Script : le même : vrai