NotifyAction - Global
A API NotifyAction permite que você defina ações a serem enviadas para um provedor de telefonia.
Você adiciona ações a um objeto NotifyAction chamando a respectiva função de adição para cada tipo de ação. Cada função de adição retorna um objeto Action, como um objetoSayAction para o método addSay(). Consulte cada exemplo de método para obter informações sobre objetos retornados.
NotifyAction – addConference()
Adiciona uma ação de conferência para mover a chamada atual para a chamada em conferência atual.
| Nome | Tipo | Descrição |
|---|---|---|
| Nenhum |
| Tipo | Descrição |
|---|---|
| AçãoConferência | Ação adicionada ao objeto NotifyAction. Use o objeto ConferenceAction para definir o nome da chamada em conferência e o comportamento da chamada em conferência quando um participante entra ou sai. |
Este exemplo demonstra como adicionar uma ação de conferência e definir o nome da conferência.
// 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(Booliano endOnExit)
Define se a chamada em conferência deve terminar quando um chamador especificado sair da chamada em conferência.
| Nome | Tipo | Descrição |
|---|---|---|
| fimEmSaída | Booliano | Sinalizador que indica se a chamada em conferência deve terminar quando o chamador especificado sair da chamada em conferência atual.
|
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo demonstra como adicionar uma ação de chamada em conferência e defini-la para que a chamada em conferência termine quando o solicitante especificado for encerrado.
// 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 (booliano hangupOnStar)
Define se a chamada em conferência deve terminar quando um participante pressiona a tecla asterisco (*).
| Nome | Tipo | Descrição |
|---|---|---|
| hangupOnStar | Booliano | Sinalizador que indica se a chamada em conferência deve terminar quando um participante pressiona a tecla asterisco (*). Valores válidos:
|
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo demonstra como adicionar uma ação de conferência e gravar a chamada em conferência.
// 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 (booliano mudo)
Define se o chamador especificado deve ser mudo na chamada em conferência atual.
Se você não chamar este método, o solicitante não ficará mudo por padrão.
| Nome | Tipo | Descrição |
|---|---|---|
| muted | Booliano | Sinalizador que indica se o chamador especificado deve ser mudo na chamada em conferência atual.
|
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo demonstra como adicionar uma ação de conferência e, em seguida, silenciar um solicitante especificado.
// 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(cadeia de caracteres name)
Define o nome da chamada em conferência atual com o nome especificado.
| Nome | Tipo | Descrição |
|---|---|---|
| nome | Cadeia de caracteres | Nome a ser associado à chamada em conferência atual. |
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo demonstra como adicionar uma ação de conferência e definir o nome da chamada em conferência.
// 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(registro booliano)
Define se a chamada em conferência associada deve ser gravada.
Se você não chamar este método, a chamada em conferência não será gravada por padrão.
| Nome | Tipo | Descrição |
|---|---|---|
| registro | Booliano | Sinalizador que indica se a chamada em conferência atual deve ser gravada.
|
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo demonstra como adicionar uma ação de conferência e gravar a chamada em conferência.
// 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(Booliano startOnEnter)
Define se a chamada em conferência deve ser iniciada quando o solicitante especificado ingressar na chamada em conferência.
Por padrão, sempre que houver dois ou mais solicitantes, a chamada em conferência será iniciada. Para que a chamada em conferência só inicie quando um solicitante específico ingressar, você deve chamar este método para cada um dos outros solicitantes e definir o valor como "falso". Ao fazer isso, a chamada em conferência não será iniciada até que a pessoa desejada ingresse na chamada em conferência.
| Nome | Tipo | Descrição |
|---|---|---|
| inícioEmEntrada | Booliano | Sinalizador que indica se a chamada em conferência deve iniciar quando o chamador selecionado ingressar na chamada em conferência atual.
|
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo demonstra como adicionar uma ação de conferência e defini-la para que a chamada em conferência não inicie até que o solicitante especificado ingresse.
// 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()
Encaminha uma chamada para um número de telefone ou cliente Notify especificado.
Depois que a ação addDial é criada, o número de telefone associado (setPhoneNumber()) ou o Cliente do Notify (setClientRecord()) também deve ser definido.
| Nome | Tipo | Descrição |
|---|---|---|
| Nenhum |
| Tipo | Descrição |
|---|---|
| DialAction | Ação adicionada ao objeto NotifyAction. |
Este exemplo mostra como fazer uma chamada de saída e gravar a chamada.
// 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(cadeia de caracteres callerID)
Define o ID do chamador para a chamada de saída.
| Nome | Tipo | Descrição |
|---|---|---|
| ID do chamador | Cadeia de caracteres | Identificador do solicitante a ser definido para a chamada de saída. |
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo mostra como fazer uma chamada de saída e definir um tempo limite de chamada.
// 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(cadeia de caracteres "tableName", cadeia de caracteres sysID)
Define o solicitante atual para um solicitante do Notify especificando a tabela na qual o registro do solicitante do Notify e o identificador exclusivo do solicitante serão encontrados.
| Nome | Tipo | Descrição |
|---|---|---|
| tableName | Cadeia de caracteres | Nome da tabela que contém as informações do solicitante desejado. |
| sysID | Cadeia de caracteres | Identificador exclusivo (sys_id) do solicitante do Notify desejado. |
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo mostra como definir o solicitante atual como um solicitante do Notify usando 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 (valor da cadeia de caracteres)
Define os tons DTMF a serem reproduzidos quando a chamada for conectada.
| Nome | Tipo | Descrição |
|---|---|---|
| valor | Cadeia de caracteres | Dígitos DTMF válidos a serem reproduzidos quando a chamada for conectada. |
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo mostra como fazer uma chamada de saída e define os tons DTMF a serem reproduzidos quando a chamada for conectada.
// 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 (booliano hangupOnStar)
Define se a chamada deve terminar quando a tecla asterisco (*) for pressionada.
| Nome | Tipo | Descrição |
|---|---|---|
| hangupOnStar | Booliano | Sinalizador que indica se a chamada deve terminar quando a tecla asterisco (*) for pressionada.
|
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo mostra como fazer uma chamada de saída e definir a tecla de desconexão como estrela.
// 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(cadeia de caracteres phoneNumber)
Define o número de telefone a ser chamado.
| Nome | Tipo | Descrição |
|---|---|---|
| phoneNumber | Cadeia de caracteres | Número de telefone compatível com E.164 para ligar. |
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo mostra como fazer uma chamada de saída e definir um tempo limite de chamada.
// 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(registro booliano)
Define se a chamada de saída deve ser gravada.
| Nome | Tipo | Descrição |
|---|---|---|
| registro | Sinalizador que indica se a chamada de saída deve ser gravada. Valores válidos:
|
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo mostra como fazer uma chamada de saída e gravar a chamada.
// 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 (Tempo limite de número inteiro)
Define o número de segundos após o qual a chamada de saída expira.
| Nome | Tipo | Descrição |
|---|---|---|
| tempo limite | Inteiro | Número de segundos após o qual a chamada de saída expira. Padrão: 30 |
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo mostra como fazer uma chamada de saída e definir um tempo limite de chamada.
// 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()
Apresenta um menu de telefone interativo especificado para o solicitante.
| Nome | Tipo | Descrição |
|---|---|---|
| Nenhum |
| Tipo | Descrição |
|---|---|
| Reunir ação | Ação adicionada ao objeto NotifyAction. Use o objeto GatherAction para definir as configurações de menu e as opções a serem apresentadas ao usuário. |
// 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()
Reproduz um arquivo de áudio na chamada.
Consulte o método NotifyAction addPlay() para obter uma descrição dos métodos secundários compatíveis.
| Nome | Tipo | Descrição |
|---|---|---|
| Nenhum |
| Tipo | Descrição |
|---|---|
| PlayAction | Ação adicionada ao objeto NotifyAction. Use o objeto PlayAction para definir o URL do arquivo de áudio e o número de vezes para repetir o áudio. |
// 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()
Define o texto para fala a ser lido na chamada.
Consulte o método NotifyAction addSay() para obter uma descrição dos métodos secundários compatíveis.
| Nome | Tipo | Descrição |
|---|---|---|
| Nenhum |
| Tipo | Descrição |
|---|---|
| DizerAção | Ação adicionada ao objeto NotifyAction. Use o objetoSayAction para definir o texto e o idioma a serem lidos. |
// 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(cadeia de caracteres "FinishKey")
Define a chave que o solicitante insere para denotar o fim da entrada.
| Nome | Tipo | Descrição |
|---|---|---|
| termineKey | Cadeia de caracteres | Chave que denota o fim da entrada do solicitante. Valores válidos:
|
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo mostra como adicionar uma ação de coleta e definir a chave que denota o fim da entrada do solicitante.
// 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(Integer numberOfDigits)
Define o número de dígitos a serem coletados.
| Nome | Tipo | Descrição |
|---|---|---|
| numberOfDigits | Inteiro | Número de dígitos a serem coletados. Zero é um valor inválido. |
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo mostra como adicionar uma ação de coleta e definir o número de toques de tecla a serem coletados.
// 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 (tempo limite de número inteiro)
Define a quantidade de tempo após a qual a coleta de entrada expirará.
| Nome | Tipo | Descrição |
|---|---|---|
| tempo limite | Inteiro | Número de segundos de espera pela entrada do solicitante antes de atingir o tempo limite. Padrão: 10 |
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo mostra como adicionar uma ação de coleta e definir o valor de tempo limite de entrada.
// 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()
Encerra uma chamada telefônica ativa.
| Nome | Tipo | Descrição |
|---|---|---|
| Nenhum |
| Tipo | Descrição |
|---|---|
| HangUpAction | Ação adicionada ao objeto NotifyAction. |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// hang up
notifyAction.addHangUp();
NotifyAction - addQueue()
Coloca a chamada na fila, o que a coloca em espera.
| Nome | Tipo | Descrição |
|---|---|---|
| Nenhum |
| Tipo | Descrição |
|---|---|
| QueueAction | Ação adicionada ao objeto NotifyAction. Use o objeto QueueAction para definir o nome da fila e o comportamento de enfileiramento ou desenfileiramento. |
Este exemplo mostra como adicionar a chamada à fila especificada.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// queue the call
var queue = notifyAction.addQueue();
queue.setName('my queue');
Este exemplo mostra como remover a chamada da fila.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// dequeue the call
var queue = notifyAction.addQueue();
queue.setDequeue(true);
NotifyAction - addQueue.setDequeue(Booliano sem fila)
Remove a chamada da fila de chamadas atual (retira-a da condição "em espera").
| Nome | Tipo | Descrição |
|---|---|---|
| desenfileirar | Booliano | Sinalizador que indica se a chamada atual deve ser removida da fila.
|
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo mostra como remover a chamada da fila.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// dequeue the call
var queue = notifyAction.addQueue();
queue.setDequeue(true);
NotifyAction - addQueue.setName(cadeia de caracteres name)
Define o nome associado a uma fila.
| Nome | Tipo | Descrição |
|---|---|---|
| nome | Cadeia de caracteres | Nome a ser associado à fila. |
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo mostra como definir o nome de uma fila.
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// queue the call
var queue = notifyAction.addQueue();
queue.setName('my queue');
NotifyAction - addPlay()
Reproduz um arquivo de áudio na chamada.
| Nome | Tipo | Descrição |
|---|---|---|
| Nenhum |
| Tipo | Descrição |
|---|---|
| PlayAction | Ação adicionada ao objeto NotifyAction. Use o objeto PlayAction para definir o URL do arquivo de áudio e o número de vezes para repetir o áudio. |
// 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 (loop de número inteiro)
Define o número de vezes para reproduzir (loop through) o arquivo de áudio.
| Nome | Tipo | Descrição |
|---|---|---|
| loop | Inteiro | Número de vezes para reproduzir o arquivo de áudio. |
| Tipo | Descrição |
|---|---|
| vazio |
// 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(cadeia de caracteres URL)
Define a URL de onde obter o arquivo de áudio a ser reproduzido.
| Nome | Tipo | Descrição |
|---|---|---|
| URL | Cadeia de caracteres | URL do arquivo de áudio a ser reproduzido. |
| Tipo | Descrição |
|---|---|
| vazio |
// 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()
Adiciona uma ação para registrar a chamada para o objeto NotifyAction atual.
A gravação termina automaticamente quando a chamada é concluída ou quando um encerramento especificado é pressionado (setFinishKey()). A gravação é então colocada na tabela notify_record para a chamada associada.
| Nome | Tipo | Descrição |
|---|---|---|
| Nenhum |
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo demonstra como gravar uma chamada.
// 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(cadeia de caracteres "FinishKey")
Define a chave que encerra a gravação.
| Nome | Tipo | Descrição |
|---|---|---|
| termineKey | Cadeia de caracteres | Chave que encerra a gravação. Valores válidos:
|
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo demonstra como gravar uma chamada e definir a chave de encerramento de chamada.
// 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(Inteiros segundos)
Define a duração máxima da gravação.
| Nome | Tipo | Descrição |
|---|---|---|
| segundos | Inteiro | Duração máxima da gravação em segundos. Padrão: 3600 |
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo demonstra como gravar uma chamada e definir a chave de encerramento de chamada.
// 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 (tempo limite de número inteiro)
Define o número de segundos de silêncio, após o qual a gravação termina.
| Nome | Tipo | Descrição |
|---|---|---|
| tempo limite | Inteiro | Número de segundos de silêncio na chamada, após o qual a gravação termina. Padrão: 10 |
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo demonstra como gravar uma chamada e definir o valor de tempo limite de gravação.
// 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()
Rejeita uma chamada de entrada.
| Nome | Tipo | Descrição |
|---|---|---|
| Nenhum |
| Tipo | Descrição |
|---|---|
| RejectAction | Ação adicionada ao objeto NotifyAction. Use o objeto RejectAction para definir o motivo da rejeição da chamada. |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// reject the call
var rejectAction = notifyAction.addReject();
rejectAction.setReason('busy'); // 'busy' or 'rejected'
NotifyActon - addReject.setReason(cadeia de caracteres motivo)
Define o motivo pelo qual a chamada foi rejeitada.
| Nome | Tipo | Descrição |
|---|---|---|
| motivo | Cadeia de caracteres | Motivo pelo qual a chamada foi rejeitada. Valores válidos:
|
| Tipo | Descrição |
|---|---|
| vazio |
// instantiate NotifyAction
var notifyAction = new SNC.NotifyAction();
// reject the call
var rejectAction = notifyAction.addReject();
rejectAction.setReason('busy'); // 'busy' or 'rejected'
NotifyAction - addSay()
Define o texto para fala a ser lido na chamada.
Vários idiomas são compatíveis com texto para fala. Os idiomas disponíveis dependem do provedor de telefonia.
| Nome | Tipo | Descrição |
|---|---|---|
| Nenhum |
| Tipo | Descrição |
|---|---|
| DizerAção | Ação adicionada ao objeto NotifyAction. Use o objetoSayAction para definir o texto e o idioma a serem lidos. |
Este exemplo demonstra a leitura de texto em vários idiomas.
// 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(cadeia de caracteres idioma)
Define o idioma no qual o texto será falado.
Use este método em conjunto com o método setText() para definir o texto a ser falado.
| Nome | Tipo | Descrição |
|---|---|---|
| idioma | Cadeia de caracteres | Código de idioma ISO 3166 que define o idioma no qual o texto associado será falado. Por exemplo, "en-US" ou "nl-NL". |
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo demonstra a leitura de texto em vários idiomas.
// 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(cadeia de caracteres text)
Define o texto a ser lido na chamada atual.
Use este método em conjunto com o método setLanguage() para definir o idioma no qual o texto fornecido será falado.
| Nome | Tipo | Descrição |
|---|---|---|
| texto | Cadeia de caracteres | Texto a ser lido em voz alta na chamada atual. |
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo demonstra a leitura de texto em vários idiomas.
// 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()
Envia uma mensagem SMS.
| Nome | Tipo | Descrição |
|---|---|---|
| Nenhum |
| Tipo | Descrição |
|---|---|
| AçãoSMS | Ação adicionada ao objeto NotifyAction. Use o objeto SMSAction para definir o texto da mensagem e o número de telefone para o qual a mensagem será enviada. |
// 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 (cadeia de caracteres mensagem)
Define o texto da mensagem SMS a ser enviada.
| Nome | Tipo | Descrição |
|---|---|---|
| message | Cadeia de caracteres | Texto da mensagem SMS a ser enviada. |
| Tipo | Descrição |
|---|---|
| vazio |
// 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(cadeia de caracteres para)
Define o número de telefone para o qual a mensagem SMS será enviada.
| Nome | Tipo | Descrição |
|---|---|---|
| a | Cadeia de caracteres | Número de telefone compatível com E.164 para o qual a mensagem SMS será enviada. |
| Tipo | Descrição |
|---|---|
| vazio |
// 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 - append(ação NotifyAction)
Anexa o objeto NotifyAction especificado ao objeto NotifyAction do cliente atual.
- PlayAction
- Ação de Registro
- DizerAção
- AçãoSMS
Todas as outras NotifyActions são de terminal. Se você tentar adicionar outra NotifyAction após uma ação de terminal, a chamada falhará.
| Nome | Tipo | Descrição |
|---|---|---|
| ação | NotifyAction | Objeto NotifyAction a ser anexado ao objeto NotifyAction do solicitante atual. |
| Tipo | Descrição |
|---|---|
| vazio |
NotifyAction - fromJson(cadeia de caracteres json)
Desserializar um objeto NotifyAction de uma cadeia de caracteres JSON.
| Nome | Tipo | Descrição |
|---|---|---|
| json | Cadeia de caracteres | Uma representação de cadeia de caracteres JSON de um objeto NotifyAction. |
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo demonstra como desserializar um objeto 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);
Este exemplo demonstra a serialização e a desserialização de um objeto 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));
Saída: *** Script: resultado da serialização: {"fClassName":"NotifyAction","fActions":[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}]} * ** Script: novo resultado de serialização: {"fClassName":"NotifyAction","fActions":[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}]} *** Script: o mesmo: verdadeiro
NotifyAction - setCallRecord(GlideRecord callRecord)
Define o registro de chamada do Notify ao qual ações subsequentes são adicionadas.
| Nome | Tipo | Descrição |
|---|---|---|
| registro de chamada | GlideRecord | GlideRecord que contém o registro do solicitante (dentro da tabela notify_call) para o qual ações serão adicionadas. Este solicitante permanece em vigor até que este método seja chamado novamente com um solicitante diferente. |
| Tipo | Descrição |
|---|---|
| vazio |
Este exemplo mostra como definir o solicitante ao qual você deseja adicionar ações.
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()
Serialize o objeto NotifyAction para uma cadeia de caracteres JSON.
| Nome | Tipo | Descrição |
|---|---|---|
| Nenhum |
| Tipo | Descrição |
|---|---|
| Cadeia de caracteres | Representação JSON deste objeto NotifyAction. |
Este exemplo demonstra a serialização de um objeto NotifyAction.
// instantiate notify action
var notifyAction = new SNC.NotifyAction();
// add one or more notify actions
// ...
// and serialize to json
var json = notifyAction.toJson();
Este exemplo demonstra a serialização e a desserialização de um objeto 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));
Saída: *** Script: resultado da serialização: {"fClassName":"NotifyAction","fActions":[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}]} * ** Script: novo resultado de serialização: {"fClassName":"NotifyAction","fActions":[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}]} *** Script: o mesmo: verdadeiro