NotifyAction - Global

  • Versão de lançamento: Zurich
  • Atualizado 31 de jul. de 2025
  • 23 min. de leitura
  • . NotifyAction A API permite definir ações a serem enviadas para um provedor de telefonia.

    Você adiciona ações a um objeto NotifyAction chamando a respectiva função ADD para cada tipo de ação. Cada função ADD retorna um objeto Action, como um objeto SayAction para AddSay() método. Consulte cada exemplo de método para obter informações sobre objetos retornados.

    Nota:
    . NotifyAction A API só é válida em aplicações globais. Para utilizar esse tipo de funcionalidade em aplicações com escopo, você deve criar atividades de fluxo de trabalho personalizadas do Notify. Para obter informações adicionais sobre como criar essas atividades, consulte Atividades de fluxo de trabalho do Notify .

    NotifyAction - addConference()

    Adiciona uma ação de conferência para mover a chamada atual para a chamada em conferência atual.

    Tabela 1. Parâmetros
    Nome Tipo Descrição
    Nenhum
    Tabela 2. Retorna
    Tipo Descrição
    ConferenceAction 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 ingressar ou sair.

    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(Boolean endOnExit)

    Define se a chamada em conferência deve terminar quando um chamador especificado sai da chamada em conferência.

    Tabela 3. Parâmetros
    Nome Tipo Descrição
    EndOnExit Booliano Sinalizador que indica se a chamada em conferência deve terminar quando o chamador especificado sai da chamada em conferência atual.
    • verdadeiro: encerra a chamada em conferência quando o chamador especificado sair da chamada em conferência
    • Falso: Padrão. Encerre a chamada em conferência depois que todos os participantes saírem
    Tabela 4. Retornos
    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 chamador especificado sair.

    // 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(Boolean hangupOnStar)

    Define se a chamada em conferência deve terminar quando um participante pressiona a tecla asterisco (*).

    Tabela 5. Parâmetros
    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:

    • verdadeiro: encerra a chamada em conferência
    • Falso: Padrão. Não encerre a chamada em conferência
    Tabela 6. Retornos
    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(Boolean mudo)

    Define se o chamador especificado deve ser silenciado na chamada em conferência atual.

    Se você não chamar este método, o chamador não será silenciado por padrão.

    Tabela 7. Parâmetros
    Nome Tipo Descrição
    muted Booliano Sinalizador que indica se o chamador especificado deve ser silenciado na chamada em conferência atual.
    • verdadeiro: o chamador deve estar mudo
    • Falso: Padrão. O chamador não deve ser silenciado
    Tabela 8. Retornos
    Tipo Descrição
    vazio

    Este exemplo demonstra como adicionar uma ação de conferência e silenciar um chamador 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(String nome)

    Define o nome da chamada em conferência atual com o nome especificado.

    Tabela 9. Parâmetros
    Nome Tipo Descrição
    nome Cadeia de caracteres Nome a ser associado à chamada em conferência atual.
    Tabela 10. Retornos
    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(Boolean registro)

    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.

    Tabela 11. Parâmetros
    Nome Tipo Descrição
    registro Booliano Sinalizador que indica se a chamada em conferência atual deve ser gravada.
    • verdadeiro: comece a gravar a chamada em conferência
    • Falso: Padrão. A chamada em conferência não foi gravada. Se estiver sendo gravada no momento, a gravação será interrompida.
    Tabela 12. Retornos
    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(Boolean startOnEnter)

    Define se a chamada em conferência deve ser iniciada quando o chamador especificado ingressar na chamada em conferência.

    Por padrão, sempre que houver dois ou mais chamadores, a chamada em conferência será iniciada. Para que a chamada em conferência comece somente quando um chamador específico ingressar, você deve chamar esse método para cada um dos outros chamadores 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.

    Tabela 13. Parâmetros
    Nome Tipo Descrição
    StartOnEnter Booliano Sinalizador que indica se a chamada em conferência deve ser iniciada quando o chamador selecionado ingressar na chamada em conferência atual.
    • Verdadeiro: Padrão. Inicie a chamada em conferência quando o chamador especificado ingressar na chamada em conferência.
    • falso: inicie a chamada em conferência depois que ela for adicionada
    Tabela 14. Retornos
    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 chamador 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 especificado ou Cliente do Notify.

    Quando a ação addDial é criada, o número de telefone associado ( SetPhoneNumber() Notify Client ( SetClientRecord() ) também deve ser definido.

    Tabela 15. Parâmetros
    Nome Tipo Descrição
    Nenhum
    Tabela 16. Retorna
    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(String callerID)

    Define o ID do chamador para a chamada de saída.

    Tabela 17. Parâmetros
    Nome Tipo Descrição
    CallerID Cadeia de caracteres Identificador do chamador a ser definido para a chamada de saída.
    Tabela 18. Retornos
    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(String tablename, cadeia de caracteres SYSID)

    Define o solicitante atual como um solicitante do Notify especificando a tabela na qual encontrar o registro do solicitante do Notify e o identificador exclusivo do solicitante.

    Tabela 19. Parâmetros
    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 chamador do Notify desejado.
    Tabela 20. Retornos
    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(String valor)

    Define os tons DTMF a serem reproduzidos quando a chamada é conectada.

    Tabela 21. Parâmetros
    Nome Tipo Descrição
    valor Cadeia de caracteres Dígitos DTMF válidos a serem reproduzidos quando a chamada for conectada.
    Tabela 22. Retornos
    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(Boolean hangupOnStar)

    Define se a chamada deve terminar quando a tecla asterisco (*) é pressionada.

    Tabela 23. Parâmetros
    Nome Tipo Descrição
    hangupOnStar Booliano Sinalizador que indica se a chamada deve terminar quando a tecla asterisco (*) é pressionada.
    • verdadeiro: encerra a chamada
    • falso: não encerre a chamada
    Tabela 24. Retornos
    Tipo Descrição
    vazio

    Este exemplo mostra como fazer uma chamada de saída e definir a tecla de desligamento 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(String phoneNumber)

    Define o número de telefone a ser chamado.

    Tabela 25. Parâmetros
    Nome Tipo Descrição
    phoneNumber Cadeia de caracteres Número de telefone compatível com E.164 para ligar.
    Tabela 26. Retornos
    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(Boolean registro)

    Define se a chamada de saída deve ser gravada.

    Tabela 27. Parâmetros
    Nome Tipo Descrição
    registro Sinalizador que indica se a chamada de saída deve ser gravada.

    Valores válidos:

    • verdadeiro: grave a chamada de saída
    • falso: não grave a chamada de saída
    Tabela 28. Retornos
    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 - tempo limite de addDial.setTimeout(Integer)

    Define o número de segundos após os quais a chamada de saída expira.

    Tabela 29. Parâmetros
    Nome Tipo Descrição
    timeout Inteiro Número de segundos após os quais a chamada de saída atinge o tempo limite. Padrão: 30
    Tabela 30. Retornos
    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 chamador.

    Tabela 31. Parâmetros
    Nome Tipo Descrição
    Nenhum
    Tabela 32. Retorna
    Tipo Descrição
    GatherAction Ação adicionada ao objeto NotifyAction. Use o objeto GatherAction para definir as configurações e opções de menu 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 NotifyAction AddPlay() método para uma descrição dos métodos secundários compatíveis.

    Tabela 33. Parâmetros
    Nome Tipo Descrição
    Nenhum
    Tabela 34. Retorna
    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 a conversão de texto em fala a ser lida na chamada.

    Consulte NotifyAction AddSay() método para uma descrição dos métodos secundários compatíveis.

    Tabela 35. Parâmetros
    Nome Tipo Descrição
    Nenhum
    Tabela 36. Retorna
    Tipo Descrição
    SayAction Ação adicionada ao objeto NotifyAction. Use o objeto SayAction 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(String finishKey)

    Define a chave que o chamador insere para indicar o fim da entrada.

    Tabela 37. Parâmetros
    Nome Tipo Descrição
    FinishKey Cadeia de caracteres Chave que indica o fim da entrada do chamador.

    Valores válidos:

    • 0-9
    • (padrão)
    • *
    Tabela 38. Retornos
    Tipo Descrição
    vazio

    Este exemplo mostra como adicionar uma ação Coletar e definir a chave que denota o fim da entrada do chamador.

    // 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.

    Tabela 39. Parâmetros
    Nome Tipo Descrição
    NumberOfDigits Inteiro Número de dígitos a serem coletados. Zero é um valor inválido.
    Tabela 40. Retornos
    Tipo Descrição
    vazio

    Este exemplo mostra como adicionar uma ação Coletar e definir o número de pressionamentos 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 - tempo limite de addGather.setTimeout(Integer)

    Define a quantidade de tempo após o qual a coleta de entrada atingirá o tempo limite.

    Tabela 41. Parâmetros
    Nome Tipo Descrição
    timeout Inteiro Número de segundos para aguardar a entrada do chamador antes de expirar. Padrão: 10
    Tabela 42. Retornos
    Tipo Descrição
    vazio

    Este exemplo mostra como adicionar uma ação Coletar e definir o valor do 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.

    Tabela 43. Parâmetros
    Nome Tipo Descrição
    Nenhum
    Tabela 44. Retorna
    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 coloca a chamada em espera.

    Tabela 45. Parâmetros
    Nome Tipo Descrição
    Nenhum
    Tabela 46. Retorna
    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(Boolean retirada da fila)

    Remove a chamada da fila de chamadas atual (tira-a da "espera").

    Tabela 47. Parâmetros
    Nome Tipo Descrição
    remover da fila Booliano Sinalizador que indica se a chamada atual deve ser removida da fila.
    • verdadeiro: remova a chamada da fila
    • falso: a chamada foi colocada na fila
    Tabela 48. Retornos
    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(String nome)

    Define o nome associado a uma fila.

    Tabela 49. Parâmetros
    Nome Tipo Descrição
    nome Cadeia de caracteres Nome a ser associado à fila.
    Tabela 50. Retornos
    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.

    Tabela 51. Parâmetros
    Nome Tipo Descrição
    Nenhum
    Tabela 52. Retorna
    Tipo Descrição
    PlayAction Ação adicionada ao objeto NotifyAction. Use o objeto PlayAction para definir a 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 - loop addPlay.setLoop(Integer)

    Define o número de vezes para reproduzir (loop-through) o arquivo de áudio.

    Tabela 53. Parâmetros
    Nome Tipo Descrição
    loop Inteiro Número de vezes para reproduzir o arquivo de áudio.
    Tabela 54. Retornos
    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(String url)

    Define o URL onde o arquivo de áudio será obtido.

    Tabela 55. Parâmetros
    Nome Tipo Descrição
    URL Cadeia de caracteres URL do arquivo de áudio a ser reproduzido.
    Tabela 56. Retornos
    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 ao objeto NotifyAction atual.

    A gravação termina automaticamente quando a chamada é concluída ou quando um término especificado é pressionado ( SetFinishKey() ). A gravação é colocada na tabela notify_record da chamada associada.

    Tabela 57. Parâmetros
    Nome Tipo Descrição
    Nenhum
    Tabela 58. Retorna
    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(String finishKey)

    Define a chave que encerra a gravação.

    Tabela 59. Parâmetros
    Nome Tipo Descrição
    FinishKey Cadeia de caracteres Chave que encerra a gravação.

    Valores válidos:

    • 0-9
    • (padrão)
    • *
    Tabela 60. Retornos
    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(Integer segundos)

    Define a duração máxima da gravação.

    Tabela 61. Parâmetros
    Nome Tipo Descrição
    segundos Inteiro Duração máxima da gravação em segundos. Padrão: 3600
    Tabela 62. Retornos
    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 - tempo limite de addRecord.setTimeout(Integer)

    Define o número de segundos de silêncio, após o qual a gravação termina.

    Tabela 63. Parâmetros
    Nome Tipo Descrição
    timeout Inteiro Número de segundos de silêncio na chamada, após os quais a gravação termina. Padrão: 10
    Tabela 64. Retornos
    Tipo Descrição
    vazio

    Este exemplo demonstra como gravar uma chamada e definir o valor do 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.

    Tabela 65. Parâmetros
    Nome Tipo Descrição
    Nenhum
    Tabela 66. Retorna
    Tipo Descrição
    Rejeitar Ação 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(String motivo)

    Define o motivo pelo qual a chamada foi rejeitada.

    Tabela 67. Parâmetros
    Nome Tipo Descrição
    motivo Cadeia de caracteres Motivo pelo qual a chamada foi rejeitada.

    Valores válidos:

    • ocupado
    • rejeitado
    Todos os outros valores são ignorados.
    Tabela 68. Retornos
    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 a conversão de texto em fala a ser lida na chamada.

    A conversão de texto em fala é compatível com vários idiomas. Os idiomas disponíveis dependem do provedor de telefonia.

    Tabela 69. Parâmetros
    Nome Tipo Descrição
    Nenhum
    Tabela 70. Retorna
    Tipo Descrição
    SayAction Ação adicionada ao objeto NotifyAction. Use o objeto SayAction 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(String idioma)

    Define o idioma no qual o texto será falado.

    Use este método em conjunto com SetText() método para definir o texto a ser falado.

    Tabela 71. Parâmetros
    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".
    Tabela 72. Retornos
    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(String texto)

    Define o texto a ser lido na chamada atual.

    Use este método em conjunto com SetLanguage() método para definir o idioma no qual falar o texto fornecido.

    Tabela 73. Parâmetros
    Nome Tipo Descrição
    texto Cadeia de caracteres Texto a ser lido em voz alta na chamada atual.
    Tabela 74. Retornos
    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.

    Nota:
    Ao usar esta função com uma chamada ativa, você não precisa chamar o. Definir como Função no objeto SMSSction retornado. O SMS é enviado automaticamente para o chamador.
    Tabela 75. Parâmetros
    Nome Tipo Descrição
    Nenhum
    Tabela 76. Retorna
    Tipo Descrição
    SCSção 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(String mensagem)

    Define o texto da mensagem SMS a ser enviada.

    Tabela 77. Parâmetros
    Nome Tipo Descrição
    message Cadeia de caracteres Texto da mensagem SMS a ser enviada.
    Tabela 78. Retornos
    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(String a)

    Define o número de telefone para o qual a mensagem SMS será enviada.

    Tabela 79. Parâmetros
    Nome Tipo Descrição
    para Cadeia de caracteres Número de telefone compatível com E.164 para o qual enviar a mensagem SMS.
    Tabela 80. Retornos
    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 - anexar (ação NotifyAction)

    Anexa o objeto NotifyAction especificado ao objeto NotifyAction do cliente atual.

    Há dois tipos de NotifyActions: Terminal e não-terminal. Depois de anexar uma ação de terminal ao objeto NotifyAction de um cliente, você não poderá anexar nenhuma ação adicional. As ações não terminais incluem:
    • PlayAction
    • Ação de Registro
    • SayAction
    • SCSção

    NotifyActions são terminais. Se você tentar adicionar outra NotifyAction após uma ação de terminal, a chamada falhará.

    Tabela 81. Parâmetros
    Nome Tipo Descrição
    ação NotifyAction Objeto NotifyAction a ser anexado ao objeto NotifyAction do solicitante atual.
    Tabela 82. Retornos
    Tipo Descrição
    vazio

    NotifyAction - fromJson(cadeia de caracteres json)

    Desserializar um NotifyAction Objeto de uma cadeia de caracteres JSON.

    Tabela 83. Parâmetros
    Nome Tipo Descrição
    json Cadeia de caracteres Uma representação de cadeia de caracteres JSON de um NotifyAction objeto.
    Tabela 84. Retornos
    Tipo Descrição
    vazio

    Este exemplo demonstra a desserialização de 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));

    Script: Resultado da serialização:("fClassName":"NotifyAction", "Factions":[["fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueue"]) ** Script: Novo resultado da serialização

    NotifyAction - setCallRecord(GlideRecord CallRecord CallRecord)

    Define o registro de chamada do Notify no qual as ações subsequentes serão adicionadas.

    Tabela 85. Parâmetros
    Nome Tipo Descrição
    CallRecord GlideRecord GlideRecord que contém o registro do chamador (na tabela notify_call) para o qual adicionar ações. Este chamador permanece em efeito até que este método seja chamado novamente com um chamador diferente.
    Tabela 86. Retornos
    Tipo Descrição
    vazio

    Este exemplo mostra como definir o chamador 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()

    Serializar o. NotifyAction Objeto para uma cadeia de caracteres JSON.

    Tabela 87. Parâmetros
    Nome Tipo Descrição
    Nenhum
    Tabela 88. Retorna
    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));

    Script: Resultado da serialização:("fClassName":"NotifyAction", "Factions":[["fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueue"]) ** Script: Novo resultado da serialização