NotifyAction - 전역

  • 릴리스 버전: Washingtondc
  • 업데이트 날짜 2024년 02월 01일
  • 읽기44분
  • NotifyAction API를 사용하면 전화 통신 공급자에게 보낼 작업을 정의할 수 있습니다.

    각 작업 유형에 대해 각각의 add 함수를 호출하여 NotifyAction 개체에 작업을 추가합니다. 각 add 함수는 addSay() 함수에 대한 SayAction 객체와 같은 Action 객체를 반환합니다. 반환된 개체에 대한 자세한 내용은 각 메서드 예제를 참조하세요.

    주:
    NotifyAction API는 전역 애플리케이션 내에서만 유효합니다. 범위가 지정된 애플리케이션에서 이 유형의 기능을 활용하려면 사용자 지정 알림 워크플로우 활동을 만들어야 합니다. 이러한 활동을 만드는 방법에 대한 자세한 내용은 Notify 워크플로 활동을 참조하십시오.

    알림 작업 - addConference()

    현재 통화를 현재 전화 회의로 이동하는 전화 회의 동작을 추가합니다.

    표 1. 매개변수
    이름 유형 설명
    없음
    표 2. 반환
    유형 설명
    ConferenceAction(컨퍼런스 작업) NotifyAction 객체에 추가된 작업입니다. ConferenceAction 개체를 사용하여 전화 회의 이름과 참가자가 참가하거나 나갈 때 전화 회의의 동작을 정의할 수 있습니다.

    이 예제에서는 전화 회의 동작을 추가하고 전화 회의 이름을 설정하는 방법을 보여 줍니다.

    // 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');

    알림 - addConference.setEndOnExit(부울 endOnExit)

    지정된 호출자가 전화 회의를 종료할 때 전화 회의를 종료할지 여부를 정의합니다.

    표 3. 매개변수
    이름 유형 설명
    endOnExit 부울 지정된 호출자가 현재 전화 회의를 종료할 때 전화 회의를 종료해야 하는지 여부를 나타내는 플래그입니다.
    • true: 지정된 호출자가 전화 회의를 종료하면 전화 회의를 종료합니다.
    • false: 기본값입니다. 모든 참가자가 나가면 전화 회의를 종료합니다.
    표 4. 반환
    유형 설명
    void

    이 예제에서는 전화 회의 동작을 추가한 다음 지정된 호출자가 나갈 때 전화 회의가 종료되도록 설정하는 방법을 보여 줍니다.

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

    참가자가 별표(*) 키를 누를 때 전화 회의를 종료해야 하는지 여부를 정의합니다.

    표 5. 매개변수
    이름 유형 설명
    행업온스타 부울 참가자가 별표(*) 키를 누를 때 전화 회의를 종료할지 여부를 나타내는 플래그입니다.

    유효한 값은 다음과 같습니다.

    • true: 전화 회의를 종료합니다.
    • false: 기본값입니다. 전화 회의를 종료하지 마십시오.
    표 6. 반환
    유형 설명
    void

    이 예는 전화 회의 동작을 추가한 다음 전화 회의를 기록하는 방법을 보여줍니다.

    // 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);

    알림 작업 - addConference.setMuted(부울 음소거)

    현재 전화 회의에서 지정된 호출자를 음소거해야 하는지 여부를 정의합니다.

    이 메서드를 호출하지 않으면 기본적으로 호출자가 음소거되지 않습니다.

    표 7. 매개변수
    이름 유형 설명
    음소거 부울 현재 전화 회의에서 지정된 호출자를 음소거해야 하는지 여부를 나타내는 플래그입니다.
    • true: 호출자를 음소거해야 합니다.
    • false: 기본값입니다. 호출자는 음소거할 수 없습니다.
    표 8. 반환
    유형 설명
    void

    이 예제에서는 전화 회의 동작을 추가한 다음 지정된 호출자를 음소거하는 방법을 보여 줍니다.

    // 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);
    }

    알림 작업 - addConference.setName(문자열 이름)

    현재 전화 회의의 이름을 지정된 이름으로 설정합니다.

    표 9. 매개변수
    이름 유형 설명
    이름 문자열 현재 전화 회의에 연결할 이름입니다.
    표 10. 반환
    유형 설명
    void

    이 예제에서는 전화 회의 작업을 추가하고 전화 회의 이름을 설정하는 방법을 보여 줍니다.

    // 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(부울 기록)

    관련된 전화 회의를 기록할지 여부를 정의합니다.

    이 메서드를 호출하지 않으면 기본적으로 전화 회의가 녹음되지 않습니다.

    표 11. 매개변수
    이름 유형 설명
    기록 부울 현재 전화 회의를 기록할지 여부를 나타내는 플래그입니다.
    • true: 전화 회의 녹음 시작
    • false: 기본값입니다. 전화 회의가 녹음되지 않았습니다. 현재 기록되고 있으면 기록이 중지됩니다.
    표 12. 반환
    유형 설명
    void

    이 예는 전화 회의 동작을 추가한 다음 전화 회의를 기록하는 방법을 보여줍니다.

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

    지정된 호출자가 전화 회의에 참가할 때 전화 회의를 시작해야 하는지 여부를 정의합니다.

    기본적으로 호출자가 둘 이상일 때마다 전화 회의가 시작됩니다. 특정 호출자가 참가할 때만 전화 회의가 시작되도록 하려면 다른 각 호출자에 대해 이 메서드를 호출하고 값을 "false"로 설정해야 합니다. 이렇게 하면 원하는 사람이 전화 회의에 참여할 때까지 전화 회의가 시작되지 않습니다.

    표 13. 매개변수
    이름 유형 설명
    스타트온엔터 부울 선택한 호출자가 현재 전화 회의에 참가할 때 전화 회의를 시작해야 하는지 여부를 나타내는 플래그입니다.
    • true: 기본값입니다. 지정된 호출자가 전화 회의에 참가하면 전화 회의를 시작합니다.
    • false: 추가된 컨퍼런스 회의를 시작합니다.
    표 14. 반환
    유형 설명
    void

    이 예제에서는 전화 회의 작업을 추가한 다음 지정된 호출자가 참가할 때까지 전화 회의가 시작되지 않도록 설정하는 방법을 보여 줍니다.

    // 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);
    }

    알림 작업 - addDial()

    지정된 전화 번호 또는 Notify 클라이언트로 콜을 착신 전환합니다.

    addDial 작업이 생성되면 연결된 전화 번호(setPhoneNumber()) 또는 알림 클라이언트(setClientRecord())도 설정해야 합니다.

    표 15. 매개변수
    이름 유형 설명
    없음
    표 16. 반환
    유형 설명
    다이얼액션 NotifyAction 객체에 추가된 작업입니다.

    이 예에서는 아웃바운드 호출을 수행하고 통화를 기록하는 방법을 보여줍니다.

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

    발신 콜에 대한 호출자 ID를 정의합니다.

    표 17. 매개변수
    이름 유형 설명
    Callerid 문자열 발신 콜에 대해 설정할 호출자 식별자입니다.
    표 18. 반환
    유형 설명
    void

    이 예제에서는 아웃바운드 호출을 수행하고 통화 시간 제한을 설정하는 방법을 보여 줍니다.

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

    Notify 호출자 기록과 호출자의 고유 식별자를 찾을 테이블을 지정하여 현재 호출자를 Notify 호출자로 설정합니다.

    표 19. 매개변수
    이름 유형 설명
    tableName 문자열 원하는 호출자의 정보가 들어있는 테이블의 이름입니다.
    sysID 문자열 원하는 Notify 호출자의 고유 식별자(sys_id)입니다.
    표 20. 반환
    유형 설명
    void

    이 예제에서는 setClientRecord()를 사용하여 현재 호출자를 Notify 호출자로 설정하는 방법을 보여줍니다.

    // 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(문자열 값)

    통화가 연결될 때 재생할 DTMF 신호음을 정의합니다.

    표 21. 매개변수
    이름 유형 설명
    문자열 통화가 연결될 때 재생할 유효한 DTMF 숫자입니다.
    표 22. 반환
    유형 설명
    void

    이 예에서는 아웃바운드 전화를 거는 방법을 보여주고 통화가 연결될 때 재생할 DTMF 신호음을 정의합니다.

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

    별표(*) 키를 누를 때 호출을 종료해야 하는지 여부를 정의합니다.

    표 23. 매개변수
    이름 유형 설명
    행업온스타 부울 별표(*) 키를 누를 때 통화를 종료할지 여부를 나타내는 플래그입니다.
    • true: 통화를 종료합니다.
    • false: 통화를 종료하지 않음
    표 24. 반환
    유형 설명
    void

    이 예제에서는 아웃바운드 전화를 걸고 끊기 키를 star로 설정하는 방법을 보여 줍니다.

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

    호출할 전화 번호를 정의합니다.

    표 25. 매개변수
    이름 유형 설명
    phoneNumber 문자열 발신할 E.164 호환 전화 번호입니다.
    표 26. 반환
    유형 설명
    void

    이 예제에서는 아웃바운드 호출을 수행하고 통화 시간 제한을 설정하는 방법을 보여 줍니다.

    // 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(부울 기록)

    발신 통화를 기록할지 여부를 정의합니다.

    표 27. 매개변수
    이름 유형 설명
    기록 발신 콜을 기록할지 여부를 나타내는 플래그입니다.

    유효한 값은 다음과 같습니다.

    • true: 발신 콜을 기록합니다.
    • false: 발신 통화를 녹음하지 않습니다.
    표 28. 반환
    유형 설명
    void

    이 예에서는 아웃바운드 호출을 수행하고 통화를 기록하는 방법을 보여줍니다.

    // 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(정수 시간 제한)

    발신 콜이 시간 초과되기까지의 시간(초)을 설정합니다.

    표 29. 매개변수
    이름 유형 설명
    시간 제한 정수 발신 호출이 시간 초과되기까지의 시간(초)입니다. 기본값: 30
    표 30. 반환
    유형 설명
    void

    이 예제에서는 아웃바운드 호출을 수행하고 통화 시간 제한을 설정하는 방법을 보여 줍니다.

    // 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);

    알림 작업 - addGather()

    발신자에게 지정된 대화형 전화 메뉴를 제공합니다.

    표 31. 매개변수
    이름 유형 설명
    없음
    표 32. 반환
    유형 설명
    개더액션 NotifyAction 객체에 추가된 작업입니다. GatherAction 개체를 사용하여 사용자에게 표시할 메뉴 설정 및 옵션을 정의합니다.
    // 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');

    알림 작업 - addGather.addPlay()

    통화에서 오디오 파일을 재생합니다.

    지원되는 하위 메서드에 대한 설명은 NotifyAction addPlay() 메서드를 참조하십시오.

    표 33. 매개변수
    이름 유형 설명
    없음
    표 34. 반환
    유형 설명
    플레이액션 NotifyAction 객체에 추가된 작업입니다. PlayAction 개체를 사용하여 오디오 파일 URL과 오디오를 반복하는 횟수를 정의합니다.
    // 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');

    알림 작업 - addGather.addSay()

    통화 시 읽을 텍스트 음성 변환을 정의합니다.

    지원되는 하위 메서드에 대한 설명은 NotifyAction addSay() 메서드를 참조하십시오.

    표 35. 매개변수
    이름 유형 설명
    없음
    표 36. 반환
    유형 설명
    세이액션(SayAction) NotifyAction 객체에 추가된 작업입니다. SayAction 개체를 사용하여 읽을 텍스트와 언어를 정의합니다.
    // 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');
    

    알림 작업 - addGather.setFinishKey(finishKey 문자열)

    호출자가 입력의 끝을 나타내기 위해 입력하는 키를 정의합니다.

    표 37. 매개변수
    이름 유형 설명
    마침 키 문자열 호출자 입력의 끝을 나타내는 키입니다.

    유효한 값은 다음과 같습니다.

    • 0-9
    • #(기본값)
    • *
    표 38. 반환
    유형 설명
    void

    이 예제에서는 gather 작업을 추가하고 호출자 입력의 끝을 나타내는 키를 정의하는 방법을 보여 줍니다.

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

    알림 작업 - addGather.setNumberOfDigits(Integer numberOfDigits)

    수집할 자릿수를 정의합니다.

    표 39. 매개변수
    이름 유형 설명
    numberOfDigits 정수 수집할 자릿수입니다. 0은 잘못된 값입니다.
    표 40. 반환
    유형 설명
    void

    이 예제에서는 수집 작업을 추가하고 수집할 키 입력 수를 정의하는 방법을 보여 줍니다.

    // 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(정수 시간 제한)

    입력 수집이 시간 초과되기까지의 시간을 정의합니다.

    표 41. 매개변수
    이름 유형 설명
    시간 제한 정수 시간이 초과되기 전에 호출자 입력을 기다리는 시간(초)입니다. 기본값: 10
    표 42. 반환
    유형 설명
    void

    이 예제에서는 수집 작업을 추가하고 입력 제한 시간 값을 정의하는 방법을 보여줍니다.

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

    알림 작업 - addHangUp()

    활성 전화 통화를 종료합니다.

    표 43. 매개변수
    이름 유형 설명
    없음
    표 44. 반환
    유형 설명
    HangUp작업 NotifyAction 객체에 추가된 작업입니다.
    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();
    
    // hang up
    notifyAction.addHangUp();

    알림 작업 - addQueue()

    통화를 대기시켜 통화를 보류합니다.

    표 45. 매개변수
    이름 유형 설명
    없음
    표 46. 반환
    유형 설명
    큐액션(QueueAction) NotifyAction 객체에 추가된 작업입니다. QueueAction 개체를 사용하여 큐 이름과 큐 또는 큐 제거 동작을 정의합니다.

    이 예제에서는 지정된 큐에 호출을 추가하는 방법을 보여 줍니다.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();
    
    // queue the call
    var queue = notifyAction.addQueue();
    queue.setName('my queue');

    이 예에서는 큐에서 호출을 제거하는 방법을 보여 줍니다.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();
    
    // dequeue the call
    var queue = notifyAction.addQueue();
    queue.setDequeue(true);

    NotifyAction - addQueue.setDequeue(부울 큐에서 제거)

    현재 통화 큐에서 통화를 제거합니다("보류 중"에서 해제).

    표 47. 매개변수
    이름 유형 설명
    부울 큐에서 현재 호출을 제거할지 여부를 나타내는 플래그입니다.
    • true: 큐에서 호출을 제거합니다.
    • false: 호출이 큐에 배치됩니다.
    표 48. 반환
    유형 설명
    void

    이 예에서는 큐에서 호출을 제거하는 방법을 보여 줍니다.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();
    
    // dequeue the call
    var queue = notifyAction.addQueue();
    queue.setDequeue(true);

    NotifyAction - addQueue.setName(name 문자열)

    큐와 연결된 이름을 정의합니다.

    표 49. 매개변수
    이름 유형 설명
    이름 문자열 큐와 연결할 이름입니다.
    표 50. 반환
    유형 설명
    void

    이 예제에서는 큐의 이름을 정의하는 방법을 보여 줍니다.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();
    
    // queue the call
    var queue = notifyAction.addQueue();
    queue.setName('my queue');

    알림 작업 - addPlay()

    통화에서 오디오 파일을 재생합니다.

    표 51. 매개변수
    이름 유형 설명
    없음
    표 52. 반환
    유형 설명
    플레이액션 NotifyAction 객체에 추가된 작업입니다. PlayAction 개체를 사용하여 오디오 파일 URL과 오디오를 반복하는 횟수를 정의합니다.
    // 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(Integer loop)

    오디오 파일을 재생(반복)하는 횟수를 정의합니다.

    표 53. 매개변수
    이름 유형 설명
    루프 정수 오디오 파일을 재생하는 횟수입니다.
    표 54. 반환
    유형 설명
    void
    // 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 문자열)

    재생할 오디오 파일을 가져올 URL을 정의합니다.

    표 55. 매개변수
    이름 유형 설명
    URL 문자열 재생할 오디오 파일의 URL입니다.
    표 56. 반환
    유형 설명
    void
    // 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);

    알림 작업 - addRecord()

    현재 NotifyAction 개체에 대한 호출을 기록하는 작업을 추가합니다.

    통화가 완료되거나 지정된 종료를 누르면(setFinishKey()) 녹음이 자동으로 종료됩니다. 그러면 녹음이 연결된 통화의 notify_record 테이블에 배치됩니다.

    표 57. 매개변수
    이름 유형 설명
    없음
    표 58. 반환
    유형 설명
    void

    이 예제에서는 통화를 녹음하는 방법을 보여 줍니다.

    // 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(문자열 finishKey)

    기록을 종료하는 키를 정의합니다.

    표 59. 매개변수
    이름 유형 설명
    마침 키 문자열 기록을 종료하는 키입니다.

    유효한 값은 다음과 같습니다.

    • 0-9
    • #(기본값)
    • *
    표 60. 반환
    유형 설명
    void

    이 예제에서는 통화를 녹음하고 통화 종료 키를 설정하는 방법을 보여 줍니다.

    // 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(정수 초)

    기록의 최대 길이를 정의합니다.

    표 61. 매개변수
    이름 유형 설명
    정수 기록의 최대 길이(초)입니다. 기본값: 3600
    표 62. 반환
    유형 설명
    void

    이 예제에서는 통화를 녹음하고 통화 종료 키를 설정하는 방법을 보여 줍니다.

    // 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); 

    알림 작업 - addRecord.setTimeout(정수 시간 제한)

    무음 시간(초)을 설정한 후 녹음이 종료됩니다.

    표 63. 매개변수
    이름 유형 설명
    시간 제한 정수 기록이 종료된 후 통화 중 무음 시간(초)입니다. 기본값: 10
    표 64. 반환
    유형 설명
    void

    이 예제에서는 통화를 녹음하고 녹음 시간 제한 값을 설정하는 방법을 보여 줍니다.

    // 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); 

    알림 작업 - addReject()

    수신 콜을 거부합니다.

    표 65. 매개변수
    이름 유형 설명
    없음
    표 66. 반환
    유형 설명
    거부 작업 NotifyAction 객체에 추가된 작업입니다. RejectAction 개체를 사용하여 호출을 거부하는 이유를 정의합니다.
    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();
    
    // reject the call
    var rejectAction = notifyAction.addReject();
    rejectAction.setReason('busy'); // 'busy' or 'rejected'

    NotifyActon - addReject.setReason(String reason)

    호출이 거부된 이유를 정의합니다.

    표 67. 매개변수
    이름 유형 설명
    이유 문자열 호출이 거부된 이유입니다.

    유효한 값은 다음과 같습니다.

    • 통화 중
    • 거부됨
    다른 모든 값은 무시됩니다.
    표 68. 반환
    유형 설명
    void
    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();
    
    // reject the call
    var rejectAction = notifyAction.addReject();
    rejectAction.setReason('busy'); // 'busy' or 'rejected'

    알림 작업 - addSay()

    통화 시 읽을 텍스트 음성 변환을 정의합니다.

    텍스트 음성 변환으로 여러 언어가 지원됩니다. 사용 가능한 언어는 전화 통신 공급자에 따라 다릅니다.

    표 69. 매개변수
    이름 유형 설명
    없음
    표 70. 반환
    유형 설명
    세이액션(SayAction) NotifyAction 객체에 추가된 작업입니다. SayAction 개체를 사용하여 읽을 텍스트와 언어를 정의합니다.

    이 예제에서는 여러 언어로 텍스트를 읽는 방법을 보여 줍니다.

    // instantiate NotifyAction
    var notifyAction = new SNC.NotifyAction();
    
    // add a say action to say something in US English
    var usSay = notifyAction.addSay();
    usSay.setText('Welcome. I can speak english');
    usSay.setLanguage('en-US');
    
    // add a say action to say something in Dutch
    var nlSay = notifyAction.addSay();
    nlSay.setText('Ik spreek ook vloeiend nederlands');
    nlSay.setLanguage('nl-NL');
    
    // and german
    var deSay = notifyAction.addSay();
    deSay.setText('Und ich kan auch deutsch sprechen');
    deSay.setLanguage('de-DE');

    NotifyAction - addSay.setLanguage(String language)

    텍스트를 말할 때 사용할 언어를 정의합니다.

    setText() 메서드와 함께 이 메서드를 사용하여 말할 표현을 정의합니다.

    표 71. 매개변수
    이름 유형 설명
    언어 문자열 관련 텍스트를 말할 언어를 정의하는 ISO 3166 언어 코드입니다. 예를 들어 "en-US" 또는 "nl-NL"입니다.
    표 72. 반환
    유형 설명
    void

    이 예제에서는 여러 언어로 텍스트를 읽는 방법을 보여 줍니다.

    // 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(text 문자열)

    현재 호출에서 읽을 텍스트를 정의합니다.

    setLanguage() 메서드와 함께 이 메서드를 사용하여 제공된 텍스트를 말할 때 사용할 언어를 정의합니다.

    표 73. 매개변수
    이름 유형 설명
    텍스트 문자열 현재 통화 내에서 소리내어 읽을 텍스트입니다.
    표 74. 반환
    유형 설명
    void

    이 예제에서는 여러 언어로 텍스트를 읽는 방법을 보여 줍니다.

    // 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');

    알림 작업 - addSMS()

    SMS 메시지를 보냅니다.

    주:
    활성 호출과 함께 이 함수를 사용하는 경우 반환된 SMSAction 개체에서 setTo 함수를 호출할 필요가 없습니다. SMS가 호출자에게 자동으로 전송됩니다.
    표 75. 매개변수
    이름 유형 설명
    없음
    표 76. 반환
    유형 설명
    SMS계정 NotifyAction 객체에 추가된 작업입니다. SMSAction 개체를 사용하여 메시지 텍스트와 메시지를 보낼 전화 번호를 정의합니다.
    // 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);

    알림 작업 - addSMS.setMessage(메시지 문자열)

    전송할 SMS 메시지의 텍스트를 정의합니다.

    표 77. 매개변수
    이름 유형 설명
    메시지 문자열 보낼 SMS 메시지의 텍스트입니다.
    표 78. 반환
    유형 설명
    void
    // 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)

    SMS 메시지를 보낼 전화 번호를 설정합니다.

    표 79. 매개변수
    이름 유형 설명
    ~ 문자열 SMS 메시지를 보낼 E.164 호환 전화 번호입니다.
    표 80. 반환
    유형 설명
    void
    // 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(NotifyAction 작업)

    지정된 NotifyAction 개체를 현재 클라이언트의 NotifyAction 개체에 추가합니다.

    NotifyActions에는 터미널과 비터미널의 두 가지 유형이 있습니다. 클라이언트의 NotifyAction 개체에 터미널 작업을 추가한 후에는 추가 작업을 추가할 수 없습니다. 비터미널 작업은 다음과 같습니다.
    • 플레이액션
    • 레코드 동작
    • 세이액션(SayAction)
    • SMS계정

    다른 모든 NotifyActions는 터미널입니다. 터미널 작업 후 다른 NotifyAction을 추가하려고 하면 호출이 실패합니다.

    표 81. 매개변수
    이름 유형 설명
    작업 알림 작업 현재 호출자의 NotifyAction 개체에 추가할 NotifyAction 개체입니다.
    표 82. 반환
    유형 설명
    void

    NotifyAction - fromJson(JSON 문자열)

    JSON 문자열에서 NotifyAction 개체를 역직렬화합니다.

    표 83. 매개변수
    이름 유형 설명
    JSON 문자열 NotifyAction 개체의 JSON 문자열 표현입니다.
    표 84. 반환
    유형 설명
    void

    이 예제에서는 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);

    이 예제에서는 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));

    출력: *** 스크립트: 직렬화 결과: {"fClassName":"NotifyAction","fActions":[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}]} *** 스크립트: 새 직렬화 결과: {"fClassName":"NotifyAction","fActions":[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}]} *** 스크립트: 동일: true

    알림 작업 - setCallRecord(GlideRecord callRecord)

    후속 작업을 추가할 알림 통화 기록을 정의합니다.

    표 85. 매개변수
    이름 유형 설명
    호출 기록 GlideRecord 작업을 추가할 호출자의 기록(notify_call 테이블 내)을 포함하는 GlideRecord입니다. 이 호출자는 이 메서드가 다른 호출자와 함께 다시 호출될 때까지 영향을 받습니다.
    표 86. 반환
    유형 설명
    void

    이 예제에서는 작업을 추가할 호출자를 설정하는 방법을 보여 줍니다.

    public NotifyAction runIncomingCallWorkflow(NotifyPhoneNumber notifyPhoneNumber, GlideRecord callRecord) throws NoWorkflowConfiguredException, NoSuchNotifyGroupRecordException {
       NotifyAction notifyAction = runWorkflow(notifyPhoneNumber, COL_INCOMING_CALL_WF, callRecord);
       notifyAction.setCallRecord(callRecord);
       return notifyAction;
    }

    알림 작업 - toJson()

    NotifyAction 개체를 JSON 문자열로 직렬화합니다.

    표 87. 매개변수
    이름 유형 설명
    없음
    표 88. 반환
    유형 설명
    문자열 이 NotifyAction 개체의 JSON 표현입니다.

    이 예제에서는 NotifyAction 개체를 serialize하는 방법을 보여 줍니다.

    // instantiate notify action
    var notifyAction = new SNC.NotifyAction();
    
    // add one or more notify actions
    // ...
    
    // and serialize to json
    var json = notifyAction.toJson();

    이 예제에서는 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));

    출력: *** 스크립트: 직렬화 결과: {"fClassName":"NotifyAction","fActions":[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}]} *** 스크립트: 새 직렬화 결과: {"fClassName":"NotifyAction","fActions":[{"fClassName":"QueueAction","fDequeue":true,"fQueueName":"myQueueName"}]} *** 스크립트: 동일: true