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 add 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 retournés.
NotifyAction : addConference()
Ajoute une action de conférence pour déplacer l’appel en cours vers la téléconférence en cours.
| Nom | Type | Description |
|---|---|---|
| Aucun |
| 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 quand un participant rejoint ou quitte la téléconférence. |
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 se terminer 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 se terminer lorsque l’appelant spécifié 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 configurer de façon à ce que la téléconférence se termine lorsque l’appelant spécifié quitte.
// 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);
}
NotifyAction : addConference.setHangupOnStar(booléen hangupOnStar)
Définit si la téléconférence doit se terminer lorsqu’un participant appuie sur la touche étoile (*).
| Nom | Type | Description |
|---|---|---|
| raccrocherOnStar | Booléen | Marqueur indiquant si la téléconférence doit se terminer 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);
NotifyAction : addConference.setMuted(booléen en sourdine)
Définit si le micro de l’appelant spécifié doit être désactivé pendant la téléconférence en cours.
Si vous n’appelez pas cette méthode, le son de l’appelant n’est pas désactivé par défaut.
| Nom | Type | Description |
|---|---|---|
| assourdi | Booléen | Marqueur indiquant si le micro de l’appelant spécifié doit être désactivé pendant la téléconférence en cours.
|
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment ajouter une action de conférence, puis couper le son 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 actuelle sur le nom spécifié.
| Nom | Type | Description |
|---|---|---|
| nom | Chaîne | Nom à associer à la téléconférence actuelle. |
| 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);
NotifyAction : addConference.setStartOnEnter(booléen startOnEnter)
Définit si la téléconférence doit commencer lorsque l’appelant spécifié rejoint la téléconférence.
Par défaut, chaque fois qu’il y a deux appelants ou plus, la téléconférence démarre. Pour que la téléconférence ne commence que lorsqu’un appelant spécifique rejoint, vous devez appeler cette méthode pour chacun des autres appelants et définir la valeur sur « faux ». En faisant cela, la téléconférence ne commencera pas tant que la personne souhaitée n’aura pas rejoint la téléconférence.
| Nom | Type | Description |
|---|---|---|
| startOnEnter | Booléen | Marqueur indiquant si la téléconférence doit commencer 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 manière à ce que la téléconférence ne démarre pas tant que l’appelant spécifié ne la rejoint pas.
// 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 à un numéro de téléphone spécifié ou Notifier le client.
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 |
|---|---|---|
| Aucun |
| Type | Description |
|---|---|
| DialAction | Action ajoutée à l’objet NotifyAction. |
Cet exemple montre comment passer 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 |
|---|---|---|
| ID de l’appelant | Chaîne | Identificateur de l’appelant à définir pour l’appel sortant. |
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment passer un appel sortant et définir un délai d’expiration d’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');
// Set the caller ID
dialAction.setCallerID('Planning Conf Call');
NotifyAction : addDial.setClientRecord(String tableName, String sysID)
Définit l’appelant actuel en appelant Notification en spécifiant la table dans laquelle rechercher l’enregistrement de l’appelant Notification et l’identificateur unique de l’appelant.
| Nom | Type | Description |
|---|---|---|
| tableName | Chaîne | Nom de la table qui contient les informations sur l’appelant souhaité. |
| sysID | Chaîne | Identificateur unique (sys_id) de l’appelant Notification souhaité. |
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment définir l’appelant actuel en appelant 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 à jouer 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");
NotifyAction : addDial.setHangupOnStar(booléen hangupOnStar)
Définit si l’appel doit se terminer lorsque la touche étoile (*) est enfoncée.
| Nom | Type | Description |
|---|---|---|
| raccrocherOnStar | 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 suspension en é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(String 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 passer un appel sortant et définir un délai d’expiration d’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');
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 passer 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 nombre 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 passer un appel sortant et définir un délai d’expiration d’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');
// 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 |
|---|---|---|
| Aucun |
| Type | Description |
|---|---|
| GatherAction (en anglais seulement) | Action ajoutée à l’objet NotifyAction. Utilisez l’objet GatherAction pour définir les paramètres et les options du menu à 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 pendant l’appel.
Reportez-vous à la méthode NotifyAction addPlay() pour obtenir une description des méthodes enfants prises en charge.
| Nom | Type | Description |
|---|---|---|
| Aucun |
| Type | Description |
|---|---|
| PlayAction (en anglais) | Action ajoutée à l’objet NotifyAction. Utilisez l’objet PlayAction pour définir l’URL du fichier audio et le nombre de fois que l’audio doit être mis en boucle. |
// 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.
Reportez-vous à la méthode NotifyAction addSay() pour obtenir une description des méthodes enfants prises en charge.
| Nom | Type | Description |
|---|---|---|
| Aucun |
| Type | Description |
|---|---|
| SayAction (en anglais seulement) | 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é saisie par l’appelant 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 indique 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
NotifyAction : addGather.setNumberOfDigits(nombre entier de chiffres)
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 après lequel la collecte des entrées expire.
| Nom | Type | Description |
|---|---|---|
| timeout | Entier | Nombre de secondes pendant lesquelles attendre l’entrée de l’appelant avant d’expirer. 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 de l’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 |
|---|---|---|
| Aucun |
| Type | Description |
|---|---|
| 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 |
|---|---|---|
| Aucun |
| 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 dequeue)
Supprime l’appel de la file d’attente d’appels actuelle (le retire de la « mise 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');
NotifyAction : addPlay()
Lit un fichier audio pendant l’appel.
| Nom | Type | Description |
|---|---|---|
| Aucun |
| Type | Description |
|---|---|
| PlayAction (en anglais) | Action ajoutée à l’objet NotifyAction. Utilisez l’objet PlayAction pour définir l’URL du fichier audio et le nombre de fois que l’audio doit être mis en boucle. |
// 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 entière)
Définit le nombre de fois qu’il faut lire (boucler) le fichier audio.
| Nom | Type | Description |
|---|---|---|
| boucle | Entier | Nombre de fois que le fichier audio sera lu. |
| 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 la chaîne)
Définit l’URL à laquelle 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 touche de terminaison spécifiée est enfoncée (setFinishKey()). L’enregistrement est ensuite placé dans la table notify_record de l’appel associé.
| Nom | Type | Description |
|---|---|---|
| Aucun |
| 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 fin 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(nombre entier en secondes)
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 : 3 600 |
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment enregistrer un appel et définir la clé de fin 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 nombre entier)
Définit le nombre de secondes de silence, après quoi l’enregistrement se termine.
| Nom | Type | Description |
|---|---|---|
| timeout | Entier | Nombre de secondes de silence sur l’appel, après quoi l’enregistrement se termine. Par défaut : 10 |
| Type | Description |
|---|---|
| nul |
Cet exemple montre comment enregistrer un appel et définir la valeur du délai d’expiration de l’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 |
|---|---|---|
| Aucun |
| Type | Description |
|---|---|
| Action de rejet | Action ajoutée à l’objet NotifyAction. Utilisez l’objet RejectAction pour définir le motif 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(motif de la chaîne)
Définit le motif de rejet de l’appel.
| 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 de l’opérateur de téléphonie.
| Nom | Type | Description |
|---|---|---|
| Aucun |
| Type | Description |
|---|---|
| SayAction (en anglais seulement) | 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 en 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(langue de chaîne)
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 à parler.
| 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 en 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 en cours. |
| Type | Description |
|---|---|
| nul |
Cet exemple illustre la lecture de texte en 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 message SMS.
| Nom | Type | Description |
|---|---|---|
| Aucun |
| 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 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(String to)
Définit le numéro de téléphone auquel envoyer le SMS.
| Nom | Type | Description |
|---|---|---|
| à | Chaîne | Numéro de téléphone compatible E.164 sur 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 (en anglais)
- RecordAction
- SayAction (en anglais seulement)
- SMSAction
Tous les autres NotifyActions sont terminaux. Si vous essayez d’ajouter une autre NotifyAction après une action de terminal, l’appel échouera.
| Nom | Type | Description |
|---|---|---|
| action | NotifyAction (en anglais seulement) | 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 la 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"}]} *** Script : identique : vrai
NotifyAction : setCallRecord(GlideRecord callRecord)
Définit l’enregistrement d’appel de Notification dans lequel ajouter des actions suivantes.
| Nom | Type | Description |
|---|---|---|
| callRecord | GlideRecord | GlideRecord contenant l’enregistrement de l’appelant (dans la table notify_call) pour lequel des actions doivent être ajoutées. Cet appelant reste dans l’effet 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 |
|---|---|---|
| Aucun |
| 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 la 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"}]} *** Script : identique : vrai